/* Google Fonts 已移至 app.js 异步加载，避免 @import 阻塞整个 CSS 渲染 */

:root {
  --bg: #faf5ff;
  --bg-deep: #ede9fe;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-dark: rgba(15, 10, 30, 0.88);
  --line: rgba(37, 99, 235, 0.10);
  --line-strong: rgba(37, 99, 235, 0.20);
  --text: #0f0a1e;
  --muted: #475569;
  --accent: #7c3aed;
  --accent-deep: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.10);
  --teal: #2563eb;
  --teal-soft: rgba(37, 99, 235, 0.10);
  --gold: #db2777;
  --gold-soft: rgba(219, 39, 119, 0.10);
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.10);
  --warn: #dc2626;
  --warn-soft: rgba(220, 38, 38, 0.08);
  --shadow-lg: 0 32px 80px rgba(15, 23, 42, 0.13);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.09);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --content: min(1240px, calc(100% - 36px));
  --border: rgba(30, 64, 175, 0.12);
  --fg: #0f0a1e;
}

/* ══════ Dark Mode ══════ */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-deep: #020617;
  --surface: rgba(30, 41, 59, 0.78);
  --surface-strong: rgba(30, 41, 59, 0.94);
  --surface-dark: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.12);
  --line-strong: rgba(148, 163, 184, 0.22);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #8b5cf6;
  --accent-deep: #7c3aed;
  --accent-soft: rgba(139, 92, 246, 0.18);
  --teal: #c084fc;
  --teal-soft: rgba(192, 132, 252, 0.14);
  --gold: #f472b6;
  --gold-soft: rgba(251, 191, 36, 0.12);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --warn: #f87171;
  --warn-soft: rgba(248, 113, 113, 0.10);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.3);
  --border: rgba(148, 163, 184, 0.18);
  --fg: #f1f5f9;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(34, 211, 238, 0.08), transparent 22%),
    radial-gradient(circle at 50% 110%, rgba(99, 102, 241, 0.06), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

[data-theme="dark"] body::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent);
}

[data-theme="dark"] body::after {
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.5));
}

[data-theme="dark"] img { opacity: 0.92; }
[data-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.68);
  border-bottom-color: rgba(148, 163, 184, 0.1);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(30, 41, 59, 0.7);
  border-color: var(--line-strong);
  color: var(--text);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
}

/* Dark mode toggle button in topbar */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  color: var(--muted);
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(124,58,237,.15);
}
.theme-toggle:active {
  transform: scale(0.95);
}
[data-theme="dark"] .theme-toggle {
  border-color: var(--line-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ── 关闭按钮 ── */
.mobile-close-btn {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 101;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1.4rem;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.mobile-close-btn.visible {
  display: flex;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.15), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(8, 145, 178, 0.12), transparent 22%),
    radial-gradient(circle at 50% 110%, rgba(99, 102, 241, 0.10), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -120px;
  right: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  filter: blur(8px);
  animation: drift 18s ease-in-out infinite alternate;
}

body::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 220px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(240, 245, 255, 0.48));
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
.brand-title,
.value,
.display-serif {
  font-family: "Noto Serif SC", "Songti SC", serif;
}

h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.3;
}

h4 {
  font-size: 1rem;
}

p,
.muted,
.helper {
  color: var(--muted);
  line-height: 1.75;
}

.shell,
.page,
.topbar-inner {
  width: var(--content);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(240, 245, 255, 0.68);
  border-bottom: 1px solid rgba(30, 64, 175, 0.08);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  min-width: 0;
}

.brand-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  height: 40px;
  width: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(37,99,235,.18));
}

