/* ==========================================================================
   排练曲目登记 —— 奶油纸张 / 墨色活字 / 朱红印章
   ========================================================================== */

:root {
  --paper: #f2ecdf;
  --paper-hi: #fbf7ee;
  --paper-lo: #e7ddc9;
  --ink: #17130e;
  --ink-2: #40382d;
  --ink-3: #776b5a;
  --red: #bf3f26;
  --green: #2c5b4a;
  --gold: #a2741c;
  --line: rgba(23, 19, 14, 0.22);
  --line-soft: rgba(23, 19, 14, 0.1);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  --shadow: 4px 4px 0 rgba(23, 19, 14, 0.85);
  --maxw: 1240px;
  --pad: clamp(16px, 4vw, 40px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(1200px 620px at 82% -12%, #f9f4e8 0%, rgba(249, 244, 232, 0) 62%),
    radial-gradient(900px 500px at 5% 105%, #ece2ce 0%, rgba(236, 226, 206, 0) 55%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: var(--red); color: var(--paper-hi); }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -100px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* 纸张颗粒 ---------------------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.34'/></svg>");
}

/* 按钮 ------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.btn:hover { background: rgba(23, 19, 14, 0.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.btn-solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--red);
}
.btn-solid:hover {
  background: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--red);
}
.btn-solid:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--red); }

.btn-ghost { background: transparent; }
.btn-lg { padding: 12px 20px; font-size: 14.5px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}
.icon-btn:hover { background: var(--ink); color: var(--paper); transform: rotate(90deg); }

.btn-danger {
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: var(--red); color: var(--paper-hi); }

/* 页头 ------------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 236, 223, 0.93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink);
}

.head-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  flex: none;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--gold);
}

.brand-en { font-size: 9.5px; letter-spacing: 0.2em; color: var(--ink-3); line-height: 1.2; }
.brand-cn { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.25; }

.head-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: rgba(251, 247, 238, 0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.member-chip:hover { border-color: var(--ink); background: var(--paper-hi); }
.member-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-3);
  box-shadow: 0 0 0 3px rgba(23, 19, 14, 0.08);
}
.chip-hint { font-size: 9px; color: var(--ink-3); letter-spacing: 0.08em; }

/* 首屏 ------------------------------------------------------------------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 72px) var(--pad) clamp(30px, 4vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
  position: relative;
}

.eyebrow { color: var(--red); font-size: 10px; letter-spacing: 0.22em; margin-bottom: 18px; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}
.hero h1 em {
  font-style: italic;
  color: var(--red);
  background-image: linear-gradient(transparent 72%, rgba(191, 63, 38, 0.28) 72%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.lede {
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.85;
  text-wrap: pretty;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-side { display: flex; flex-direction: column; gap: 22px; align-items: stretch; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--ink);
  background: rgba(251, 247, 238, 0.5);
  box-shadow: 6px 6px 0 rgba(23, 19, 14, 0.07);
}
.stats > div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats > div:nth-child(2n) { border-right: 0; }
.stats > div:nth-last-child(-n + 2) { border-bottom: 0; }
.stats dt { font-size: 9.5px; letter-spacing: 0.16em; color: var(--ink-3); font-family: var(--mono); text-transform: uppercase; }
.stats dd {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.stats dd small { font-size: 12px; font-family: var(--sans); color: var(--ink-3); margin-left: 4px; }

.stamp {
  align-self: flex-end;
  width: 128px; height: 128px;
  border: 2px solid var(--red);
  border-radius: 50%;
  padding: 6px;
  color: var(--red);
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
  transform: rotate(-9deg);
  opacity: 0.86;
  mix-blend-mode: multiply;
  position: relative;
  flex: none;
}
.stamp::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(191, 63, 38, 0.65);
  border-radius: 50%;
}
.stamp span {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.3em;
  line-height: 1.5;
  padding-left: 0.3em;
}
.stamp strong { font-size: 8.5px; letter-spacing: 0.18em; margin-top: 2px; }

/* 工具栏 ----------------------------------------------------------------- */

.board {
  border-top: 1px solid var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 220px);
}

.toolbar {
  position: sticky;
  top: 63px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--pad);
  background: rgba(242, 236, 223, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.chip small { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] small { color: rgba(251, 247, 238, 0.6); }
.chip .chip-key { width: 7px; height: 7px; flex: none; border-radius: 50%; }

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

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span {
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.field > .field-help {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0;
  line-height: 1.55;
  color: var(--ink-3);
}
.field input,
.field select,
.field textarea {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  background: rgba(251, 247, 238, 0.85);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px 10px;
  min-height: 36px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 0;
  border-color: transparent;
  background: var(--paper-hi);
}
.field-search input { min-width: 200px; }
.field select { cursor: pointer; appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* 主布局 ----------------------------------------------------------------- */

.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 34px) var(--pad) clamp(48px, 6vw, 84px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  gap: clamp(24px, 3.5vw, 48px);
  align-items: start;
}

.list-wrap { min-width: 0; }

.list-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 122px 148px 150px 26px;
  gap: 16px;
  padding: 0 8px 8px 8px;
  border-bottom: 1.5px solid var(--ink);
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.16em;
}

/* 分组 ------------------------------------------------------------------- */

.group { margin-top: 34px; }
.group:first-child { margin-top: 26px; }

.group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 8px 12px;
}
.group-head h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.group-head .group-count {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}
.group-head .group-line { flex: 1; height: 1px; background: var(--line); }
.group-head .group-desc { font-size: 12px; color: var(--ink-3); }
.group-desc-restack {
  writing-mode: horizontal-tb;
}

/* 曲目行 ----------------------------------------------------------------- */

.song-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 122px 148px 150px 26px;
  gap: 16px;
  align-items: center;
  padding: 15px 8px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  cursor: pointer;
  transition: background 0.16s ease;
}
.song-row::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  background: transparent;
  transition: background 0.16s ease;
}
.song-row:hover { background: rgba(251, 247, 238, 0.72); }
.song-row:hover::before { background: var(--red); }
.song-row:focus-within { background: rgba(251, 247, 238, 0.85); }
.song-row.is-pending { opacity: 0.55; pointer-events: none; }

