/* 篮一把-生涯模拟器 —— 样式
   深色球馆配色：近黑木地板打底，面板只比底色亮一点点，层次靠 1px 描边。
   主色是球场橙，OVR 徽章和能力值用金色，跟满屏的橙拉开。
   颜色存 HSL 三元组，用的时候 hsl(var(--bg))，要透明度就 hsl(var(--bg) / .5)。 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
          "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC",
          "Segoe UI", "Microsoft YaHei", sans-serif;
  --r-card: 10px;
  --r-row: 7px;
  --maxw: 460px;
  --maxw-wide: 1180px;
}

/* ---------- 球馆夜色（唯一一套）---------- */
html {
  --bg: 26 12% 6%;
  --card: 26 11% 9%;
  --row: 26 10% 12%;
  --row-hi: 25 9% 16%;
  --border: 26 8% 21%;
  --border-strong: 26 8% 28%;
  --text: 40 20% 93%;
  --muted: 30 8% 64%;
  --faint: 28 6% 53%;
  --accent: 26 92% 56%;
  --accent-on: 26 40% 10%;
  --btn-bg: 25 10% 22%;
  --gold1: 40 66% 55%;
  --gold2: 32 62% 44%;
  --warning: 40 66% 55%;
  --failure: 8 62% 58%;
  --info: 202 45% 60%;
  --scrim: 26 12% 2%;
}
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: hsl(var(--bg));
  color: hsl(var(--text));
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  /* 手机端：去掉双击缩放和点击延迟 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body.no-actionbar { padding-bottom: 2rem; }
button, a, input { touch-action: manipulation; }

/* ================= 顶栏 ================= */
.topbar {
  position: relative;
  display: flex; align-items: center;
  padding: .8rem 3.4rem .8rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.brand {
  display: inline-flex; align-items: center; gap: .45rem;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: inherit; color: inherit;
  font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em;
}
.brand-mark {
  display: grid; place-items: center;
  width: 1.5rem; height: 1.5rem; border-radius: 6px;
  background: hsl(var(--text)); color: hsl(var(--bg)); font-size: .82rem;
}
.corner-btn {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  font-family: inherit; font-size: .74rem;
  padding: .32rem .6rem; border-radius: var(--r-row); letter-spacing: .06em;
  border: 1px solid hsl(var(--border));
  background: transparent; color: hsl(var(--faint)); cursor: pointer; transition: all .15s;
}
.corner-btn:hover { color: hsl(var(--text)); border-color: hsl(var(--muted)); }

/* ================= 布局 ================= */
#app { max-width: var(--maxw); margin: 0 auto; padding: 1.1rem 1rem 0; }
#app.wide { max-width: var(--maxw-wide); }
.view { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

/* ================= 首页 ================= */
.intro { text-align: center; }
.eyebrow {
  font-size: .7rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: hsl(var(--faint));
}
.hero-title {
  margin-top: .9rem;
  font-size: 1.9rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.15;
}
.hero-art {
  margin: 1.2rem auto 0; width: 100%; aspect-ratio: 4 / 3;
  border-radius: var(--r-card); overflow: hidden;
  border: 1px solid hsl(var(--border));
}
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-sub { margin-top: 1.1rem; font-size: .9rem; color: hsl(var(--muted)); }

.segmented {
  display: flex; gap: .25rem; margin: 1.4rem auto 0;
  padding: .25rem; border-radius: var(--r-card);
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
}
.seg {
  flex: 1; font-family: inherit; font-size: .86rem; font-weight: 650;
  padding: .5rem .3rem; border: 0; border-radius: var(--r-row); letter-spacing: .06em;
  background: transparent; color: hsl(var(--faint)); cursor: pointer;
  transition: background .18s, color .18s;
}
.seg:hover { color: hsl(var(--text)); }
.seg.selected { background: hsl(var(--accent)); color: hsl(var(--accent-on)); }
.seg-note { margin-top: .7rem; font-size: .8rem; color: hsl(var(--faint)); min-height: 1.2em; }

.seed-box {
  display: flex; align-items: center; gap: .6rem;
  margin: 1rem auto 0; padding: .5rem .7rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--r-row); text-align: left;
}
.seed-box label { flex-shrink: 0; font-size: .8rem; color: hsl(var(--faint)); }
.seed-box input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  font-family: inherit; font-size: .9rem; color: hsl(var(--text));
}
.seed-box input::placeholder { color: hsl(var(--faint) / .7); }

