/* =========================================================
   lol1.moe · 萝莉图鉴
   A tiny atlas of moe — vanilla CSS, no build, no CDN.
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #fff8f4;
  --bg-2: #ffeff4;
  --surface: #fffdfc;
  --surface-2: #fff3f7;
  --ink: #4a3340;
  --ink-2: #7d5c6b;
  /* #8a6678 在 --bg-2 (#ffeff4) 上只有 4.45:1，差一点点不够 AA。
     调深两级到 4.57（最差），肉眼几乎看不出差别，但过线了。 */
  --ink-3: #876274;
  --pink: #ff8ab5;
  --pink-2: #c53d70;
  --pink-soft: #ffd7e5;
  /* 浅底上的粉色小字：--pink / --pink-2 是图形色，当正文文字对比度不够 */
  --pink-ink: #b8406a;
  --lav: #b79cff;
  --mint: #9fe3cf;
  --sky: #a8d4ff;
  --gold: #ffce73;
  --line: rgba(122, 74, 95, 0.12);
  --line-2: rgba(122, 74, 95, 0.22);
  --shadow-sm: 0 6px 18px -8px rgba(170, 80, 115, 0.22);
  --shadow: 0 26px 60px -26px rgba(190, 80, 125, 0.4);
  --radius: 26px;
  --radius-sm: 18px;
  --nav-h: 72px;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
    "Noto Serif SC", "STSong", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
    "Source Han Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1420;
  --bg-2: #251a2b;
  --surface: #271c2e;
  --surface-2: #322338;
  --ink: #f8eaf1;
  --ink-2: #e0c8d5;
  --ink-3: #b39aa8;
  --pink: #ff9dc2;
  --pink-2: #ff9ec4;
  --pink-soft: #4a2a3c;
  /* #ffb6ce 对 --surface 有 9.94，但对 .daily 卡片的实际底色只剩 4.44 —— 
     差了 0.06 没过线。提亮一档到 4.8 以上，暗色主题里几乎看不出变化。 */
  --pink-ink: #ffc2d7;
  --lav: #c4aaff;
  --mint: #8fd8c3;
  --sky: #9cc8f5;
  --gold: #ffd489;
  --line: rgba(255, 210, 230, 0.12);
  --line-2: rgba(255, 210, 230, 0.22);
  --shadow-sm: 0 6px 18px -8px rgba(0, 0, 0, 0.55);
  --shadow: 0 26px 60px -26px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60vw 42vw at 88% -6%, rgba(255, 183, 213, 0.55), transparent 62%),
    radial-gradient(46vw 38vw at -6% 18%, rgba(183, 156, 255, 0.28), transparent 62%),
    radial-gradient(52vw 42vw at 52% 112%, rgba(159, 227, 207, 0.26), transparent 64%);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(60vw 42vw at 88% -6%, rgba(120, 60, 90, 0.65), transparent 62%),
    radial-gradient(46vw 38vw at -6% 18%, rgba(86, 66, 130, 0.4), transparent 62%),
    radial-gradient(52vw 42vw at 52% 112%, rgba(46, 92, 86, 0.3), transparent 64%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.55'/></svg>");
}

[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: 0.04; }

::selection {
  background: var(--pink);
  color: #fff;
}

img { max-width: 100%; }

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

/* 焦点环要在「浅色按钮」「浅色页面」上都看得见。
 * 原来用 --pink 混 75% 白，在浅色主题下和背景对比度只有 1.72:1
 * （WCAG 要求 3:1），键盘用户基本看不见焦点停在哪。
 * 改成深一号的粉，并加一圈白色外描边，保证落在任何底色上都醒目。 */
:focus-visible {
  outline: 3px solid var(--focus-ring, #c2185b);
  outline-offset: 2px;
  border-radius: 8px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] :focus-visible {
  outline-color: #ffb5d1;
  box-shadow: 0 0 0 5px rgba(20, 12, 18, 0.8);
}

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

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.85rem;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 14px; }

