/* ==========================================================================
   Personal Library — design system
   ========================================================================== */

:root {
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --maxw: 1140px;
  --gutter: 28px;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --accent: #b8607d;
  --accent-2: #6fae8d;
  --accent-3: #d99a84;
  --accent-grad: linear-gradient(120deg, #eda6bd 0%, #e0b3cf 46%, #a6d6bf 100%);
  --danger: #d95d72;

  --header-h: 74px;
  --ease: cubic-bezier(0.22, 0.72, 0.22, 1);
  --transition: 220ms var(--ease);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf5f2;
  --bg-soft: #f6ece7;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-2: rgba(255, 255, 255, 0.92);
  --surface-solid: #fffaf8;
  --border: rgba(86, 64, 68, 0.10);
  --border-strong: rgba(86, 64, 68, 0.20);
  --text: #2f2a2c;
  --text-soft: #514a4c;
  --muted: #7a6f71;
  --faint: #a39597;
  --header-bg: rgba(251, 245, 242, 0.82);
  --shadow-lg: 0 40px 90px -46px rgba(120, 80, 90, 0.30);
  --shadow-md: 0 22px 48px -32px rgba(120, 80, 90, 0.26);
  --glow: rgba(217, 127, 156, 0.24);
  --input-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15120f;
  --bg-soft: #1c1815;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-solid: #221d19;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #f5efe9;
  --text-soft: #d8ccc3;
  --muted: #a99b92;
  --faint: #7d716a;
  --header-bg: rgba(21, 18, 15, 0.72);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
  --shadow-md: 0 20px 50px -28px rgba(0, 0, 0, 0.8);
  --glow: rgba(240, 169, 191, 0.2);
  --input-bg: rgba(255, 255, 255, 0.05);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: rgba(201, 116, 146, 0.35); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }

.container {
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
}

/* ---------- ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.orb-a {
  width: 46vw; height: 46vw;
  left: -14vw; top: -12vw;
  background: radial-gradient(circle at 40% 40%, rgba(240, 168, 190, 0.55), transparent 68%);
}
.orb-b {
  width: 40vw; height: 40vw;
  right: -12vw; top: 18vh;
  background: radial-gradient(circle at 50% 50%, rgba(160, 211, 181, 0.46), transparent 70%);
}
.orb-c {
  width: 44vw; height: 44vw;
  left: 24vw; bottom: -24vw;
  background: radial-gradient(circle at 50% 50%, rgba(245, 198, 176, 0.34), transparent 70%);
}

[data-theme="light"] .orb { opacity: 0.5; }
[data-theme="light"] .orb-a { background: radial-gradient(circle at 40% 40%, rgba(240, 168, 190, 0.5), transparent 68%); }
[data-theme="light"] .orb-b { background: radial-gradient(circle at 50% 50%, rgba(160, 211, 181, 0.42), transparent 70%); }
[data-theme="light"] .orb-c { background: radial-gradient(circle at 50% 50%, rgba(245, 198, 176, 0.32), transparent 70%); }

[data-theme="dark"] .orb { opacity: 0.34; }
[data-theme="dark"] .orb-a { background: radial-gradient(circle at 40% 40%, rgba(198, 105, 132, 0.42), transparent 68%); }
[data-theme="dark"] .orb-b { background: radial-gradient(circle at 50% 50%, rgba(104, 160, 132, 0.34), transparent 70%); }
[data-theme="dark"] .orb-c { background: radial-gradient(circle at 50% 50%, rgba(180, 120, 100, 0.24), transparent 70%); }

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 320ms var(--ease), border-color 320ms var(--ease),
    backdrop-filter 320ms var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: var(--header-bg);
  border-bottom-color: var(--border);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  min-width: 0;
}

.brand-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.1);
}
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text small {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--faint);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-nav a {
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--muted);
  transition: color var(--transition), background var(--transition);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition), color var(--transition);
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn .icon { width: 17px; height: 17px; }

.btn-primary {
  background: var(--accent-grad);
  color: #3a2b30;
  box-shadow: 0 12px 30px -14px rgba(201, 116, 146, 0.8);
}
.btn-primary:hover {
  box-shadow: 0 16px 34px -12px rgba(201, 116, 146, 0.9);
  filter: brightness(1.04);
}

.btn-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-soft);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }

.btn-soft {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.btn-soft:hover { border-color: var(--border-strong); }

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.18); }

.btn-danger {
  background: rgba(255, 107, 129, 0.14);
  border-color: rgba(255, 107, 129, 0.4);
  color: #ff8fa1;
}
.btn-danger:hover { background: rgba(255, 107, 129, 0.24); }

.btn-sm { height: 38px; padding: 0 15px; font-size: 13px; }
.btn-xs { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }

.publish-btn { width: auto; min-width: 40px; padding: 0 13px 0 11px; gap: 7px; border-radius: 999px; }
.publish-label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
@media (max-width: 980px) {
  .publish-btn { width: 40px; padding: 0; gap: 0; }
  .publish-label { display: none; }
}

.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn-sm .icon { width: 15px; height: 15px; }

.link-btn {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}
.link-btn:hover { border-bottom-color: currentColor; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.chip .icon { width: 14px; height: 14px; }
.chip-ghost {
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 20, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.chip-ghost:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* theme icon swap */
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: inline-block; }
[data-theme="light"] .icon-moon { display: none; }