/* ================= 按钮 ================= */
.btn {
  display: block; width: 100%;
  font-family: inherit; font-size: .86rem; font-weight: 550; letter-spacing: .06em;
  padding: .7rem 1.1rem; border-radius: var(--r-row);
  border: 1px solid hsl(var(--border-strong));
  background: hsl(var(--btn-bg)); color: hsl(var(--text));
  cursor: pointer; text-align: center; transition: all .15s;
}
.btn:hover { border-color: hsl(var(--accent)); box-shadow: inset 0 0 0 1px hsl(var(--accent)); }
.btn-primary {
  background: hsl(var(--accent)); border-color: hsl(var(--accent));
  color: hsl(var(--accent-on)); font-weight: 650;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; filter: none; box-shadow: none; }
.btn-stack { display: grid; gap: .5rem; margin-top: 1.3rem; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; gap: .6rem;
  max-width: var(--maxw); margin: 0 auto;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
  background: hsl(var(--bg) / .93);
  backdrop-filter: blur(12px);
  border-top: 1px solid hsl(var(--border));
}
.actionbar .btn { flex: 1; }
.actionbar .btn-back { flex: 0 0 34%; }

/* ================= 分步页头 ================= */
.step-head { margin-bottom: 1.1rem; }
.step-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.progress { margin-top: .7rem; height: 5px; border-radius: 999px; background: hsl(var(--row)); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: hsl(var(--accent)); transition: width .35s ease; }
.step-sub { margin-top: .6rem; font-size: .82rem; color: hsl(var(--faint)); }

/* ================= 上一世提示 ================= */
.legacy-banner {
  display: flex; align-items: baseline; gap: .6rem;
  margin-bottom: .8rem; padding: .55rem .8rem;
  border-radius: var(--r-row);
  background: hsl(var(--gold1) / .09);
  box-shadow: inset 0 0 0 1px hsl(var(--gold1) / .3);
}
.legacy-gen {
  flex-shrink: 0;
  font-size: .74rem; font-weight: 800; letter-spacing: .04em;
  color: hsl(var(--gold1));
}
.legacy-bits { min-width: 0; font-size: .76rem; color: hsl(var(--muted)); }

/* ================= 选择列表 ================= */
.panel {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--r-card); padding: .5rem;
}
.pick-list { display: grid; gap: .3rem; }
.pick {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .7rem .8rem; border: 0; border-radius: var(--r-row);
  background: transparent; color: inherit; font-family: inherit;
  text-align: left; cursor: pointer;
}
.pick:hover { background: hsl(var(--row)); box-shadow: inset 0 0 0 1px hsl(var(--accent)); }
.pick.selected { background: hsl(var(--row)); box-shadow: inset 0 0 0 1px hsl(var(--accent)); }
.pick-main { min-width: 0; flex: 1; }
.pick-name { display: block; font-size: .92rem; font-weight: 650; }
.pick-desc { display: block; font-size: .76rem; color: hsl(var(--faint)); margin-top: .1rem; }
.swatch { width: 1.5rem; height: 1.5rem; border-radius: 5px; flex-shrink: 0; }

/* ================= 球场选位置 ================= */
.court {
  position: relative; width: 100%; max-width: 340px; margin: 0 auto;
  aspect-ratio: 3 / 3.8;
  border-radius: var(--r-card); overflow: hidden;
  border: 1px solid hsl(var(--border));
}
.court > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pos-btn {
  position: absolute; transform: translate(-50%, -50%);
  font-family: inherit; font-size: .76rem; font-weight: 700;
  width: 4.2rem; padding: .4rem .2rem;
  border-radius: var(--r-row); letter-spacing: .04em;
  border: 1px solid hsl(var(--border-strong));
  background: hsl(var(--card) / .92); color: hsl(var(--muted));
  cursor: pointer; text-align: center; transition: all .15s;
  backdrop-filter: blur(4px);
}
.pos-btn:hover { color: hsl(var(--text)); border-color: hsl(var(--accent)); }
.pos-btn.selected {
  background: hsl(var(--accent)); color: hsl(var(--accent-on));
  border-color: hsl(var(--accent));
  box-shadow: 0 0 0 3px hsl(var(--accent) / .25);
}
.pos-hint { margin-top: .9rem; text-align: center; font-size: .82rem; color: hsl(var(--muted)); min-height: 3.6em; }