.wrap {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary {
  /* 原来是白字压在粉→橙→紫的渐变上，实测 2.01–2.28:1 —— 三个停靠点
     全都不够，最差的是中间那个 #ff9d8a（2.01）。这是全站最常用的按钮
     （17 处：首页、404、12 个角色页、3D 台、测试结果），却一直是最不可读的。
     改成深色字：渐变保持原样（它是这个站的识别色），文字用已有的 --ink，
     对三个停靠点分别是 5.20 / 5.68 / 5.01，最差 5.01，不用新增颜色变量。 */
  color: var(--ink);
  background: linear-gradient(120deg, var(--pink) 0%, #ff9d8a 50%, var(--lav) 100%);
  box-shadow: 0 16px 34px -14px rgba(231, 95, 147, 0.7);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -14px rgba(231, 95, 147, 0.8); }

.btn--ghost {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-color: var(--line-2);
  color: var(--ink);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover { background: var(--surface); transform: translateY(-2px); }

.btn--small { padding: 0.55rem 1rem; font-size: 0.82rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo svg { width: 28px; height: 28px; flex: none; }
.logo__word { font-family: var(--font-body); font-size: 1.02rem; }
.logo__word i { font-style: normal; color: var(--pink-2); }
.logo__badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--pink-2);
  border: 1px solid var(--pink-soft);
  background: var(--pink-soft);
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  transform: translateY(-1px);
}

.nav__links {
  display: flex;
  /* 只剩 4 个真正的页面了，间距可以从 0.15rem 放开 ——
     7 项挤一起时是"一排字"，4 项分开才是"4 个入口"。 */
  gap: clamp(0.15rem, 0.8vw, 0.5rem);
  /* 4 项只占 320px，靠 margin-left:auto 推到最右会飘在右半空，
     和右边的两个图标挤在一起、和 logo 之间空出 600px ——
     看着像两截断开的东西。改成跟住 logo，图标那边再靠 auto 推出去，
     整条栏变成「品牌 + 入口 ——— 工具」三段。 */
  margin-left: clamp(0.5rem, 3vw, 2.5rem);
  margin-right: auto;
}

.nav__link {
  position: relative; /* 给下面的 ::after 下划线定位 */
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* 触控区下限，见 stage.css 同名规则 */
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, font-weight 0.25s;
}
.nav__link:hover { background: var(--surface-2); color: var(--ink); }

/* ---------------------------------------------------------------
   当前所在的位置

   aria-current 早就在 HTML 里了，但没有一条 CSS 用到它 —— 属性白写了，
   导航栏看不出你在哪一页。现在统一用「下划线 + 加粗 + 变色」这一套，
   不用胶囊底：胶囊底和 hover 撞形状，而 hover 是"你手正指着它"、
   current 是"你在这儿"，两种状态长得一样会互相盖掉。

   两种 current 值语义不同，但在导航里只有 4 项、都是"页面"，
   视觉上没必要分两套：
     · page —— 当前就是这个页面
     · true —— 首页里当前滚到的那一段（小屏幕上不会同时出现两个）
   --------------------------------------------------------------- */

.nav__link[aria-current] {
  color: var(--ink);
  font-weight: 700;
}
.nav__link[aria-current]::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.5rem;
  height: 2px;
  border-radius: 2px;
  background: var(--pink-2);
}
[data-theme='dark'] .nav__link[aria-current] {
  color: var(--text-strong, #fff);
}
[data-theme='dark'] .nav__link[aria-current]::after { background: var(--pink-ink); }

/* hover 不要盖掉 current —— 当前项悬停时保持原样，别跟着变浅 */
.nav__link[aria-current]:hover {
  background: transparent;
  color: var(--ink);
}
[data-theme='dark'] .nav__link[aria-current]:hover { color: var(--text-strong, #fff); }

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s;
}
.icon-btn:hover { transform: translateY(-1px) rotate(-6deg); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* 背景音乐按钮：默认静音图标，点开才换成带声波的 */
.bgm-toggle .bgm-off { display: none; }
.bgm-toggle.is-on .bgm-on { display: none; }
.bgm-toggle.is-on .bgm-off { display: block; }
.bgm-toggle.is-on { color: var(--pink-ink); border-color: var(--pink-2); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(2.6rem, 6vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}

#petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero__eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink-2);
  box-shadow: 0 0 0 4px var(--pink-soft);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 6.2vw, 5.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 1.15rem 0 1rem;
}
.hero h1 .grad {
  display: inline-block;
  background: linear-gradient(105deg, var(--pink-2) 4%, #ff9d8a 38%, var(--lav) 72%, var(--mint) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 33rem;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(0.96rem, 1.35vw, 1.06rem);
  line-height: 1.95;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.9rem;
}

.hero__meta {
  display: flex;
  gap: clamp(1.4rem, 4vw, 2.8rem);
  margin-top: 2.6rem;
  padding-top: 1.3rem;
  border-top: 1px dashed var(--line-2);
}
.hero__stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.2;
}
.hero__stat span {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

/* hero collage */

.hero__stage {
  position: relative;
  min-height: 560px;
}

.polaroid {
  position: absolute;
  margin: 0;
  width: 48%;
  padding: 10px 10px 42px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform-origin: center;
  animation: bob 7s ease-in-out infinite;
}
.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--pink-soft), var(--surface-2));
}
.polaroid figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.polaroid--a { top: 36px; left: 0; transform: rotate(-5deg); z-index: 3; animation-delay: -1.2s; }
.polaroid--b { top: 0; right: 0; width: 41%; transform: rotate(5.5deg); z-index: 2; animation-delay: -3.6s; }
.polaroid--c { bottom: 0; left: 33%; width: 39%; transform: rotate(-2deg); z-index: 1; animation-delay: -5.4s; }

.hero__sticker {
  position: absolute;
  right: 3%;
  bottom: 10px;
  z-index: 4;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #6b4411;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.35;
  transform: rotate(10deg);
  box-shadow: 0 14px 30px -14px rgba(140, 90, 20, 0.5);
}
.hero__sticker::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px dashed rgba(107, 68, 17, 0.4);
}
.hero__spark {
  position: absolute;
  color: var(--pink-2);
  font-size: 1.1rem;
  animation: twinkle 3.6s ease-in-out infinite;
}
.hero__spark--1 { left: 46%; top: 4%; }
.hero__spark--2 { left: 8%; bottom: 8%; animation-delay: -1.4s; }
.hero__spark--3 { right: 2%; bottom: 20%; animation-delay: -2.2s; }

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

/* ---------- ticker ---------- */

.ticker {
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  overflow: hidden;
  padding: 0.7rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker 42s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__track span {
  padding-inline: 1.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--ink-3);
  white-space: nowrap;
}
@keyframes ticker {
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.section { padding: clamp(2.8rem, 5.5vw, 5rem) 0; scroll-margin-top: 88px; }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}

.kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--pink-2);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.3vw, 2.55rem);
  margin: 0.35rem 0 0.4rem;
  line-height: 1.25;
}

.section__desc {
  margin: 0;
  max-width: 40rem;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.85;
}

/* ---------- gallery toolbar ---------- */

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.search {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  max-width: 420px;
}
.search svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 0.72rem 1rem 0.72rem 2.55rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.86rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }

.chips {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.15rem;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent);
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 0.46rem 0.88rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}
.chip:hover { transform: translateY(-1px); border-color: var(--pink); color: var(--pink-2); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* 芯片上的人数：让人先看到"点下去会有几张卡" */
.chip__n {
  margin-left: 0.38rem;
  font-style: normal;
  font-size: 0.68em;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}

/* 卡片 / 详情里的主题芯片比工具栏那排小一号。
   用粉色字把它们和旁边不可点的普通标签区分开 —— 否则看不出哪个能点。 */
.chip--tiny {
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  border-color: color-mix(in srgb, var(--pink) 40%, transparent);
  background: var(--surface-2);
  color: var(--pink-ink);
  font-weight: 600;
}
.chip--tiny:hover { border-color: var(--pink); color: var(--pink-2); }

.toolbar__right {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.count {
  font-size: 0.76rem;
  color: var(--ink-3);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.fav-toggle[aria-pressed="true"] {
  background: var(--pink-soft);
  border-color: var(--pink);
  color: var(--pink-2);
}

/* ---------- gallery grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.9rem, 2vw, 1.4rem);
}

.card {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }

.card__body {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.card__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(160deg, var(--pink-soft), var(--surface-2));
}
.card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.card:hover .card__media img { transform: scale(1.045); }

.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #5b3d4a;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  backdrop-filter: blur(4px);
}
[data-theme="dark"] .card__badge { background: rgba(30, 20, 25, 0.74); color: #f8eaf1; }

.card__hint {
  position: absolute;
  inset: auto 12px 12px 12px;
  padding: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #5b3d4a;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: 0.35s var(--ease);
  backdrop-filter: blur(4px);
}
.card:hover .card__hint,
.card:focus-within .card__hint { opacity: 1; transform: none; }
[data-theme="dark"] .card__hint { background: rgba(30, 20, 25, 0.8); color: #f8eaf1; }

.card__info { display: block; padding: 0.95rem 1.05rem 1.15rem; }
.card__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.4;
}
.card__name small {
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-left: 0.35rem;
}
.card__title {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  color: var(--ink-2);
}

/* 卡片上的那一句台词。
   身份标签（樱花树下的巫女）说的是"她是谁"，这句说的是"她怎么说"。
   用斜体 + 角色自己的颜色，和下面那排主题标签区分开。 */
.card__tagline {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.6;
  font-style: italic;
  /* 不能用 --pa-glow：那是给发光效果用的浅色，当文字色只有 1.2~1.6:1，
     几乎看不见。改用 --ink-2，读得清，斜体本身已经能和身份标签区分开。 */
  color: var(--ink-2);
  /* 再长也不换第三行，卡片的节奏靠这个维持 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.6rem; }

/* 卡片上的主题。放在 .card__body 之外——那是个 <button>，
   按钮里嵌按钮是非法的，点的时候也会一起触发"打开档案"。 */
.card__themes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  padding: 0 1.05rem 1.15rem;
}
/* 有主题行时 info 的底部留白让给主题，否则卡片会长出一条空当。
   没有 :has 的浏览器只是多留一点白，不影响使用。 */
.card:has(.card__themes) .card__info { padding-bottom: 0.55rem; }


.tag {
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

.card__like {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.82);
  color: #c99aab;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.25s var(--ease), color 0.25s, background 0.25s;
}
.card__like:hover { transform: scale(1.09); }
.card__like[aria-pressed="true"] { color: #ff4f86; background: #fff; }
[data-theme="dark"] .card__like { background: rgba(30, 20, 25, 0.75); border-color: rgba(255, 255, 255, 0.15); }
[data-theme="dark"] .card__like[aria-pressed="true"] { background: #3a2530; }

.empty {
  grid-column: 1 / -1;
  padding: 4rem 1rem;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.9rem;
}
.empty b {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
}

/* ---------- <noscript> 兜底 ---------- */

/*
 * 关掉 JS 时首页三块（图鉴 / 地域 / 关系网）的内容。
 * 由 scripts/build-pages.mjs 生成，正常访问时浏览器根本不会渲染它，
 * 所以这里的样式只服务于"真的没开 JS"这一种情况 —— 简单、可读即可。
 */
.ns__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}
.ns__themes {
  margin: 0 0 1.4rem;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 2;
  color: var(--ink-2);
}
.ns__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ns__cards a {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.6;
  text-decoration: none;
}
.ns__cards img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.4rem;
  border-radius: 14px;
}
.ns__cards b { color: var(--ink); }
.ns__plain {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 2;
  color: var(--ink-2);
}
.ns__plain a { color: var(--ink); }
.ns a:hover { text-decoration: underline; }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.about-card {
  padding: 1.4rem 1.4rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}
.about-card .ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 1.15rem;
}
.about-card h3 {
  margin: 0.85rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
}
.about-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.85;
}

.about-note {
  margin-top: 1rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2);
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1.9;
}
.about-note code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.78rem;
}

