/* ===================================================================
   嘉兴古建·时光解码 · 一期「时光长河」
   视觉系统见 DESIGN.md。配色 OKLCH（附 hex 兜底，老引擎可读）。
   =================================================================== */

:root {
  /* —— 绢底（冷青灰，刻意避开暖米/奶油） —— */
  --paper: #edf1ee;            --paper: oklch(0.949 0.007 150);
  --paper-2: #e3e7e3;          --paper-2: oklch(0.924 0.009 150);
  --paper-sink: #d8ddd8;       --paper-sink: oklch(0.893 0.012 150);
  --hair: #c5cbc5;             --hair: oklch(0.838 0.013 150);

  /* —— 墨黛文字 —— */
  --ink: #22272e;             --ink: oklch(0.255 0.018 235);
  --ink-2: #5a626b;           --ink-2: oklch(0.438 0.020 230);

  /* —— 黛青（主色 / 结构） —— */
  --dai: #305a6b;             --dai: oklch(0.404 0.060 222);
  --dai-deep: #1f3742;        --dai-deep: oklch(0.262 0.045 230);
  --ink-hero: #1a2330;        --ink-hero: oklch(0.205 0.024 235);

  /* —— 时光琥珀（长河主线 / 年代 / active；brand seed） —— */
  --amber: #d98a3c;           --amber: oklch(0.700 0.130 60);
  --amber-soft: #e7b27e;      --amber-soft: oklch(0.800 0.090 65);
  --amber-deep: #936020;      --amber-deep: oklch(0.505 0.115 58);

  /* —— 青瓷（水 / 次强调） —— */
  --celadon: #5f928a;         --celadon: oklch(0.620 0.055 175);
  --celadon-deep: #356a68;    --celadon-deep: oklch(0.452 0.060 185);

  /* —— 字族 —— */
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  /* —— 间距 / 圆角 / 阴影 —— */
  --r-sm: 6px; --r-md: 12px; --r-lg: 18px;
  --shadow-card: 0 1px 2px rgba(26, 35, 48, 0.05), 0 14px 32px -18px rgba(26, 35, 48, 0.28);
  --shadow-pop: 0 24px 60px -22px rgba(26, 35, 48, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quint 风格 */

  /* —— z 轴语义层级 —— */
  --z-river: 1; --z-content: 2; --z-rail: 5;
  --z-backdrop: 50; --z-dialog: 60; --z-toast: 70;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--paper);
  /* 绢纹：极细的双向网与河面微光，低饱和不喧宾夺主 */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(95, 146, 138, 0.06), transparent 42%),
    radial-gradient(circle at 86% 78%, rgba(217, 138, 60, 0.05), transparent 44%);
  background-attachment: fixed;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(217, 138, 60, 0.24); color: var(--ink); }

a { color: var(--celadon-deep); text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===================== HERO 暗带 ===================== */
.hero {
  position: relative;
  overflow: hidden;
  color: #e9ede9;
  background:
    radial-gradient(ellipse 120% 90% at 50% -30%, rgba(95, 146, 138, 0.16), transparent 55%),
    radial-gradient(ellipse 80% 60% at 80% 120%, rgba(217, 138, 60, 0.14), transparent 50%),
    linear-gradient(180deg, var(--ink-hero), var(--dai-deep) 120%);
  padding: clamp(3.5rem, 9vh, 7rem) clamp(1.25rem, 5vw, 4rem) clamp(7rem, 14vh, 11rem);
}
.hero__inner { max-width: 64rem; margin: 0 auto; position: relative; z-index: var(--z-content); }

.hero__kicker {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--amber-soft);
  margin: 0 0 1.1rem;
}
.hero__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: 0.03em;
  margin: 0;
  text-wrap: balance;
}
.hero__title .glow { color: var(--amber); }
.hero__subtitle {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  color: #cdd6d2;
  margin: 1rem 0 0;
  letter-spacing: 0.04em;
}
.hero__intro {
  max-width: 38em;
  margin: 1.6rem 0 0;
  color: #b9c3bf;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  text-wrap: pretty;
}
.hero__thread {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem;
  margin: 2rem 0 0; padding: 0; list-style: none;
}
.hero__thread li {
  font-size: 0.8rem; letter-spacing: 0.1em; color: #9fb0ab;
  display: flex; align-items: center; gap: 0.9rem;
}
.hero__thread li::after { content: "→"; color: rgba(217, 138, 60, 0.6); }
.hero__thread li:last-child::after { content: ""; }

.hero__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 2.2rem 0 0; }
.hero__enter {
  display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none;
  font-family: var(--font-serif); font-weight: 700; font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  color: #1a2330; background: linear-gradient(135deg, var(--amber-soft), var(--amber));
  padding: 0.8rem 1.5rem; border-radius: 999px; letter-spacing: 0.04em;
  box-shadow: 0 12px 30px -10px rgba(217, 138, 60, 0.6); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.hero__enter span { transition: transform 0.3s var(--ease); }
.hero__enter:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(217, 138, 60, 0.7); }
.hero__enter:hover span { transform: translateX(4px); }
.hero__enter-note { font-size: 0.82rem; color: #9fb0ab; letter-spacing: 0.06em; }

/* hero 里的琥珀长河缎带 */
.hero__river { position: absolute; inset: auto 0 -1px 0; width: 100%; height: 130px; z-index: var(--z-river); display: block; }
.hero__river path { fill: none; stroke-linecap: round; }
.hero__river .flow {
  stroke: url(#heroAmber); stroke-width: 3;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: draw 2.6s var(--ease) 0.3s forwards;
}
.hero__river .flow-soft { stroke: rgba(231, 178, 126, 0.25); stroke-width: 8; filter: blur(2px); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(1.5rem, 4vh, 3rem);
  transform: translateX(-50%); z-index: var(--z-content);
  color: #9fb0ab; font-size: 0.76rem; letter-spacing: 0.2em;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.scroll-cue::after {
  content: ""; width: 1px; height: 38px;
  background: linear-gradient(var(--amber-soft), transparent);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: scaleY(0.3); transform-origin: top; } 40% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); transform-origin: top; } }