/* ---------- hero ---------- */
.hero { padding-top: calc(var(--header-h) + 26px); }

.hero-card {
  --hero-ink: #2f2a2c;
  --hero-soft: rgba(47, 42, 44, 0.72);
  --hero-faint: rgba(47, 42, 44, 0.5);
  --hero-line: rgba(255, 255, 255, 0.66);
  --hero-panel: rgba(255, 255, 255, 0.52);
  --hero-panel-strong: rgba(255, 255, 255, 0.8);
  --hero-title-shadow: 0 1px 24px rgba(255, 255, 255, 0.4);
  position: relative;
  isolation: isolate;
  min-height: clamp(480px, 64vh, 620px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #f7eee9;
}

[data-theme="dark"] .hero-card {
  --hero-ink: #f8f1eb;
  --hero-soft: rgba(248, 241, 235, 0.76);
  --hero-faint: rgba(248, 241, 235, 0.52);
  --hero-line: rgba(255, 255, 255, 0.2);
  --hero-panel: rgba(20, 16, 14, 0.38);
  --hero-panel-strong: rgba(20, 16, 14, 0.58);
  --hero-title-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.14);
  background: #1b1714;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  transform: scale(1.04);
  animation: heroZoom 18s var(--ease) both;
}

@keyframes heroZoom {
  from { transform: scale(1.1); opacity: 0.6; }
  to { transform: scale(1.04); opacity: 1; }
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 250, 247, 0.14) 0%, transparent 30%),
    linear-gradient(90deg, rgba(255, 250, 247, 0.94) 0%, rgba(255, 250, 247, 0.7) 36%, rgba(255, 250, 247, 0.12) 68%, transparent 84%),
    linear-gradient(0deg, rgba(255, 250, 247, 0.95) 0%, rgba(255, 250, 247, 0.52) 30%, rgba(255, 250, 247, 0.04) 58%, transparent 72%);
}

[data-theme="dark"] .hero-bg {
  filter: brightness(0.52) saturate(0.82);
}

[data-theme="dark"] .hero-shade {
  background:
    linear-gradient(180deg, rgba(14, 10, 9, 0.5) 0%, transparent 34%),
    linear-gradient(90deg, rgba(14, 10, 9, 0.94) 0%, rgba(14, 10, 9, 0.74) 40%, rgba(14, 10, 9, 0.2) 78%),
    linear-gradient(0deg, rgba(14, 10, 9, 0.96) 0%, rgba(14, 10, 9, 0.5) 38%, transparent 68%);
}

.hero-shade::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 80% at 6% 96%, rgba(240, 168, 190, 0.28), transparent 62%),
    radial-gradient(70% 70% at 94% 6%, rgba(160, 211, 181, 0.24), transparent 62%);
}

.hero-content {
  position: relative;
  padding: 0 clamp(26px, 4.4vw, 56px) 26px;
  max-width: 780px;
  color: var(--hero-ink);
  animation: heroIn 900ms var(--ease) both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hero-soft);
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--hero-line);
  background: var(--hero-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 20px;
}

.eyebrow-sep { opacity: 0.4; }

.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #6fbf97;
  box-shadow: 0 0 0 0 rgba(111, 191, 151, 0.6);
  animation: pulse 2.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 191, 151, 0.55); }
  60% { box-shadow: 0 0 0 7px rgba(111, 191, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 191, 151, 0); }
}

.hero-title {
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
  text-wrap: balance;
  text-shadow: var(--hero-title-shadow);
}

.hero-subtitle {
  font-size: clamp(15px, 1.5vw, 17.5px);
  line-height: 1.65;
  color: var(--hero-soft);
  max-width: 560px;
  margin-bottom: 22px;
  text-wrap: pretty;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.hero-tag {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--hero-line);
  color: var(--hero-ink);
  background: var(--hero-panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(26px, 4.4vw, 56px);
  border-top: 1px solid var(--hero-line);
  background: linear-gradient(90deg, var(--hero-panel-strong), var(--hero-panel));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--hero-soft);
  font-size: 12.5px;
  z-index: 1;
}

.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.hero-foot-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.hero-meta strong { color: var(--hero-ink); font-weight: 650; font-size: 13px; }
.dot-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  display: inline-block;
}

.hero-corner {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  color: var(--hero-faint);
  white-space: nowrap;
  z-index: 1;
}

.hero-card .btn-glass {
  background: var(--hero-panel);
  border-color: var(--hero-line);
  color: var(--hero-ink);
}
.hero-card .btn-glass:hover { background: var(--hero-panel-strong); }
.hero-card .chip-ghost {
  color: var(--hero-soft);
  border-color: var(--hero-line);
  background: var(--hero-panel);
}
.hero-card .chip-ghost:hover { color: var(--hero-ink); background: var(--hero-panel-strong); }

/* ---------- sections ---------- */
.section { padding-top: 76px; }
.section + .section { padding-top: 72px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--accent);
  margin-bottom: 7px;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: clamp(24px, 2.6vw, 31px);
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  transform: translateY(-2px);
}

.section-aside { color: var(--faint); font-size: 13px; padding-bottom: 4px; }
.head-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
}