.brand-wordmark {
  font-family: "Noto Serif SC", "Georgia", serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-logo {
  height: 38px;
  width: auto;
}

.brand-tagline {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.75;
  padding-left: 50px;
  font-weight: 500;
  line-height: 1.3;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  font-size: 1.28rem;
  font-weight: 700;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(30, 64, 175, 0.07);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.lang-select {
  appearance: none;
  border: 1px solid rgba(30, 64, 175, 0.10);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 30px 8px 12px;
  font: inherit;
  font-weight: 700;
  min-width: 108px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.lang-select:focus {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.page {
  position: relative;
  z-index: 1;
  margin: 30px auto 64px;
  display: grid;
  gap: 22px;
}

/* ── Auth page centered layout ── */
.auth-page-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 80vh;
  padding-top: 40px;
}

.auth-page-center {
  max-width: 480px;
  width: 100%;
  padding: 0 18px;
}

.nav-actions,
.button-row,
.card-actions,
.selection-actions,
.inline-fields,
.hero-actions,
.toolbar,
.feature-list,
.metric-row,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── Toggle switch ── */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--line, #ccc);
  border-radius: 26px;
  cursor: pointer;
  transition: background .3s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .3s;
}
.switch input:checked + .slider {
  background: var(--accent, #7c3aed);
}
.switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* ── Nav-links: always a slide-in menu panel ── */
.nav-links {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--bg, #faf5ff);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 80px 20px 32px;
  gap: 6px;
  border-radius: 0;
  border: none;
  overflow-y: auto;
}
.nav-links.mobile-open {
  display: flex;
}
.nav-links .nav-link {
  padding: 15px 20px;
  font-size: 1.05rem;
  border-radius: 14px;
  justify-content: flex-start;
  width: 100%;
  font-weight: 600;
  color: var(--text);
  transition: background .15s;
}
.nav-links .nav-link:hover,
.nav-links .nav-link.active {
  background: var(--accent-soft, rgba(124,58,237,.08));
  color: var(--accent, #7c3aed);
}

/* ── Hamburger menu button (always visible) ── */
.menu-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--line, #ddd);
  cursor: pointer;
  padding: 7px 12px;
  color: var(--text);
  border-radius: 10px;
  line-height: 1;
  height: 38px;
  transition: background .2s, border-color .2s;
}
.menu-hamburger:hover {
  background: var(--accent-soft, rgba(99,102,241,.08));
  border-color: var(--accent, #6366f1);
}
.hamburger-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
}
.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: absolute;
  left: 0;
}
.hamburger-icon::before { top: -5px; }
.hamburger-icon::after { top: 5px; }
.hamburger-label {
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-link,
.ghost-button,
.primary-button,
.danger-button,
.tag,
.chip,
.metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
}

.nav-link,
.ghost-button,
.danger-button,
.tag,
.chip,
.metric-pill {
  border: 1px solid transparent;
}

.nav-link {
  padding: 10px 14px;
  color: var(--muted);
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(30, 64, 175, 0.07);
}

.ghost-button,
.primary-button,
.danger-button,
button,
.tab-button {
  cursor: pointer;
  font: inherit;
  padding: 12px 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary-button,
button,
button.primary {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.22);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--line);
}

.danger-button {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(220, 38, 38, 0.18);
}

.outline-button {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.outline-button:hover {
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--accent);
}
.outline-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
button:hover,
.tab-button:hover,
.album-card:hover,
.media-card:hover,
.result-card:hover,
.purchase-card:hover,
.admin-row:hover,
.card:hover {
  transform: translateY(-2px);
}

.hero,
.panel,
.card,
.media-card,
.empty-state,
.stat-card,
.album-card,
.result-card,
.purchase-card,
.admin-row {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(14px);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.18fr) minmax(min(330px, 100%), 0.82fr);
  background:
    linear-gradient(145deg, rgba(240, 245, 255, 0.72), rgba(220, 230, 249, 0.58)),
    var(--surface);
}

[data-theme="dark"] .hero {
  background:
    linear-gradient(145deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.72)),
    var(--surface);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: calc(var(--radius-xl) - 8px);
  pointer-events: none;
}