.row-rank {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-left: 4px;
}
.row-rank.top { color: var(--red); font-weight: 700; }

.row-main { min-width: 0; }
.row-title-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.row-title {
  font-family: var(--serif);
  font-size: clamp(18px, 1.9vw, 22px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.row-title:hover { color: var(--red); }

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  opacity: 0.9;
}
.status-tag[data-status="done"] { color: var(--green); }
.status-tag[data-status="rehearsing"] { color: var(--gold); }
.status-tag[data-status="wish"] { color: var(--red); }

.row-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.row-artist { color: var(--ink-2); }
.row-tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.row-tags span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--ink-3); }
.row-tags span::before { content: "#"; color: var(--red); }

.row-by {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-by b { font-weight: 600; }

.row-meta { display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }
.row-meta span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.row-meta b { color: var(--ink-2); font-weight: 600; letter-spacing: 0.02em; }
.diff { display: inline-flex; gap: 2px; align-items: center; margin-left: 2px; }
.diff i { width: 5px; height: 5px; border-radius: 50%; background: rgba(23, 19, 14, 0.18); }
.diff i.on { background: var(--ink); }

.row-score { display: flex; flex-direction: column; gap: 1px; }
.score-line { display: flex; align-items: baseline; gap: 7px; }
.score-avg {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-avg.empty { color: var(--ink-3); font-weight: 400; }
.score-count { font-family: var(--mono); font-size: 9px; color: var(--ink-3); letter-spacing: 0.04em; }

.stars { display: inline-flex; gap: 1px; line-height: 1; color: var(--ink-3); }
.stars .s { font-size: 12px; color: rgba(23, 19, 14, 0.2); }
.stars .s.on { color: var(--gold); }
.stars .s.mid { color: var(--gold); opacity: 0.55; }

.row-mine { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.mine-label { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; color: var(--ink-3); }
.mine-hint { font-size: 10.5px; color: var(--ink-3); }

.star-input { display: inline-flex; gap: 2px; }
.star-input button {
  border: 0;
  background: none;
  padding: 1px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  color: rgba(23, 19, 14, 0.22);
  transition: color 0.12s ease, transform 0.12s ease;
}
.star-input button:hover,
.star-input button.hover { color: var(--red); transform: translateY(-1px); }
.star-input button.on { color: var(--gold); }
.star-input button:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.star-input[data-disabled="true"] { opacity: 0.4; pointer-events: none; }

.row-chevron {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--ink-3);
  text-align: right;
  transition: transform 0.16s ease, color 0.16s ease;
}
.song-row:hover .row-chevron { transform: translateX(4px); color: var(--red); }

/* 空状态 ----------------------------------------------------------------- */

.empty {
  margin: 26px 0 0;
  padding: 34px 26px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--ink-3);
  background: rgba(251, 247, 238, 0.35);
}
.empty h3 { font-family: var(--serif); font-size: 21px; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: 13px; margin-bottom: 16px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.group-empty {
  padding: 16px 10px;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 9px;
}
.group-empty .mono { font-size: 9px; }

/* 侧栏 ------------------------------------------------------------------- */

.side { position: static; }

.panel {
  border: 1px solid var(--ink);
  background: rgba(251, 247, 238, 0.55);
  padding: 16px 16px 14px;
  margin-bottom: 18px;
  box-shadow: 6px 6px 0 rgba(23, 19, 14, 0.06);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h3 { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: 0.04em; }
.panel-tag { font-size: 8.5px; color: var(--ink-3); letter-spacing: 0.14em; }
.panel-note { margin-top: 12px; font-size: 11px; line-height: 1.65; color: var(--ink-3); }

.board-tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.board-tabs button {
  flex: 1;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 5px 2px 7px;
  font-size: 11.5px;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.board-tabs button:hover { color: var(--ink); }
.board-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); font-weight: 700; }

.board-list { display: flex; flex-direction: column; }
.board-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dotted var(--line);
}
.board-item:last-child { border-bottom: 0; }
.board-rank {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-3);
  line-height: 1;
}
.board-item:first-child .board-rank { color: var(--red); }
.board-title {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  max-width: 100%;
}
.board-title:hover { color: var(--red); }
.board-artist { display: block; font-size: 10.5px; color: var(--ink-3); font-family: var(--sans); font-weight: 400; }
.board-score { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.board-score b { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink); }
.board-score span { display: block; font-size: 8.5px; color: var(--ink-3); letter-spacing: 0.04em; }