/* ---------- profile ---------- */
.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 34px;
  padding: 32px;
}

.profile-main { display: flex; gap: 26px; min-width: 0; }

.avatar-wrap { position: relative; flex: none; align-self: flex-start; }

.avatar {
  width: 132px; height: 132px;
  border-radius: 32px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.6);
}

.status-dot {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #34d399;
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.profile-info { min-width: 0; padding-top: 2px; }

.profile-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.profile-name-row h3 {
  font-size: clamp(23px, 2.4vw, 28px);
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(201, 116, 146, 0.12);
  border: 1px solid rgba(201, 116, 146, 0.24);
}

.profile-headline { color: var(--text-soft); font-size: 14px; margin-top: 7px; }

.profile-bio {
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.75;
  margin-top: 12px;
  max-width: 62ch;
  text-wrap: pretty;
}

.profile-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }

.tag {
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}

.profile-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.profile-link:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.profile-link .icon { width: 15px; height: 15px; color: var(--accent); }
.profile-link span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  border-left: 1px solid var(--border);
  padding-left: 30px;
}

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 11px; color: var(--faint); letter-spacing: 0.06em; }

.side-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1.4;
}
.side-note .icon { width: 13px; height: 13px; color: #34d399; }

/* ---------- gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 178px;
  gap: 13px;
  grid-auto-flow: dense;
}

.photo-card {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: zoom-in;
  transition: transform 380ms var(--ease), box-shadow 380ms var(--ease), border-color 380ms var(--ease);
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease), filter 400ms var(--ease);
}
.photo-card:hover img { transform: scale(1.045); }

.photo-card figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 30px 13px 11px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(0deg, rgba(5, 7, 12, 0.82), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-card:hover figcaption { opacity: 1; transform: none; }

.photo-actions {
  position: absolute;
  top: 9px; right: 9px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.photo-card:hover .photo-actions,
.photo-card:focus-within .photo-actions { opacity: 1; transform: none; }

.photo-actions .icon-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(8, 10, 16, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.photo-actions .icon-btn:hover { background: rgba(255, 107, 129, 0.85); border-color: transparent; }
.photo-actions .icon-btn .icon { width: 14px; height: 14px; }

.photo-card.is-feature { grid-column: span 2; grid-row: span 2; }
.photo-card.is-tall { grid-row: span 2; }
.photo-card.is-wide { grid-column: span 2; }

.gallery-grid .photo-card:first-child:only-child { grid-column: span 2; grid-row: span 2; }

.photo-card.is-broken {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  cursor: default;
}
.photo-card.is-broken::before {
  content: "图片无法加载";
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ---------- files ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(94, 234, 212, 0.18);
  background: linear-gradient(120deg, rgba(94, 234, 212, 0.07), rgba(201, 116, 146, 0.06));
  margin-bottom: 14px;
}

.notice-icon {
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(94, 234, 212, 0.12);
  color: #34d399;
}
.notice-icon .icon { width: 17px; height: 17px; }

.notice-body { flex: 1; min-width: 0; }
.notice-body strong { display: block; font-size: 12.8px; font-weight: 650; margin-bottom: 2px; }
.notice-body p { font-size: 11.8px; color: var(--muted); line-height: 1.55; }

.notice-actions { display: flex; align-items: center; gap: 4px; flex: none; }

.files-panel { padding: 20px; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.files-panel.is-dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.16);
}

.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px;
  min-width: 240px;
  flex: 1 1 240px;
  max-width: 340px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box:focus-within {
  border-color: rgba(201, 116, 146, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.12);
}
.search-box .icon { width: 16px; height: 16px; color: var(--faint); }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 13px;
}
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }

.toolbar-right { display: flex; align-items: center; gap: 6px; }

.storage { display: flex; flex-direction: column; gap: 5px; width: 156px; margin-right: 6px; }
.storage-text {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.storage-hint { letter-spacing: 0.04em; }
.storage-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.storage-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent-grad);
  transition: width 600ms var(--ease);
}

.dropzone {
  margin-top: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px ;
  text-align: center;
  color: var(--muted);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  cursor: pointer;
}
.dropzone:hover { border-color: rgba(201, 116, 146, 0.5); background: rgba(201, 116, 146, 0.04); }

.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(201, 116, 146, 0.09);
  transform: scale(1.004);
}

.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dropzone-inner > .icon { width: 21px; height: 21px; color: var(--accent); margin-bottom: 3px; }
.dropzone-inner p { font-size: 12.5px; color: var(--text-soft); }
.dropzone-inner span { font-size: 10.5px; color: var(--faint); }

.file-list { display: flex; flex-direction: column; margin-top: 6px; }

.file-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.file-row:last-child { border-bottom-color: transparent; }
.file-row:hover { background: var(--surface-2); }

.file-thumb {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--tint, #8b9dff) 14%, transparent);
  color: var(--tint, #8b9dff);
  border: 1px solid color-mix(in srgb, var(--tint, #8b9dff) 22%, transparent);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: none;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .icon { width: 20px; height: 20px; }

.file-info { min-width: 0; }
.file-name {
  font-size: 13.4px;
  font-weight: 550;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.file-name mark { background: rgba(201, 116, 146, 0.22); color: inherit; border-radius: 3px; padding: 0 1px; }
.file-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
  font-size: 10.8px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.file-meta .tag-mini {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.file-actions { display: flex; align-items: center; gap: 2px; }
.file-actions .icon-btn { width: 34px; height: 34px; }
.file-actions .icon-btn .icon { width: 16px; height: 16px; }
.file-actions .icon-btn.is-danger:hover { color: #ff8fa1; background: rgba(255, 107, 129, 0.12); }

.no-results { padding: 30px 10px; text-align: center; color: var(--faint); font-size: 13px; }

/* ---------- empty states ---------- */
.empty-state {
  margin-top: 14px;
  padding: 54px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty-state-inline { border: 0; background: transparent; padding: 34px 20px 26px; }

.empty-art {
  width: 62px; height: 62px;
  border-radius: 20px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(150deg, rgba(201, 116, 146, 0.16), rgba(111, 174, 141, 0.06));
  border: 1px solid rgba(201, 116, 146, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.empty-art .icon { width: 26px; height: 26px; }

.empty-state h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.empty-state p {
  max-width: 380px;
  margin: 7px auto 18px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.65;
}
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 88px;
  border-top: 1px solid var(--border);
  padding: 34px 0 116px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.12));
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-mark {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--surface);
}
.footer-brand strong { font-size: 14px; font-weight: 650; display: block; }
.footer-brand p { font-size: 11.5px; color: var(--faint); }

.footer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--faint);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Music player
   ========================================================================== */