[data-theme="dark"] .hero::before {
  border-color: rgba(148, 163, 184, 0.08);
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(8, 145, 178, 0.08));
}

.hero-copy,
.hero-side,
.page-stack,
.content-slot,
.sidebar-stack {
  display: grid;
  gap: 18px;
  align-content: start;
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero-lead {
  max-width: 62ch;
  font-size: 1.04rem;
}

.feature-list {
  margin-top: 4px;
}

.metric-pill {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(30, 64, 175, 0.07);
  color: var(--text);
}

[data-theme="dark"] .metric-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.15);
}

.hero-grid,
.stats-grid,
.panel-grid,
.cards-grid,
.album-grid,
.result-grid,
.purchase-grid,
.admin-grid,
.two-col,
.three-col,
.dashboard-grid,
.story-grid,
.insight-grid {
  display: grid;
  gap: 16px;
}

.hero-grid,
.three-col,
.story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.two-col,
.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards-grid,
.album-grid,
.result-grid,
.purchase-grid,
.insight-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.panel,
.card,
.media-card,
.empty-state,
.stat-card,
.album-card,
.result-card,
.purchase-card,
.admin-row {
  padding: 24px;
}

.card,
.media-card,
.album-card,
.result-card,
.purchase-card,
.admin-row,
.stat-card {
  position: relative;
  overflow: hidden;
}

.card::before,
.media-card::before,
.album-card::before,
.result-card::before,
.purchase-card::before,
.admin-row::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 32%);
  pointer-events: none;
}

.stat-card .value {
  margin-top: 10px;
  font-size: 2.15rem;
  font-weight: 700;
  overflow-wrap: break-word;
  word-break: break-all;
  min-width: 0;
}

.stat-card .stat-number {
  display: block;
  font-size: 2.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-all;
}

.stat-card .stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.album-card,
.media-card,
.result-card,
.purchase-card,
.admin-row,
.card {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.album-card.active {
  border-color: rgba(37, 99, 235, 0.40);
  box-shadow: 0 22px 44px rgba(37, 99, 235, 0.14);
}

.tag,
.chip {
  padding: 8px 12px;
  font-size: 0.8rem;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.chip.free {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip.paid {
  background: var(--gold-soft);
  color: var(--gold);
}

.chip.admin {
  background: var(--teal-soft);
  color: var(--teal);
}

/* ====== User Dropdown Menu ====== */
.user-menu-wrap {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(30, 64, 175, 0.08);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
}

.user-menu-trigger .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu-trigger .user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.user-menu-trigger .dropdown-arrow {
  font-size: 0.65rem;
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.user-menu-wrap.open .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(30, 64, 175, 0.1);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
  padding: 8px 0;
  z-index: 100;
}

.user-menu-wrap.open .user-dropdown {
  display: block;
}

.user-dropdown .dropdown-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(30, 64, 175, 0.06);
}

.user-dropdown .dropdown-header .dd-username {
  font-weight: 700;
  font-size: 0.95rem;
  word-break: break-all;
}

.user-dropdown .dropdown-header .dd-email {
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
  margin-top: 2px;
}

.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s;
}

.user-dropdown .dropdown-item:hover {
  background: rgba(37, 99, 235, 0.06);
}

.user-dropdown .dropdown-divider {
  height: 1px;
  background: rgba(30, 64, 175, 0.06);
  margin: 4px 0;
}

.user-dropdown .dropdown-item.danger {
  color: var(--warn);
}

.card-head,
.media-head,
.album-head,
.section-head,
.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.meta,
.detail-list,
.info-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.meta span,
.detail-pill {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--muted);
  font-size: 0.83rem;
}

.section-frame {
  display: grid;
  gap: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.section-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.93rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: auto;
}

.status {
  min-height: 24px;
  font-size: 0.94rem;
}

.field-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #888);
  margin-top: 4px;
}

.status.success {
  color: var(--ok);
}

