/* 按设计系统组《主流程样板 v0.3》换皮；颜色、字号、圆角全部来自设计系统草案_tokens.css（服务端 /ds/tokens.css 直读原件） */
@import url("/ds/tokens.css");

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root { color-scheme: light; }   /* 王导 11-07：只有白色模式 */
html, body { background: var(--c-bg); color: var(--c-text); font-family: var(--f-ui); font-size: var(--fs-body); line-height: var(--lh-body); }
body { max-width: 560px; margin: 0 auto; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
a { color: var(--c-primary); text-decoration: none; }
button { font: inherit; cursor: pointer; }
main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* 头部晨雾 */
.head { background: var(--g-head); padding: calc(18px + env(safe-area-inset-top)) var(--page-x) 4px; min-height: 64px; }
.hero { font-size: var(--fs-hero); line-height: var(--lh-hero); font-weight: 800; letter-spacing: .5px; }
.hero b, .lead b { color: var(--c-primary); }
.lead { font-size: var(--fs-sub); color: var(--c-text-2); margin-top: 6px; line-height: 1.6; }
.nav { display: flex; align-items: center; justify-content: center; position: relative; font-weight: 800; font-size: 17px; height: 36px; margin-bottom: 4px; }
.nav .back { position: absolute; left: 0; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.8); border: 0; display: grid; place-items: center; font-size: 20px; color: var(--c-text); }
.nav .act { position: absolute; right: 0; font-size: 14px; font-weight: 700; }
.pad { padding: 0 var(--page-x); }

/* 卡片 */
.card { background: var(--c-card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 18px; margin-top: 14px; position: relative; display: block; color: inherit; }
.card h3 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 800; }
.st { font-size: 13px; color: var(--c-text-2); margin-top: 4px; line-height: 1.6; }
.st b { color: var(--c-text); font-size: 15px; }
.ill { position: absolute; right: 14px; bottom: 12px; font-size: 32px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.15)); pointer-events: none; }
.tag { display: inline-block; font-size: var(--fs-tag); line-height: var(--lh-tag); padding: 2px 8px; border-radius: var(--r-tag); background: #E7F8EF; color: #16a34a; font-weight: 700; }
.tag.b { background: var(--c-primary-weak); color: var(--c-primary); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.grid .card { margin: 0; min-height: 108px; padding: 14px; }
.grid h3 { font-size: 16px; }

/* 按钮 */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 22px; border-radius: var(--r-pill); border: 0;
  background: var(--c-primary); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 6px 16px rgba(59,99,243,.3); }
.pill.wide { width: 100%; height: var(--btn-h); }
.pill:disabled { opacity: .5; }
.ghost { height: var(--btn-h); padding: 0 16px; border-radius: var(--r-pill); border: 1.5px solid var(--c-line); background: var(--c-card); font-weight: 700; font-size: 14px; color: var(--c-text); display: inline-flex; align-items: center; justify-content: center; }
.ghost.on { color: var(--c-gain); border-color: var(--c-gain); }
.linkbtn { background: none; border: 0; color: var(--c-primary); font-weight: 700; font-size: 14px; padding: 4px 0; }

/* 记录 + 红章 */
.rec { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--c-line); color: inherit; }
.rec:first-of-type { border-top: 0; }
.rec .t { flex: 1; min-width: 0; }
.rec .t div { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec .t span { font-size: 12px; color: var(--c-text-3); }
.seal { font-family: var(--f-mark); color: var(--c-lose); font-size: 26px; font-weight: 700; border: 2px solid var(--c-lose); border-radius: 8px;
  padding: 0 6px; transform: rotate(-8deg); line-height: 34px; opacity: .9; flex: none; white-space: nowrap; }
.seal.s { font-size: 15px; font-family: var(--f-ui); font-weight: 800; }
.empty { text-align: center; color: var(--c-text-3); padding: 28px 0; font-size: 14px; }

/* 底部 tab */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; height: calc(68px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--c-card) 92%, transparent); backdrop-filter: blur(12px);
  display: flex; justify-content: space-around; align-items: center; font-size: 11px; color: var(--c-text-3); border-top: 1px solid var(--c-line); z-index: 10; }
