/* ---------- 主题令牌 ---------- */

:root,
[data-theme="dark"] {
  --bg: #0b0d10;
  --panel: #13171d;
  --panel-2: #1a2029;
  --line: #262e39;
  --line-soft: #1e252e;
  --text: #e9e6e0;
  --muted: #8b94a1;
  --muted-2: #5f6874;
  --blue: #6fb6cc;
  --violet: #a78bd8;
  --red: #e2604e;

  --gold: #f2c14e;
  --gold-soft: rgba(242, 193, 78, 0.12);
  --gold-line: rgba(242, 193, 78, 0.3);
  --gold-fade: rgba(242, 193, 78, 0.5);
  --btn-bg: rgba(242, 193, 78, 0.07);
  --btn-bg-hover: rgba(242, 193, 78, 0.16);
  --btn-line: rgba(242, 193, 78, 0.35);
  --btn-line-hover: rgba(242, 193, 78, 0.65);
  --open-line: rgba(242, 193, 78, 0.42);
  --focus-line: rgba(242, 193, 78, 0.6);
  --focus-ring: rgba(242, 193, 78, 0.1);
  --glow: rgba(242, 193, 78, 0.07);
  --glow-2: rgba(111, 182, 204, 0.05);

  --grid-line: rgba(255, 255, 255, 0.022);
  --header-bg: rgba(11, 13, 16, 0.82);
  --board-from: rgba(26, 32, 41, 0.72);
  --board-to: rgba(19, 23, 29, 0.55);
  --overlay-1: rgba(255, 255, 255, 0.035);
  --overlay-2: rgba(255, 255, 255, 0.045);
  --overlay-3: rgba(255, 255, 255, 0.06);
  --soft-bg: rgba(255, 255, 255, 0.018);
  --hover-border: #333c49;
  --story-hover-bg: #151a21;
  --on-accent: #10130f;
  --comment-text: #c8ccd2;
  --gate-bg: rgba(8, 10, 13, 0.93);
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);

  --radius: 10px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f1ec;
  --panel: #ffffff;
  --panel-2: #f6f4ef;
  --line: #dcd7cd;
  --line-soft: #e8e3da;
  --text: #1c1e21;
  --muted: #5c636e;
  --muted-2: #8a9099;
  --blue: #2b7c92;
  --violet: #6a55a6;
  --red: #c2452f;

  --gold: #a9761a;
  --gold-soft: rgba(169, 118, 26, 0.1);
  --gold-line: rgba(169, 118, 26, 0.28);
  --gold-fade: rgba(169, 118, 26, 0.4);
  --btn-bg: rgba(169, 118, 26, 0.07);
  --btn-bg-hover: rgba(169, 118, 26, 0.13);
  --btn-line: rgba(169, 118, 26, 0.32);
  --btn-line-hover: rgba(169, 118, 26, 0.6);
  --open-line: rgba(169, 118, 26, 0.45);
  --focus-line: rgba(169, 118, 26, 0.55);
  --focus-ring: rgba(169, 118, 26, 0.12);
  --glow: rgba(169, 118, 26, 0.06);
  --glow-2: rgba(43, 124, 146, 0.05);

  --grid-line: rgba(0, 0, 0, 0.028);
  --header-bg: rgba(243, 241, 236, 0.88);
  --board-from: rgba(255, 255, 255, 0.92);
  --board-to: rgba(250, 248, 244, 0.9);
  --overlay-1: rgba(0, 0, 0, 0.035);
  --overlay-2: rgba(0, 0, 0, 0.05);
  --overlay-3: rgba(0, 0, 0, 0.07);
  --soft-bg: rgba(0, 0, 0, 0.02);
  --hover-border: #cdc7bb;
  --story-hover-bg: #fbfaf7;
  --on-accent: #fffaf0;
  --comment-text: #3a3f46;
  --gate-bg: rgba(38, 36, 32, 0.55);
  --shadow: 0 16px 36px -26px rgba(70, 55, 25, 0.5);

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(900px 500px at 82% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 420px at 5% 0%, var(--glow-2), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s, color 0.25s;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 70%);
}