.status.error {
  color: var(--warn);
}

.status.pending {
  color: var(--teal);
}

.hidden {
  display: none !important;
}

.auth-layout {
  display: grid;
  gap: 16px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.05);
  gap: 6px;
}

.tab-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex: 1 1 auto;
  text-align: center;
}

.tab-button.active {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-weight: 600;
}

/* Auth method toggle buttons (inside login/register panels) */
.auth-method-toggle .auth-method-btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-method-toggle .auth-method-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.auth-card,
.portal-card,
.detail-layout,
.admin-layout {
  display: grid;
  gap: 18px;
}

.detail-layout,
.admin-layout {
  grid-template-columns: minmax(0, 1.22fr) minmax(min(320px, 100%), 0.78fr);
}

.media-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.07));
  min-height: 320px;
  border: 1px solid rgba(30, 64, 175, 0.06);
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: radial-gradient(circle at top, #1e293b, #0f172a);
}

.empty-state {
  text-align: center;
  padding: 44px 28px;
}

.selection-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--line);
}

.video-tier-option:hover {
  border-color: var(--accent) !important;
  background: rgba(124, 58, 237, 0.04);
}

.video-tier-option:has(input:checked) {
  border-color: var(--accent) !important;
  background: rgba(124, 58, 237, 0.08);
}

.mini-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.mini-list::-webkit-scrollbar {
  width: 10px;
}

.mini-list::-webkit-scrollbar-thumb {
  background: rgba(30, 64, 175, 0.14);
  border-radius: 999px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.process-card {
  display: grid;
  gap: 10px;
}

.process-step {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero-note,
.side-note {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(30, 64, 175, 0.07);
}

[data-theme="dark"] .hero-note,
[data-theme="dark"] .side-note {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.12);
}

.story-card {
  min-height: 100%;
}

.story-card p + p {
  margin-top: 8px;
}

.dashboard-grid .sidebar-stack {
  grid-column: span 1;
}

.dashboard-grid .content-slot {
  display: grid;
  gap: 18px;
}

.admin-banner {
  display: grid;
  gap: 14px;
}

.overview-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.ribbon-card {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(30, 64, 175, 0.07);
}

[data-theme="dark"] .ribbon-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.12);
}

.ribbon-card strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 6px;
}

.page[data-page="home"] .hero,
body[data-page="home"] .hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(min(320px, 100%), 0.92fr);
}

.page[data-page="admin"] .hero,
body[data-page="admin"] .hero {
  background:
    linear-gradient(145deg, rgba(224, 231, 255, 0.86), rgba(199, 210, 254, 0.72)),
    var(--surface);
}

.page-accent {
  color: var(--accent-deep);
}

.auth-panel-highlight {
  position: relative;
}

/* Admin row accent bar */
.admin-row-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--teal));
  border-radius: 4px 0 0 4px;
}

/* Purchase card accent bar */
.purchase-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--ok), var(--teal));
  border-radius: 4px 0 0 4px;
}

/* Visual shell for album covers */
.visual-shell {
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 140px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.08));
}

.visual-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-surface {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 18px;
  text-align: center;
}

.placeholder-badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.card-stack {
  display: grid;
  gap: 6px;
}

/* Media card frame */
.media-card-frame img,
.media-card-frame video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #1e293b, #0f172a);
}

/* Album summary panel */
.album-summary-panel {
  display: grid;
  gap: 18px;
}

.album-summary-side {
  max-width: 200px;
}

/* Search summary */
.search-summary-panel {
  display: grid;
  gap: 14px;
}

/* Footer */
.footer-bar {
  text-align: center;
  padding: 28px 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-panel-highlight::after {
  content: "";
  position: absolute;
  inset: 10px 10px auto auto;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0));
  pointer-events: none;
}

.page-fineprint {
  font-size: 0.9rem;
}

[data-page] .page > * {
  animation: rise-in 0.5s ease both;
}