/* ================= 姓名与号码 ================= */
.identity-input {
  display: block; width: 100%;
  margin-top: .45rem; padding: .65rem .8rem;
  border-radius: var(--r-row);
  border: 1px solid hsl(var(--border-strong));
  background: hsl(var(--row)); color: hsl(var(--text));
  font-family: inherit; font-size: 1rem; outline: none;
  transition: border-color .15s;
}
.identity-input:focus { border-color: hsl(var(--accent)); }
.identity-input::placeholder { color: hsl(var(--faint) / .7); }
.identity-dice { margin-top: .9rem; font-size: .72rem; color: hsl(var(--faint)); }

/* ================= 生涯页 ================= */
.career-head {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .7rem .85rem; border-radius: var(--r-card);
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  margin-bottom: .8rem;
}
.career-name { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; }
.career-meta { font-size: .76rem; color: hsl(var(--faint)); margin-top: .05rem; }

.career-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: .8rem; align-items: start;
}
@media (max-width: 860px) {
  .career-grid { grid-template-columns: 1fr; }
  .status-panel { order: -1; }
}

/* ---------- 时间线 ---------- */
.timeline { display: grid; gap: .45rem; }
.tl-sec {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .65rem; border-radius: var(--r-row);
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
}
.tl-age {
  flex-shrink: 0; width: 2.4rem; text-align: center;
  font-size: .78rem; font-weight: 800; color: hsl(var(--gold1));
}
.tl-team {
  flex-shrink: 0; display: flex; align-items: center; gap: .4rem;
  min-width: 7.5rem; font-size: .8rem; font-weight: 600;
}
.tl-crest {
  width: 1.15rem; height: 1.15rem; border-radius: 4px; flex-shrink: 0;
  display: grid; place-items: center; font-size: .6rem; color: #fff;
}
.tl-ovr {
  flex-shrink: 0; padding: .08rem .4rem; border-radius: 5px;
  font-size: .72rem; font-weight: 800; letter-spacing: .03em;
  background: hsl(var(--gold1) / .12); color: hsl(var(--gold1));
  box-shadow: inset 0 0 0 1px hsl(var(--gold1) / .35);
}
.tl-stats { flex: 1; min-width: 0; font-size: .76rem; color: hsl(var(--muted)); white-space: nowrap; }
.tl-hons { display: flex; flex-wrap: wrap; gap: .2rem; justify-content: flex-end; }
.hon {
  font-size: .62rem; font-weight: 700; letter-spacing: .02em;
  padding: .1rem .32rem; border-radius: 4px;
  background: hsl(var(--row-hi)); color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}
.hon.gold {
  background: hsl(var(--gold1) / .14); color: hsl(var(--gold1));
  border-color: hsl(var(--gold1) / .4);
}
.hon.accent {
  background: hsl(var(--accent) / .14); color: hsl(var(--accent));
  border-color: hsl(var(--accent) / .4);
}
.tl-note {
  padding: .3rem .65rem .1rem;
  font-size: .76rem; color: hsl(var(--faint)); line-height: 1.55;
}