/* ===================== 时代导览 rail（桌面 sticky） ===================== */
.era-rail {
  position: sticky; top: 0; z-index: var(--z-rail);
  display: none;
}
@media (min-width: 1400px) {
  .era-rail {
    display: flex; flex-direction: column; gap: 0.2rem;
    position: fixed; left: clamp(1rem, 3vw, 2.4rem); top: 50%; transform: translateY(-50%);
  }
  .era-rail__item {
    display: flex; align-items: center; gap: 0.7rem;
    background: none; border: 0; cursor: pointer;
    font-family: var(--font-sans); color: var(--ink-2);
    font-size: 0.78rem; letter-spacing: 0.08em; padding: 0.32rem 0;
    opacity: 0.55; transition: opacity 0.4s var(--ease), color 0.4s var(--ease);
  }
  .era-rail__item .tick {
    width: 18px; height: 1.5px; background: var(--hair);
    transition: width 0.4s var(--ease), background 0.4s var(--ease);
  }
  .era-rail__item:hover { opacity: 1; }
  .era-rail__item.is-active { opacity: 1; color: var(--ink); }
  .era-rail__item.is-active .tick { width: 34px; background: var(--amber); }
}

/* ===================== 长河主轴 + 节点 ===================== */
.river-scroll {
  position: relative;
  max-width: 70rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) clamp(1.1rem, 4vw, 2.5rem) 2rem;
}

.river-intro {
  text-align: center; max-width: 34em; margin: 0 auto clamp(2.5rem, 6vh, 4.5rem);
}
.river-intro h2 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: 0.04em;
  margin: 0 0 0.7rem; text-wrap: balance;
}
.river-intro p { color: var(--ink-2); margin: 0; }

/* 河：节点列表的中轴 */
.stations { list-style: none; margin: 0; padding: 0; position: relative; }
.stations::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; transform: translateX(-50%); z-index: var(--z-river);
  background:
    linear-gradient(180deg, transparent, var(--amber) 4%, var(--amber-deep) 50%, var(--amber) 96%, transparent);
  border-radius: 3px;
  box-shadow: 0 0 18px rgba(217, 138, 60, 0.28);
}
/* 河面微光：缓缓向下流动 */
.stations::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; transform: translateX(-50%); z-index: var(--z-river);
  background: linear-gradient(180deg, transparent 0%, rgba(255, 244, 222, 0.85) 8%, transparent 16%);
  background-size: 100% 280px; opacity: 0.7;
  animation: flow 5.5s linear infinite;
  pointer-events: none;
}
@keyframes flow { from { background-position: 0 -280px; } to { background-position: 0 100%; } }

.station {
  position: relative; z-index: var(--z-content);
  display: grid;
  grid-template-columns: 1fr 96px 1fr;
  align-items: center;
  margin: clamp(2.2rem, 6vh, 4.5rem) 0;
}

/* 河埠：年代 + 节点珠 */
.station__axis {
  grid-column: 2; justify-self: center; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.station__year {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 1.02rem; color: var(--amber-deep); letter-spacing: 0.02em;
  white-space: nowrap;
}
.station__bead {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--amber);
  box-shadow: 0 0 0 5px rgba(217, 138, 60, 0.12), 0 0 16px rgba(217, 138, 60, 0.4);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.station.is-decoded .station__bead {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(217, 138, 60, 0.2), 0 0 20px rgba(217, 138, 60, 0.6);
}

/* 卡片 */
.station__card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease), border-color 0.55s var(--ease);
  max-width: 30rem;
}
.station.left .station__card { grid-column: 1; justify-self: end; }
.station.right .station__card { grid-column: 3; justify-self: start; }

/* 支流连接线 */
.station__card::after {
  content: ""; position: absolute; top: 50%; width: clamp(14px, 4vw, 40px); height: 1.5px;
  background: linear-gradient(90deg, var(--amber), transparent);
}
.station.left .station__card::after { right: calc(-1 * clamp(14px, 4vw, 40px)); background: linear-gradient(270deg, var(--amber), transparent); }
.station.right .station__card::after { left: calc(-1 * clamp(14px, 4vw, 40px)); }

.station__card:hover, .station__card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
  border-color: rgba(217, 138, 60, 0.5);
  outline: none;
}
.station__card:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.station__chapter {
  font-family: var(--font-sans); font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.22em; color: var(--celadon-deep); margin: 0 0 0.5rem;
}
.station__name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin: 0; color: var(--ink);
  letter-spacing: 0.02em; text-wrap: balance;
}
.station__era { font-size: 0.82rem; color: var(--ink-2); margin: 0.25rem 0 0; }
.station__lede {
  font-family: var(--font-serif); font-size: 1rem; color: var(--dai);
  margin: 0.9rem 0 0; line-height: 1.7; text-wrap: pretty;
}
.station__cta {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin-top: 1rem; font-size: 0.86rem; font-weight: 700; color: var(--amber-deep);
  letter-spacing: 0.06em;
}
.station__cta .arr { transition: transform 0.4s var(--ease); }
.station__card:hover .station__cta .arr { transform: translateX(4px); }