[data-page] .page > *:nth-child(2) {
  animation-delay: 0.06s;
}

[data-page] .page > *:nth-child(3) {
  animation-delay: 0.12s;
}

[data-page] .page > *:nth-child(4) {
  animation-delay: 0.18s;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-24px, 20px, 0) scale(1.08);
  }
}

@media (max-width: 1080px) {
  .hero,
  .detail-layout,
  .admin-layout,
  .hero-grid,
  .stats-grid,
  .three-col,
  .two-col,
  .dashboard-grid,
  .story-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="home"] .hero,
  .page[data-page="home"] .hero {
    grid-template-columns: 1fr;
  }

  .shell,
  .page,
  .topbar-inner {
    width: min(100% - 24px, 1240px);
  }

  .hero {
    padding: 28px;
  }
}

@media (max-width: 720px) {
  .hero,
  .panel,
  .card,
  .media-card,
  .empty-state,
  .stat-card,
  .album-card,
  .result-card,
  .purchase-card,
  .admin-row {
    padding: 18px;
    border-radius: 22px;
  }

  h1 {
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    line-height: 1.2;
  }

  h2 {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
  }

  /* ── 移动端导航 ── */
  .topbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(240, 245, 255, 0.96);
  }
  [data-theme="dark"] .topbar {
    background: rgba(15, 23, 42, 0.96);
  }

  .topbar-inner {
    padding: 10px 0;
    flex-wrap: nowrap;
  }

  .nav-actions {
    gap: 6px;
  }

  .brand-wordmark {
    font-size: 1.1rem;
  }

  .brand-icon {
    height: 30px;
    width: 30px;
  }

  .brand-tagline {
    display: none;
  }

  .button-row,
  .hero-actions,
  .card-actions {
    width: 100%;
  }

  .button-row > *,
  .hero-actions > *,
  .card-actions > * {
    flex: 1 1 100%;
  }

  .tabs {
    width: 100%;
  }

  .tabs .tab-button {
    flex: 1 1 0;
  }

  /* ── 首页 hero 改善 ── */
  .hero {
    padding: 20px;
    gap: 20px;
  }

  .hero-copy {
    gap: 14px;
  }

  .hero-lead {
    font-size: 0.92rem;
  }

  .feature-list {
    gap: 8px;
  }

  .metric-pill {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .overview-ribbon {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ribbon-card {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .ribbon-card strong {
    font-size: 1rem;
    margin-top: 4px;
  }

  .ribbon-card p {
    font-size: 0.85rem;
  }

  /* ── auth card 手机端 ── */
  .auth-card {
    padding: 28px 20px !important;
  }

  .auth-card h2 {
    font-size: 1.3rem;
  }

  /* ── story-grid 手机端 ── */
  .story-grid {
    grid-template-columns: 1fr;
  }

  .story-card {
    padding: 18px;
  }

  .process-step {
    font-size: 0.95rem;
  }

  /* ── 页面容器 ── */
  .shell,
  .page,
  .topbar-inner {
    width: min(100% - 16px, 1240px);
  }

  .page {
    margin: 16px auto 48px;
    gap: 16px;
  }

  /* ── 用户菜单 ── */
  .user-menu-trigger .user-name {
    display: none;
  }

  /* ── footer ── */
  footer {
    padding: 16px 12px !important;
    font-size: 0.78rem !important;
  }

  /* ── admin gate 两列改单列 ── */
  .two-col {
    grid-template-columns: 1fr;
  }

  /* ── auth page ── */
  .auth-page-layout {
    padding-top: 20px;
    min-height: auto;
  }

  /* ── messages ── */
  .messages-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 160px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.card-stack {
  display: grid;
  gap: 12px;
}

.visual-shell {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.14), rgba(99, 102, 241, 0.12));
}

.visual-shell img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.placeholder-surface {
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  color: #f0f5ff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(155deg, rgba(8, 145, 178, 0.85), rgba(37, 99, 235, 0.88));
}

.placeholder-surface strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.2rem;
}

