:root {
  /* 色彩：70 深底 / 20 紫面板 / 10 霓虹点缀 */
  --bg: #0e0b1a;
  --bg-2: #15122a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-solid: #1a1730;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ECE9F5;
  --text-soft: #B8B2D8;
  --text-faint: #8B85A8;
  --text-strong: #ffffff;

  --primary: #7C6CFF;        /* 紫 · 主色 */
  --primary-soft: rgba(124, 108, 255, 0.16);
  --magenta: #FF4D9D;        /* 霓虹品红 · 情绪 / CTA */
  --cyan: #2EE6D6;           /* 青 · 平台 */
  --gold: #FFD166;           /* 金 · 题材 */
  --violet: #B07CFF;         /* 紫罗兰 · 情景 */

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 14px 44px rgba(124, 108, 255, 0.28);
  --glow-magenta: 0 0 0 1px rgba(255, 77, 157, 0.5), 0 0 22px rgba(255, 77, 157, 0.35);

  --font-display: 'ZCOOL KuaiLe', "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: 'Noto Sans SC', "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 12% -10%, rgba(124, 108, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 77, 157, 0.16), transparent 55%),
    radial-gradient(800px 700px at 50% 120%, rgba(46, 230, 214, 0.12), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 背景光斑（缓慢游动，记忆点之一） */
.bg-aurora {
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(420px 420px at 20% 30%, rgba(124, 108, 255, 0.20), transparent 70%),
    radial-gradient(360px 360px at 80% 60%, rgba(255, 77, 157, 0.16), transparent 70%),
    radial-gradient(300px 300px at 60% 20%, rgba(46, 230, 214, 0.14), transparent 70%);
  filter: blur(20px);
  will-change: transform;
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.04); }
}
/* 噪点纹理，营造纵深 */
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  /* 去掉背景模糊，滚动时避免模糊层重绘 */
  background: rgba(14, 11, 26, 0.72);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo { font-size: 32px; line-height: 1; filter: drop-shadow(0 0 10px rgba(255, 77, 157, 0.5)); }
.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.5px;
  background: linear-gradient(92deg, #fff, var(--magenta) 55%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { margin: 2px 0 0; font-size: 12.5px; color: var(--text-faint); }
.topbar-actions { display: flex; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 44px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-soft); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.btn-ghost { background: rgba(255, 255, 255, 0.04); }
.btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-link { border: none; background: none; color: var(--magenta); padding: 8px 10px; min-height: 40px; font-size: 13.5px; }
.btn-link:hover { text-decoration: underline; }
.btn-clear { border: none; background: rgba(255, 255, 255, 0.06); color: var(--text-faint); }
.btn-clear:hover { color: var(--magenta); }
.badge {
  background: var(--gold);
  color: #2a1d00;
  border-radius: 999px;
  font-size: 12px;
  padding: 0 7px;
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1080px;
  margin: 30px auto 4px;
  padding: 0 24px;
  text-align: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 50px);
  line-height: 1.15;
  margin: 6px 0 10px;
  background: linear-gradient(100deg, #fff 10%, var(--magenta) 45%, var(--violet) 75%, var(--cyan));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
  filter: drop-shadow(0 4px 26px rgba(255, 77, 157, 0.25));
}
@keyframes shimmer { to { background-position: 220% center; } }
.hero-sub { margin: 0 auto 22px; font-size: 15px; color: var(--text-soft); max-width: 640px; }

/* ---------- Search bar ---------- */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 6px 8px 6px 16px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-bar:focus-within { border-color: var(--magenta); box-shadow: var(--glow-magenta); }
.search-ico { font-size: 18px; opacity: .7; }
#searchInput {
  flex: 1;
  min-height: 44px;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 4px;
  font-size: 15px;
  color: var(--text);
  font-family: var(--font-body);
}
#searchInput::placeholder { color: var(--text-faint); }