/* —— relic 影像框（含母题 + 预留照片位） —— */
.relic { margin: 0 0 1.1rem; }
.relic__frame {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--r-md);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(95, 146, 138, 0.12), transparent 70%),
    linear-gradient(160deg, var(--paper-sink), var(--paper-2));
  border: 1px solid var(--hair);
  /* 胶片框：四角刻度 */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 0 40px rgba(26, 35, 48, 0.06);
  display: grid; place-items: center;
}
.relic__frame::before, .relic__frame::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 1.5px solid rgba(48, 90, 107, 0.4);
}
.relic__frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.relic__frame::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.relic__motif { width: 56%; height: 56%; color: var(--dai); opacity: 0.78; }
.relic__motif path, .relic__motif line, .relic__motif circle, .relic__motif polyline, .relic__motif rect { vector-effect: non-scaling-stroke; }
.relic__wm {
  position: absolute; bottom: 8px; left: 10px;
  font-size: 0.66rem; letter-spacing: 0.18em; color: var(--ink-2);
  background: rgba(237, 241, 238, 0.7); padding: 1px 7px; border-radius: 999px;
}
.relic__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.relic.has-photo .relic__photo { display: block; }
.relic.has-photo .relic__motif, .relic.has-photo .relic__wm { display: none; }

/* —— 速览 chips —— */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.chip {
  font-size: 0.74rem; color: var(--dai); background: rgba(48, 90, 107, 0.08);
  border: 1px solid rgba(48, 90, 107, 0.16); border-radius: 999px;
  padding: 0.2rem 0.7rem; letter-spacing: 0.02em;
}

/* ===================== 解码面板 dialog ===================== */
dialog.decode {
  width: min(680px, 92vw); max-height: 90vh; padding: 0; border: none;
  border-radius: var(--r-lg); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-pop); overflow: hidden;
}
dialog.decode::backdrop {
  background: rgba(26, 35, 48, 0.5);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.decode__scroll { max-height: 90vh; overflow-y: auto; }

.decode__hero {
  position: relative; padding: 1.5rem 1.6rem 1.3rem;
  color: #e9ede9;
  background: linear-gradient(165deg, var(--ink-hero), var(--dai-deep));
}
.decode__chapter { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.24em; color: var(--amber-soft); margin: 0 0 0.5rem; }
.decode__title { font-family: var(--font-serif); font-weight: 700; font-size: clamp(1.5rem, 4vw, 2rem); margin: 0; letter-spacing: 0.02em; }
.decode__era { font-size: 0.86rem; color: #c4cdc9; margin: 0.35rem 0 0; }
.decode__lede { font-family: var(--font-serif); font-size: 1rem; color: var(--amber-soft); margin: 0.9rem 0 0; }
.decode__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e9ede9; font-size: 1.2rem; line-height: 1; display: grid; place-items: center;
  transition: background 0.3s var(--ease);
}
.decode__close:hover { background: rgba(255, 255, 255, 0.22); }

.decode__body { padding: 1.4rem 1.6rem 1.7rem; }

/* tabs */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--hair); margin: 0 0 1.2rem; }
.tab {
  background: none; border: 0; cursor: pointer; font-family: var(--font-sans);
  font-size: 0.92rem; font-weight: 600; color: var(--ink-2); padding: 0.6rem 0.9rem;
  position: relative; letter-spacing: 0.05em; transition: color 0.3s var(--ease);
}
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0.6rem; right: 0.6rem; bottom: -1px; height: 2.5px;
  background: var(--amber); border-radius: 3px;
}
.tabpanel { font-size: 0.98rem; color: var(--ink); line-height: 1.92; text-wrap: pretty; }
.tabpanel[hidden] { display: none; }

.decode__facts { margin: 1.3rem 0 0; }
.decode__facts h4, .decode__ask h4, .decode__sources h4 {
  font-family: var(--font-sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em;
  color: var(--ink-2); margin: 0 0 0.7rem; text-transform: none;
}

/* 追问 */
.decode__ask { margin: 1.6rem 0 0; padding: 1.2rem; background: var(--paper-2); border: 1px solid var(--hair); border-radius: var(--r-md); }
.ask-form { display: flex; gap: 0.55rem; }
.ask-input {
  flex: 1; font-family: var(--font-sans); font-size: 0.95rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-sm);
  padding: 0.65rem 0.85rem; transition: border-color 0.3s var(--ease);
}
.ask-input::placeholder { color: var(--ink-2); }
.ask-input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(217, 138, 60, 0.16); }

.btn {
  font-family: var(--font-sans); font-weight: 700; cursor: pointer;
  border-radius: var(--r-sm); padding: 0.65rem 1.1rem; font-size: 0.92rem;
  border: 1px solid transparent; transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
  letter-spacing: 0.04em; white-space: nowrap;
}
.btn--primary { background: var(--dai); color: #eef3f1; box-shadow: 0 6px 16px -8px rgba(48, 90, 107, 0.7); }
.btn--primary:hover { background: var(--dai-deep); transform: translateY(-1px); }
.btn--primary:disabled { opacity: 0.55; cursor: default; transform: none; }

.ask-suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0 0; }
.ask-suggestion {
  font-size: 0.78rem; color: var(--celadon-deep); cursor: pointer;
  background: rgba(95, 146, 138, 0.1); border: 1px solid rgba(95, 146, 138, 0.22);
  border-radius: 999px; padding: 0.25rem 0.75rem; transition: background 0.3s var(--ease);
}
.ask-suggestion:hover { background: rgba(95, 146, 138, 0.2); }

.ask-answer { margin: 1.1rem 0 0; }
.ask-answer[hidden] { display: none; }
.ask-badge {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; padding: 0.2rem 0.65rem; border-radius: 999px; margin-bottom: 0.6rem;
}
.ask-badge.is-llm { color: var(--amber-deep); background: rgba(217, 138, 60, 0.12); border: 1px solid rgba(217, 138, 60, 0.3); }
.ask-badge.is-offline { color: var(--celadon-deep); background: rgba(95, 146, 138, 0.12); border: 1px solid rgba(95, 146, 138, 0.3); }
.ask-answer__text { font-size: 0.97rem; line-height: 1.92; color: var(--ink); white-space: pre-wrap; text-wrap: pretty; }
.ask-answer__text p { margin: 0 0 0.8rem; }