.placeholder-surface span {
  color: rgba(224, 231, 255, 0.88);
  font-size: 0.92rem;
}

.placeholder-badge {
  justify-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.album-card,
.media-card,
.purchase-card,
.result-card {
  display: grid;
  gap: 16px;
}

.media-card-frame {
  min-height: 240px;
}

.album-summary-panel,
.media-stage-panel,
.media-info-panel,
.search-summary-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 34%),
    var(--surface);
}

.album-summary-panel .section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 18px;
}

.album-summary-side .visual-shell {
  min-height: 170px;
}

.media-info-panel {
  align-content: start;
}

.purchase-accent,
.admin-row-accent {
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
}

.purchase-card .card-actions,
.result-card .card-actions,
.media-card .card-actions,
.album-card .card-actions {
  margin-top: auto;
}

.admin-row {
  display: grid;
  gap: 12px;
}

.admin-row .inline-fields {
  gap: 12px;
}

.admin-row .inline-fields > * {
  flex: 1 1 160px;
}

@media (max-width: 1080px) {
  .album-summary-panel .section-head {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   社交系统样式
   ============================================================ */

/* — 帖子卡片 — */
.post-card {
  margin-bottom: 16px;
  transition: box-shadow 0.2s ease;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.post-avatar:hover {
  transform: scale(1.08);
}

.post-author-name {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.post-author-name:hover {
  color: var(--accent);
}

.post-time {
  font-size: 0.78rem;
  color: var(--muted);
}

.post-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  margin-bottom: 4px;
}

.post-media img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.post-actions .ghost-button {
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 99px;
  transition: background 0.15s ease;
}

.post-actions .ghost-button:hover {
  background: var(--accent-soft);
}

/* — 评论区 — */
.post-comments-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.post-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.comment-item {
  font-size: 0.88rem;
  padding: 6px 0;
  line-height: 1.5;
}

.comment-item a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.comment-item a:hover {
  color: var(--accent);
}

.comment-item .comment-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 6px;
}

.post-comment-form {
  display: flex;
  gap: 8px;
}

.post-comment-form input {
  flex: 1;
  font-size: 0.88rem;
}

.post-comment-form .primary-button {
  font-size: 0.82rem;
  padding: 6px 16px;
  white-space: nowrap;
}

/* — 消息页 — */
.messages-layout {
  max-width: 820px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 520px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}

/* ── 新版消息页布局 ── */
.messages-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 180px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
}

.msg-sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.03);
}

.msg-sidebar-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.msg-sidebar-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.msg-conv-list {
  flex: 1;
  overflow-y: auto;
}

.msg-conv-list .conv-item {
  padding: 14px 20px;
  gap: 14px;
}

.msg-conv-list .conv-avatar {
  width: 42px;
  height: 42px;
  font-size: 0.88rem;
}

.msg-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.msg-chat-header {
  padding: 18px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--line);
  min-height: 28px;
  background: rgba(255,255,255,0.02);
}

.msg-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-chat-input {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.msg-chat-input input {
  flex: 1;
  font-size: 0.95rem;
}

.msg-chat-input .primary-button {
  padding: 8px 24px;
  white-space: nowrap;
}

.conv-sidebar {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  max-height: 620px;
}

.conv-item {
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(30, 64, 175, 0.04);
  display: flex;
  gap: 12px;
  align-items: center;
  transition: background 0.15s ease;
}

.conv-item:hover {
  background: rgba(37, 99, 235, 0.04);
}

.conv-item.active {
  background: rgba(37, 99, 235, 0.08);
}

.conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.conv-info {
  min-width: 0;
  flex: 1;
}

.conv-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.conv-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 0.7rem;
  margin-left: 6px;
  font-weight: 600;
}