/* ---------- 事件卡 ---------- */
.ev-card {
  border-radius: var(--r-card); padding: .85rem .9rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  animation: fade .3s ease;
}
.ev-card .ev-tag {
  font-size: .64rem; font-weight: 800; letter-spacing: .18em;
  color: hsl(var(--accent));
}
.ev-card h3 { margin-top: .3rem; font-size: 1rem; font-weight: 750; line-height: 1.35; }
.ev-card .ev-text { margin-top: .4rem; font-size: .84rem; color: hsl(var(--muted)); line-height: 1.7; }
.ev-card .ev-ask { margin-top: .7rem; font-size: .82rem; font-weight: 700; color: hsl(var(--text)); }
.ev-options { display: grid; gap: .4rem; margin-top: .55rem; }
.ev-opt {
  display: block; width: 100%; padding: .6rem .75rem;
  border-radius: var(--r-row); border: 1px solid hsl(var(--border-strong));
  background: hsl(var(--row)); color: inherit; font-family: inherit;
  font-size: .86rem; line-height: 1.5; text-align: left; cursor: pointer;
  transition: all .15s;
}
.ev-opt:hover { border-color: hsl(var(--accent)); box-shadow: inset 0 0 0 1px hsl(var(--accent)); }
.ev-opt .opt-t { font-weight: 700; }
.ev-opt .opt-d { display: block; margin-top: .1rem; font-size: .74rem; color: hsl(var(--faint)); }
.ev-opt .opt-hint { display: block; margin-top: .25rem; font-size: .72rem; color: hsl(var(--warning)); }

.ev-result {
  border-radius: var(--r-card); padding: .8rem .9rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border-strong));
}
/* 已答的抉择卡：按钮禁用并降透明度，时间线里的旧卡不再"看着能点" */
.ev-card.answered { opacity: .72; }
.ev-card.answered .ev-opt { opacity: .45; pointer-events: none; cursor: default; }
.ev-result .ev-res-t { font-size: .9rem; font-weight: 750; }
.ev-result .ev-res-body { margin-top: .35rem; font-size: .82rem; color: hsl(var(--muted)); line-height: 1.7; }
.fx-deltas { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.fx-delta {
  font-size: .72rem; font-weight: 700;
  padding: .14rem .42rem; border-radius: 4px;
  background: hsl(var(--row-hi)); color: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}
.fx-delta.up { color: hsl(var(--accent)); border-color: hsl(var(--accent) / .45); background: hsl(var(--accent) / .1); }
.fx-delta.down { color: hsl(var(--failure)); border-color: hsl(var(--failure) / .45); background: hsl(var(--failure) / .1); }
.fx-delta.money { color: hsl(var(--gold1)); border-color: hsl(var(--gold1) / .45); background: hsl(var(--gold1) / .1); }

/* ---------- 右侧状态栏 ---------- */
.status-panel {
  position: sticky; top: .8rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--r-card); padding: .9rem;
  display: grid; gap: .8rem;
}
.st-top { display: flex; align-items: center; gap: .7rem; }
.st-avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 1rem; font-weight: 800; color: hsl(var(--accent-on));
  background: linear-gradient(135deg, hsl(var(--accent)), hsl(30 90% 42%));
}
.st-name { font-size: .98rem; font-weight: 800; }
.st-sub { font-size: .74rem; color: hsl(var(--faint)); margin-top: .05rem; }
.st-ovr {
  margin-left: auto; flex-shrink: 0;
  padding: .3rem .5rem; border-radius: 8px; text-align: center;
  background: hsl(var(--gold1) / .12);
  box-shadow: inset 0 0 0 1px hsl(var(--gold1) / .4);
}
.st-ovr b { display: block; font-size: 1.15rem; color: hsl(var(--gold1)); line-height: 1.1; }
.st-ovr span { font-size: .58rem; letter-spacing: .14em; color: hsl(var(--gold1) / .8); }

.stat-line { display: grid; gap: .42rem; }
.stat-bar-label {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: hsl(var(--muted));
}
.stat-bar-label b { color: hsl(var(--text)); font-variant-numeric: tabular-nums; }
.stat-bar {
  height: 6px; border-radius: 999px; background: hsl(var(--row)); overflow: hidden;
}
.stat-bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.bar-abi { background: linear-gradient(90deg, hsl(32 62% 44%), hsl(var(--gold1))); }
.bar-rel { background: linear-gradient(90deg, hsl(202 40% 38%), hsl(202 60% 55%)); }
.bar-fame { background: linear-gradient(90deg, hsl(8 55% 42%), hsl(var(--failure))); }
.bar-clean { background: hsl(var(--muted)); opacity: .5; }

.st-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.kpi {
  padding: .4rem .5rem; border-radius: var(--r-row);
  background: hsl(var(--row)); border: 1px solid hsl(var(--border));
}
.kpi b { display: block; font-size: .92rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .64rem; color: hsl(var(--faint)); letter-spacing: .06em; }
.kpi b.small { font-size: .78rem; }