.wrap {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 顶栏 ---------- */

.top {
  border-bottom: 1px solid var(--line-soft);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0 14px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }

.mark {
  width: 34px; height: 34px;
  display: block;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: 0.92;
  flex: none;
}

.brand h1,
.brand-name {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-name span {
  font-size: inherit;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: inherit;
}

.brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.top-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  flex: none;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--btn-line-hover); }
.theme-toggle svg { display: block; }
.theme-toggle .ico-moon { display: none; }
[data-theme="light"] .theme-toggle .ico-sun { display: none; }
[data-theme="light"] .theme-toggle .ico-moon { display: block; }

.stats { display: flex; gap: 26px; }
.stat { text-align: right; }
.stat b {
  display: block;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }

/* ---------- 总榜 ---------- */

.board {
  margin-top: 26px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--board-from), var(--board-to));
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.board-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}

.board-title::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--gold);
  margin-right: 9px;
  vertical-align: 2px;
  transform: rotate(45deg);
}

.board-sub { font-size: 12px; color: var(--muted-2); }

.board-list { display: grid; gap: 9px; }

.board-row {
  display: grid;
  grid-template-columns: 118px 1fr 56px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  transition: background 0.15s;
}
.board-row:hover { background: var(--overlay-1); }

.board-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-track {
  height: 12px;
  background: var(--overlay-2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.board-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-fade), var(--gold));
  border-radius: 2px;
  transform-origin: left center;
  animation: grow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.board-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gold);
  font-size: 14px;
}
.board-score small { color: var(--muted-2); font-weight: 400; font-size: 11px; }

.board-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0 4px;
}
.board-empty b { color: var(--gold); font-weight: 600; }

/* ---------- 工具条 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0 14px;
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s;
  letter-spacing: 0.02em;
}
.tab:hover { color: var(--text); border-color: var(--hover-border); }
.tab[aria-selected="true"] {
  color: var(--on-accent);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 600;
}
.tab em {
  font-style: normal;
  opacity: 0.55;
  margin-left: 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 自定义下拉：原生 select 的弹层高度改不了，列表太长会一拉到底 */
.dd { position: relative; }

.dd-btn {
  height: 36px;
  min-width: 118px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px 0 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.dd-btn:hover { border-color: var(--hover-border); }
.dd[data-open="true"] .dd-btn {
  border-color: var(--focus-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.dd-label { overflow: hidden; text-overflow: ellipsis; max-width: 168px; }
.dd-caret { color: var(--muted-2); flex: none; margin-left: auto; transition: transform 0.15s; }
.dd[data-open="true"] .dd-caret { transform: rotate(180deg); }

.dd-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 252px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 2px;
  animation: slide 0.12s ease-out;
}
.dd-menu[hidden] { display: none; }
.filters .dd:last-of-type .dd-menu { left: auto; right: 0; }
.dd-menu::-webkit-scrollbar { width: 6px; }
.dd-menu::-webkit-scrollbar-thumb { background: var(--overlay-3); border-radius: 3px; }
.dd-menu::-webkit-scrollbar-track { background: transparent; }

.dd-opt {
  appearance: none;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.dd-opt:hover { background: var(--overlay-1); }
.dd-opt[aria-selected="true"] { color: var(--gold); background: var(--gold-soft); font-weight: 600; }

.search input,
.filters select {
  height: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input { width: 230px; }
.search input:focus,
.filters select:focus { border-color: var(--focus-line); box-shadow: 0 0 0 3px var(--focus-ring); }

.filters select {
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
  cursor: pointer;
}

/* ---------- 列表 ---------- */

.list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted-2);
  padding: 0 4px 8px;
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}

.list-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.chip {
  appearance: none;
  font: inherit;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--hover-border); }
.chip.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); font-weight: 600; }
.chip:disabled { opacity: 0.45; cursor: default; }
.chip:disabled:hover { color: var(--muted); border-color: var(--line); }

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  animation: slide 0.14s ease-out;
}
.batch-bar[hidden] { display: none; }
.batch-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-count { font-size: 12.5px; color: var(--muted); }
.batch-count b { color: var(--gold); font-size: 14px; }
.batch-hint { font-size: 11.5px; color: var(--muted-2); }
.batch-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.batch-save {
  appearance: none;
  border: 0;
  background: var(--gold);
  color: var(--on-accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s;
}
.batch-save:hover { filter: brightness(1.06); }

.check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: block;
  position: relative;
  justify-self: start;
  transition: background 0.15s, border-color 0.15s;
}
.story.in-batch { cursor: pointer; }
.story.in-batch .rate-btn { display: none; }
.story.unchecked { opacity: 0.5; }
.story.unchecked .check { border-color: var(--hover-border); }
.check.on { background: var(--gold); border-color: var(--gold); }
.check.on::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--on-accent);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.story {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  border-radius: var(--radius);
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
}
.story:hover { border-color: var(--hover-border); background: var(--story-hover-bg); }
.story.open { border-color: var(--open-line); background: var(--story-hover-bg); }
.story.mine { box-shadow: inset 3px 0 0 var(--gold); }