.conv-preview {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-area {
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 14px 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  min-height: 22px;
  font-size: 0.95rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  max-height: 460px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Admin Gate ── */
.gate-card {
  transition: box-shadow 0.2s, transform 0.15s;
}
.gate-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.admin-back-btn {
  font-size: 0.88rem;
}

/* ── Shoot Page ── */

.shoot-form { display: flex; flex-direction: column; gap: 18px; }

.shoot-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.shoot-form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.shoot-form-field select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--bg);
  transition: border-color 0.15s;
}
.shoot-form-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.shoot-dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.shoot-dropzone:hover,
.shoot-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.04);
}

.shoot-dropzone-content { pointer-events: none; }

.shoot-dropzone-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 8px;
}

.shoot-dropzone-sub {
  font-size: 0.8rem;
  margin-top: 4px;
}

.shoot-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.shoot-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.shoot-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}

.shoot-file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shoot-file-item .file-size {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.shoot-file-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1;
  padding: 2px;
  transition: color 0.15s;
}
.shoot-file-remove:hover { color: var(--danger, #ef4444); }

.shoot-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.shoot-form-actions .status {
  font-size: 0.85rem;
  color: var(--muted);
}

.shoot-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.shoot-recent-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.shoot-recent-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.shoot-recent-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--border);
}

.shoot-recent-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--border);
  color: var(--muted);
}

.shoot-recent-info {
  padding: 8px 10px;
}

.shoot-recent-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shoot-recent-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.shoot-status-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.6;
}
.shoot-status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}
.shoot-status-badge.done {
  background: #d1fae5;
  color: #065f46;
}

@media (max-width: 768px) {
  #admin-shoot-view [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 520px) {
  .shoot-form-row { grid-template-columns: 1fr; }
  .shoot-recent-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

.chat-row {
  display: flex;
}

.chat-row.mine {
  justify-content: flex-end;
}

.chat-row.theirs {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.mine {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
  background: var(--surface-strong);
  border-bottom-left-radius: 4px;
}

.chat-bubble-time {
  font-size: 0.65rem;
  opacity: 0.55;
  margin-top: 4px;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  flex: 1;
}

/* — 通知页 — */
.notif-container {
  max-width: 680px;
  margin: 24px auto 0;
}

.notif-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.notif-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}

.notif-item.unread {
  border-left: 3px solid var(--accent);
}

.notif-item.read {
  opacity: 0.6;
}

.notif-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.notif-body {
  flex: 1;
}

.notif-text {
  font-size: 0.92rem;
  line-height: 1.4;
}

.notif-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* — 用户主页 — */
.user-profile-section {
  max-width: 680px;
  margin: 0 auto;
}

.user-profile-card {
  text-align: center;
}

.user-avatar-big {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}

.user-join-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.user-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.user-posts-section {
  max-width: 680px;
  margin: 28px auto 0;
}

/* — 媒体社交区 — */
.media-social-section {
  max-width: 680px;
  margin: 24px auto 0;
}

.media-social-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.media-social-actions .ghost-button {
  min-width: 100px;
}

.media-comments-area h3 {
  margin-bottom: 10px;
}

.media-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-comment-item {
  font-size: 0.92rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(30, 64, 175, 0.04);
  line-height: 1.5;
}

.media-comment-item a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.media-comment-item a:hover {
  color: var(--accent);
}

.media-comment-item .comment-content {
  margin-left: 6px;
}

.media-comment-item .comment-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 8px;
}

.media-comment-form {
  display: flex;
  gap: 8px;
}

.media-comment-form input {
  flex: 1;
}

/* — Feed布局 — */
.feed-container {
  max-width: 680px;
  margin: 0 auto;
}

.feed-tabs {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

/* — 社交响应式 — */
@media (max-width: 768px) {
  .messages-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .messages-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 80px);
  }

  .msg-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 240px;
  }

  .msg-chat-body {
    min-height: 320px;
  }

  .conv-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 200px;
  }

  .chat-messages {
    max-height: 300px;
  }

  .post-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
  }

  .user-avatar-big {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
  }

  .notif-item {
    padding: 12px 14px;
  }
}