.ask-loading { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink-2); font-size: 0.9rem; }
.ask-loading .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: pulse 1.1s var(--ease) infinite; }
.ask-loading .dot:nth-child(2) { animation-delay: 0.18s; }
.ask-loading .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

/* 来源 */
.decode__sources { margin: 1.5rem 0 0; }
.source-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.source-list a {
  display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.84rem;
  color: var(--celadon-deep); text-decoration: none; padding: 0.5rem 0.7rem;
  background: var(--paper-2); border: 1px solid var(--hair); border-radius: var(--r-sm);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.source-list a:hover { border-color: var(--celadon); background: rgba(95, 146, 138, 0.08); }
.source-list a .num { font-family: var(--font-serif); color: var(--amber-deep); font-weight: 700; }
.source-list a .ext { margin-left: auto; opacity: 0.5; }

.related { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; }
.related-chip {
  font-size: 0.78rem; cursor: pointer; color: var(--dai); background: none;
  border: 1px dashed var(--hair); border-radius: 999px; padding: 0.25rem 0.75rem;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.related-chip:hover { border-color: var(--amber); color: var(--amber-deep); }

/* ===================== 页脚 + 图鉴 ===================== */
.footer {
  margin-top: clamp(3rem, 8vh, 6rem);
  background: var(--paper-sink); border-top: 1px solid var(--hair);
  padding: clamp(2.5rem, 6vh, 4rem) clamp(1.25rem, 5vw, 4rem);
}
.footer__inner { max-width: 64rem; margin: 0 auto; display: grid; gap: 1.6rem; }

.codex {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  padding: 1.1rem 1.3rem; background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-md);
}
.codex__label { font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; }
.codex__bar { flex: 1; min-width: 160px; height: 8px; border-radius: 999px; background: var(--paper-sink); overflow: hidden; }
.codex__fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--amber-deep), var(--amber)); transition: width 0.8s var(--ease); }
.codex__count { font-family: var(--font-serif); color: var(--amber-deep); font-weight: 700; }
.codex__count b { font-size: 1.3rem; }

.footer__notes { color: var(--ink-2); font-size: 0.84rem; line-height: 1.8; }
.footer__notes strong { color: var(--ink); }
.footer__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: 0.8rem; color: var(--ink-2); }
.footer__meta .phase { color: var(--celadon-deep); }

/* ===================== toast ===================== */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 1.5rem);
  z-index: var(--z-toast); background: var(--ink); color: var(--paper);
  padding: 0.7rem 1.2rem; border-radius: 999px; font-size: 0.86rem;
  box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== 进场动效（默认即可见，仅作增强） ===================== */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0.001; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* ===================== 响应式 ===================== */
@media (max-width: 760px) {
  .station {
    grid-template-columns: 54px 1fr;
    margin: clamp(1.8rem, 5vh, 3rem) 0;
  }
  .stations::before, .stations::after { left: 27px; }
  .station__axis { grid-column: 1; }
  .station__year { font-size: 0.84rem; writing-mode: vertical-rl; letter-spacing: 0.04em; }
  .station.left .station__card,
  .station.right .station__card { grid-column: 2; justify-self: stretch; max-width: none; }
  .station__card::after,
  .station.left .station__card::after,
  .station.right .station__card::after {
    left: calc(-1 * clamp(12px, 5vw, 22px)); right: auto;
    background: linear-gradient(90deg, var(--amber), transparent);
    width: clamp(12px, 5vw, 22px);
  }
  .ask-form { flex-direction: column; }
  .btn--primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__river .flow { animation: none; stroke-dashoffset: 0; }
  .stations::after, .scroll-cue::after, .ask-loading .dot, .codex__fill { animation: none; }
  .codex__fill { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* ===================================================================
   照片署名 · 图鉴文脉值
   =================================================================== */
.relic__credit { position: absolute; bottom: 6px; right: 8px; display: none;
  font-size: 0.62rem; letter-spacing: 0.02em; color: #eef3f1;
  background: rgba(26, 35, 48, 0.55); padding: 2px 7px; border-radius: 999px;
  max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relic.has-photo .relic__credit { display: block; }
.relic__credit a { color: #eef3f1; text-decoration: none; }
.relic__credit a:hover { text-decoration: underline; }
.codex__points { font-size: 0.84rem; color: var(--ink-2); }
.codex__points b { font-family: var(--font-serif); color: var(--amber-deep); font-size: 1.05rem; }

.btn--ghost { background: transparent; color: var(--dai); border: 1px solid var(--hair); }
.btn--ghost:hover { background: var(--paper-2); border-color: var(--dai); }

/* ===================================================================
   时光雅集 · 互动区
   =================================================================== */
.arcade {
  border-top: 1px solid var(--hair);
  background:
    radial-gradient(ellipse 80% 60% at 80% 0%, rgba(217, 138, 60, 0.05), transparent 55%),
    var(--paper-sink);
  padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 5vw, 4rem);
}
.arcade__inner { max-width: 64rem; margin: 0 auto; }
.arcade__head { text-align: center; max-width: 40em; margin: 0 auto clamp(2rem, 5vh, 3rem); }
.arcade__kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.28em; color: var(--celadon-deep); margin: 0 0 0.7rem; }
.arcade__title { font-family: var(--font-serif); font-weight: 700; font-size: clamp(1.5rem, 3.6vw, 2.2rem); margin: 0; letter-spacing: 0.03em; text-wrap: balance; }
.arcade__intro { color: var(--ink-2); margin: 0.9rem 0 0; text-wrap: pretty; }

.arcade__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.game-card {
  background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: clamp(1.3rem, 2.6vw, 1.8rem); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); border-color: rgba(217, 138, 60, 0.4); }
.game-card__icon { width: 64px; height: 64px; color: var(--amber-deep); }
.game-card__icon .mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 100%; height: 100%; }
.game-card__icon .mini-grid span { display: block; }
.game-card__title { font-family: var(--font-serif); font-weight: 700; font-size: 1.3rem; margin: 0.3rem 0 0; }
.game-card__desc { color: var(--ink-2); font-size: 0.92rem; margin: 0; flex: 1; }
.game-card__meta { font-size: 0.82rem; color: var(--ink-2); }
.game-card__meta b { font-family: var(--font-serif); color: var(--amber-deep); }
.game-card .btn { align-self: flex-start; margin-top: 0.4rem; }