.search-suggest {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 14px;
  z-index: 40;
  text-align: left;
}
.suggest-group + .suggest-group { margin-top: 12px; }
.suggest-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-faint); margin-bottom: 8px;
}
.suggest-head .link { border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: 12px; }
.suggest-head .link:hover { color: var(--magenta); text-decoration: underline; }
.suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest-chip {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.suggest-chip:hover { border-color: var(--magenta); color: var(--magenta); }
.suggest-chip.hot:hover { border-color: var(--cyan); color: var(--cyan); }

/* 已选药丸 */
.filter-pills {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  justify-content: center; margin: 16px auto 0; max-width: 760px;
}
.pills-label { font-size: 13px; color: var(--text-faint); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--magenta);
  background: rgba(255, 77, 157, 0.14);
  color: #ffd3e7;
  border-radius: 999px;
  padding: 5px 8px 5px 13px;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.pill:hover { background: var(--magenta); color: #fff; }
.pill-x { font-size: 15px; line-height: 1; opacity: .85; }
.pill:hover .pill-x { opacity: 1; }

/* 快捷情绪条 */
.quick-row {
  display: flex; align-items: baseline; gap: 12px;
  margin: 20px auto 0; max-width: 860px; flex-wrap: wrap; justify-content: center;
}
.quick-label { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.match-hint {
  text-align: center; font-size: 12.5px; color: var(--text-faint);
  margin: 16px auto 0; max-width: 760px; padding: 0 24px;
}
.match-hint strong { color: var(--cyan); }

/* ---------- 筛选区 ---------- */
.filter-zone {
  max-width: 1080px;
  margin: 14px auto 0;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.filter-group {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.filter-group-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.fg-title { font-size: 15px; font-weight: 700; color: var(--text); }
.fg-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 10px var(--primary);
}
.fg-sub { font-size: 12px; color: var(--text-faint); }
.fg-note { display: block; width: 100%; font-size: 11px; color: var(--text-faint); opacity: .85; margin-top: 6px; line-height: 1.5; }
.filter-actions { display: flex; justify-content: flex-end; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip:active { transform: scale(0.95); }
.chip:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.chip.active { font-weight: 700; }
.chip-mood { border-style: dashed; border-color: rgba(255, 77, 157, 0.55); color: #ff9ecb; }
.chip-mood::before { content: "🎭"; margin-right: 4px; font-size: .82em; }

/* 各维度霓虹配色 */
.mood-chips .chip.active { background: rgba(255, 77, 157, 0.18); border-color: var(--magenta); color: #ffd3e7; box-shadow: 0 0 16px rgba(255, 77, 157, 0.3); }
.scene-chips .chip.active { background: rgba(176, 124, 255, 0.18); border-color: var(--violet); color: #e6d6ff; box-shadow: 0 0 16px rgba(176, 124, 255, 0.3); }
.category-chips .chip.active { background: rgba(255, 209, 102, 0.16); border-color: var(--gold); color: #ffe9b0; box-shadow: 0 0 16px rgba(255, 209, 102, 0.28); }
.platform-chips .chip.active { background: rgba(46, 230, 214, 0.16); border-color: var(--cyan); color: #c6fff8; box-shadow: 0 0 16px rgba(46, 230, 214, 0.3); }

mark { background: rgba(255, 209, 102, 0.32); color: var(--text-strong); padding: 0 2px; border-radius: 3px; }

/* ---------- Result bar ---------- */
.result-bar {
  max-width: 1080px; margin: 26px auto 0; padding: 0 24px;
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 13px; color: var(--text-faint);
}
.result-bar[hidden] { display: none; }
.result-tip { opacity: .85; }
.result-right { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 12.5px; color: var(--text-faint); }
.sort-select {
  min-height: 36px; padding: 4px 10px; font-size: 13px; font-family: var(--font-body);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; cursor: pointer; outline: none;
}
.sort-select:focus { border-color: var(--magenta); }
html[data-theme="light"] .sort-select { background: #fff; color: var(--text); border-color: rgba(26, 22, 48, 0.2); }

/* ---------- Cards ---------- */
.card-grid {
  max-width: 1080px; margin: 16px auto 40px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px;
}
.card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; color: var(--text-strong); }
.card-meta { margin-top: 4px; font-size: 12.5px; color: var(--text-soft); }
.card-meta .platform {
  display: inline-block;
  background: rgba(46, 230, 214, 0.14);
  border: 1px solid rgba(46, 230, 214, 0.4);
  border-radius: 6px; padding: 1px 7px; margin-right: 6px;
  font-size: 11.5px; color: var(--cyan);
}
.star-btn {
  border: none; background: none; font-size: 22px; cursor: pointer; line-height: 1;
  color: var(--text-faint); transition: transform .12s ease;
  min-width: 40px; min-height: 40px;
}
.star-btn:hover { transform: scale(1.15); }
.star-btn.faved { color: var(--gold); }

.original {
  margin: 14px 0 12px; padding: 12px 14px;
  background: linear-gradient(180deg, rgba(124, 108, 255, 0.14), rgba(124, 108, 255, 0.04));
  border-left: 4px solid var(--primary);
  border-radius: 8px; font-size: 15px; color: var(--text-strong);
  position: relative; transition: box-shadow .16s ease;
}
.card:hover .original { box-shadow: 0 0 20px rgba(124, 108, 255, 0.3); }
.original .quote-mark { font-family: Georgia, serif; opacity: 0.4; }

.interpretation { font-size: 13.5px; color: var(--text-soft); margin: 0 0 12px; }

.comments { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.comments li {
  font-size: 12.5px; color: var(--text-faint);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px; padding: 6px 10px;
}
.comments li::before { content: "💬 "; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: rgba(46, 230, 214, 0.12); color: var(--cyan);
}
.tag.mood { background: rgba(255, 77, 157, 0.12); color: #ffb3d6; }
.tag.scene { background: rgba(176, 124, 255, 0.14); color: var(--violet); }

.scene-tags { margin-bottom: 8px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.copy-btn {
  flex: 1; min-height: 44px;
  border: none;
  background: linear-gradient(92deg, var(--magenta), #ff7ab8);
  color: #fff; border-radius: 10px; padding: 8px;
  font-size: 13.5px; font-family: var(--font-body); cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease;
  box-shadow: 0 6px 18px rgba(255, 77, 157, 0.28);
}
.copy-btn:hover { box-shadow: 0 8px 26px rgba(255, 77, 157, 0.5); }
.copy-btn:active { transform: scale(0.97); }

/* ---------- States ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-faint); }
.empty-emoji { font-size: 46px; margin: 0; }
.empty-title { font-size: 17px; color: var(--text-soft); margin: 8px 0 14px; font-weight: 600; }
.empty-state .hint { margin: 10px 0 16px; font-size: 13px; }

.footer {
  max-width: 1080px; margin: 0 auto; padding: 28px 24px;
  font-size: 12px; color: var(--text-faint);
  border-top: 1px solid var(--border);
}
.footer code { background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 5px; }
.disclaimer { color: var(--gold); }

/* ---------- 详情弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(8, 6, 18, 0.72); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative; max-width: 720px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--surface-solid), var(--bg-2));
  border: 1px solid var(--border-strong);
  border-radius: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  padding: 26px 26px 22px;
  animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft); font-size: 16px; cursor: pointer;
  transition: .15s;
}
.modal-close:hover { color: var(--magenta); border-color: var(--magenta); }
.modal-close:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.detail-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-breadcrumb .tag { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: rgba(46, 230, 214, 0.12); color: var(--cyan); }
.detail-title { font-family: var(--font-display); font-size: clamp(22px, 5vw, 28px); margin: 2px 0 4px; color: var(--text-strong); }
.detail-meta { font-size: 13px; color: var(--text-soft); margin-bottom: 14px; }
.detail-original {
  font-size: 19px; color: var(--text-strong); line-height: 1.6;
  background: linear-gradient(180deg, rgba(124, 108, 255, 0.18), rgba(124, 108, 255, 0.04));
  border-left: 5px solid var(--primary);
  border-radius: 10px; padding: 16px 18px; margin: 0 0 16px;
  position: relative; box-shadow: 0 0 26px rgba(124, 108, 255, 0.22);
}
.detail-original .quote-mark { font-family: Georgia, serif; opacity: .4; }
.detail-section-title {
  font-size: 14px; font-weight: 700; color: var(--magenta);
  margin: 18px 0 8px; display: flex; align-items: center; gap: 8px;
}
.detail-section-title::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--magenta); box-shadow: 0 0 8px var(--magenta);
}
.detail-interpretation { font-size: 14.5px; color: var(--text-soft); line-height: 1.7; }
.detail-comments { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.detail-comments li { font-size: 13px; color: var(--text-faint); background: rgba(255, 255, 255, 0.04); border-radius: 9px; padding: 8px 12px; }
.detail-comments li::before { content: "💬 "; }
.detail-usage {
  font-size: 13.5px; color: var(--text-soft); line-height: 1.7;
  background: rgba(255, 209, 102, 0.08); border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 10px; padding: 12px 14px;
}
.detail-usage b { color: var(--gold); }
.rel-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-chip {
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft); border-radius: 999px; padding: 7px 14px; font-size: 12.5px;
  cursor: pointer; transition: .15s; text-align: left;
}
.rel-chip:hover { border-color: var(--violet); color: var(--violet); }
.rel-chip small { display: block; color: var(--text-faint); font-size: 11px; }
.detail-actions { display: flex; gap: 10px; margin-top: 20px; }
.detail-actions .copy-btn { flex: 1; }
.detail-btn {
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.05);
  color: var(--text); border-radius: 10px; padding: 8px 14px; font-size: 13.5px;
  cursor: pointer; min-height: 44px; transition: .15s; white-space: nowrap;
}
.detail-btn:hover { border-color: var(--primary); color: #fff; }
.detail-btn:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.card { cursor: pointer; }
.card:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--surface-solid); color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 11px 20px; border-radius: 12px; font-size: 14px;
  z-index: 80; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 搜索实时补全 ---------- */
.match-type { font-size: 11px; color: var(--text-faint); margin-left: 4px; }

/* ---------- 收藏管理 / 投稿 弹层 ---------- */
.fav-title { font-family: var(--font-display); font-size: clamp(20px, 4vw, 26px); margin: 0 0 14px; color: var(--text-strong); }
.fav-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fav-group-chip {
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s;
}
.fav-group-chip:hover { border-color: var(--primary); color: var(--text); }
.fav-group-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.fav-newgroup { display: flex; gap: 8px; margin-bottom: 14px; }
.fav-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.fav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.fav-item-main { min-width: 0; }
.fav-item-title { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.fav-item-meta { font-size: 12px; color: var(--text-faint); }
.fav-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fav-move { min-height: 36px; padding: 4px 8px; font-size: 12.5px; }
.fav-open { border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.05); color: var(--text-soft); border-radius: 8px; min-width: 36px; min-height: 36px; cursor: pointer; font-size: 14px; }
.fav-open:hover { border-color: var(--primary); color: var(--text); }
.fav-empty { color: var(--text-faint); font-size: 13px; padding: 14px 4px; }
.fav-foot { display: flex; gap: 10px; justify-content: space-between; margin-top: 16px; align-items: center; }

.submit-tip { font-size: 12.5px; color: var(--text-faint); margin: 0 0 14px; }
.submit-form { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 13px; color: var(--text-soft); }
.form-row label small { color: var(--text-faint); font-size: 11px; margin-left: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: rgba(255, 255, 255, 0.05); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: var(--font-body); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--magenta); box-shadow: var(--glow-magenta); }
.form-textarea { min-height: 72px; resize: vertical; line-height: 1.6; }
.submit-foot { display: flex; gap: 10px; margin-top: 16px; }
.btn-primary { background: linear-gradient(92deg, var(--magenta), #ff7ab8); color: #fff; border-color: transparent; }
.btn-primary:hover { box-shadow: 0 8px 26px rgba(255, 77, 157, 0.5); }

/* 浅色下表单/弹层新元素对比度 */
html[data-theme="light"] .form-input,
html[data-theme="light"] .form-select,
html[data-theme="light"] .form-textarea { background: #fff; color: var(--text); border-color: rgba(26, 22, 48, 0.2); }
html[data-theme="light"] .fav-group-chip { background: #fff; border-color: rgba(26, 22, 48, 0.18); color: var(--text-soft); }
html[data-theme="light"] .fav-group-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
html[data-theme="light"] .fav-open,
html[data-theme="light"] .fav-move { background: #fff; border-color: rgba(26, 22, 48, 0.18); color: var(--text); }
html[data-theme="light"] .fav-item { background: #fff; border-color: rgba(26, 22, 48, 0.14); }
html[data-theme="light"] .submit-tip,
html[data-theme="light"] .match-type { color: var(--text-soft); }

/* ---------- Hero 统计行 ---------- */
.hero-stats {
  margin: 10px auto 0; font-size: 13px; color: var(--text-faint);
  max-width: 640px; padding: 7px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  display: inline-block;
}
html[data-theme="light"] .hero-stats { background: #fff; border-color: rgba(26, 22, 48, 0.14); color: var(--text-soft); }

/* ---------- 移动端筛选折叠 ---------- */
.filter-toggle-btn {
  display: none;
  align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 44px; margin: 10px auto 0; max-width: 1080px;
  background: var(--primary-soft); color: var(--text); border: 1px solid var(--primary);
  border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font-body); cursor: pointer;
}

/* ---------- 首页编排 ---------- */
.home-view { max-width: 1080px; margin: 22px auto 0; padding: 0 24px; }
.home-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.home-tab {
  min-height: 42px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
  font-size: 14px; font-family: var(--font-body); transition: .15s;
}
.home-tab:hover { border-color: var(--text); color: var(--text); }
.home-tab.active {
  background: linear-gradient(92deg, var(--magenta), #ff7ab8); color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px rgba(255, 77, 157, 0.3);
}
.home-hint { text-align: center; font-size: 12.5px; color: var(--text-faint); margin: 12px 0 4px; }
.home-grid { margin-top: 14px; }
.home-foot { text-align: center; margin: 18px 0 8px; }

/* 按书分组标题 */
.book-header {
  grid-column: 1 / -1;
  font-family: var(--font-display); font-size: 17px; color: var(--text-strong);
  margin: 14px 0 4px; padding: 8px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--violet);
}

/* ---------- 加载更多 ---------- */
.load-more {
  text-align: center; color: var(--text-faint); font-size: 13.5px;
  padding: 18px; cursor: pointer; user-select: none;
}
.load-more:hover { color: var(--magenta); }
.load-more[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .bg-aurora, .hero-title, .modal-panel { animation: none; }
}

/* ---------- 浅色主题（右上角按钮切换） ---------- */
html[data-theme="light"] {
  --bg: #f3f0fb;
  --bg-2: #ffffff;
  --surface: rgba(26, 22, 48, 0.04);
  --surface-solid: #ffffff;
  --border: rgba(26, 22, 48, 0.12);
  --border-strong: rgba(26, 22, 48, 0.22);
  --text: #1c1830;
  --text-soft: #4a4466;
  --text-faint: #5a5478;
  --text-strong: #1c1830;
  --shadow: 0 8px 30px rgba(80, 60, 160, 0.12);
  --shadow-hover: 0 14px 40px rgba(124, 108, 255, 0.22);
}
/* 浅色下渐变标题不能从纯白起，否则在浅底上消失 */
html[data-theme="light"] .brand-title,
html[data-theme="light"] .hero-title {
  background: linear-gradient(92deg, #5b4bd6, var(--magenta) 55%, var(--violet));
  -webkit-background-clip: text; background-clip: text;
}
/* 浅色下：卡片/筛选组/搜索栏用白色实底 + 明显边框阴影，从浅紫背景上"浮"起来 */
html[data-theme="light"] .card {
  background: #ffffff;
  border-color: rgba(26, 22, 48, 0.16);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.10);
}
html[data-theme="light"] .card:hover {
  box-shadow: 0 12px 32px rgba(124, 108, 255, 0.22);
  border-color: var(--primary);
}
html[data-theme="light"] .filter-group {
  background: #ffffff;
  border-color: rgba(26, 22, 48, 0.14);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
}
html[data-theme="light"] .search-bar {
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(80, 60, 160, 0.12);
}
html[data-theme="light"] .search-suggest {
  background: #ffffff;
  border-color: rgba(26, 22, 48, 0.16);
}
html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(26, 22, 48, 0.12);
}
html[data-theme="light"] .chip,
html[data-theme="light"] .btn,
html[data-theme="light"] .rel-chip,
html[data-theme="light"] .suggest-chip,
html[data-theme="light"] .comments li,
html[data-theme="light"] .detail-comments li,
html[data-theme="light"] .modal-close,
html[data-theme="light"] .detail-btn {
  background: #ffffff;
  border-color: rgba(26, 22, 48, 0.18);
  color: var(--text-soft);
}
/* 浅色下 active 标签 / 标签 / 药丸 / 高亮 换成深色系，保证对比度 */
html[data-theme="light"] .mood-chips .chip.active { color: #c2185b; background: rgba(255, 77, 157, 0.16); border-color: var(--magenta); }
html[data-theme="light"] .scene-chips .chip.active { color: #6a3fc0; background: rgba(176, 124, 255, 0.18); border-color: var(--violet); }
html[data-theme="light"] .category-chips .chip.active { color: #9a6b00; background: rgba(255, 209, 102, 0.22); border-color: var(--gold); }
html[data-theme="light"] .platform-chips .chip.active { color: #0a8c80; background: rgba(46, 230, 214, 0.18); border-color: var(--cyan); }
html[data-theme="light"] .chip-mood { border-color: rgba(214, 51, 132, 0.6); color: #c2185b; }
html[data-theme="light"] .tag { color: #0a8c80; background: rgba(46, 230, 214, 0.16); }
html[data-theme="light"] .tag.mood { color: #c2185b; background: rgba(255, 77, 157, 0.14); }
html[data-theme="light"] .tag.scene { color: #6a3fc0; background: rgba(176, 124, 255, 0.16); }
html[data-theme="light"] .card-meta .platform { color: #0a8c80; background: rgba(46, 230, 214, 0.16); border-color: rgba(46, 230, 214, 0.5); }
html[data-theme="light"] .pill { background: rgba(255, 77, 157, 0.16); color: #c2185b; border-color: var(--magenta); }
html[data-theme="light"] .pill:hover { background: var(--magenta); color: #fff; }
html[data-theme="light"] mark { color: #1c1830; background: rgba(255, 209, 102, 0.5); }
html[data-theme="light"] .detail-section-title { color: #c2185b; }
html[data-theme="light"] .detail-section-title::before { background: #c2185b; box-shadow: none; }
html[data-theme="light"] .detail-usage b { color: #9a6b00; }
html[data-theme="light"] .original { background: linear-gradient(180deg, rgba(124, 108, 255, 0.10), rgba(124, 108, 255, 0.03)); }
html[data-theme="light"] .detail-original { background: linear-gradient(180deg, rgba(124, 108, 255, 0.12), rgba(124, 108, 255, 0.03)); }
html[data-theme="light"] .detail-title,
html[data-theme="light"] .card-title,
html[data-theme="light"] .original,
html[data-theme="light"] .detail-original { color: #1c1830; }
html[data-theme="light"] .bg-aurora,
html[data-theme="light"] .bg-noise { opacity: 0.5; }

/* 浅色下小元素对比度补强 */
html[data-theme="light"] .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
html[data-theme="light"] .btn-link,
html[data-theme="light"] .btn-link:hover { color: #c2185b; }
html[data-theme="light"] .match-hint strong { color: #0a8c80; }
html[data-theme="light"] .star-btn.faved { color: #c98a00; }
html[data-theme="light"] .disclaimer { color: #9a6b00; }
html[data-theme="light"] .footer code { background: rgba(26, 22, 48, 0.07); color: var(--text-soft); }

/* 主题切换按钮 */
.theme-toggle { min-width: 92px; }

/* ---------- 移动优先 ---------- */
@media (max-width: 768px) {
  .filter-toggle-btn { display: flex; }
  .filter-area.collapsed { display: none; }
  .filter-zone { gap: 0; }
}
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .result-tip { display: none; }
  .hero { margin-top: 18px; }
  .search-bar { border-radius: 16px; }
}