/* ============================================================
   Admin Tab Navigation
   ============================================================ */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab {
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}

.admin-tab:hover {
  color: var(--fg);
}

.admin-tab.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent-deep);
}

.manage-tab-content {
  animation: tabFadeIn 0.22s ease;
}

.manage-tab-content.hidden {
  display: none !important;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .admin-tabs {
    gap: 0;
  }
  .admin-tab {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* Album Sub-Tab Navigation (inside 相册管理) */
.album-sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.album-sub-tab {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
}

.album-sub-tab:hover {
  color: var(--fg);
  border-color: var(--accent-deep);
  background: rgba(99, 102, 241, 0.06);
}

.album-sub-tab.active {
  color: #fff;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.album-sub-content {
  animation: tabFadeIn 0.22s ease;
}

.album-sub-content.hidden {
  display: none !important;
}

@media (max-width: 700px) {
  .album-sub-tabs {
    gap: 6px;
  }
  .album-sub-tab {
    padding: 6px 14px;
    font-size: 0.82rem;
  }
  /* Album list 2-col grid → stacked on mobile */
  #album-sub-list div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  #album-sub-list div[style*="flex-direction:column"] {
    max-height: none !important;
  }
}

/* ============================================================
   Community Tab Content
   ============================================================ */
.community-tab-content {
  animation: tabFadeIn 0.22s ease;
}

.community-tab-content.hidden {
  display: none !important;
}

/* ============================================================
   Batch Toolbar
   ============================================================ */
.batch-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.batch-toolbar .button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.batch-toolbar select {
  padding: 6px 12px;
  font-size: 0.88rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

/* ============================================================
   Modal Overlay
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-panel {
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Post Card Enhancements
   ============================================================ */
.post-images img {
  transition: transform 0.15s ease;
}

.post-images img:hover {
  transform: scale(1.04);
}

.post-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.post-actions .ghost-button {
  font-size: 0.85rem;
  padding: 4px 10px;
}

.repost-card {
  transition: background 0.15s ease;
}

.repost-card:hover {
  background: rgba(15, 23, 42, 0.07);
}

.post-dropdown {
  min-width: 140px;
}

.post-dropdown .ghost-button:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* Gift button styling */
.gift-btn {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

.gift-btn:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.16)) !important;
}

/* ==================== Skeleton Loading ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--clr-border, #e5e7eb) 25%, var(--clr-muted, #f0f0f0) 50%, var(--clr-border, #e5e7eb) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-text { height: 1em; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 1.4em; margin-bottom: 12px; width: 60%; }
.skeleton-card { height: 200px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== Improved Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-muted, #c4c4c4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-accent, #2563eb); }

/* ==================== Selection Color ==================== */
::selection { background: rgba(37, 99, 235, 0.2); color: inherit; }

/* ==================== Focus Ring Accessibility ==================== */
:focus-visible {
  outline: 2px solid var(--clr-accent, #2563eb);
  outline-offset: 2px;
}

/* ==================== Smooth Page Transitions ==================== */
.page-view { animation: pageIn 0.25s ease; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== Back to Top ==================== */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--clr-accent, #2563eb);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s, transform .3s;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { transform: scale(1.1); }

/* ════════ Photographer Page (tab-bar / form-grid / card-grid) ════════ */
.compact-hero {
  padding: 24px 36px;
  grid-template-columns: 1fr;
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent, #2563eb);
  border-bottom-color: var(--accent, #2563eb);
}

.pg-tab-content {
  animation: tabFadeIn 0.22s ease;
}

.pg-tab-content.hidden {
  display: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.pagination-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 700px) {
  .compact-hero {
    padding: 18px 16px;
  }
  .tab-bar {
    gap: 0;
  }
  .tab-btn {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}