.player {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  width: 344px;
  max-width: calc(100vw - 24px);
  color: #eef1f8;
  font-family: var(--font-sans);
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 68px;
  padding: 0 10px 0 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(24, 20, 18, 0.88);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color var(--transition), transform var(--transition);
}
.player:hover .player-bar { border-color: rgba(255, 255, 255, 0.22); }

.vinyl {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background:
    repeating-radial-gradient(circle at 50% 50%, #2a2320 0 2px, #1c1816 2px 4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.vinyl-art {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f0b6c8, #e7c6d8 52%, #b9ddc9);
  color: rgba(10, 12, 20, 0.75);
  overflow: hidden;
}
.vinyl-art img { width: 100%; height: 100%; object-fit: cover; }
.vinyl-art .icon { width: 16px; height: 16px; }

.vinyl-hole {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #0b0e15;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.14);
  z-index: 2;
}

.player.is-playing .vinyl { animation: spin 6s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.pb-meta { min-width: 0; flex: 1; line-height: 1.25; }
.pb-meta strong {
  display: block;
  font-size: 12.4px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pb-meta span {
  display: block;
  font-size: 10.2px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-play {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: #fff;
  color: #10131c;
  transition: transform 180ms var(--ease), background var(--transition);
}
.pb-play:hover { transform: scale(1.06); background: #f3f0ff; }
.pb-play:active { transform: scale(0.96); }
.pb-play .icon { width: 15px; height: 15px; }
.pb-play .icon-pause { display: none; }
.player.is-playing .pb-play .icon-play { display: none; }
.player.is-playing .pb-play .icon-pause { display: block; }

.pb-play-lg { width: 46px; height: 46px; }
.pb-play-lg .icon { width: 18px; height: 18px; }

.pb-expand {
  width: 28px; height: 32px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  transition: color var(--transition), transform 300ms var(--ease);
  flex: none;
}
.pb-expand:hover { color: #fff; }
.pb-expand .icon { width: 16px; height: 16px; transition: transform 300ms var(--ease); }
.player.is-open .pb-expand .icon { transform: rotate(180deg); }

.player-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: min(72vh, 620px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(12, 15, 23, 0.92);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: panelIn 260ms var(--ease) both;
  transform-origin: bottom right;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.pp-head { display: flex; align-items: center; gap: 12px; }

.pp-cover {
  width: 54px; height: 54px;
  border-radius: 16px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f0b6c8, #e7c6d8 52%, #b9ddc9);
  color: rgba(10, 12, 20, 0.7);
  overflow: hidden;
  box-shadow: 0 10px 24px -12px rgba(201, 116, 146, 0.9);
}
.pp-cover img { width: 100%; height: 100%; object-fit: cover; }
.pp-cover .icon { width: 22px; height: 22px; }

.pp-titles { flex: 1; min-width: 0; line-height: 1.3; }
.pp-titles strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pp-titles span {
  display: block;
  font-size: 10.8px;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-head .icon-btn { color: rgba(255, 255, 255, 0.6); }
.pp-head .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); border-color: transparent; }

.pp-seek { margin-top: 16px; }

.pp-times {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.42);
  font-variant-numeric: tabular-nums;
}

.pp-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 8px;
}

.pp-controls .icon-btn { color: rgba(255, 255, 255, 0.66); width: 34px; height: 34px; }
.pp-controls .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); border-color: transparent; }
.pp-controls .icon-btn.is-active { color: #b8607d; background: rgba(201, 116, 146, 0.15); }
.pp-controls .icon-btn.is-active::after {
  content: "";
  position: absolute;
}

.volume {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  width: 92px;
  flex: none;
}
.volume .icon { width: 15px; height: 15px; }
.volume .range { width: auto; flex: 1; min-width: 0; }

#repeatBtn { position: relative; }
#repeatBtn.is-one::after {
  content: "1";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #b8607d;
  color: #10131c;
  font-size: 8px;
  font-weight: 800;
  line-height: 11px;
  text-align: center;
  font-family: var(--font-mono);
}

.pp-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}
.pp-list-head em {
  font-style: normal;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.6);
  margin-left: 4px;
}
.pp-list-head .link-btn { font-size: 11px; letter-spacing: 0; text-transform: none; color: #b8607d; }
.pp-list-actions { display: flex; align-items: center; gap: 12px; }

.playlist { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }

.playlist li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 7px;
  border-radius: 9px;
  cursor: pointer;
  transition: background var(--transition);
}
.playlist li:hover { background: rgba(255, 255, 255, 0.06); }
.playlist li.is-current { background: rgba(201, 116, 146, 0.14); }