/* ---------- policy ---------- */

.policy {
  padding: clamp(1.5rem, 3.5vw, 2.6rem);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--surface) 0%, var(--surface-2) 100%);
}
.policy h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
}
.policy ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.95;
}
.policy li + li { margin-top: 0.45rem; }
.policy a { color: var(--pink-2); text-underline-offset: 3px; }

/* ---------- footer ---------- */

.footer {
  margin-top: 3rem;
  padding: 2.2rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.78rem;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-2);
}
.footer p { margin: 0; }
.footer__note { letter-spacing: 0.04em; }

/* ---------- dialog ---------- */

.detail {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90dvh, 820px);
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
  overflow: visible;
}
.detail::backdrop {
  background: rgba(34, 18, 28, 0.55);
  backdrop-filter: blur(7px);
}
.detail__panel {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  max-height: min(90dvh, 820px);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.detail__media {
  position: relative;
  background: var(--surface-2);
}
.detail__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(90dvh, 820px);
  object-fit: cover;
}
.detail__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--ink-2);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.detail__info {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  overflow-y: auto;
}
.detail__eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink-2);
}
.detail h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.2;
}
.detail__en {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.detail__tagline {
  margin: 0.2rem 0 0;
  font-size: 0.98rem;
  color: var(--pink-2);
  font-style: italic;
}
.detail__bio {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.95;
}

/* 台词。
   和上面的 tagline 分开：tagline 是"这本书怎么介绍她"，
   台词是"她自己在说话"。所以给一句左竖线 + 轻微底色，
   读起来像引语而不是简介。 */
.detail__voice {
  position: relative;
  margin: 0.75rem 0 0.85rem;
  padding: 0.55rem 0 0.55rem 0.9rem;
  border-left: 2px solid var(--pa, var(--pink));
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--pa, var(--pink)) 7%, transparent),
    transparent 70%
  );
  border-radius: 0 8px 8px 0;
}
.detail__voice-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--ink);
  /* 换句时的高度变化别把下面的内容顶着跳 */
  min-height: 2.6em;
}
.detail__voice-text[hidden] { display: none; }
.detail__voice-next {
  appearance: none;
  margin-top: 0.35rem;
  padding: 0.15rem 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--ink-3) 40%, transparent);
  transition: color 0.2s;
}
.detail__voice-next:hover { color: var(--pink-2); }
.detail__voice-next:focus-visible {
  outline: 2px solid var(--pink-2);
  outline-offset: 3px;
  border-radius: 4px;
}
.detail__voice-next[hidden] { display: none; }
[data-theme='dark'] .detail__voice-next:hover { color: var(--pink-ink); }
[data-theme='dark'] .detail__voice-next:focus-visible { outline-color: var(--pink-ink); }
.detail__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1.2rem;
  margin: 0.35rem 0;
  padding: 0.9rem 0;
  border-block: 1px dashed var(--line-2);
  font-size: 0.78rem;
}
.detail__meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}
.detail__meta dt { color: var(--ink-3); }
.detail__meta dd { margin: 0; color: var(--ink-2); text-align: right; }
.detail__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }

/* 弹窗里的六维性格：弹窗本来就长，这里只给最小高度，别再加一条分隔线
 * （上面的 dl 已经有边框了，再加一层视觉噪音太大） */
.detail__traits { margin: 0.1rem 0 0.2rem; }
.detail__traits:empty { display: none; }
/* 弹窗里排两列：竖排六行要 154px，超过第五轮给弹窗定的 +150px 预算，
 * 而且弹窗本来就矮，这 154px 会把关系列表挤到需要额外滚动。 */
.detail__traits .traits {
  max-width: 100%;
  gap: 5px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.detail__traits .traits__row { grid-template-columns: 2.9em 1fr; gap: 10px; }
.detail__traits .traits__name { font-size: 0.72rem; }
.detail__traits .traits__bar { height: 6px; }

/* ---------- 详情里的关系（弹窗内那条路）---------- */

.detail__relTitle {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.drel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
/* 并排会让 note 挤成两行字，460px 以下保持单列 */
@media (min-width: 460px) {
  .drel { grid-template-columns: 1fr 1fr; }
}
.drel__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    'kind name'
    'note note';
  gap: 0.15rem 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.drel__item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
}
.drel__kind {
  grid-area: kind;
  align-self: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pink) 18%, transparent);
  color: var(--pink-ink);
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}
.drel__name {
  grid-area: name;
  align-self: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}