.story-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 200px auto;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}

.rank {
  font-size: 12px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.rank.top { color: var(--gold); font-weight: 600; }

.info { min-width: 0; }

.title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.title-line h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 3px;
  border: 1px solid transparent;
  letter-spacing: 0.08em;
  flex: none;
  line-height: 1.6;
}
.badge.main { color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.badge.side { color: var(--blue); background: rgba(111, 182, 204, 0.12); border-color: rgba(111, 182, 204, 0.3); }
.badge.story { color: var(--violet); background: rgba(167, 139, 216, 0.12); border-color: rgba(167, 139, 216, 0.3); }
.badge.collab { color: #b4763a; background: rgba(224, 160, 107, 0.14); border-color: rgba(224, 160, 107, 0.35); }

.meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted-2);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.meta .my { color: var(--gold); }

.score-box { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }

.avg {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  min-width: 46px;
  text-align: right;
  color: var(--muted-2);
}
.avg.has { color: var(--text); }
.avg small { font-size: 11px; color: var(--muted-2); font-weight: 400; margin-left: 2px; }

.rail {
  width: 84px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
}
.rail i {
  height: 12px;
  background: var(--overlay-3);
  border-radius: 1px;
  display: block;
}
.rail i.on { background: var(--gold); opacity: 0.85; }

.count {
  font-size: 11.5px;
  color: var(--muted-2);
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rate-btn {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  border-radius: 7px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--gold);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.rate-btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-line-hover); }
.rate-btn.filled { background: var(--btn-bg-hover); }
.rate-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- 展开面板 ---------- */

.panel {
  border-top: 1px solid var(--line-soft);
  padding: 16px 16px 18px;
  display: grid;
  gap: 16px;
  animation: slide 0.18s ease-out;
}
@keyframes slide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.panel-name { font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }

.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--panel-2);
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--gold-soft); color: var(--gold); font-weight: 600; }

.seg-sm { border-radius: 6px; }
.seg-sm .seg-btn { font-size: 11.5px; padding: 3px 10px; }

.watched-tip { font-size: 11px; color: var(--muted-2); }