/* 成就墙 */
.achievements { margin: clamp(2rem, 5vh, 3rem) 0 0; padding: clamp(1.3rem, 3vw, 1.8rem);
  background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-lg); }
.achievements__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.2rem; }
.achievements__head h3 { font-family: var(--font-serif); font-size: 1.3rem; margin: 0; }
.achievements__points { font-size: 0.86rem; color: var(--ink-2); }
.achievements__points b { font-family: var(--font-serif); color: var(--amber-deep); }
.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
.badge {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.6rem;
  align-items: center; padding: 0.7rem 0.85rem; border-radius: var(--r-md);
  background: var(--paper-2); border: 1px solid var(--hair); opacity: 0.62; transition: opacity 0.4s var(--ease), border-color 0.4s var(--ease);
}
.badge.is-got { opacity: 1; border-color: rgba(217, 138, 60, 0.5); background: rgba(217, 138, 60, 0.07); }
.badge__seal { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  font-size: 0.9rem; color: var(--ink-2); background: var(--paper-sink); }
.badge.is-got .badge__seal { color: #fff; background: var(--amber); box-shadow: 0 0 14px rgba(217, 138, 60, 0.5); }
.badge__name { font-family: var(--font-serif); font-weight: 700; font-size: 0.95rem; }
.badge.is-got .badge__name { color: var(--ink); }
.badge__desc { grid-column: 2; font-size: 0.72rem; color: var(--ink-2); line-height: 1.4; }

/* ===================================================================
   游戏对话框（与解码面板同语言）
   =================================================================== */
dialog.game-dialog {
  width: min(640px, 94vw); max-height: 92vh; padding: 0; border: none; border-radius: var(--r-lg);
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); overflow: hidden;
}
dialog.game-dialog::backdrop { background: rgba(26, 35, 48, 0.5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.game-dialog__scroll { max-height: 92vh; overflow-y: auto; }
.game-dialog__head { position: relative; padding: 1.4rem 1.6rem; color: #e9ede9;
  background: linear-gradient(165deg, var(--ink-hero), var(--dai-deep)); display: flex; }
.game-dialog__kicker { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.24em; color: var(--amber-soft); margin: 0 0 0.4rem; }
.game-dialog__title { font-family: var(--font-serif); font-weight: 700; font-size: clamp(1.4rem, 3.6vw, 1.8rem); margin: 0; }
.game-dialog__sub { font-size: 0.86rem; color: #c4cdc9; margin: 0.3rem 0 0; }
.game-dialog__close { position: absolute; top: 1rem; right: 1rem; width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e9ede9; font-size: 1.2rem; display: grid; place-items: center; transition: background 0.3s var(--ease); }
.game-dialog__close:hover { background: rgba(255, 255, 255, 0.22); }
.game-dialog__body { padding: 1.4rem 1.6rem 1.8rem; }

/* —— 时光问答 —— */
.quiz__bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-size: 0.84rem; color: var(--ink-2); }
.quiz__bar b { font-family: var(--font-serif); color: var(--ink); }
.quiz__streak { color: var(--amber-deep); font-weight: 700; }
.quiz__track { height: 5px; border-radius: 999px; background: var(--paper-sink); margin: 0.7rem 0 1.3rem; overflow: hidden; }
.quiz__track-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--amber-deep), var(--amber)); transition: width 0.4s var(--ease); }
.quiz__q { font-family: var(--font-serif); font-weight: 700; font-size: 1.2rem; line-height: 1.6; margin: 0 0 1.2rem; text-wrap: balance; }
.quiz__opts { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz__opt { display: flex; align-items: center; gap: 0.7rem; text-align: left; cursor: pointer;
  font-family: var(--font-sans); font-size: 0.98rem; color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--hair); border-radius: var(--r-md); padding: 0.8rem 1rem; transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease); }