.st-hons { display: flex; flex-wrap: wrap; gap: .25rem; }
.st-hons .hon { font-size: .64rem; }

/* ================= 结算页 ================= */
.summary-wrap { max-width: 640px; margin: 0 auto; }
.ending-hero {
  text-align: center; padding: 1.6rem 1.2rem;
  border-radius: var(--r-card);
  background:
    radial-gradient(120% 90% at 50% 0%, hsl(var(--accent) / .16), transparent 60%),
    hsl(var(--card));
  border: 1px solid hsl(var(--border-strong));
}
.ending-hero .eyebrow { color: hsl(var(--accent)); }
.ending-title {
  margin-top: .7rem; font-size: 2rem; font-weight: 900; letter-spacing: -.02em;
  color: hsl(var(--gold1));
}
.ending-desc { margin-top: .5rem; font-size: .88rem; color: hsl(var(--muted)); line-height: 1.7; }
.ending-line { margin-top: .7rem; font-size: .8rem; color: hsl(var(--faint)); }
.ending-line b { color: hsl(var(--text)); font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.4rem, 1fr)); gap: .45rem; margin-top: .8rem; }
.stat-cell {
  padding: .55rem .6rem; border-radius: var(--r-row);
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
}
.stat-cell b { display: block; font-size: 1rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-cell span { font-size: .66rem; color: hsl(var(--faint)); letter-spacing: .05em; }

.honor-list { margin-top: .8rem; }
.honor-list h3 { font-size: .82rem; letter-spacing: .1em; color: hsl(var(--faint)); margin-bottom: .5rem; }
.hl-row {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .4rem .6rem; border-radius: var(--r-row);
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  margin-bottom: .3rem; font-size: .84rem;
}
.hl-row .hl-age { flex-shrink: 0; color: hsl(var(--gold1)); font-weight: 800; font-variant-numeric: tabular-nums; }
.hl-row .hl-txt { color: hsl(var(--muted)); }
.codex-note { margin-top: .8rem; text-align: center; font-size: .76rem; color: hsl(var(--faint)); }

/* ================= 档案页 ================= */
.page-head { margin-bottom: 1rem; }
.page-head h2 { font-size: 1.3rem; font-weight: 800; }
.page-head p { font-size: .78rem; color: hsl(var(--faint)); margin-top: .2rem; }
.archive-list { display: grid; gap: .5rem; }
.archive-card {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .8rem; border-radius: var(--r-row);
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  cursor: pointer; transition: all .15s; text-align: left;
  font-family: inherit; color: inherit; width: 100%;
}
.archive-card:hover { border-color: hsl(var(--accent)); box-shadow: inset 0 0 0 1px hsl(var(--accent)); }
.ar-avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  color: hsl(var(--accent-on));
  background: linear-gradient(135deg, hsl(var(--accent)), hsl(30 90% 42%));
}
.ar-main { flex: 1; min-width: 0; }
.ar-name { font-size: .92rem; font-weight: 700; }
.ar-sub { font-size: .72rem; color: hsl(var(--faint)); margin-top: .1rem; }
.ar-end { flex-shrink: 0; font-size: .72rem; color: hsl(var(--gold1)); font-weight: 700; }
.ar-del {
  flex-shrink: 0; padding: .3rem .5rem; font-size: .7rem;
  border-radius: 5px; border: 1px solid hsl(var(--border));
  background: transparent; color: hsl(var(--faint)); cursor: pointer;
}
.ar-del:hover { color: hsl(var(--failure)); border-color: hsl(var(--failure)); }
.empty-tip { text-align: center; color: hsl(var(--faint)); font-size: .84rem; padding: 2.5rem 0; }

/* ================= 图鉴页 ================= */
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; }
.codex-cell {
  padding: .65rem .7rem; border-radius: var(--r-row); min-height: 4.6rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  display: flex; flex-direction: column; justify-content: space-between; gap: .3rem;
}
.codex-cell.locked { opacity: .55; }
.codex-cell .cx-id { font-size: .62rem; color: hsl(var(--faint)); letter-spacing: .12em; }
.codex-cell .cx-name { font-size: .88rem; font-weight: 750; }
.codex-cell.locked .cx-name { color: hsl(var(--faint)); letter-spacing: .1em; }
.codex-cell .cx-count { font-size: .64rem; color: hsl(var(--gold1)); }
.codex-progress { margin-bottom: .9rem; font-size: .78rem; color: hsl(var(--faint)); }