.ghost-btn {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ghost-btn:hover { color: var(--gold); border-color: var(--btn-line-hover); }

.hist-wrap {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 12px 14px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--soft-bg);
  width: fit-content;
  animation: slide 0.16s ease-out;
}
.hist { display: flex; align-items: flex-end; gap: 6px; height: 74px; }
.hist-col { width: 20px; height: 100%; display: grid; grid-template-rows: 1fr auto; }
.hist-bar {
  align-self: end;
  width: 100%;
  background: linear-gradient(180deg, var(--gold), var(--gold-fade));
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.hist-col:hover .hist-bar { opacity: 1; }
.hist-lab { font-size: 9.5px; color: var(--muted-2); text-align: center; margin-top: 4px; }
.hist-note { font-size: 11px; color: var(--muted-2); }

.picker-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 9px;
}
.picker-label { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.picker-value { font-size: 12.5px; color: var(--gold); min-height: 18px; }

.picker { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }

.pick {
  appearance: none;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  height: 42px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: all 0.12s;
}
.pick:hover { border-color: var(--hover-border); color: var(--text); }
.pick.sel {
  color: #12140f;
  font-weight: 700;
  border-color: transparent;
}
.pick:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.vote-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.vote-row textarea {
  flex: 1 1 320px;
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.vote-row textarea:focus { border-color: var(--focus-line); }
.vote-row textarea::placeholder { color: var(--muted-2); }

.submit {
  appearance: none;
  font-family: inherit;
  border: none;
  background: var(--gold);
  color: var(--on-accent);
  font-weight: 650;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 7px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: filter 0.15s, transform 0.1s;
}
.submit:hover { filter: brightness(1.06); }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: 0.45; cursor: not-allowed; }

.comments { border-top: 1px dashed var(--line-soft); padding-top: 12px; }
.comments-head {
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.comment { display: flex; gap: 10px; font-size: 12.5px; padding: 4px 0; align-items: baseline; }
.comment .s {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  flex: none;
  width: 26px;
}
.comment .a { color: var(--muted-2); flex: none; font-size: 11.5px; }
.comment .c { color: var(--comment-text); }
.no-comment { font-size: 12.5px; color: var(--muted-2); }

/* ---------- 空态 / 页脚 / toast ---------- */

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}
.empty b { color: var(--gold); }

.foot {
  margin: 30px 0 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 12px);
  background: var(--gold);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); color: #fff; }

/* ---------- 登录门 ---------- */

.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.user[hidden] { display: none; }
.user span { color: var(--gold); font-weight: 600; }
.user button {
  appearance: none;
  font-family: inherit;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.user button:hover { color: var(--text); border-color: var(--hover-border); }

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gate-bg);
  backdrop-filter: blur(8px);
}
.gate[hidden] { display: none; }

.gate-card {
  width: min(380px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 26px 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  text-align: center;
  position: relative;
}

.gate-close {
  position: absolute;
  top: 10px;
  right: 12px;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.gate-close:hover { color: var(--text); background: var(--overlay-3); }
.gate-card .mark { margin: 0 auto 2px; width: 34px; height: 34px; }
.gate-card h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: 0.04em; }
.gate-sub { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; text-align: left; }

.field { display: grid; gap: 6px; text-align: left; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.field input {
  height: 42px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { border-color: var(--focus-line); box-shadow: 0 0 0 3px var(--focus-ring); }
.gate-card .submit { width: 100%; padding: 12px; }
.gate-err { margin: 0; min-height: 16px; font-size: 12.5px; color: var(--red); }

/* ---------- 响应式 ---------- */

@media (max-width: 820px) {
  .story-row { grid-template-columns: 30px 1fr auto; grid-template-areas: "rank info btn" ". score score"; row-gap: 10px; }
  .rank { grid-area: rank; }
  .check { grid-area: rank; }
  .info { grid-area: info; }
  .score-box { grid-area: score; justify-content: flex-start; }
  .rate-btn { grid-area: btn; }
  .board-row { grid-template-columns: 92px 1fr 50px; }
  .brand h1 { font-size: 17px; }
  .stats { gap: 18px; }
  .search input { width: 100%; }
  .filters { width: 100%; }
  .search { flex: 1 1 100%; }
  .filters .dd { flex: 1 1 auto; }
  .dd-btn { width: 100%; min-width: 0; }
  .dd-label { max-width: none; }
}

/* 手机端：顶栏压到一行 */
@media (max-width: 640px) {
  .top-inner { padding: 8px 0; gap: 8px; }
  .brand { gap: 9px; }
  .mark { width: 24px; height: 24px; }
  .brand h1,
  .brand-name { font-size: 14px; letter-spacing: 0.03em; gap: 5px; }
  .brand-name span { font-size: inherit; }
  .brand p { display: none; }

  .stats { display: none; }

  .top-actions { gap: 6px; }
  .theme-toggle { width: 30px; height: 30px; border-radius: 7px; }
  .user { gap: 6px; font-size: 12px; }
  .user button { padding: 4px 9px; font-size: 11px; }

  .board { margin-top: 14px; padding: 14px 14px 16px; }
  .toolbar { margin: 14px 0 10px; }
  .list-head { padding-bottom: 6px; }
}