.drel__note {
  grid-area: note;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.detail__actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
}
.pager { display: flex; align-items: center; gap: 0.35rem; }
.pager button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
}
.pager button:hover { border-color: var(--pink); color: var(--pink-2); }
.pager span {
  min-width: 52px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

body.is-locked { overflow: hidden; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 300;
  translate: -50% 0;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.toast.is-on { opacity: 1; transform: none; }

/* ---------- reveal ---------- */

/*
 * reveal 默认**可见**，只有确认 JS 在跑（<html class="js">）才隐藏。
 *
 * 之前是反过来的：.reveal { opacity: 0 }，靠 JS 加 .is-in 才显示。
 * 关掉 JS 时整页停在 opacity:0 —— 首屏 hero 下面全空，noscript 里的
 * 兜底内容也跟着被藏（fallback 内容本身也在 .reveal 里）。
 * 现在改成渐进增强：没有 JS 就老老实实显示，有 JS 才做进场动画。
 */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */

.error-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.error-page__inner { position: relative; z-index: 1; max-width: 34rem; }
.error-page .code {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(5.5rem, 20vw, 11rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(120deg, var(--pink-2), var(--lav) 55%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-page h1 {
  margin: 0.4rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}
.error-page p {
  margin: 0 auto 1.8rem;
  max-width: 26rem;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.9;
}
.error-page .actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
/* 花是装饰，挂在内容块右上角。
   原来挂在页面容器上（top:16%），容器高度随内容变，花的位置就跟着漂 ——
   404 页加了人物推荐之后，标题被居中算法顶上去，正好撞上花。 */
.error-page .ghost-flower {
  position: absolute;
  right: -6%;
  top: -5%;
  font-size: clamp(3rem, 8vw, 6rem);
  opacity: 0.35;
  pointer-events: none;
  animation: bob 7s ease-in-out infinite;
}

/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__stage { width: 100%; max-width: 520px; margin: 1.2rem auto 0; min-height: 440px; }
  .hero__lead { max-width: 38rem; }
}

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .detail__panel { grid-template-columns: minmax(0, 1fr); }
  .detail__media { min-width: 0; aspect-ratio: 4 / 3; }
  .detail__media img { max-height: 42dvh; object-position: center top; }
  /* 之前这里直接 display:none —— 手机上首页没有任何导航入口，连「3D 手办台」
     都进不去。窄屏挤不下四项，改成两行：第一行 logo + 图标，第二行整条导航。 */
  .nav {
    height: auto;
    flex-wrap: wrap;
    padding-block: 0.35rem 0.2rem;
    row-gap: 0;
  }
  /* 导航变两行后总高约 100px，锚点跳转要跟着让位，否则标题被吸顶栏盖住 */
  .section { scroll-margin-top: 112px; }
  /* 两行导航本来就比桌面高，再半透明会让下面的卡片透上来糊成一片 */
  .site-header {
    background: var(--bg);
    backdrop-filter: none;
  }
  .nav__links {
    order: 3;
    flex-basis: 100%;
    display: flex;
    /* 原来是 space-between + 每项 flex:1 1 0，把 7 项等分铺满整行。
       只剩 4 项之后这个组合会把它们拉得极开，当前项的下划线也跟着
       被拉成一整段 —— 看着像四个互不相干的东西。改成居中聚拢。 */
    justify-content: center;
    gap: clamp(0.1rem, 1.5vw, 0.6rem);
    margin-left: 0;
  }
  .nav__link {
    flex: 0 1 auto;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* 往下滚时收起导航行，只留 logo + 图标，吸顶栏从 92px 降到 52px。
     用 max-height 而不是 display:none，才能过渡；opacity 一起降到 0
     避免文字被压扁时露出来。 */
  .nav__links {
    overflow: hidden;
    max-height: 44px;
    opacity: 1;
    transition: max-height 0.28s var(--ease), opacity 0.2s var(--ease),
                margin 0.28s var(--ease);
  }
  .site-header.is-collapsed .nav__links {
    max-height: 0;
    opacity: 0;
    margin-block: 0;
    pointer-events: none;
  }
  /* 收起后导航行不占位，原本靠它的 margin-left:auto 把图标推到右边，
     现在没了推力，logo 和图标会全部挤在左边 —— 这里补回来。
     只在「已收起」时生效，展开时仍由 nav__links 撑开，避免双重推力。 */
  .site-header.is-collapsed .nav .logo {
    margin-right: auto;
  }
}

@media (max-width: 500px) {
  /* 七项等分并排在 500px 以下都嫌挤：390px 时「3D 手办台」已经被切掉，
     414px 时也一样。不缩字号也不藏项 —— 换成允许折行、按内容定宽，
     按屏宽自然排成一到两行。缩字号让本来就不大的中文更难读，藏项等于
     少了入口，都不如多占一行。 */
  .nav__links {
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 0.1rem;
    row-gap: 0.1rem;
    /* 折成两行后展开高度约 76px，收起动画的基准值要跟着放宽，
       否则未收起时也会被 max-height: 44px 切断 */
    max-height: 88px;
  }
  .nav__link {
    flex: 0 1 auto;
    padding: 0.35rem 0.45rem;
  }
  /* 两行导航顶到 130px 左右，锚点跳转的让位距离要一起加 */
  .section { scroll-margin-top: 148px; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  /* 注意：这里不能再写死 .nav 高度 —— 860 断点里导航改成了两行，
     写死 64px 会让第二行溢出容器、压到下面的卡片上。 */
  .logo__badge { display: none; }
  .hero { padding-top: 2.2rem; }
  .hero h1 { font-size: clamp(2.3rem, 10.5vw, 3.1rem); }
  .hero__meta { gap: 1.3rem; }
  .hero__stage { min-height: 380px; }
  .polaroid { padding: 7px 7px 30px; }
  .polaroid figcaption { font-size: 0.6rem; bottom: 8px; }
  .hero__sticker { width: 64px; height: 64px; font-size: 0.56rem; }
  .toolbar { grid-template-columns: 1fr; }
  .search { grid-column: 1; grid-row: 1; max-width: none; }
  .toolbar__right { grid-column: 1; grid-row: 2; width: 100%; justify-content: space-between; }
  .chips { grid-row: 3; }
  .card__info { padding: 0.7rem 0.75rem 0.9rem; }
  .card:has(.card__themes) .card__info { padding-bottom: 0.45rem; }
  .card__themes { padding: 0 0.75rem 0.9rem; }
  .card__name { font-size: 1rem; }
  .card__name small { display: block; margin-left: 0; }
  .card__title { font-size: 0.74rem; }
  .detail { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .detail__panel { max-height: 100dvh; height: 100%; border-radius: 0; }
  .detail__media img { max-height: 38dvh; object-position: center top; }
  .detail__meta { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

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

.select {
  padding: 0.46rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.78rem;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }

/* ---------- 地域视图（批次一）---------- */

.regions {
  display: grid;
  gap: 12px;
  /* 158 -> 186：卡片里要放得下三行描写，太窄会把每行挤到 8 个字 */
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
}

/* 每个地名用该角色自己的两色做底，12 个格子天然就是 12 种颜色。
   之前 12 个格子长得一模一样 —— 同样的字、同样的排版，只有底色不同，
   读起来像 12 个同名标签。现在每格左上角放一个大图形（她的元素），
   远看就能认出「这格是海」「那格是书」。 */
.region {
  position: relative;
  display: grid;
  gap: 2px;
  /* 原来是 align-content: end —— 靠底排，让几个短标签贴着卡片下沿。
     加入地点描写之后每张卡的字数不一样，靠底排会让地名高低不齐
     （描写长的卡片地名往上顶）。改成从顶部开始排，12 个地名一条线。 */
  align-content: start;
  min-height: 176px;
  padding: 18px 15px 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--pb) 34%, var(--line));
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in srgb, #ffffff 62%, transparent), transparent 70%),
    linear-gradient(150deg, var(--pa), var(--pb));
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* 图形只当底纹：压得很淡、位置固定，不跟文字抢 */
.region__glyph {
  position: absolute;
  top: 10px;
  right: 8px;
  color: var(--pa-ink);
  opacity: 0.42;
  transition: opacity 0.2s ease, transform 0.3s var(--ease);
}
.region__glyph .glyph { width: 46px; height: 46px; }
[data-theme="dark"] .region__glyph { color: var(--pa-ink); opacity: 0.5; }
.region:hover .region__glyph,
.region:focus-visible .region__glyph { opacity: 0.72; transform: rotate(-6deg) scale(1.06); }

/* 地点描写。
   这一段在 data 里一直写着（每人 35~49 字），但首页的「十二个地方」
   一个小字都没展示 —— 标题说"看看那里住着谁"，卡片上只有人名。
   放进卡片后格子变高，所以 min-height 从 132 抬到 176。
   不限行数：截断会切掉「石阶三十七级，最后三级最陡」这种最见性格的结尾，
   宁可让格子随文字长高 —— 同一行的卡片会被 grid 拉齐，不会参差。 */
.region__note {
  margin-top: 6px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--pa-ink);
  opacity: 0.82;
}
[data-theme="dark"] .region__note { opacity: 0.88; }

/* 窄屏两列。
   加入描写后单列每张卡 209px，12 张要滚 2500px；而且整行宽度只放两行字，
   大片空白。改成两列，卡片降到约 200px 高、总高砍掉一半，
   字也更聚。320px 以下再退回单列 —— 那时两列每列只有 140px，
   一行放不下 8 个字，读起来会断。 */
@media (max-width: 560px) {
  .regions { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .region { min-height: 0; padding: 14px 12px 12px; }
  .region__note { font-size: 0.7rem; line-height: 1.55; }
  .region__glyph .glyph { width: 34px; height: 34px; }
}
@media (max-width: 340px) {
  .regions { grid-template-columns: 1fr; }
}

.region > * { position: relative; z-index: 1; }

.region:hover,
.region:focus-visible {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.4);
}

.region__name {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  /* 用算出来的深色而不是写死的 #3d2b34 —— 12 种底色深浅不一，
     写死一个颜色在某几种底色上会糊 */
  color: var(--pa-ink);
}
/* 暗色主题：地域卡片的底还是**浅色**（palette 本来就是浅的），
   所以文字必须继续用深色 —— 用 --pa-glow（提亮版）压上去等于
   米白字压浅粉底，对比度 ~1.6:1，实测整片糊掉。
   卡片是"浅色小岛浮在暗色页面上"，岛上就得用岛上的字色。 */
[data-theme="dark"] .region__name { color: var(--pa-ink); }
.region__who {
  font-size: 0.82rem;
  /* 原来这里有个 opacity: 0.82 想做"次要信息"的层级，结果是 13px 的字
     被稀释到 2.96–3.63:1（12 张卡片全部低于 AA，最差薄荷 2.96）。
     层级改用字号和字重表达：名字 700，人名 400 —— 不加透明度。 */
  color: var(--pa-ink);
}
[data-theme="dark"] .region__who { color: var(--pa-ink); }
.region__el {
  justify-self: start;
  margin-top: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, #ffffff 62%, transparent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pa-ink);
}
[data-theme="dark"] .region__el {
  background: color-mix(in srgb, #000000 22%, transparent);
  color: var(--pa-ink);
}

@media (prefers-reduced-motion: reduce) {
  .region { transition: none; }
  .region:hover { transform: none; }
}

/* ---------- 图鉴完成度（批次二）---------- */

.hero__progress {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 14px 18px;
  margin-top: clamp(20px, 3vw, 28px);
  max-width: 660px;
}

/* 标签在上、数字在下：和上方 hero__stat 的"大数字 + 小说明"是同一套读法，
   左右分列会让「3/12」看起来像属于下一个标签 */
.prog__top {
  display: grid;
  gap: 1px;
  margin-bottom: 7px;
}
.prog__top span {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.prog__top b {
  font-size: 1.02rem;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.prog__top b i {
  font-style: normal;
  font-size: 0.74rem;
  color: var(--ink-3);
  font-weight: 500;
}

.prog__bar {
  height: 6px;
  border-radius: 999px;
  /* 轨道必须看得见，否则只剩粉色填充段，看着像条形错位 */
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
  overflow: hidden;
}
.prog__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb7d5, #b79cff);
  transition: width 0.5s var(--ease);
}

/* 未开始的一项淡一点，避免四个都是空条时显得像坏了 */
.prog[data-key] .prog__bar span[style*='width:0%'] { opacity: 0; }

/* ---------- 每日一抽（批次二）---------- */

.section--tight { padding-top: clamp(20px, 3vw, 34px); }

.daily {
  display: grid;
  gap: clamp(16px, 3vw, 32px);
  grid-template-columns: 1fr;
  /* 不铺满整行：否则标签贴左、角色贴右，中间空出一大片 */
  max-width: 880px;
  align-items: center;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, #ffd9e6 60%, transparent), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, #e5d9ff 60%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow);
}

/* 这两个 radial-gradient 里的淡粉和淡紫是写死的浅色 —— 在暗色主题里
   它们照样刷在深色 --surface 上，把卡片盖成一片紫灰。结果浅粉色的
   「今天适合：…」压上去只剩 2.35:1，一个字都认不出来。
   暗色主题要换成低不透明度的深色光晕，让卡片保持深。 */
[data-theme="dark"] .daily {
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--pink) 12%, transparent), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--lav) 12%, transparent), transparent 60%),
    var(--surface);
}

@media (min-width: 720px) {
  /* 两列都按内容宽度、整体居中：如果让左列 flex 撑开，
     标签和角色会被推到两端，中间空一大块 */
  .daily {
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 5vw, 56px);
  }
}

.daily__note { margin: 6px 0 0; font-size: 0.86rem; color: var(--ink-3); }

.daily__body {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 22px);
}

.daily__face {
  flex: 0 0 auto;
  width: clamp(84px, 14vw, 120px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: transform 0.25s var(--ease);
}
.daily__face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.daily__face:hover { transform: translateY(-3px) rotate(-1.5deg); }

.daily__name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.daily__name span {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-3);
}
.daily__line {
  margin: 8px 0 10px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 32ch;
}
.daily__acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
}
/* 今天适合做点什么：一句话，链到对应页面，比再加一句抒情有用 */
.daily__suggest {
  font-size: 0.78rem;
  color: var(--pink-ink);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--pink-ink) 45%, transparent);
}
.daily__suggest:hover { border-bottom-style: solid; }
@media (max-width: 460px) {
  .daily__suggest { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .daily__face { transition: none; }
  .daily__face:hover { transform: none; }
}

/* ---------- 关系网（批次四）---------- */

.web {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 20px) 0;
}