/* ================= 弹窗 ================= */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--scrim) / .82);
  backdrop-filter: blur(4px);
  padding: 1rem;
  animation: fade .2s ease;
}
.modal {
  position: relative; width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border-strong));
  border-radius: var(--r-card); padding: 1.2rem 1.1rem;
}
.modal h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: .6rem; }
.modal h3 { font-size: .88rem; margin: .9rem 0 .35rem; color: hsl(var(--accent)); }
.modal p { font-size: .84rem; color: hsl(var(--muted)); line-height: 1.7; }
.modal ul { padding-left: 1.1rem; }
.modal li { font-size: .82rem; color: hsl(var(--muted)); margin-bottom: .3rem; line-height: 1.6; }
.modal li strong { color: hsl(var(--text)); }
.modal-close {
  position: absolute; right: .8rem; top: .8rem;
  width: 1.7rem; height: 1.7rem; border-radius: 6px;
  border: 1px solid hsl(var(--border)); background: transparent;
  color: hsl(var(--faint)); cursor: pointer; font-size: .8rem;
}
.modal-close:hover { color: hsl(var(--text)); border-color: hsl(var(--muted)); }

/* ================= 分享卡 ================= */
.share-modal { max-width: 420px; text-align: center; }
.share-eyebrow { font-size: .66rem; letter-spacing: .22em; color: hsl(var(--faint)); }
.share-title { margin-top: .3rem; }
.share-card-wrap { margin-top: .9rem; }
.share-card-wrap canvas, .share-card-wrap img {
  width: 100%; border-radius: var(--r-card);
  border: 1px solid hsl(var(--border-strong));
}
.share-tip { margin-top: .5rem; color: hsl(var(--gold1)) !important; font-size: .76rem !important; }
.share-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: .8rem; font-size: .8rem; color: hsl(var(--muted)); cursor: pointer;
}
.share-toggle input { display: none; }
.share-toggle i {
  position: relative; width: 2.2rem; height: 1.2rem; border-radius: 999px;
  background: hsl(var(--row-hi)); border: 1px solid hsl(var(--border-strong));
  transition: background .2s;
}
.share-toggle i::after {
  content: ""; position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: .9rem; height: .9rem; border-radius: 50%;
  background: hsl(var(--muted)); transition: all .2s;
}
.share-toggle input:checked + i { background: hsl(var(--accent) / .4); }
.share-toggle input:checked + i::after { left: calc(100% - .95rem); background: hsl(var(--accent)); }
.share-actions { display: flex; justify-content: center; gap: .6rem; margin-top: .9rem; }
.share-btn {
  width: 2.7rem; height: 2.7rem; border-radius: 8px;
  border: 1px solid hsl(var(--border-strong)); background: hsl(var(--row));
  color: hsl(var(--muted)); cursor: pointer;
  display: grid; place-items: center; transition: all .15s;
}
.share-btn:hover { color: hsl(var(--accent)); border-color: hsl(var(--accent)); }
.share-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ================= 页脚 ================= */
.footer {
  margin-top: 2.2rem; padding: 1rem 1rem 0;
  text-align: center; font-size: .72rem; color: hsl(var(--faint) / .8);
}

@media (max-width: 600px) {
  .topbar { padding: .7rem 3.4rem .6rem 1rem; }
  .hero-title { font-size: 1.65rem; }
  .tl-team { min-width: 6rem; }
  .tl-stats { display: none; }
}

/* ---------- 手机端生涯页：单栏，时间线随页面滚动，状态栏不吸顶 ---------- */
@media (max-width: 860px) {
  #timeline { max-height: none !important; overflow-y: visible !important; }
  .status-panel { position: static !important; }
  .ev-opt { padding: .7rem .8rem; }
  .ev-card { padding: .95rem 1rem; }
  .career-head { padding: .75rem .9rem; }
  .st-kpis { grid-template-columns: repeat(3, 1fr); }
}