.feed { display: flex; flex-direction: column; gap: 11px; }
.feed-item { display: grid; grid-template-columns: 7px minmax(0, 1fr); gap: 9px; align-items: start; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; }
.feed-text { font-size: 11.8px; line-height: 1.55; color: var(--ink-2); }
.feed-text b { font-weight: 600; color: var(--ink); }
.feed-link {
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.feed-link:hover { color: var(--red); border-bottom-color: var(--red); }
.feed-meta { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.05em; color: var(--ink-3); margin-top: 1px; }
.feed-meta a { color: var(--ink-3); text-decoration: none; border-bottom: 1px solid var(--line); cursor: pointer; }
.feed-empty { font-size: 11.5px; color: var(--ink-3); }

.legend { display: flex; flex-direction: column; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-glyph {
  width: 26px; height: 26px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 2px;
  color: var(--paper-hi);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}
.legend-name { font-size: 12.5px; font-weight: 600; }
.legend-en { font-family: var(--mono); font-size: 8.5px; color: var(--ink-3); letter-spacing: 0.08em; margin-left: auto; }
.legend-you { font-family: var(--mono); font-size: 8.5px; color: var(--red); letter-spacing: 0.06em; }

.tips { display: flex; flex-direction: column; gap: 10px; counter-reset: tip; }
.tips li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: baseline; counter-increment: tip; }
.tips li::before {
  content: counter(tip, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--red);
  letter-spacing: 0.02em;
}
.tips b { grid-column: 2; font-size: 12.5px; font-weight: 600; display: block; }
.tips span { grid-column: 2; font-size: 11px; color: var(--ink-3); line-height: 1.55; display: block; }

/* 页脚 ------------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--ink);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px var(--pad) 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  align-items: baseline;
}
.site-foot .mono { font-size: 9.5px; color: var(--ink-3); }
.foot-note { font-size: 11.5px; color: var(--ink-3); }
.foot-note a { text-decoration: none; border-bottom: 1px solid var(--line); }
.foot-note a:hover { color: var(--red); border-color: var(--red); }

/* 弹窗通用 ---------------------------------------------------------------- */

dialog.dialog {
  padding: 0;
  color: var(--ink);
}
dialog.dialog::backdrop {
  background: rgba(23, 19, 14, 0.58);
  backdrop-filter: blur(3px) saturate(0.9);
}
dialog.dialog[open] { animation: sheet-in 0.24s cubic-bezier(0.2, 0.7, 0.3, 1); }

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px) scale(0.995); }
  to { opacity: 1; transform: none; }
}

.sheet-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 12px 12px 0 rgba(23, 19, 14, 0.32);
  margin: auto;
  padding: 0;
}
.sheet-dialog::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 3;
}