.quiz__opt:hover:not(:disabled) { border-color: var(--amber); transform: translateX(3px); }
.quiz__opt:disabled { cursor: default; }
.quiz__opt-key { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-serif); font-weight: 700; font-size: 0.82rem; color: var(--dai); background: var(--paper-sink); }
.quiz__opt.is-right { border-color: var(--celadon); background: rgba(95, 146, 138, 0.14); }
.quiz__opt.is-right .quiz__opt-key { background: var(--celadon-deep); color: #fff; }
.quiz__opt.is-wrong { border-color: #b06a4e; background: rgba(176, 106, 78, 0.12); }
.quiz__opt.is-wrong .quiz__opt-key { background: #b06a4e; color: #fff; }
.quiz__feedback { margin: 1.1rem 0 0; padding: 0.9rem 1.1rem; border-radius: var(--r-md); display: flex; flex-direction: column; gap: 0.35rem; }
.quiz__feedback.is-right { background: rgba(95, 146, 138, 0.1); border: 1px solid rgba(95, 146, 138, 0.3); }
.quiz__feedback.is-wrong { background: rgba(176, 106, 78, 0.08); border: 1px solid rgba(176, 106, 78, 0.3); }
.quiz__feedback b { font-size: 0.92rem; }
.quiz__feedback span { font-size: 0.86rem; color: var(--ink-2); line-height: 1.7; }
.quiz__actions { margin: 1.2rem 0 0; display: flex; justify-content: flex-end; }

.quiz-result { text-align: center; padding: 1.5rem 0; }
.quiz-result__grade { font-family: var(--font-serif); font-weight: 900; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--amber-deep); margin: 0; letter-spacing: 0.06em; }
.quiz-result__line { font-size: 1.05rem; margin: 0.8rem 0 0; }
.quiz-result__line b, .quiz-result__best b { font-family: var(--font-serif); color: var(--dai); }
.quiz-result__best { color: var(--ink-2); font-size: 0.88rem; margin: 0.4rem 0 0; }
.quiz-result__btns { display: flex; gap: 0.7rem; justify-content: center; margin: 1.6rem 0 0; }

/* —— 文脉消消乐 —— */
.m3__bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-2); margin: 0 0 0.9rem; }
.m3__bar b { font-family: var(--font-serif); color: var(--ink); font-size: 1.05rem; }
.m3__hint { margin-left: auto; font-size: 0.78rem; }
.m3__board { display: grid; gap: 5px; max-width: 420px; margin: 0 auto; }
.m3-cell { aspect-ratio: 1; border: none; border-radius: 10px; cursor: pointer; padding: 14%;
  background: var(--paper-2); /* 兜底：不支持 color-mix 的旧引擎 */
  background: color-mix(in oklab, var(--gem) 16%, var(--paper)); color: var(--gem);
  box-shadow: inset 0 0 0 1px var(--hair);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gem) 30%, transparent);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.m3-cell:hover { transform: scale(1.05); }
.m3-cell.is-sel { box-shadow: 0 0 0 3px var(--amber), 0 0 14px rgba(217, 138, 60, 0.5); transform: scale(1.08); }
.m3-cell.is-clear { animation: m3clear 0.2s var(--ease) forwards; }
.m3-cell.is-empty { background: transparent; box-shadow: none; }
.m3-cell__gem { display: block; width: 100%; height: 100%; }
@keyframes m3clear { to { transform: scale(0.2); opacity: 0; } }
.m3__toast { margin: 0.9rem auto 0; text-align: center; font-size: 0.86rem; font-weight: 700; padding: 0.5rem 0.9rem; border-radius: 999px; max-width: max-content; }
.m3__toast.is-ok { color: var(--celadon-deep); background: rgba(95, 146, 138, 0.14); }
.m3__toast.is-no { color: #8a4f38; background: rgba(176, 106, 78, 0.14); }

.m3-bonus { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 1.2rem;
  background: rgba(26, 35, 48, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); border-radius: var(--r-lg); }
.m3-bonus__card { background: var(--paper); border-radius: var(--r-lg); padding: 1.4rem; max-width: 420px; width: 100%; box-shadow: var(--shadow-pop); }
.m3-bonus__tag { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; color: var(--amber-deep); margin: 0 0 0.6rem; }
.m3-bonus__card h4 { font-family: var(--font-serif); font-size: 1.1rem; margin: 0 0 1rem; line-height: 1.55; }
.m3-bonus__opts { display: grid; gap: 0.5rem; }
.m3-bonus__opts button { text-align: left; cursor: pointer; font-family: var(--font-sans); font-size: 0.92rem; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 0.6rem 0.85rem; transition: border-color 0.2s var(--ease); }
.m3-bonus__opts button:hover:not(:disabled) { border-color: var(--amber); }
.m3-bonus__opts button.ok { border-color: var(--celadon); background: rgba(95, 146, 138, 0.14); }
.m3-bonus__opts button.no { border-color: #b06a4e; background: rgba(176, 106, 78, 0.12); }
.game-dialog__body { position: relative; }

/* ③ 时光奔跑（跑酷） */
.run { display: flex; flex-direction: column; gap: 0.9rem; }
.run__hud { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--ink-2); }
.run__hud b { color: var(--ink); font-size: 1.05rem; }
.run__spd { font-size: 0.78rem; letter-spacing: 0.04em; color: var(--amber-deep); }
.run__stage { position: relative; width: 100%; height: 300px; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); background: var(--paper-2); }
.run__canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; cursor: pointer; }
.run__tip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; padding: 0.3rem 0.85rem; font-size: 0.8rem; color: var(--ink-2); background: rgba(237, 241, 238, 0.84); border-radius: 999px; pointer-events: none; transition: opacity 0.4s var(--ease); }
.run__tip.is-hidden { opacity: 0; }
.run-ov { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 1.2rem; background: rgba(26, 35, 48, 0.34); }
.run-ov__card { background: var(--paper); border-radius: var(--r-lg); padding: 1.4rem 1.5rem; max-width: 440px; width: 100%; box-shadow: var(--shadow-pop); text-align: left; }
.run-ov__tag { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; color: var(--amber-deep); margin: 0 0 0.6rem; }
.run-ov__tag--warn { color: #b06a4e; }
.run-ov__fact { font-family: var(--font-serif); font-size: 1.04rem; line-height: 1.7; margin: 0 0 1.1rem; color: var(--ink); }
.run-ov__q { font-family: var(--font-serif); font-size: 1.06rem; margin: 0 0 0.9rem; line-height: 1.55; }
.run-ov__skip { margin: 0.85rem 0 0; text-align: center; }
.run-ov .m3-bonus__opts { display: grid; gap: 0.5rem; }

/* ===== 吉祥物 嘉禾 ===== */
.jiahe { position: fixed; right: 20px; bottom: 18px; width: 92px; z-index: 45; cursor: pointer; -webkit-user-select: none; user-select: none; }
.jiahe-svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 16px rgba(26, 35, 48, 0.25)); animation: jiahe-bob 3.2s var(--ease) infinite; transform-origin: 50% 100%; }
.jiahe:hover .jiahe-svg { animation-play-state: paused; transform: translateY(-4px) scale(1.04); transition: transform 0.2s var(--ease); }
.jiahe-shadow { fill: rgba(34, 39, 46, 0.14); }
.jiahe-ear { transform-origin: 50px 36px; animation: jiahe-sway 3.6s ease-in-out infinite; }
.jiahe-eyes { animation: jiahe-blink 5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes jiahe-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes jiahe-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
@keyframes jiahe-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.12); } }
.jiahe.is-talking .jiahe-svg { animation: jiahe-talk 0.3s ease-in-out infinite; }
@keyframes jiahe-talk { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px) scale(1.015); } }
.jiahe.is-greeting .jiahe-arm--r { transform-box: fill-box; transform-origin: 25% 75%; animation: jiahe-wave 0.42s ease-in-out 3; }
@keyframes jiahe-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-24deg); } }