.tabbar[hidden] { display: none; }
.tabbar a { color: inherit; text-align: center; min-width: 52px; }
.tabbar i { display: block; font-style: normal; font-size: 20px; line-height: 26px; }
.tabbar .on { color: var(--c-primary); font-weight: 700; }
.tabbar .cam { width: 54px; height: 54px; min-width: 0; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; font-size: 24px;
  margin-top: -22px; box-shadow: 0 8px 18px rgba(59,99,243,.35); }
.bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--c-card) 95%, transparent); backdrop-filter: blur(12px); display: flex; gap: 10px; border-top: 1px solid var(--c-line); z-index: 10; }
.bar .pill { flex: 1; height: var(--btn-h); }

/* 刷真题 */
.big { font-size: 40px; font-weight: 800; line-height: 1.1; }
.big small { font-size: 18px; color: var(--c-text-3); font-weight: 700; }
.rings { display: flex; justify-content: space-between; margin-top: 14px; gap: 4px; }
.ring { text-align: center; font-size: 11px; color: var(--c-text-2); background: none; border: 0; padding: 0; }
.ring svg { display: block; margin: 0 auto 4px; }
.ring.on { color: var(--c-text); font-weight: 800; }
.cells { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.cell { width: 36px; height: 36px; border-radius: var(--r-cell); display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--c-cell); color: var(--c-text-2); }
.cell.ok { background: var(--c-primary); color: #fff; } .cell.bad { background: var(--c-lose); color: #fff; }
.cell.cur { background: var(--c-card); border: 2px solid var(--c-primary); color: var(--c-primary); }
.book { width: 52px; height: 66px; border-radius: 8px; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 22px; flex: none; }
.resume { display: flex; align-items: center; gap: 10px; background: var(--c-primary-weak); color: var(--c-primary); font-weight: 700; border-radius: 16px; padding: 12px 14px; margin-top: 14px; font-size: 14px; }
.resume span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--c-line); color: inherit; }
.qrow:first-of-type { border-top: 0; }
.qrow .t { flex: 1; min-width: 0; }
.qrow .t div { font-size: 15px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.qrow .t span { font-size: 12px; color: var(--c-text-3); }

/* 题目 */
.stem { white-space: pre-wrap; font-size: 15px; line-height: 1.8; margin-top: 8px; }
.stem.fold { max-height: 240px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.sub { font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { position: relative; padding: 6px 12px; border-radius: var(--r-pill); background: var(--c-primary-weak); color: var(--c-primary); font-weight: 700; font-size: 13px; border: 0; }
.chip select, .chip input { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; outline: none; }
.chip input { width: 3.2em; text-align: center; }
.chip.dd::after { content: " ▾"; font-size: 10px; }
.match { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--c-gain); font-weight: 700; margin-top: 8px; line-height: 1.5; }
.match.no { color: var(--c-partial); }
.paper { width: 100%; min-height: 240px; background: var(--c-paper); border-radius: 14px; padding: 12px; font-size: 15px; line-height: 1.8; margin-top: 10px;
  color: var(--c-text); font-family: var(--f-mark); border: 1px solid transparent; resize: vertical; }
.paper:focus { outline: none; border-color: var(--c-primary); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--c-cell); }
.shot { display: flex; gap: 10px; margin-top: 12px; }
.shot > * { flex: 1; }
.spin { display: flex; align-items: center; gap: 10px; color: var(--c-text-2); font-size: 14px; padding: 10px 0; }
.spin::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--c-line); border-top-color: var(--c-primary); animation: r .8s linear infinite; flex: none; }
@keyframes r { to { transform: rotate(1turn); } }
.steps div { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 8px 0; }
.steps .d { color: var(--c-gain); } .steps .w { color: var(--c-primary); font-weight: 700; } .steps .z { color: var(--c-text-3); }
.cand { display: block; padding: 10px 12px; border-radius: 14px; background: var(--c-cell); margin-top: 8px; color: inherit; font-size: 14px; line-height: 1.5; border: 0; width: 100%; text-align: left; }
.cand b { color: var(--c-primary); }