.sheet-close-wrap {
  position: sticky;
  top: 18px;
  z-index: 4;
  height: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0 18px;
}
.sheet-close-wrap .icon-btn { background: var(--paper); }

/* 详情 ------------------------------------------------------------------- */

#songDetail { padding: 4px clamp(20px, 4vw, 36px) clamp(24px, 4vw, 36px); }
#formBody { padding: 8px clamp(20px, 4vw, 36px) clamp(24px, 4vw, 36px); }

.detail-head { padding: 10px 0 18px; border-bottom: 1.5px solid var(--ink); }
.detail-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.detail-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 700;
  padding-right: 40px;
}
.detail-artist { margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.detail-artist b { color: var(--ink-2); font-weight: 600; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.detail-chips span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  border: 1px solid var(--line);
  padding: 3px 7px;
  color: var(--ink-2);
  background: rgba(251, 247, 238, 0.6);
}

.detail-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; padding-bottom: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h3 { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.section-head .mono { font-size: 8.5px; color: var(--ink-3); }
.primary-tag {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 2px 5px;
  border-radius: 2px;
}

.rate-block { background: rgba(251, 247, 238, 0.42); border: 1px solid var(--line-soft); padding: 16px; margin-bottom: 12px; }
.rate-block.is-primary { border-color: rgba(191, 63, 38, 0.35); background: rgba(251, 247, 238, 0.72); box-shadow: inset 3px 0 0 var(--red); }
.rate-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.rate-head h4 { font-family: var(--serif); font-size: 16.5px; font-weight: 700; letter-spacing: 0.03em; }
.rate-head h4 small { font-family: var(--sans); font-size: 11px; font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.rate-hint { font-size: 10.5px; color: var(--ink-3); margin-bottom: 12px; }
.rate-main { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.rate-avg { font-family: var(--serif); font-size: 42px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-avg span { font-size: 14px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.rate-avg-empty { font-family: var(--serif); font-size: 22px; color: var(--ink-3); }
.rate-stars { display: flex; flex-direction: column; gap: 6px; }
.rate-stars .star-input button { font-size: 26px; padding: 0 2px; }
.rate-count { font-family: var(--mono); font-size: 9px; color: var(--ink-3); letter-spacing: 0.08em; }

.member-votes { display: grid; gap: 7px; margin-top: 4px; }
.vote-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.vote-member { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.vote-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.vote-stars .stars .s { font-size: 13px; }
.vote-value { font-family: var(--mono); font-size: 10px; color: var(--ink-3); min-width: 26px; text-align: right; }
.vote-empty { color: var(--ink-3); font-size: 11px; }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 14px;
}
.detail-notes {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
  white-space: pre-wrap;
  border-left: 2px solid var(--gold);
  padding-left: 14px;
}
.detail-notes.empty-notes { color: var(--ink-3); border-left-color: var(--line); font-size: 12.5px; }

.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* 编辑表单 --------------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.field-help { font-size: 10px; color: var(--ink-3); margin-top: -1px; }
.range-wrap { display: flex; align-items: center; gap: 10px; }
.range-wrap input[type="range"] { flex: 1; accent-color: var(--red); padding: 0; min-height: auto; background: none; border: 0; }
.range-out { font-family: var(--mono); font-size: 12px; color: var(--ink); min-width: 44px; }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 2px;
  color: var(--ink-2);
  transition: all 0.14s ease;
}
.segmented input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.form-error {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 12px;
  background: rgba(191, 63, 38, 0.06);
}
.form-error:empty { display: none; }

.sheet-title { padding: 6px 0 14px; border-bottom: 1.5px solid var(--ink); margin-bottom: 18px; }
.sheet-title h2 { font-family: var(--serif); font-size: clamp(26px, 3.6vw, 34px); font-weight: 700; line-height: 1.15; padding-right: 44px; }
.sheet-title p { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* 时间线 ----------------------------------------------------------------- */

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 12px;
  position: relative;
}
.timeline-item::before {
  content: "";
  width: 7px; height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink-3);
  z-index: 1;
}
.timeline-item:first-child::before { border-color: var(--red); background: var(--red); }
.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 3px; top: 13px; bottom: -2px;
  width: 1px;
  background: var(--line);
}
.timeline-text { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.timeline-text b { font-weight: 600; color: var(--ink); }
.timeline-meta { font-family: var(--mono); font-size: 9px; color: var(--ink-3); letter-spacing: 0.04em; margin-top: 2px; }

/* 身份选择 --------------------------------------------------------------- */

.identity-dialog {
  width: min(940px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 12px 12px 0 rgba(23, 19, 14, 0.35);
  margin: auto;
}
.identity-inner { padding: clamp(24px, 5vw, 52px); }
.identity-inner h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.dialog-lede { max-width: 54ch; font-size: 14px; line-height: 1.8; color: var(--ink-2); }

.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 22px;
}
.identity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 22px 20px 18px;
  border: 1px solid var(--ink);
  background: rgba(251, 247, 238, 0.55);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  overflow: hidden;
}
.identity-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--c, var(--ink));
}
.identity-card:hover,
.identity-card:focus-visible {
  transform: translate(-2px, -3px);
  box-shadow: 6px 6px 0 var(--c, var(--ink));
  background: var(--paper-hi);
  outline: none;
}
.identity-glyph {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c, var(--ink));
  color: var(--paper-hi);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}