.playlist .track-index {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}
.playlist li.is-current .track-index { color: #b8607d; }
.playlist .track-title {
  font-size: 11.8px;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist li.is-current .track-title { color: #fff; font-weight: 550; }
.playlist .track-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.32);
}
.playlist .track-del {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.3);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
}
.playlist li:hover .track-del { opacity: 1; }
.playlist .track-del:hover { color: #ff8fa1; background: rgba(255, 107, 129, 0.14); }
.playlist .track-del .icon { width: 12px; height: 12px; }

.pp-empty {
  padding: 18px 6px 8px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.36);
  line-height: 1.6;
}

/* range styling */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #b8607d var(--progress, 0%), rgba(255, 255, 255, 0.14) var(--progress, 0%));
  outline: none;
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.22), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 120ms var(--ease);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.25); }
.range::-moz-range-thumb {
  width: 11px; height: 11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.22);
}
.range-sm { height: 3px; }
.range-sm::-webkit-slider-thumb { width: 9px; height: 9px; }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 11, 0.66);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fadeIn 200ms ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(100%, 520px);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  border-radius: 26px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.8);
  padding: 26px;
  animation: modalIn 300ms var(--ease) both;
}

.modal-lg { width: min(100%, 680px); }
.modal-sm { width: min(100%, 400px); text-align: center; padding: 28px 26px 24px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.modal-head h3 { font-size: 20px; font-weight: 680; letter-spacing: -0.02em; }
.modal-head .eyebrow { margin-bottom: 4px; }

.modal-body { display: flex; flex-direction: column; gap: 15px; }

.modal-hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: -6px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.modal-actions-center { justify-content: center; border-top: 0; padding-top: 4px; }

/* form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field > span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}
.field > span em {
  font-style: normal;
  font-weight: 400;
  color: var(--faint);
  font-size: 10.5px;
  margin-left: 4px;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--border-strong); }
.input:focus {
  border-color: rgba(201, 116, 146, 0.6);
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.13);
}

.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input-sm { height: 36px; font-size: 12px; }

.avatar-editor {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.avatar-preview {
  width: 86px; height: 86px;
  border-radius: 24px;
  overflow: hidden;
  flex: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-editor-side { flex: 1; min-width: 0; }
.avatar-editor-side strong { font-size: 13px; }
.avatar-editor-side p { font-size: 11px; color: var(--faint); line-height: 1.5; margin: 3px 0 8px; }
.inline-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.inline-actions .link-btn { font-size: 11.5px; }

/* confirm */
.confirm-icon {
  width: 54px; height: 54px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #ff8fa1;
  background: rgba(255, 107, 129, 0.12);
  border: 1px solid rgba(255, 107, 129, 0.24);
}
.confirm-icon .icon { width: 23px; height: 23px; }
.modal-sm h3 { font-size: 18px; font-weight: 660; letter-spacing: -0.01em; }
.confirm-message {
  margin: 8px auto 18px;
  max-width: 300px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.6;
  word-break: break-word;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(4, 5, 9, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  padding: 64px 76px;
  animation: fadeIn 220ms ease both;
}

.lightbox-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  z-index: 2;
}

.lightbox-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
}

.lightbox-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn-light { color: rgba(255, 255, 255, 0.7); }
.icon-btn-light:hover { color: #fff; background: rgba(255, 255, 255, 0.12); border-color: transparent; }

.lightbox-figure {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-figure img {
  max-width: min(88vw, 1280px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9);
  animation: modalIn 300ms var(--ease) both;
}

.lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  text-align: center;
  max-width: 70ch;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  transition: background var(--transition), transform var(--transition);
  z-index: 2;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.16); }
.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 44px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow-md);
  animation: toastIn 300ms var(--ease) both;
  line-height: 1.4;
}