.web__svg {
  display: block;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1;
  overflow: visible;
}

/* 关系种类分色 + 分线型。
   之前 19 条线全长一样：挚友和"街角常客"在图上是同一根灰线，
   图能看出"谁连着谁"，看不出"怎么连的"—— 那这张图等于只画了一半。 */
.web__edge {
  --kind: #b9a2ae;
  stroke: var(--kind);
  stroke-width: 0.26;
  stroke-linecap: round;
  opacity: 0.72;
  transition: stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease;
}
.web__edge[data-kind="挚友"] { --kind: #e0518a; }
.web__edge[data-kind="师承"] { --kind: #7b5cd6; stroke-dasharray: 2.6 1.4; }
.web__edge[data-kind="邻居"] { --kind: #3f9a86; }
.web__edge[data-kind="同好"] { --kind: #d98a1f; stroke-dasharray: 1.1 1.1; }
.web__edge[data-kind="常客"] { --kind: #2f78b8; stroke-dasharray: 0.9 1.6; }
.web__edge[data-kind="旧识"] { --kind: #8a7f74; stroke-dasharray: 3.4 1.6; }
[data-theme="dark"] .web__edge[data-kind="挚友"] { --kind: #ff8ab5; }
[data-theme="dark"] .web__edge[data-kind="师承"] { --kind: #b79cff; }
[data-theme="dark"] .web__edge[data-kind="邻居"] { --kind: #7fd4c0; }
[data-theme="dark"] .web__edge[data-kind="同好"] { --kind: #ffc266; }
[data-theme="dark"] .web__edge[data-kind="常客"] { --kind: #7fb8e8; }
[data-theme="dark"] .web__edge[data-kind="旧识"] { --kind: #b8ada2; }
/* 有一个人被聚焦时，其他线退到后面去 */
.web.is-focus .web__edge { opacity: 0.18; }
.web.is-focus .web__edge.is-hot {
  opacity: 1;
  /* 聚焦时保持自己的色 —— 统一涂成品牌粉会把刚分好的颜色信息抹掉 */
  stroke-width: 0.62;
}

.web__node { cursor: pointer; }
/* 节点里的元素图形：底色是浅粉，图形用 ink-2 才看得清 */
.web__node .web__glyph { color: #4a3340; pointer-events: none; }
[data-theme="dark"] .web__node .web__glyph { color: #2a1c24; }
.web__node circle {
  stroke: var(--surface);
  stroke-width: 0.5;
  transition: r 0.18s ease;
}
.web__node text {
  font-size: 2.5px;
  fill: var(--ink-2);
  transition: fill 0.18s ease, font-weight 0.18s ease;
}
.web__node:hover circle,
.web__node:focus-visible circle,
.web__node.is-hot circle { r: 4.4; }
.web__node:hover text,
.web__node:focus-visible text,
.web__node.is-hot text { fill: var(--ink); font-weight: 700; }

.web__node:focus-visible { outline: none; }
.web__node:focus-visible circle {
  stroke: var(--pink-2);
  stroke-width: 0.8;
}

/* ---------- 关系图例 ---------- */

.web__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.9rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.76rem;
  color: var(--ink-2);
}
.web__key {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}
.web__key svg { width: 34px; height: 9px; flex: none; }
.web__key .web__edge { stroke-width: 2.2; opacity: 1; }
.web__key b { font-weight: 600; color: var(--ink); }
.web__key i {
  font-style: normal;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- 关系气泡 ---------- */

/*
 * 节点从 <a> 换成 <g role="button"> 之后，跳转不能让节点直接承担 ——
 * 那样又变回"一碰就走"。气泡里放关系和出口。
 */
.web__pop {
  position: absolute;
  z-index: 5;
  min-width: 168px;
  max-width: min(260px, calc(100% - 8px));
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: pop-in 0.14s var(--ease);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.web__popName {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}
.web__popName small {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-3);
}
.web__popList {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.web__popList li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}
.web__popList a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.web__popList a:hover { border-bottom-color: var(--pink); }
.web__popKind {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pink) 18%, transparent);
  color: var(--pink-ink);
  font-size: 0.64rem;
  font-weight: 700;
}
/* note 跟在名字后面，浅色小字；浮层本身要限宽，否则长 note 会把它撑开 */
.web__popNote {
  margin-left: auto;
  padding-left: 0.4rem;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--ink-3);
  max-width: 9.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web__popMore {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.76rem;
  color: var(--pink-ink);
  text-decoration: none;
}
.web__popMore:hover { text-decoration: underline; }

/* 窄屏上气泡浮在图里会盖住节点本身，改成图下方的一块 */
@media (max-width: 560px) {
  .web__pop {
    position: static;
    order: 2;
    margin-top: 0.8rem;
    max-width: none;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .web__edge, .web__node circle, .web__node text { transition: none; }
  .web__pop { animation: none; }
}

/* =========================================================
   元素图形与角色 accent（第四轮 · 批次 I）

   --pa / --pb 是角色原色，只能当背景；要当文字色得用 --pa-ink
   （由 accent.js 按 WCAG 算到 4.6:1 以上）。深色主题下换成 --pa-glow，
   因为深色 accent 压在 #1c1420 上只有 3.6:1。
   ========================================================= */

:root {
  --pa-ink: var(--pink-ink);
  --pa-glow: var(--pink-ink);
}
/* 整个站点默认是品牌粉，只有带 style 的角色元素会覆盖掉它 */

[data-theme="dark"] {
  --pa-ink: var(--pa-glow);
}

.glyph {
  display: block;
  flex: none;
  color: currentColor;
  /* 12 个图形都是手画的描边路径，半透明描边会迅速糊掉，保持实心 */
}
.glyph--inline {
  display: inline-block;
  vertical-align: -0.18em;
  margin-right: 0.4rem;
}

/* 卡片上的元素徽标：和 NO.01 同一行，紧挨着它。
   放到右上角会正好压在收藏爱心下面（爱心绝对定位在 top:12 right:12），
   两个胶囊叠在一起，实测在图上完全看不清。所以改成左上角并排。 */
.card__el {
  position: absolute;
  top: 12px;
  left: 74px;                 /* NO.01 胶囊之后 */
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.5rem 0.24rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--pa-ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.card__el .glyph { width: 13px; height: 13px; }
.card__el i { font-style: normal; }
[data-theme="dark"] .card__el { background: rgba(30, 20, 25, 0.76); color: var(--pa-glow); }

/* hover 时描边取自己的颜色 —— 12 张卡不再共用同一个粉色 */
.card:hover .card__media,
.card:focus-within .card__media {
  box-shadow: 0 24px 48px -26px color-mix(in srgb, var(--pb) 78%, #5b2b3c);
  border-color: color-mix(in srgb, var(--pb) 46%, var(--line));
}

/* ---------- 纸张质感 ----------
 *
 * 教训：这一条最初写成 `body::before`，把上面那条**底色光晕**整条覆盖掉了
 * —— 同选择器 + 同属性，后写的赢。结果整站的三团柔和渐变全部消失，
 * 只剩纯 --bg 加噪点。视觉上不容易立刻发现（背景本来就是"很淡"），
 * 但页面确实从"有光"变成了"一块平色"，吸顶栏失去透出来的色彩层次，
 * 滚动时那点色彩变化也没了。
 *
 * 所以噪点只能挂在一个**没被占用的**伪元素上，不能抢光晕的座位。
 * body 的两个伪元素都已经被占用，这里改挂到 html 上：
 * html::after 只负责颗粒，body::before 继续负责底色光晕。
 */
html::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%22180%22%3E%3Cfilter%20id%3D%22n2%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%220.82%22%20numOctaves%3D%223%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%22180%22%20height%3D%22180%22%20filter%3D%22url%28%23n2%29%22%20opacity%3D%220.42%22%2F%3E%3C%2Fsvg%3E");
  background-size: 180px 180px;
  /* 0.5 太狠：multiply 在浅底上会把整页压暗约 9 个亮度级
     （实测均值 234 → 224），纸感变成了"脏"。0.28 压暗约 3 级，
     颗粒看得见但不影响底色。 */
  opacity: 0.28;
  mix-blend-mode: multiply;
}
[data-theme="dark"] html::after {
  mix-blend-mode: screen;
  opacity: 0.14;
}

/* ---------- 此刻（批次 K）---------- */

/*
 * 四档时段切换 + 当天此刻在做的事。
 * 数据只有 characters.json 里的 day[]（每人四条），所以这里不新造内容，
 * 只是把"她的一天"按读者自己的本地时间翻到那一档。
 * 区块本身约 320px：首页已经很高了，这里必须紧凑，不能再长。
 */
.now__switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  justify-self: start;
}
.now__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.84rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.now__btn:hover { color: var(--ink); }
.now__btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(120, 70, 95, 0.18);
}
.now__btn .now__btn-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.now__btn[aria-pressed="true"] .now__btn-hint { color: var(--pink-ink); }

/* #now-card 现在装两块：她自己那张卡（.now__feature），
   加上"同一时刻其他 11 位在做什么"（.now__rest）。
   两列的网格挪到 .now__feature 上，卡片本身变成纵向排列。 */
.now__card {
  margin-top: clamp(16px, 3vw, 28px);
  display: grid;
  gap: clamp(14px, 2vw, 20px);
  max-width: 880px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--pb) 34%, var(--line));
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--pa) 66%, transparent), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow);
}
.now__feature {
  display: grid;
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
}
@media (min-width: 720px) {
  .now__feature { grid-template-columns: auto 1fr; }
}

/* ---------- 同一时刻的其他居民 ---------- */

.now__rest {
  border-top: 1px solid var(--line);
  padding-top: clamp(12px, 2vw, 16px);
}
.now__restLabel {
  margin: 0 0 10px;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.now__restList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .now__restList { grid-template-columns: 1fr 1fr; column-gap: clamp(16px, 3vw, 30px); }
}

.now__someone {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.18s ease;
}
.now__someone:hover,
.now__someone:focus-visible {
  background: color-mix(in srgb, var(--pa) 22%, transparent);
}
.now__someone:focus-visible { outline: 2px solid var(--pa-ink); outline-offset: 1px; }

/* 活动名在前、人名在后：一眼扫过去先看到"在做什么"，
   这一节问的就是这件事。 */
.now__someoneAct {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--pa-ink);
  white-space: nowrap;
}
[data-theme="dark"] .now__someoneAct { color: var(--pa-glow); }
.now__someoneName {
  font-size: 0.74rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now__someoneText {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.now__face {
  width: clamp(96px, 14vw, 132px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--pa), var(--pb));
  border: 1px solid var(--line);
}
.now__face img { width: 100%; height: 100%; object-fit: cover; display: block; }

.now__time {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--pa-ink);
}
[data-theme="dark"] .now__time { color: var(--pa-glow); }
.now__text {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.32rem);
  line-height: 1.7;
  color: var(--ink);
}
.now__meta {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.now__meta a { color: var(--pa-ink); text-decoration: none; }
.now__meta a:hover { text-decoration: underline; }
[data-theme="dark"] .now__meta a { color: var(--pa-glow); }

@media (prefers-reduced-motion: no-preference) {
  .now__card { transition: opacity 0.2s ease; }
  .now__card.is-switching { opacity: 0.35; }
}

/* ---------- 全部关系故事（批次 O2）----------
 * 放在关系网下面，默认收起。19 段 × 80 字全展开会把 #web 从 991px 撑到
 * 四五屏，而 visitor 大多数时候只是想知道"谁和谁有什么关系"。
 */
.webStory {
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}
.webStory > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--ink-2, var(--ink));
}
.webStory > summary::-webkit-details-marker { display: none; }
.webStory > summary::before {
  content: '＋';
  color: var(--pink-2);
  margin-right: 0.4em;
}
.webStory[open] > summary::before { content: '－'; }
.webStory > summary:focus-visible {
  outline: 2px solid var(--pink-2);
  outline-offset: 4px;
  border-radius: 4px;
}
.webStory__list {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .webStory__list { grid-template-columns: 1fr 1fr; gap: 1.2rem 2rem; }
}
.webStory__list li {
  padding-left: 0.9rem;
  border-left: 2px solid color-mix(in srgb, var(--pink) 45%, transparent);
}
.webStory__pair {
  margin: 0 0 0.3rem;
  font-size: 0.84rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.webStory__pair a { color: var(--ink); text-decoration: none; font-weight: 700; }
.webStory__pair a:hover { text-decoration: underline; }
.webStory__pair span {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  background: color-mix(in srgb, var(--pink) 16%, transparent);
  color: var(--pink-ink);
}
.webStory__list p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.72;
  color: var(--ink-2, var(--ink));
}
.webStory__note { color: var(--ink-3) !important; }

/* ---------- 今天读一句（批次 P3）----------
 * 一条 1 行高的窄带子，不是 section：首页 1440 下已经 7500px，
 * 满宽 section 会把图鉴推得更远。窄带只占 ~44px。
 * 没有 JS 时这里是空的（CSS 给了 min-height 会留白，所以用 :empty 收掉）。
 */
.quote {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.7rem 0 0.7rem;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.quote:empty { display: none; }
.quote__text {
  margin: 0;
  flex: 1 1 22rem;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink);
}
.quote__who {
  flex: none;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}
.quote__who span { color: var(--pink-ink); font-weight: 700; }
.quote__who:hover { color: var(--ink); }
@media (max-width: 560px) {
  .quote { gap: 0.3rem; padding-block: 0.7rem; }
  .quote__text { font-size: 0.92rem; }
}

/* ---------- 卡片角落的 3D 标记（批次 P1）----------
 * 之前读者只能点进 /3d/ 才知道谁是手办、谁还是立牌。这个角标把
 * "她有 3D" 提到图鉴上，点角标直接进 /3d/?id=xxx，不用先开档案再找入口。
 * 只有配了模型的角色才有 —— 12 个里 12 个都有，但条件是数据驱动的，
 * 以后加了没有模型的角色也不会出现空角标。
 */
/* 卡片上的「3D」小标签。
 *
 * 位置换过两次：右下会被悬停提示「翻开她的档案 →」盖住，
 * 右上被收藏按钮的心形盖住。最后放进名字那一行 ——
 * 那里本来就空着，而且"这个人有 3D"本来就是一条信息，不是装饰。
 *
 * 也不放模型缩略图：20px 的浅色低多边形在浅色卡片上像一团污渍，认不出是人。 */
.card__model {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45em;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pink) 16%, transparent);
  color: var(--pink-ink);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: 0.15em;
}

/* ---------- 六维性格（批次 N）----------
 *
 * traits 早就存在于 characters.json，但一直只当余弦相似度的中间变量，
 * 界面上一次都没出现过。这里把它画成六根条。
 *
 * 不用雷达图：分值只有 1/2/3 三档，画成多边形会暗示"有更细的精度"，
 * 那是编出来的分辨率。条长只表达"强/中/弱"，和数据的粒度一致。
 * 不印数字：1/2/3 印在边上，这一块就变成表格了。
 */
/* 六根条竖着排要 165px，占掉角色页一整屏之外的一大块。
 * 宽屏上排成 3 列 × 2 行（53px）—— 六个维度之间是并列关系，
 * 分成两行读不会有任何歧义。窄屏仍然一列，横向空间不够时排队比挤好。 */
.traits {
  display: grid;
  gap: 9px 22px;
  max-width: 380px;
}
@media (min-width: 720px) {
  .traits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 560px;
  }
}
.traits__row {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  align-items: center;
  gap: 12px;
}
.traits__name {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-2, var(--ink));
}
.traits__bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--line-2, var(--line));
  overflow: hidden;
}
.traits__bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pa, var(--pink)), var(--pb, var(--pink-2)));
  /* 三档之间长度差 33%，不做缓动的话读起来像"跳"，加一点点 */
  transition: width 0.5s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .traits__bar > i { transition: none; }
}