.identity-name { font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: 0.04em; }
.identity-en { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; color: var(--ink-3); }
.identity-tagline { font-size: 12.5px; color: var(--ink-2); }
.identity-cta {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.identity-card:hover .identity-cta { color: var(--red); }
.fine { font-size: 8.5px; color: var(--ink-3); letter-spacing: 0.1em; }

/* Toast ------------------------------------------------------------------ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 480px);
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--red);
  padding: 10px 16px;
  font-size: 12.5px;
  line-height: 1.5;
  animation: toast-in 0.22s ease-out;
  max-width: 100%;
}
.toast::before { content: "✦"; color: var(--gold); font-size: 11px; }
.toast.is-error { background: var(--red); box-shadow: 4px 4px 0 var(--ink); }
.toast.is-error::before { color: var(--paper); }
.toast.is-out { animation: toast-out 0.2s ease-in forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

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

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr) 280px; }
  .layout { grid-template-columns: minmax(0, 1fr) 296px; gap: 26px; }
  .song-row, .list-head { grid-template-columns: 36px minmax(0, 1fr) 132px 142px 24px; }
  .row-meta { display: none; }
  .list-head span:nth-child(3) { display: none; }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-side { flex-direction: row; align-items: flex-end; gap: 18px; }
  .stats { flex: 1; }
  .stamp { width: 108px; height: 108px; }
  .stamp span { font-size: 11px; }
  .layout { grid-template-columns: 1fr; }
  .side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .side .panel { margin-bottom: 16px; }
  .list-head { display: none; }
  .song-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: start;
    padding: 16px 6px;
  }
  .row-rank { padding-top: 4px; }
  .row-score { grid-column: 3; grid-row: 1; align-items: flex-end; }
  .score-line { flex-direction: column; align-items: flex-end; gap: 2px; }
  .row-mine { grid-column: 2 / 4; }
  .row-chevron { display: none; }
  .row-by { white-space: normal; }
  .toolbar { position: static; }
  .tools { width: 100%; }
  .field-search { flex: 1 1 220px; }
  .field-search input { width: 100%; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .head-inner { flex-wrap: wrap; gap: 10px; }
  .brand-en { display: none; }
  .brand-cn { font-size: 16px; }
  .head-nav { gap: 8px; }
  .btn-export { display: none; }
  .chip-hint { display: none; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(36px, 11vw, 52px); }
  .stamp { display: none; }
  .stats > div { padding: 11px 12px; }
  .hero-side { flex-direction: column; align-items: stretch; }
  .toolbar { padding-top: 12px; }
  .tools { display: grid; grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .chips { gap: 5px; }
  .chip { padding: 6px 9px; font-size: 12px; }
  .side { grid-template-columns: 1fr; }
  .site-foot { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .identity-grid { grid-template-columns: 1fr; gap: 10px; margin: 22px 0 18px; }
  .identity-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 16px; }
  .identity-card::before { inset: 0 auto 0 0; width: 5px; height: auto; }
  .identity-glyph { width: 46px; height: 46px; font-size: 22px; margin: 0; }
  .identity-name { font-size: 22px; }
  .identity-cta { width: 100%; padding-top: 2px; }
  .identity-tagline { width: 100%; font-size: 11.5px; }
  .sheet-dialog { width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .sheet-close-wrap { top: 14px; padding: 0 14px; }
  #songDetail { padding: 4px 18px 28px; }
  .rate-block { padding: 13px; }
  .rate-avg { font-size: 34px; }
  .dialog .form-grid { grid-template-columns: 1fr; }
  .vote-row { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 6px; }
  .toasts { bottom: 16px; }
}

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