.toast.is-leaving { animation: toastOut 260ms var(--ease) both; }
.toast .icon { width: 15px; height: 15px; color: #34d399; flex: none; }
.toast.is-error .icon { color: #ff8fa1; }
.toast.is-info .icon { color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 760ms var(--ease), transform 760ms var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  :root { --gutter: 22px; }
  .profile-card { grid-template-columns: minmax(0, 1fr) 230px; gap: 26px; padding: 28px; }
  .profile-side { padding-left: 24px; }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .profile-card { grid-template-columns: 1fr; gap: 22px; }
  .profile-side {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 20px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
  .stats { flex: 1; justify-content: flex-start; gap: 38px; }
  .profile-side .btn { width: auto; flex: none; }
  .side-note { display: none; }
  .site-nav { display: none; }
  .hero-corner { display: none; }
  .storage { width: 120px; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; --gutter: 18px; }

  body { font-size: 14.5px; }

  .header-actions .btn span { display: none; }
  .header-actions .btn { width: 38px; height: 38px; padding: 0; }
  .header-actions .btn .icon { width: 17px; height: 17px; }
  .brand-text small { display: none; }

  .hero { padding-top: calc(var(--header-h) + 16px); }
  .hero-card { min-height: 520px; border-radius: 24px; }
  .hero-content { padding: 0 22px 24px; }
  .hero-title { font-size: clamp(34px, 10vw, 48px); }
  .hero-subtitle { font-size: 14px; }
  .hero-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 22px;
  }
  .hero-foot .chip { align-self: flex-end; margin-left: auto; }
  .hero-meta { font-size: 11.5px; gap: 8px; }
  .hero-actions .btn { height: 42px; font-size: 13px; padding: 0 16px; }
  .hero-tags { margin-bottom: 20px; }

  .section { padding-top: 58px; }
  .section + .section { padding-top: 54px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .section-aside { display: none; }

  .profile-card { padding: 20px; border-radius: 20px; }
  .profile-main { flex-direction: column; gap: 18px; }
  .avatar { width: 92px; height: 92px; border-radius: 24px; }
  .status-dot { width: 20px; height: 20px; border-width: 3px; }
  .profile-bio { font-size: 13px; }
  .stats { gap: 26px; }
  .stat strong { font-size: 22px; }
  .profile-side { flex-wrap: wrap; }
  .profile-side .btn { width: 100%; }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 140px;
    gap: 9px;
  }
  .photo-card { border-radius: 14px; }
  .photo-card.is-feature { grid-column: span 2; grid-row: span 2; }
  .photo-card figcaption { opacity: 1; transform: none; font-size: 10px; padding: 22px 10px 8px; }
  .photo-actions { opacity: 1; transform: none; }

  .notice { flex-wrap: wrap; }
  .notice-actions { width: 100%; justify-content: flex-end; }
  .files-panel { padding: 14px; border-radius: 20px; }
  .files-toolbar { gap: 10px; }
  .search-box { max-width: none; min-width: 0; }
  .storage { width: 100px; }
  .storage-hint { display: none; }
  .dropzone { padding: 15px; }
  .file-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 11px 6px; }
  .file-thumb { width: 40px; height: 40px; border-radius: 10px; }
  .file-actions .icon-btn { width: 30px; height: 30px; }
  .file-meta { font-size: 10px; gap: 5px; }

  .empty-state { padding: 40px 18px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-meta { flex-wrap: wrap; }

  .player {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
  }
  .player-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 90px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
  }
  .player-bar { height: 62px; border-radius: 18px; }
  .toasts { left: 12px; bottom: 86px; }
  .modal { padding: 12px; }
  .modal-card { padding: 20px; border-radius: 20px; max-height: 92vh; }
  .form-grid { grid-template-columns: 1fr; }
  .avatar-editor { flex-direction: row; align-items: flex-start; }
  .avatar-preview { width: 68px; height: 68px; border-radius: 18px; }
  .lightbox { padding: 70px 14px; }
  .lightbox-nav { width: 38px; height: 38px; }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .lightbox-figure img { max-height: 70vh; }
}

@media (max-width: 420px) {
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .profile-side { flex-direction: column; align-items: stretch; }
  .stats { justify-content: space-between; gap: 10px; }
  .toolbar-right { width: 100%; justify-content: space-between; }
  .storage { flex: 1; width: auto; }
  .file-actions .icon-btn:nth-child(1) { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- pastel player (light) ---------- */
[data-theme="light"] .player { color: #3a3234; }

[data-theme="light"] .player-bar {
  border-color: rgba(120, 86, 92, 0.14);
  background: rgba(255, 251, 248, 0.88);
  box-shadow: 0 22px 50px -24px rgba(120, 80, 90, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .player:hover .player-bar { border-color: rgba(201, 116, 146, 0.42); }

[data-theme="light"] .vinyl {
  background: repeating-radial-gradient(circle at 50% 50%, #f4e2e6 0 2px, #e8d0d6 2px 4px);
  box-shadow: inset 0 0 0 1px rgba(120, 86, 92, 0.12), 0 4px 12px rgba(120, 80, 90, 0.16);
}
[data-theme="light"] .vinyl-art {
  background: linear-gradient(135deg, #f0b6c8, #e7c6d8 52%, #b9ddc9);
  color: rgba(58, 50, 52, 0.72);
}
[data-theme="light"] .vinyl-hole {
  background: #4b3a3d;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.7);
}
[data-theme="light"] .pb-meta span { color: rgba(58, 50, 52, 0.56); }
[data-theme="light"] .pb-play { background: #c97492; color: #fff; }
[data-theme="light"] .pb-play:hover { background: #b8607d; }
[data-theme="light"] .pb-expand { color: rgba(58, 50, 52, 0.46); }
[data-theme="light"] .pb-expand:hover { color: #3a3234; }

[data-theme="light"] .player-panel {
  border-color: rgba(120, 86, 92, 0.14);
  background: rgba(255, 250, 247, 0.96);
  box-shadow: 0 30px 70px -28px rgba(120, 80, 90, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .pp-cover {
  background: linear-gradient(135deg, #f0b6c8, #e7c6d8 52%, #b9ddc9);
  color: rgba(58, 50, 52, 0.68);
  box-shadow: 0 10px 24px -12px rgba(201, 116, 146, 0.7);
}
[data-theme="light"] .pp-titles span { color: rgba(58, 50, 52, 0.54); }
[data-theme="light"] .pp-head .icon-btn { color: rgba(58, 50, 52, 0.5); }
[data-theme="light"] .pp-head .icon-btn:hover { color: #3a3234; background: rgba(201, 116, 146, 0.1); }
[data-theme="light"] .pp-times { color: rgba(58, 50, 52, 0.44); }
[data-theme="light"] .pp-controls .icon-btn { color: rgba(58, 50, 52, 0.66); }
[data-theme="light"] .pp-controls .icon-btn:hover { color: #3a3234; background: rgba(201, 116, 146, 0.1); }
[data-theme="light"] .pp-controls .icon-btn.is-active { color: #b8607d; background: rgba(201, 116, 146, 0.14); }
[data-theme="light"] .volume { color: rgba(58, 50, 52, 0.46); }
[data-theme="light"] #repeatBtn.is-one::after { background: #c97492; color: #fff; }

[data-theme="light"] .pp-list-head {
  border-top-color: rgba(120, 86, 92, 0.12);
  color: rgba(58, 50, 52, 0.42);
}
[data-theme="light"] .pp-list-head em { color: rgba(58, 50, 52, 0.58); }
[data-theme="light"] .pp-list-head .link-btn { color: #b8607d; }
[data-theme="light"] .playlist li:hover { background: rgba(201, 116, 146, 0.08); }
[data-theme="light"] .playlist li.is-current { background: rgba(111, 174, 141, 0.18); }
[data-theme="light"] .playlist .track-index { color: rgba(58, 50, 52, 0.36); }
[data-theme="light"] .playlist li.is-current .track-index { color: #4f8f70; }
[data-theme="light"] .playlist .track-title { color: rgba(58, 50, 52, 0.82); }
[data-theme="light"] .playlist li.is-current .track-title { color: #2f2a2c; }
[data-theme="light"] .playlist .track-time { color: rgba(58, 50, 52, 0.34); }
[data-theme="light"] .playlist .track-del { color: rgba(58, 50, 52, 0.34); }
[data-theme="light"] .playlist .track-del:hover { color: #d95d72; background: rgba(217, 93, 114, 0.12); }
[data-theme="light"] .pp-empty { color: rgba(58, 50, 52, 0.4); }

[data-theme="light"] .range {
  background: linear-gradient(90deg, #c97492 var(--progress, 0%), rgba(86, 64, 68, 0.14) var(--progress, 0%));
}
[data-theme="light"] .range::-webkit-slider-thumb {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.22), 0 2px 6px rgba(120, 80, 90, 0.3);
}
[data-theme="light"] .range::-moz-range-thumb {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 116, 146, 0.22);
}

/* ---------- print ---------- */
@media print {
  .site-header, .player, .toasts, .head-actions, .dropzone, .photo-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .hero-card { box-shadow: none; border: 1px solid #ddd; }
}

/* --------------------------------------------------------------------------
   Publish settings + download password
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.settings-help {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin: -2px 0 0;
}
.settings-help a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.settings-help code,
.notice-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(201, 116, 146, 0.10);
  color: var(--accent-deep);
}

.settings-status {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
}
.settings-status.is-ok { color: #3d7d5f; background: rgba(111, 174, 141, 0.13); border-color: rgba(111, 174, 141, 0.35); }
.settings-status.is-warn { color: #96602f; background: rgba(230, 175, 92, 0.13); border-color: rgba(230, 175, 92, 0.34); }
.settings-status.is-error { color: var(--danger); background: rgba(217, 93, 114, 0.10); border-color: rgba(217, 93, 114, 0.30); }
[data-theme="dark"] .settings-status { background: rgba(255, 255, 255, 0.04); }

.settings-actions { padding-top: 14px; }
.settings-actions .btn-sm { min-height: 36px; }
.settings-actions .btn-primary { margin-left: auto; }

.settings-publish {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.settings-publish strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.settings-publish .settings-help { margin: 0; }

.password-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.password-form .field { gap: 0; }
.password-error {
  font-size: 12px;
  color: var(--danger);
  margin: -2px 0 0;
}
.password-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
  text-align: center;
  margin: 10px 0 0;
}

.files-panel.is-uploading .dropzone { opacity: 0.55; pointer-events: none; }
.files-panel.is-uploading .files-toolbar::after {
  content: "正在上传…";
  font-size: 11.5px;
  color: var(--accent-deep);
  margin-left: 8px;
}

@media (max-width: 760px) {
  .settings-publish { flex-direction: column; align-items: flex-start; }
  .settings-actions { flex-wrap: wrap; }
  .settings-actions .btn-primary { margin-left: 0; width: 100%; }
}

/* Visitors only see the public library; owner controls appear after GitHub config. */
.is-visitor .owner-only { display: none !important; }

/* Autoplay hint shown only when the browser blocks audible autoplay. */
.autoplay-hint {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 75;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: hint-in 0.35s ease both;
}
.autoplay-hint .icon { width: 15px; height: 15px; color: var(--accent); }
.autoplay-hint:hover { border-color: var(--accent); transform: translateY(-1px); }
@keyframes hint-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
  .autoplay-hint {
    left: 12px;
    right: 12px;
    bottom: 92px;
    justify-content: center;
  }
}


/* ==========================================================================
   Four-page layout, navigation pills, gallery masonry and logs
   ========================================================================== */
.page[hidden] { display: none !important; }
.page.is-active { display: block; }
.page > .section:first-child { padding-top: calc(var(--header-h) + 34px); }

/* Header: four independent capsule nav pills next to the brand */
.header-inner .brand { margin-right: 0; }
.site-nav {
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  margin-right: auto;
  overflow: visible;
}
.site-nav a {
  padding: 7px 17px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(80, 50, 58, 0.04);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.site-nav a.is-active {
  color: var(--red-deep);
  border-color: rgba(201, 116, 146, 0.38);
  background: linear-gradient(120deg, rgba(234, 166, 188, 0.34), rgba(214, 178, 204, 0.26) 48%, rgba(166, 214, 191, 0.32));
}

.page-desc { margin-top: 7px; font-size: 13px; color: var(--muted); max-width: 620px; }
.page-head { align-items: flex-end; margin-bottom: 26px; }

/* Gallery masonry */
.gallery-masonry { columns: 3; column-gap: 20px; }
.gallery-card {
  break-inside: avoid;
  position: relative;
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}
.gallery-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.gallery-card img { display: block; width: 100%; height: auto; background: var(--surface-2); }
.gallery-card figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px 12px;
  border-top: 1px solid var(--border);
}
.gallery-card figcaption strong {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card figcaption span { flex: none; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.gallery-owner { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity 200ms var(--ease); }
.gallery-card:hover .gallery-owner, .gallery-card:focus-within .gallery-owner { opacity: 1; }
.gallery-owner .icon-btn {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: rgba(251, 246, 243, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #3a2b30;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gallery-owner .icon-btn:hover { background: #fff; }
.gallery-card.is-broken img { display: none; }
.gallery-card.is-broken { min-height: 120px; }

/* Logs — deliberately one calm vertical column */
.log-list { display: flex; flex-direction: column; gap: 16px; }
.log-card {
  padding: 24px 28px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.log-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.log-date { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--faint); }
.log-actions { display: flex; gap: 12px; margin-left: auto; }
.log-actions .link-btn { font-size: 12px; color: var(--muted); }
.log-actions .link-btn.is-danger { color: var(--red-deep); }
.log-title { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); margin-bottom: 9px; }
.log-body { position: relative; max-height: 92px; overflow: hidden; color: var(--muted); font-size: 13.5px; line-height: 1.85; white-space: pre-wrap; }
.log-body::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38px;
  background: linear-gradient(180deg, transparent, var(--surface) 82%);
  pointer-events: none;
}
.log-card.is-open .log-body { max-height: none; }
.log-card.is-open .log-body::after { display: none; }
.log-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 11px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--red-deep);
  cursor: pointer;
}
.log-toggle .icon { width: 13px; height: 13px; transition: transform 200ms var(--ease); }
.log-card.is-open .log-toggle .icon { transform: rotate(180deg); }
.log-empty-note { margin-top: 14px; font-size: 11.5px; color: var(--faint); }

@media (max-width: 1000px) {
  .gallery-masonry { columns: 2; column-gap: 16px; }
  .gallery-card { margin-bottom: 16px; }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 10px 12px; padding-top: 10px; padding-bottom: 8px; align-items: center; }
  .site-nav {
    display: flex;
    order: 3;
    width: 100%;
    margin: 0;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: none; padding: 6px 14px; font-size: 12.5px; }
  .header-actions { margin-left: auto; gap: 6px; }
  :root { --header-h: 118px; }
  .page-head { align-items: flex-start; }
}

@media (max-width: 760px) {
  :root { --header-h: 114px; }
  .publish-label { display: none; }
  .header-actions .btn span { display: none; }
  #editProfileTop { width: 38px; height: 38px; padding: 0; justify-content: center; gap: 0; }
  .gallery-masonry { columns: 2; column-gap: 12px; }
  .gallery-card { margin-bottom: 12px; border-radius: 14px; }
  .gallery-card figcaption { display: block; padding: 8px 10px 9px; }
  .gallery-card figcaption strong { display: block; font-size: 11.5px; white-space: nowrap; }
  .gallery-card figcaption span { display: none; }
  .gallery-owner { opacity: 1; top: 6px; right: 6px; gap: 4px; }
  .gallery-owner .icon-btn { width: 27px; height: 27px; }
  .log-card { padding: 19px 18px 15px; border-radius: 15px; }
  .log-title { font-size: 17px; }
  .log-body { font-size: 13px; line-height: 1.8; max-height: 82px; }
  .log-actions { gap: 9px; }
}

@media (max-width: 760px) {
  .autoplay-hint { display: none !important; }
}

/* Autoplay fallback must stay legible on both themes */
[data-theme="light"] .autoplay-hint { background: #ffffff; color: #2f2a2c; }
[data-theme="dark"] .autoplay-hint { background: #241f22; color: #f5efe9; }