/* ---------------------------------------------------------------
   阅读进度 + 回到顶部

   这条页面在手机上 9.7 屏高（约 8700px），滚到一半不知道还剩多少。
   进度条回答"我走到哪了"，回到顶部回答"怎么回去"。
   --------------------------------------------------------------- */

.readbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}
.readbar__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pa, var(--pink)), var(--pb, var(--pink-2)));
  /* width 而不是 transform:scaleX —— 2px 高的线上 scale 会有亚像素抖动，
     滚动时看着像在抖。这条线本来就便宜，性能不是瓶颈。 */
  transition: width 0.1s linear;
}

.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 55;
  display: grid;
  place-items: center;
  width: 44px; /* 触控区下限 */
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s;
  animation: pop-in 0.25s var(--ease);
}
.to-top:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  color: var(--pink-2);
}
.to-top:focus-visible {
  outline: 2px solid var(--pink-2);
  outline-offset: 3px;
}
.to-top[hidden] { display: none; }
[data-theme='dark'] .to-top:hover { color: var(--pink-ink); }
[data-theme='dark'] .to-top:focus-visible { outline-color: var(--pink-ink); }

@media (prefers-reduced-motion: reduce) {
  .readbar__fill { transition: none; }
  .to-top { animation: none; }
  .to-top:hover { transform: none; }
}