/* 结果页 */
.score { display: flex; align-items: center; gap: 16px; }
.ringbig { position: relative; width: 96px; height: 96px; flex: none; }
.ringbig b { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; line-height: 1; }
.ringbig b small { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }
.teacher { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; background: var(--c-primary-weak); border-radius: 16px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.ava { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #8EA8FF, #B79CFF); display: grid; place-items: center; color: #fff; font-size: 18px; flex: none; }
.seg { display: flex; background: var(--c-cell); border-radius: 14px; padding: 4px; margin-top: 14px; }
.seg button { flex: 1; text-align: center; padding: 8px 0; border-radius: 10px; font-size: 14px; color: var(--c-text-2); font-weight: 600; border: 0; background: none; }
.seg .on { background: var(--c-card); color: var(--c-text); font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.pt { border-top: 1px solid var(--c-line); padding: 12px 0; }
.pt:first-child { border-top: 0; padding-top: 0; }
.pth { display: flex; align-items: center; gap: 10px; }
.ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.ic.g { background: var(--c-gain); } .ic.p { background: var(--c-partial); } .ic.l { background: var(--c-lose); }
.pth .n { flex: 1; font-weight: 700; font-size: 15px; line-height: 1.45; min-width: 0; }
.pth .n span { display: block; font-size: 12px; color: var(--c-text-3); font-weight: 500; }
.pth .v { font-weight: 800; font-size: 16px; flex: none; }
.v.l { color: var(--c-lose); } .v.p { color: var(--c-partial); } .v.g { color: var(--c-gain); }
.why { margin: 8px 0 0 36px; font-size: 14px; line-height: 1.7; color: var(--c-text-2); }
.quote { background: var(--c-quote); color: var(--c-text); padding: 1px 3px; border-radius: 3px; }
.fix { margin-top: 6px; color: var(--c-gain); }
.fix::before { content: "怎么写："; font-weight: 800; }
.refsub { padding: 10px 0; border-top: 1px solid var(--c-line); white-space: pre-wrap; font-size: 15px; line-height: 1.8; }
.refsub:first-child { border-top: 0; padding-top: 0; }
.refsub b { color: var(--c-primary); }
.stat { display: flex; } .stat > div { flex: 1; text-align: center; }
.stat b { display: block; font-size: 30px; font-weight: 800; color: var(--c-primary); line-height: 1.3; }
.stat span { font-size: 13px; color: var(--c-text-2); }
.num { font-variant-numeric: tabular-nums; }
.essay-band { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 6px; }
.essay-grade { font-size: 44px; line-height: 1.1; font-weight: 900; color: var(--c-lose); font-family: var(--f-mark); }
.essay-score { font-size: 14px; color: var(--c-text-2); padding-bottom: 6px; }
.essay-score b { font-size: 20px; color: var(--c-text); }
.essay-sec { padding: 12px 0; border-top: 1px solid var(--c-line); }
.essay-sec:first-of-type { border-top: 0; }
.essay-tip { font-size: 15px; line-height: 1.75; margin-top: 6px; }
.warn { margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c-partial) 16%, var(--c-card)); color: var(--c-text); font-size: 14px; font-weight: 600; }
.warn::before { content: "⚠ "; color: var(--c-partial); }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: rgba(20,23,31,.88); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; z-index: 20; }

/* ===== A2 融合版（王导 11-07 定：主应用照 Claude Design 画布最新 A2 重做）=====
   雾面紫头部 + 暖黄主按钮 + 大圆角白卡 + 进度环 + 题号格；只有白色模式。放在最后，覆盖上面 v1.0 的值。 */
