/* 「脑力百科」共用样式 · 风格 A「展馆白墙」（11-11 站长选定）：暖白墙面、墨色线条、朱红点缀；不用网格、暗角、渐变光晕。
   各版块自己的样式在 timeline.css / hub.css 等。 */
@font-face { font-family: "Chrono Serif"; src: url(../fonts/serif.woff2) format("woff2"); font-weight: 600 900; font-display: swap; }
:root {
  --paper: #EEEAE2; --paper2: #E6E1D7; --paper3: #F5F2EC; --ink: #1D1D1B; --ink2: #4A4740; --mute: #686257;
  --line: rgba(29, 29, 27, .14); --line2: rgba(29, 29, 27, .42); --red: #C8432B; --red-t: rgba(200, 67, 43, .08); --green: #2F6B4F; --off: #CFC8BA; --lock: #E0DACE;
  --serif: "Chrono Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.45, .55, 1);
  --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- 画面 ---------- */
.app { min-height: 100dvh; }
.scr { display: none; min-height: 100dvh; flex-direction: column; }
.scr.is-on { display: flex; }
.bar { position: sticky; top: 0; z-index: 20; flex: none; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.bar--plain { border-bottom: 0; background: transparent; position: static; }
.bar__t { margin: 0 0 0 4px; min-width: 0; font: 800 20px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__t--game { display: flex; align-items: center; gap: 10px; }
.bar__t--game span { font: 600 13px/1 var(--sans); color: var(--mute); letter-spacing: .04em; }
.bar__end { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.bar__stars { gap: 6px; padding-right: 8px; font-size: 14px; color: var(--ink2); white-space: nowrap; }
.bar__stars svg { width: 17px; height: 17px; fill: var(--red); stroke: none; }
.bar__stars b { font: 800 19px/1 var(--serif); color: var(--ink); }
.bar__home { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 6px; font-weight: 600; font-size: 14px; text-decoration: none; }
.seal { display: inline-grid; place-items: center; background: var(--red); color: #fff; font: 900 15px/1 var(--serif); border-radius: 3px; }
.seal--sm { width: 26px; height: 26px; }

/* ---------- 按钮 ---------- */
.icn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transition: background .15s, transform .12s; }
.icn:hover { background: rgba(29, 29, 27, .07); }
.icn:active { transform: scale(.9); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border: 0; border-radius: 999px; background: transparent; font: 600 15px/1 var(--sans); white-space: nowrap; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.97); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #000; }
.btn--line { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--line:hover { background: rgba(29, 29, 27, .06); }
.btn--lg { height: 52px; padding: 0 30px; font-size: 16px; }
.btn--xl { height: 62px; min-width: 280px; padding: 0 36px; font-size: 18px; }
.btn--xl svg { width: 20px; height: 20px; fill: currentColor; }
.btn--xl span { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.btn--xl small { font-size: 12.5px; font-weight: 500; opacity: .75; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 3px; font: 700 12px/1 var(--sans); font-style: normal; letter-spacing: .06em; box-shadow: inset 0 0 0 1.5px currentColor; white-space: nowrap; }
.tag--red { color: var(--red); }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars i { display: grid; }
.stars svg { width: 15px; height: 15px; fill: var(--off); stroke: none; }
.stars i.on svg { fill: var(--red); }
.meter { display: block; flex: 1; height: 4px; border-radius: 2px; background: var(--paper2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }

/* ---------- 标题页 ---------- */
.title { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 20px 8px; text-align: center; }
.title__k { margin: 0 0 18px; font: 600 13px/1 var(--sans); letter-spacing: .32em; color: var(--mute); }
.logo { margin: 0; font: 900 clamp(64px, 8.6vw, 124px)/1 var(--serif); letter-spacing: .08em; padding-left: .08em; }
.title__tag { position: relative; margin: 30px 0 0; font-size: 16px; color: var(--ink2); }
.title__tag::before { content: ""; position: absolute; left: 50%; top: -17px; width: 44px; height: 3px; background: var(--red); transform: translateX(-50%); }
.title__acts { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 34px; }
.title__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.title__me { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 26px 0 0; font-size: 14px; color: var(--mute); }
.title__me b { font: 800 16px/1 var(--serif); color: var(--ink); }
.title__me svg { width: 15px; height: 15px; margin-right: 4px; fill: var(--red); stroke: none; vertical-align: -2px; }
.wall { flex: none; padding: 10px 24px 44px; overflow: hidden; }
.wall__row { --ew: clamp(108px, 10.5vw, 168px); position: relative; display: flex; justify-content: center; gap: clamp(14px, 2.6vw, 44px); max-width: 1180px; margin: 0 auto; }
.wall__row::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--ew) * .75 + 12px + 18px); height: 2px; background: var(--ink); }
.exhibit { position: relative; flex: none; width: var(--ew); margin: 0; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 80ms + 120ms); }
.exhibit__img { display: block; aspect-ratio: 4 / 3; padding: 6px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 10px 18px -12px rgba(0, 0, 0, .4); }
.exhibit__img img, .exhibit__img .ph { display: block; width: 100%; height: 100%; object-fit: cover; }
.exhibit figcaption { position: relative; padding-top: 36px; }
.exhibit figcaption::before { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 18px; background: var(--ink); transform: translateX(-50%); }
.exhibit figcaption::after { content: ""; position: absolute; left: 50%; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); transform: translateX(-50%); }
.exhibit b { display: block; font: 800 18px/1.2 var(--serif); }
.exhibit b small { font-size: 12px; margin-right: 2px; }
.exhibit figcaption span { display: -webkit-box; margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--ink2); -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- 子页面通用 ---------- */
.sub-in { width: min(1200px, 100%); margin: 0 auto; padding: 28px 24px 56px; }

/* ---------- 对话框 ---------- */
.dlg { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1.5px var(--ink), 0 30px 60px -24px rgba(0, 0, 0, .45); }
.dlg[open] { animation: dlgIn .26s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dlg__in { padding: 26px 28px 24px; }
.dlg__in h2 { margin: 0 0 14px; font: 900 26px/1.3 var(--serif); }
.rules { display: grid; gap: 10px; margin: 0 0 14px; padding-left: 1.3em; font-size: 14.5px; line-height: 1.7; color: var(--ink2); }
.rules b { color: var(--ink); }
.dlg__note { margin: 0 0 18px; font-size: 13px; line-height: 1.65; color: var(--mute); }
.dlg--card { width: min(520px, calc(100% - 32px)); }
.cardx { position: relative; }
.cardx__img { aspect-ratio: 4 / 3; background: var(--paper3); }
.cardx__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cardx__x { position: absolute; right: 10px; top: 10px; background: rgba(255, 255, 255, .92); }
.cardx__x:hover { background: #fff; }
.cardx__b { padding: 18px 22px 22px; }
.cardx__y { display: flex; align-items: baseline; font: 800 26px/1.2 var(--serif); }
.cardx__y small { margin: 0 3px; font-size: 13px; }
.cardx__y em { margin-left: auto; font: 600 12px/1 var(--sans); font-style: normal; letter-spacing: .12em; color: var(--mute); }
.cardx__t { margin: 6px 0 10px; font: 900 23px/1.35 var(--serif); }
.cardx__f { margin: 0 0 14px; font-size: 15px; line-height: 1.8; }
.cardx__m { margin: 0; font-size: 12px; line-height: 1.6; color: var(--mute); word-break: break-word; }

/* ---------- 成就 ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0 0 28px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.stats div { padding: 16px 18px; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats dt { font-size: 12px; color: var(--mute); }
.stats dd { margin: 4px 0 0; font: 800 24px/1.2 var(--serif); }
.stats small { font: 500 12px var(--sans); color: var(--mute); }
.achs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.ach { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 10px; background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1px var(--line); }
.ach.is-on { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.ach > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ach b { font: 800 16px/1.3 var(--serif); }
.ach small { font-size: 13px; color: var(--ink2); }
.ach em { font-size: 12px; font-style: normal; color: var(--mute); }
.ach .meter { flex: none; margin: 4px 0 0; }
.badge { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 4px; background: var(--red); color: #fff; font: 900 22px/1 var(--serif); transform: rotate(-4deg); }
.badge.is-off { background: var(--lock); color: #A39C8F; transform: none; }

/* ---------- 提示 ---------- */
.toast { position: fixed; inset: 16px auto auto 50%; z-index: 90; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); margin: 0; padding: 8px 18px 8px 8px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; overflow: visible; transform: translate(-50%, -160%); transition: transform .38s var(--spring); pointer-events: none; }
.toast.on { transform: translate(-50%, 0); }
.toast:not(:popover-open) { display: none; }
.toast > span:only-child { padding: 4px 0 4px 10px; }
.toast .badge { width: 32px; height: 32px; font-size: 16px; }
.toast b { font-weight: 700; }
.fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