/* ---------------------------------------------------------------
   弹窗分层：把「查资料时才要的」收进 details

   加了台词之后，弹窗在手机上正好占满一屏（内容 1272px vs 视口 844px）。
   但真正要看的是"她是谁 / 她说什么 / 她的故事"，
   "画师 / 授权 / 六维性格 / 和谁有关"属于查资料时才翻的部分。

   用原生 <details>：键盘能开、读屏会念展开状态、不用写折叠 JS。
   --------------------------------------------------------------- */

.detail__more {
  margin: 0.2rem 0 0.6rem;
  border-top: 1px dashed var(--line-2);
  border-bottom: 1px dashed var(--line-2);
}

.detail__moreSummary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--ink-2);
  list-style: none; /* 去掉默认三角，自己画一个 */
  transition: color 0.2s;
}
.detail__moreSummary::-webkit-details-marker { display: none; }
.detail__moreSummary::before {
  content: '›';
  display: inline-block;
  width: 1em;
  color: var(--ink-3);
  transition: transform 0.2s var(--ease);
  transform-origin: 50% 50%;
}
.detail__more[open] > .detail__moreSummary::before { transform: rotate(90deg); }
.detail__moreSummary:hover { color: var(--ink); }
.detail__moreSummary:focus-visible {
  outline: 2px solid var(--pink-2);
  outline-offset: 2px;
  border-radius: 4px;
}
.detail__moreHint {
  color: var(--ink-3);
  font-size: 0.74rem;
}
.detail__more[open] .detail__moreHint { display: none; }

/* 展开后里面的块不要再多出一层虚线分隔 */
.detail__more > .detail__meta,
.detail__more > .detail__traits,
.detail__more > .detail__rels {
  margin-top: 0.5rem;
  margin-bottom: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .detail__moreSummary::before { transition: none; }
}

/* ---------------------------------------------------------------
   404 页的人物推荐

   迷路的人只看一句"页面被风吹走了"就没事可做了。这里列出 12 位居民，
   点谁都有一条路可走 —— 比两个按钮更能把人留住。
   --------------------------------------------------------------- */

.lost {
  margin-top: 2rem;
  width: 100%;
}
.lost[hidden] { display: none; }

.lost__label {
  margin: 0 0 0.85rem;
  font-size: 0.76rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.lost__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 10px;
}

.lost__card {
  display: grid;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.lost__card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 9px;
}
.lost__name {
  font-size: 0.72rem;
  color: var(--ink-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lost__card:hover,
.lost__card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--pink-2) 45%, var(--line));
  box-shadow: var(--shadow-sm);
}
.lost__card:focus-visible {
  outline: 2px solid var(--pink-2);
  outline-offset: 2px;
}
.lost__card:hover .lost__name { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .lost__card { transition: none; }
  .lost__card:hover { transform: none; }
}