:root {
  --c-bg: #F4F4FB;
  --g-head: linear-gradient(180deg, #E1E6FF 0%, #EDE4FF 55%, #F4F4FB 100%);
  --c-primary: #4B5BD6; --c-primary-strong: #3442B8; --c-primary-weak: #EEF0FF;
  --c-text: #1B1D29; --c-text-2: #5F6475; --c-text-3: #6E7385;
  --c-line: #E6E7F2; --c-cell: #EFF0F6;
  --c-gain: #1FA971; --c-lose: #E5484D; --c-partial: #F5A300;
  --a2-yellow: #FFD23F; --a2-yellow-ink: #1D1B16; --a2-yellow-weak: #FFF3CC; --a2-amber: #F5A300;
  --r-card: 26px;
  --shadow: 0 10px 30px rgba(80,80,170,.10);
}
.head { min-height: 0; }
.hero b, .lead b { color: var(--c-primary); }
.hero .y { color: var(--a2-amber); }
.pill { background: var(--a2-yellow); color: var(--a2-yellow-ink); font-weight: 800; box-shadow: 0 8px 18px rgba(245,163,0,.32); }
.tag { background: var(--a2-yellow-weak); color: #8A5A00; }
.resume { background: var(--a2-yellow-weak); color: #6B4600; }
.tabbar .on { color: var(--c-primary); }
.tabbar .cam { background: var(--a2-yellow); color: var(--a2-yellow-ink); box-shadow: 0 8px 20px rgba(245,163,0,.4); }
.tabbar svg { display: block; margin: 0 auto 2px; }
.cell.mid { background: var(--a2-amber); color: #fff; }
.book { background: linear-gradient(160deg, #FFC24D, #F5A300); box-shadow: 3px 4px 0 #D98C00; }
.teacher { background: var(--c-primary-weak); }
.ava { background: linear-gradient(135deg, #8E9BFF, #B79CFF); font-size: 11px; font-weight: 800; }
.icon-img { width: 46px; height: 46px; flex: none; }
.ai-ph { position: absolute; right: 14px; top: 16px; width: 104px; height: 120px; border-radius: 22px; background: linear-gradient(160deg, #E9EBFF, #F1E8FF); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--c-text-3); line-height: 1.5; }
.fn { display: flex; gap: 10px; align-items: center; background: var(--c-card); border-radius: 20px; padding: 14px; box-shadow: 0 4px 16px rgba(80,80,170,.06); color: var(--c-text); }
.fn b { display: block; font-size: 15px; }
.fn span { font-size: 12px; color: var(--c-text-2); }
/* 大号「刷选择题」入口 */
.xz-entry { display: block; position: relative; overflow: hidden; border-radius: 28px; padding: 22px 20px 20px; color: var(--a2-yellow-ink);
  background: linear-gradient(135deg, #FFE27A 0%, #FFD23F 45%, #FFB938 100%); box-shadow: 0 14px 34px rgba(245,163,0,.35); }
.xz-entry .t1 { font-size: 30px; font-weight: 900; line-height: 1.15; }
.xz-entry .t2 { font-size: 14px; font-weight: 600; margin-top: 6px; opacity: .85; }
.xz-entry .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; height: 46px; padding: 0 24px; border-radius: 999px; background: var(--a2-yellow-ink); color: #FFE27A; font-weight: 800; font-size: 16px; }
.xz-entry .nums { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.xz-entry .nums span { background: rgba(255,255,255,.55); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.xz-entry .deco { position: absolute; right: -18px; bottom: -22px; width: 150px; height: 150px; opacity: .95; }
.seg-cells { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
/* 首页刷选择题大卡：科目标签直接进对应科目（王导 11-07「必须选一个学科」） */
.xz-entry .nums a { position: relative; z-index: 1; background: rgba(255,255,255,.75); color: var(--a2-yellow-ink); border-radius: 999px; padding: 9px 16px; font-size: 16px; font-weight: 800; }
.xz-entry .nums a small { font-size: 12px; font-weight: 600; opacity: .7; }
.xz-entry .nums { gap: 10px; margin-top: 14px; }
.xz-entry .go { position: relative; z-index: 1; }
.xz-entry .deco { z-index: 0; }