/* 提示气泡：升到吉祥物正上方、贴右对齐并自动换行，不再向左横铺、挡住左侧内容 */
.jiahe-tip { position: absolute; right: 0; bottom: 100%; margin-bottom: 12px; max-width: 230px; white-space: normal; text-align: left; line-height: 1.5; background: var(--paper); color: var(--ink); border: 1px solid var(--hair); border-radius: 14px; border-bottom-right-radius: 5px; padding: 0.5rem 0.8rem; font-size: 0.82rem; box-shadow: var(--shadow-card); opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.jiahe-tip::after { content: ''; position: absolute; right: 20px; bottom: -7px; width: 12px; height: 12px; background: var(--paper); border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); transform: rotate(45deg); }
.jiahe-tip.is-show { opacity: 1; transform: translateY(0); }

.jiahe-chat { position: fixed; right: 20px; bottom: 122px; width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 540px); display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); z-index: 46; overflow: hidden; opacity: 0; transform: translateY(12px) scale(0.98); transform-origin: bottom right; transition: opacity 0.22s var(--ease), transform 0.22s var(--ease); pointer-events: none; }
.jiahe-chat.is-open { opacity: 1; transform: none; pointer-events: auto; }
.jiahe-chat__head { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.85rem; background: linear-gradient(180deg, var(--paper-2), var(--paper)); border-bottom: 1px solid var(--hair); }
.jiahe-chat__face { width: 34px; height: 40px; flex: none; }
.jiahe-chat__face .jiahe-svg { animation: none; filter: none; }
.jiahe-chat__face .jiahe-shadow { display: none; }
.jiahe-chat__title { font-family: var(--font-serif); font-weight: 700; font-size: 1rem; color: var(--ink); }
.jiahe-chat__sub { font-size: 0.7rem; color: var(--ink-2); }
.jiahe-chat__sp { margin-left: auto; display: flex; gap: 0.35rem; }
.jiahe-ic { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--hair); background: var(--paper); cursor: pointer; display: grid; place-items: center; font-size: 0.9rem; line-height: 1; color: var(--ink-2); }
.jiahe-ic:hover { border-color: var(--amber); }
.jiahe-chat__body { padding: 0.8rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.55rem; }
.jiahe-msg { max-width: 88%; padding: 0.55rem 0.75rem; border-radius: 13px; font-size: 0.9rem; line-height: 1.62; white-space: pre-wrap; word-break: break-word; }
.jiahe-msg.is-bot { align-self: flex-start; background: var(--paper-2); color: var(--ink); border-bottom-left-radius: 4px; }
.jiahe-msg.is-user { align-self: flex-end; background: var(--dai); color: #fff; border-bottom-right-radius: 4px; }
/* 字幕式逐字显示：揭示中先藏来源 chip，并在末尾跟一个轻光标 */
.jiahe-msg.is-revealing .jiahe-src { display: none; }
.jiahe-msg.is-revealing .jiahe-msg__text::after { content: '▍'; margin-left: 1px; opacity: 0.5; animation: jiahe-caret 0.9s steps(1) infinite; }
@keyframes jiahe-caret { 50% { opacity: 0; } }
.jiahe-src { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }
.jiahe-src a, .jiahe-src span { font-size: 0.68rem; color: var(--dai); border: 1px solid var(--hair); border-radius: 999px; padding: 0.08rem 0.5rem; text-decoration: none; background: var(--paper); }
.jiahe-src a:hover { border-color: var(--amber); }
.jiahe-typing { align-self: flex-start; color: var(--ink-2); font-size: 0.85rem; padding: 0.2rem 0.2rem; }
.jiahe-chat__form { display: flex; gap: 0.5rem; padding: 0.65rem; border-top: 1px solid var(--hair); }
.jiahe-chat__input { flex: 1; min-width: 0; border: 1px solid var(--hair); border-radius: 999px; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.88rem; background: var(--paper); color: var(--ink); }
.jiahe-chat__input:focus { outline: none; border-color: var(--amber); }
.jiahe-chat__send { border: none; background: var(--amber); color: #3a2a12; font-weight: 700; border-radius: 999px; padding: 0.5rem 0.95rem; cursor: pointer; white-space: nowrap; }
.jiahe-chat__send:disabled { opacity: 0.5; cursor: default; }
.jiahe-chat__mic { border: 1px solid var(--hair); background: var(--paper); color: var(--dai, #305a6b); border-radius: 999px; width: 38px; flex: 0 0 38px; cursor: pointer; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; touch-action: none; transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s; }
.jiahe-chat__mic.is-rec { color: #fff; }
.ic-svg { display: block; flex: none; pointer-events: none; }
.jiahe-chat__mic:hover { background: var(--paper-2); }
.jiahe-chat__mic.is-rec { background: #e3534a; border-color: #e3534a; color: #fff; transform: scale(1.06); box-shadow: 0 0 0 4px rgba(227,83,74,0.22); animation: jiahe-recpulse 1s ease-in-out infinite; }
@keyframes jiahe-recpulse { 50% { box-shadow: 0 0 0 8px rgba(227,83,74,0.10); } }

/* 窗口内「求助嘉禾」提示 */
.jiahe-hintchip { position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 0.35rem; background: var(--amber); color: #3a2a12; border: none; border-radius: 999px; padding: 0.4rem 0.85rem 0.4rem 0.4rem; font-weight: 700; font-size: 0.84rem; cursor: pointer; box-shadow: var(--shadow-card); z-index: 6; transition: opacity 0.25s, transform 0.25s; }
.jiahe-hintchip.is-hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.jiahe-hintchip__face { width: 26px; height: 30px; display: inline-block; }
.jiahe-hintchip__face .jiahe-svg { animation: none; filter: none; }
.jiahe-hintchip__face .jiahe-shadow { display: none; }

/* 嘉禾「随身解惑」全局向导：注入弹窗右下角的可多轮对话小面板，从右侧跑进 */
/* 固定到「屏幕」右下角（不再贴弹窗内部），落在居中弹窗右侧的空白处，尽量不挡弹窗内容 */
.jiahe-guide { position: fixed; right: 16px; bottom: 16px; z-index: 8; width: min(300px, calc(100vw - 24px));
  transform: translateX(130%); opacity: 0; pointer-events: none; transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s; }
.jiahe-guide.is-in { transform: translateX(0); opacity: 1; pointer-events: auto; }
.jiahe-guide__panel { display: flex; flex-direction: column; max-height: min(62vh, 440px); background: var(--paper); border: 1px solid var(--hair); border-radius: 16px; box-shadow: var(--shadow-pop); overflow: hidden; }
.jiahe-guide__head { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; color: #eef3f1; background: linear-gradient(160deg, var(--ink-hero, #2b3a44), var(--dai-deep, #234)); }
.jiahe-guide__face { width: 34px; height: 40px; flex: none; }
.jiahe-guide__face .jiahe-shadow { display: none; }
.jiahe-guide.is-in .jiahe-guide__face { animation: jiahe-run 0.55s ease; }
.jiahe-guide__face.is-talking { animation: jiahe-talk 0.5s ease-in-out infinite; }
.jiahe-guide__title { flex: 1; font-family: var(--font-serif, serif); font-weight: 700; font-size: 0.92rem; }
.jiahe-guide__x { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; line-height: 1; font-size: 1rem; }
.jiahe-guide__x:hover { background: rgba(255, 255, 255, 0.24); }
.jiahe-guide__msgs { flex: 1; min-height: 84px; overflow-y: auto; padding: 0.7rem; display: flex; flex-direction: column; gap: 0.45rem; }
.jiahe-gmsg { max-width: 88%; padding: 0.45rem 0.66rem; border-radius: 12px; font-size: 0.85rem; line-height: 1.62; white-space: pre-wrap; word-break: break-word; }
.jiahe-gmsg.is-user { align-self: flex-end; background: var(--dai, #305a6b); color: #eef3f1; border-bottom-right-radius: 4px; }
.jiahe-gmsg.is-bot { align-self: flex-start; background: var(--paper-2, #f3ece0); color: var(--ink); border: 1px solid var(--hair); border-bottom-left-radius: 4px; }
.jiahe-gmsg.is-typing { align-self: flex-start; color: var(--ink-2); font-size: 0.82rem; }
.jiahe-guide__form { display: flex; gap: 0.4rem; padding: 0.5rem; border-top: 1px solid var(--hair); }
.jiahe-guide__mic { flex: 0 0 34px; width: 34px; border: 1px solid var(--hair); border-radius: 999px; background: var(--paper); color: var(--dai, #305a6b); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; touch-action: none; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.jiahe-guide__mic.is-rec { background: #e3534a; color: #fff; box-shadow: 0 0 0 4px rgba(227, 83, 74, 0.2); }
.jiahe-guide__input { flex: 1; min-width: 0; border: 1px solid var(--hair); border-radius: 999px; padding: 0.45rem 0.8rem; font: inherit; font-size: 0.85rem; background: var(--paper); color: var(--ink); }
.jiahe-guide__input:focus { outline: none; border-color: var(--amber); }
.jiahe-guide__send { flex: none; border: none; background: var(--amber); color: #3a2a12; font-weight: 700; border-radius: 999px; padding: 0.45rem 0.85rem; cursor: pointer; }
.jiahe-guide__send:disabled { opacity: 0.5; cursor: default; }
@keyframes jiahe-run { 0% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-6px) rotate(-6deg); } 45% { transform: translateY(0) rotate(0); } 70% { transform: translateY(-5px) rotate(6deg); } 100% { transform: translateY(0) rotate(0); } }
@keyframes jiahe-talk { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px) scale(1.05); } }

@media (max-width: 640px) {
  .jiahe { width: 72px; right: 12px; bottom: 12px; }
  .jiahe-chat { right: 12px; bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz__track-fill { transition: none; }
  .m3-cell, .m3-cell.is-sel { transition: none; }
  .m3-cell.is-clear { animation: none; opacity: 0; }
}

@media (max-width: 560px) {
  .quiz-result__btns { flex-direction: column; }
  .m3__hint { display: none; }
}
