/* 学习同步中心 · 样式
   设计：作业本。楷体 = 人说的话（结论、建议、鼓励）；黑体 = 数据和操作。
   荧光笔黄只用在"自主性指数"一处。深色模式是一块黑板。 */
:root {
  --paper: #f4f7f3;
  --surface: #ffffff;
  --cover: #e3ede5;
  --line: #d6e3da;
  --rule: #e6ece7;
  --ink: #1d2b4f;
  --muted: #5d6a75;
  --accent: #2747a8;
  --accent-soft: #e8edfa;
  --hl: #ffe45c;
  --ok: #2f7d57;
  --ok-soft: #e2f1e7;
  --warn: #a8650a;
  --warn-soft: #fcf0da;
  --danger: #c23a2e;
  --danger-soft: #fbe6e3;
  --margin: #eaa9a2;
  --sticker-1: #fff4c2;
  --sticker-2: #dff2e6;
  --sticker-3: #e3ebfb;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "AR PL UKai CN", "Noto Serif SC", serif;
  --r-lg: 18px;
  --r: 12px;
  --r-sm: 8px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17211c; --surface: #1e2a24; --cover: #24352c; --line: #34483d; --rule: #2c3c33;
    --ink: #e8eee7; --muted: #a2b2a8; --accent: #9dbbff; --accent-soft: #263452;
    --hl: #e6c84a; --ok: #7bd3a2; --ok-soft: #1f3a2d; --warn: #f0b75e; --warn-soft: #3b2e19;
    --danger: #ff8f83; --danger-soft: #45241f; --margin: #7a4540;
    --sticker-1: #3a3520; --sticker-2: #213a2d; --sticker-3: #24304a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── 按钮和表单 ── */
button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .45rem .95rem; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); }
button.link { border: none; background: none; padding: 0; color: var(--accent); border-radius: 4px; }
button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
button.link.danger { color: var(--danger); }
input[type=text], input[type=search], input[type=url], input[type=password], input[type=datetime-local], input[type=time], select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .55rem .7rem; width: 100%; font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 11rem; resize: vertical; line-height: 1.6; }
label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: .3rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; color: var(--ink); font-size: .95rem; }
.check input { margin-top: .35rem; accent-color: var(--accent); }

/* ── 顶栏 ── */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem;
  padding: .65rem 1.4rem; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
/* 田字格里的"学" */
.brand .mark {
  width: 30px; height: 30px; display: grid; place-items: center; border: 1.5px solid var(--ok); border-radius: 5px;
  font-family: var(--kai); font-weight: 400; font-size: 20px; color: var(--ok); line-height: 1;
  background:
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat,
    linear-gradient(90deg, var(--line), var(--line)) center / 1px 100% no-repeat;
}
.tag { font-size: .72rem; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .05rem .55rem; }
.nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); padding: .35rem .8rem; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--rule); }
.nav a[aria-current=page] { color: var(--ink); font-weight: 600; background: var(--cover); }
.child-pick { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .88rem; }
.child-pick select { width: auto; padding: .3rem .6rem; }
.userbox { display: flex; align-items: center; gap: .6rem; }
.banner-note { background: var(--warn-soft); border-bottom: 1px solid var(--rule); padding: .5rem 1.4rem; font-size: .92rem; text-align: center; }

/* ── 版面 ── */
.view { max-width: 1040px; margin: 0 auto; padding: 1.6rem 1.4rem 5rem; }
h1 { font-size: 1.6rem; line-height: 1.3; margin: 0 0 .3rem; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.lead { font-size: 1.05rem; margin: .25rem 0 0; color: var(--muted); max-width: 42em; }
.stack > * + * { margin-top: 1.1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.15rem 1.3rem; }

/* ── 周报封面：作业本封面上的姓名栏 + 楷体批语 ── */
.hero { background: var(--cover); border-radius: 22px; padding: 1.5rem 1.7rem 1.3rem; }
.plate {
  display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; width: fit-content; max-width: 100%;
  background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 10px; padding: .55rem 1.1rem;
}
.plate div { display: flex; align-items: baseline; gap: .5rem; }
.plate span { font-size: .82rem; color: var(--muted); }
.plate b { font-family: var(--kai); font-weight: 400; font-size: 1.18rem; border-bottom: 1px solid var(--ink); padding: 0 .5rem; min-width: 3.2em; text-align: center; }
.hero h1 { font-family: var(--kai); font-weight: 400; font-size: 2.15rem; margin: 1.1rem 0 .35rem; }
.verdict { font-family: var(--kai); font-size: 1.3rem; line-height: 1.7; color: var(--ink); max-width: 34em; margin: 0; }
.watch { margin: .35rem 0 0; color: var(--warn); font-size: .95rem; }
.period { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.period span { font-weight: 600; font-variant-numeric: tabular-nums; }
.period button { background: transparent; }

/* ── 提醒 ── */
.alert { border-radius: var(--r); padding: .8rem 1rem; border: 1px solid; border-left-width: 4px; }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); border-left-color: var(--warn); }
.alert.urgent { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 45%, transparent); border-left-color: var(--danger); }
.alert b { margin-right: .5rem; }
.alert details { margin-top: .4rem; font-size: .9rem; }
.alert details .rec { border-color: color-mix(in srgb, var(--ink) 12%, transparent); }

/* ── 核心数字：一条横排，不拆成一堆小卡片 ── */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); }
.metric { padding: 1rem 1.25rem 1.1rem; border-left: 1px dashed var(--line); }
.metric:first-child { border-left: none; }
.metric .v { font-size: 2.1rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric .v .of { font-size: .95rem; font-weight: 500; color: var(--muted); }
.metric .k { font-size: .88rem; color: var(--muted); margin-top: .2rem; }
/* 荧光笔：只画在自主性指数下面 */
.hl { position: relative; z-index: 0; padding: 0 .12em; }
.hl::before {
  content: ''; position: absolute; z-index: -1; left: -.08em; right: -.1em; bottom: .1em; height: .48em;
  background: var(--hl); border-radius: .35em .12em .4em .18em; transform: rotate(-2.5deg); opacity: .92;
}
@media (prefers-color-scheme: dark) { .hl { color: #1d2b4f; } .hl::before { height: .9em; bottom: .12em; } }
.delta-up { color: var(--ok); font-size: .95rem; font-weight: 600; margin-left: .2rem; }
.delta-down { color: var(--danger); font-size: .95rem; font-weight: 600; margin-left: .2rem; }

/* ── 图表 ── */
.bars { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: 6.8em 1fr 2.2em; align-items: center; gap: .7rem; font-size: .9rem; }
.bar-track { background: var(--rule); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.s-hi { background: var(--ok); }
.s-mid { background: var(--accent); }
.s-lo { background: var(--warn); }
.s-zero { background: var(--danger); }
.cols { display: flex; align-items: flex-end; gap: .8rem; height: 160px; padding-top: 1.4rem; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3rem; min-width: 0; }
.col .stick { width: 100%; max-width: 56px; background: var(--line); border-radius: 10px 10px 3px 3px; }
.col.cur .stick { background: var(--accent); }
.col .lbl { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.col .val { font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 90px; }
.hours div { background: var(--accent); border-radius: 4px 4px 1px 1px; min-height: 2px; }
.hours div.late { background: var(--warn); }
.hours div.zero { background: var(--rule); }
.hour-axis { display: grid; grid-template-columns: repeat(24, 1fr); font-size: .72rem; color: var(--muted); margin-top: .25rem; }

/* ── 给家长的话：写在横格纸上，左边一道红色页边线 ── */
.ruled {
  --lh: 2.1rem;
  font-family: var(--kai); font-size: 1.12rem; line-height: var(--lh);
  padding: 0 .4rem 0 2.6rem; margin: 0 -1.3rem; list-style: none;
  background:
    linear-gradient(90deg, transparent 1.7rem, var(--margin) 1.7rem, var(--margin) calc(1.7rem + 1.5px), transparent calc(1.7rem + 1.5px)),
    repeating-linear-gradient(transparent 0, transparent calc(var(--lh) - 1px), var(--line) calc(var(--lh) - 1px), var(--line) var(--lh));
}
.ruled li { margin: 0; }
.ruled + .row { margin-top: .9rem; }

/* ── 记录 ── */
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { font-size: .8rem; background: var(--rule); border-radius: 6px; padding: .08rem .5rem; white-space: nowrap; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.rec { border-top: 1px dashed var(--line); padding: .8rem 0; }
.rec:first-child { border-top: none; padding-top: .2rem; }
.rec .meta { font-size: .84rem; color: var(--muted); display: flex; gap: .2rem .8rem; flex-wrap: wrap; }
.rec .meta .subj { color: var(--ink); font-weight: 600; }
.rec .sum { margin: .25rem 0 .4rem; }
.rec details summary { cursor: pointer; color: var(--accent); }
.msgs { margin-top: .6rem; display: flex; flex-direction: column; gap: .4rem; font-size: .92rem; }
.msg { padding: .5rem .75rem; border-radius: 14px; max-width: 88%; white-space: pre-wrap; word-break: break-word; }
.msg.child { background: var(--accent-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.ai, .msg.unknown { background: var(--rule); align-self: flex-start; border-bottom-left-radius: 4px; }

/* ── 分段按钮 ── */
.tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; background: var(--rule); padding: .25rem; border-radius: 12px; margin-bottom: 1rem; }
.tabs button { border: none; background: transparent; padding: .38rem .9rem; border-radius: 9px; }
.tabs button[aria-pressed=true] { background: var(--surface); font-weight: 600; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent); }

/* ── 孩子端：贴纸和题目卡 ── */
.kid-hero h1 { font-family: var(--kai); font-weight: 400; font-size: 2.15rem; }
.kid-hero .lead { font-family: var(--kai); font-size: 1.2rem; color: var(--ink); }
.badges { display: flex; flex-wrap: wrap; gap: .75rem .6rem; padding: .3rem 0; }
.badge { background: var(--sticker-1); border-radius: 999px; padding: .45rem 1.05rem; font-size: .95rem; transform: rotate(-1.5deg); box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent); }
.badge:nth-child(3n+2) { background: var(--sticker-2); transform: rotate(1.2deg); }
.badge:nth-child(3n) { background: var(--sticker-3); transform: rotate(-.6deg); }
.badge b { font-size: 1.1em; }
.qcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.qcard { background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--line); border-radius: 6px 6px var(--r) var(--r); padding: .8rem .95rem; display: flex; flex-direction: column; gap: .4rem; }
.qcard[data-status="已掌握"] { border-top-color: var(--ok); }
.qcard[data-status="需要再练"] { border-top-color: var(--danger); }
.qcard[data-status="答案来自 AI"] { border-top-color: var(--warn); }
.qcard[data-status="待巩固"] { border-top-color: var(--accent); }
.qcard .q { font-weight: 600; word-break: break-word; }
.qcard .tip { font-family: var(--kai); font-size: 1rem; color: var(--muted); }

/* ── 其他 ── */
.result { border-left: 4px solid var(--accent); }
.kv { display: grid; grid-template-columns: 7.5em 1fr; gap: .3rem .9rem; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
code { background: var(--rule); padding: .05rem .35rem; border-radius: 5px; }
pre { background: var(--rule); padding: .85rem; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.note { background: var(--cover); border-radius: var(--r); padding: .75rem 1rem; font-size: .92rem; }
.toast { position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .65rem 1.1rem; border-radius: 12px; max-width: 90vw; box-shadow: 0 6px 24px color-mix(in srgb, var(--ink) 25%, transparent); }
.empty { font-family: var(--kai); font-size: 1.08rem; color: var(--muted); }

/* ── 后台表格 ── */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th, table.list td { text-align: left; padding: .55rem .6rem; border-top: 1px dashed var(--line); white-space: nowrap; }
table.list th { color: var(--muted); font-weight: 500; font-size: .84rem; border-top: none; }
table.list td.wrap { white-space: normal; }
table.list tr.bad td { background: var(--danger-soft); }
.cred { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
input[type=file] { font-size: .9rem; }

/* ── 登录：一本作业本的封面 ── */
.login { min-height: 82vh; display: grid; place-items: center; padding: 1rem; }
.login form {
  width: min(400px, 100%); background: var(--cover); border-radius: 8px 22px 22px 8px; padding: 2.2rem 2rem 1.8rem 2.6rem;
  border-left: 16px solid color-mix(in srgb, var(--ok) 55%, var(--cover));
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--ink) 45%, transparent);
}
.login .brand .mark { width: 40px; height: 40px; font-size: 27px; }
.login h1 { font-family: var(--kai); font-weight: 400; font-size: 2rem; margin: 0; }
.login .plate { width: 100%; flex-direction: column; gap: 1rem; padding: 1.1rem 1.2rem 1.2rem; }
.login .plate label { margin: 0; font-size: .85rem; }
.login input[type=text], .login input[type=password] {
  border: none; border-bottom: 1.5px solid var(--ink); border-radius: 0; background: transparent; padding: .35rem .2rem; font-size: 1.1rem;
}
.login input:focus { box-shadow: 0 2px 0 0 var(--accent); border-bottom-color: var(--accent); }

/* ── 手机 ── */
@media (max-width: 760px) {
  .top { display: grid; grid-template-columns: 1fr auto; gap: .45rem .6rem; padding: .6rem .9rem 0; }
  .userbox { grid-column: 2; grid-row: 1; justify-self: end; }
  .nav { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; margin: 0 -.9rem; padding: 0 .9rem .55rem; scrollbar-width: none; }
  .child-pick { grid-column: 1 / -1; padding-bottom: .5rem; }
  .grid2 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { border-left: none; }
  .metric:nth-child(n+3) { border-top: 1px dashed var(--line); }
}
@media (max-width: 640px) {
  .view { padding: 1.1rem .85rem 3.5rem; }
  .hero { padding: 1.1rem 1.1rem 1rem; border-radius: 18px; }
  .hero h1, .kid-hero h1 { font-size: 1.8rem; }
  .verdict { font-size: 1.15rem; }
  .metric .v { font-size: 1.75rem; }
  .bar-row { grid-template-columns: 5.6em 1fr 2em; }
  .kv { grid-template-columns: 6em 1fr; }
  .card { padding: 1rem 1rem; }
  .ruled { margin: 0 -1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .bar-fill, .col .stick { transition: height .4s ease-out, width .4s ease-out; }
}
.plate .period { margin: 0; gap: .35rem; }
.plate .period button { padding: 0 .5rem; border-radius: 999px; line-height: 1.6; background: transparent; }
.watch.calm { color: var(--ok); }
.login .plate div { display: block; }

/* ═════ 主题：学生端四套样子 + 教练后台 ═════ */
body { background: var(--paper); color: var(--ink); font-family: var(--bodyfont, var(--sans)); min-height: 100vh; }
.t-ink, .t-spring, .t-vivid, .t-admin { --ok: #2f6b55; --ok-soft: #e3f0ea; --warn: #8a5a12; --warn-soft: #fbeedd; --danger: #a8322a; --danger-soft: #f6e0dc; --hl: #ffe45c; }
.t-ink { --paper: #f3ede0; --surface: #faf6ec; --cover: #ebe3d2; --line: #cfc4ad; --rule: #e2d9c5; --ink: #2b2a28; --muted: #6b6558; --accent: #2f4a5e; --accent-soft: #e1e7e9; --a1: #a8322a; --a3: #3f6b5a; --on: #faf6ec; --rad: 3px; --r-lg: 3px; --r: 3px; --dw: 400; --display: 'Kaiti SC', 'STKaiti', 'KaiTi', 'Noto Serif SC', serif; --bodyfont: 'Songti SC', 'STSong', 'Noto Serif SC', 'SimSun', serif; }
.t-night { --paper: #111a33; --surface: #1a2547; --cover: #22305c; --line: #33416e; --rule: #2a3761; --ink: #eef1fa; --muted: #a9b3d1; --accent: #8aa5f0; --accent-soft: #263a6e; --a1: #e0a93a; --a3: #5fc0a4; --on: #111a33; --rad: 14px; --r-lg: 14px; --r: 10px; --dw: 700; --display: 'Songti SC', 'STSong', 'Noto Serif SC', serif; --bodyfont: 'Songti SC', 'STSong', 'Noto Serif SC', serif; --ok: #7bd3a2; --ok-soft: #1f3a2d; --warn: #f0b75e; --warn-soft: #3b2e19; --danger: #ff8f83; --danger-soft: #45241f; --hl: #e0a93a; }
.t-spring { --paper: #f1f6ea; --surface: #ffffff; --cover: #e2eed6; --line: #cfdcc2; --rule: #e1ebd7; --ink: #23351f; --muted: #566650; --accent: #2f6f4f; --accent-soft: #e0efe4; --a1: #bd4265; --a3: #3d6f8f; --on: #ffffff; --rad: 18px; --r-lg: 18px; --r: 12px; --dw: 400; --display: 'Kaiti SC', 'STKaiti', 'KaiTi', serif; --bodyfont: var(--sans); }
.t-vivid { --paper: #fff7e8; --surface: #ffffff; --cover: #ffecc9; --line: #ecdfc6; --rule: #f3e9d4; --ink: #1c1b3a; --muted: #5a5875; --accent: #3b3fd8; --accent-soft: #e6e7fb; --a1: #c93f0b; --a3: #0c7a5e; --on: #ffffff; --rad: 22px; --r-lg: 22px; --r: 14px; --dw: 900; --display: var(--sans); --bodyfont: var(--sans); }
.t-admin { --paper: #f4f5f7; --surface: #ffffff; --cover: #eef1f4; --line: #dfe3e8; --rule: #e9ecf0; --ink: #1d2733; --muted: #5b6673; --accent: #2f4a5e; --accent-soft: #e6ecf0; --a1: #a8322a; --a3: #2f6b55; --on: #ffffff; --rad: 10px; --r-lg: 10px; --r: 8px; --dw: 700; --display: var(--sans); --bodyfont: var(--sans); }
.t-night .art { filter: invert(1) hue-rotate(180deg); }
.t-admin h1 { font-family: var(--sans); font-weight: 700; font-size: 1.7rem; }
.display { font-family: var(--display); font-weight: var(--dw); letter-spacing: .04em; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on); }

.themepick { display: flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--muted); }
.themepick button { border-radius: 999px; padding: .3rem .8rem; min-height: 36px; background: transparent; white-space: nowrap; }
.themepick button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--on); }

/* 学生端：五个标签、横幅 */
.stabs { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.stab { font-family: var(--display); font-weight: var(--dw); font-size: 1.35rem; letter-spacing: .05em; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--rad); padding: .55rem 1.4rem; min-height: 44px; display: inline-flex; align-items: center; }
.stab:hover { border-color: var(--accent); }
.stab[aria-current=page] { background: var(--accent); border-color: var(--accent); color: var(--on); }
.banner { position: relative; overflow: hidden; min-height: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); padding: 2.4rem 2.6rem; display: flex; align-items: center; }
.banner .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.banner-text { position: relative; max-width: 21em; }
.banner-text h1 { font-family: var(--display); font-weight: var(--dw); font-size: 2.9rem; letter-spacing: .06em; margin: 0 0 .5rem; }
.banner-text p { margin: 0; font-size: 1.05rem; line-height: 1.8; color: var(--muted); }
.sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin: 1.2rem 0 0; }
.sec-title h2 { font-family: var(--display); font-weight: var(--dw); font-size: 2rem; letter-spacing: .06em; margin: 0; }
.sec-title span { color: var(--muted); font-size: .95rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); padding: 2rem 2.4rem; }
.signoff { font-size: .9rem; color: var(--muted); }

/* 他们眼中的你 */
.ai-headline { font-family: var(--display); font-weight: var(--dw); font-size: 2.35rem; line-height: 1.55; letter-spacing: .03em; margin: .8rem 0 1.4rem; max-width: 24em; }
.who { font-family: var(--display); font-weight: var(--dw); font-size: 1.6rem; letter-spacing: .08em; margin: 0; color: var(--accent); }
.who.coach { color: var(--a1); } .who.parent { color: var(--a3); }
.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1.4rem 2.2rem; border-top: 1px solid var(--line); padding-top: 1.4rem; margin-bottom: 1.2rem; }
.traits h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.traits p { margin: 0; line-height: 1.9; }
.letters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 1.4rem; }
.letter { display: flex; flex-direction: column; gap: .9rem; }
.letter .to { font-family: var(--display); font-weight: var(--dw); font-size: 1.35rem; margin: 0; }
.letter .body { margin: 0; font-size: 1.05rem; line-height: 2.1; text-indent: 2em; white-space: pre-wrap; }
.letter .signoff { align-self: flex-end; }

/* 成长印记 */
.statline { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); }
.statline div { padding: 1.1rem 1.7rem; display: flex; align-items: baseline; gap: .6rem; }
.statline b { font-family: var(--display); font-weight: var(--dw); font-size: 2.8rem; line-height: 1.1; }
.statline div:nth-child(1) b { color: var(--a1); } .statline div:nth-child(2) b { color: var(--accent); } .statline div:nth-child(3) b { color: var(--a3); }
.achs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.3rem; }
.ach { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); padding: 1.7rem 1.6rem; display: flex; gap: 1.1rem; }
.ach .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .6rem; }
.ach .quality { font-family: var(--display); font-weight: var(--dw); font-size: 2.6rem; line-height: 1.25; letter-spacing: .1em; color: var(--a1); }
.ach:nth-child(3n+2) .quality { color: var(--accent); } .ach:nth-child(3n) .quality { color: var(--a3); }
.ach p { margin: 0; line-height: 1.9; }
.ach .signoff { margin-top: auto; }
.seal { flex: none; align-self: flex-start; background: var(--a1); color: var(--on); border-radius: 4px; padding: .75rem .42rem; font-family: var(--display); font-size: 1.2rem; line-height: 1; writing-mode: vertical-rl; letter-spacing: .28em; }
.ach:nth-child(3n+2) .seal { background: var(--accent); } .ach:nth-child(3n) .seal { background: var(--a3); }
.timeline { list-style: none; margin: 0; padding: 1.8rem 2rem .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); }
.timeline li { display: grid; grid-template-columns: 6.2em 1.6em 1fr; gap: 0 .8rem; }
.timeline .when { color: var(--muted); font-size: .95rem; text-align: right; padding-top: .2rem; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; }
.timeline .dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line); margin-top: .45rem; }
.timeline .rail::after { content: ''; flex: 1; width: 2px; background: var(--line); margin-top: 4px; }
.timeline li:last-child .rail::after { display: none; }
.timeline .what { padding-bottom: 1.6rem; display: flex; flex-direction: column; gap: .2rem; }
.timeline .what b { font-size: 1.12rem; }
.timeline .what span { color: var(--muted); line-height: 1.8; }
.timeline li.big .dot { width: 18px; height: 18px; background: var(--a1); margin-top: .35rem; }
.timeline li.big .what b { font-family: var(--display); font-weight: var(--dw); font-size: 1.6rem; letter-spacing: .04em; color: var(--a1); }

/* 我的梦想、当下聚焦 */
.dreambox { background: var(--accent); color: var(--on); border-radius: var(--rad); padding: 2.6rem 2.6rem 2.3rem; }
.dreambox h2 { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; letter-spacing: .12em; }
.dreambox .dream { font-family: var(--display); font-weight: var(--dw); font-size: 2.8rem; line-height: 1.5; letter-spacing: .05em; margin: 0 0 1rem; white-space: pre-wrap; }
.dreambox .dream.empty { font-size: 1.6rem; color: var(--on); }
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 1.4rem; }
.goal h3 { font-family: var(--display); font-weight: var(--dw); font-size: 1.6rem; line-height: 1.4; letter-spacing: .04em; margin: 0 0 .7rem; }
.goal p { margin: 0; padding: .7rem 0; line-height: 1.9; border-top: 1px solid var(--line); }
.goal p:first-of-type { border-top: none; padding-top: 0; }
.focus-headline { font-family: var(--display); font-weight: var(--dw); font-size: 2.7rem; line-height: 1.45; letter-spacing: .05em; color: var(--a1); margin: .4rem 0 1.6rem; }
.evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 1.6rem 2.6rem; border-top: 1px solid var(--line); padding-top: 1.6rem; }
.evidence h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.evidence p { margin: 0 0 .4rem; line-height: 1.95; white-space: pre-wrap; }
.next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.next h3 { font-family: var(--display); font-weight: var(--dw); font-size: 1.6rem; margin: 0 0 .3rem; }
.next p { margin: 0; line-height: 1.9; }
a.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.3rem; border-radius: var(--rad); background: var(--accent); color: var(--on); text-decoration: none; }

/* 挑战台 */
.steps4 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); }
.steps4 li { padding: 1.2rem 1.5rem; line-height: 1.8; }
.steps4 b { display: block; font-family: var(--display); font-weight: var(--dw); font-size: 1.6rem; color: var(--a1); }
.chals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 1.4rem; }
.chal { display: flex; flex-direction: column; gap: .7rem; }
.chal .top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; }
.chal h3 { font-family: var(--display); font-weight: var(--dw); font-size: 1.75rem; letter-spacing: .06em; margin: 0; }
.chal p { margin: 0; line-height: 1.9; }
.pill { font-size: .88rem; border-radius: 999px; padding: .1rem .8rem; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.on { background: var(--a3); border-color: var(--a3); color: var(--on); }
.pill.done { background: var(--a1); border-color: var(--a1); color: var(--on); }
.promptbox { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--rad); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.promptbox pre { margin: 0; background: transparent; padding: 0; font-family: inherit; font-size: .95rem; line-height: 1.8; }
button.go { align-self: flex-start; min-height: 46px; padding: 0 1.5rem; background: var(--a1); border-color: var(--a1); color: var(--on); font-weight: 600; }

/* 教练后台 */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--rad); }
.counters div { padding: 1rem 1.4rem; }
.counters b { display: block; font-size: 1.9rem; line-height: 1.2; }
.counters .hot b { color: var(--a1); }
.quoteblock { background: var(--paper); border-radius: 8px; padding: .8rem 1rem; white-space: pre-wrap; }
.coachonly { background: var(--warn-soft); border-radius: 8px; padding: .8rem 1rem; }
.coachonly > b { display: block; font-size: .85rem; font-weight: 500; color: var(--warn); margin-bottom: .2rem; }
.fld { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .7rem; }
.fld textarea { min-height: 5rem; }
.item { border: 1px solid var(--rule); border-radius: 8px; padding: .9rem 1rem .3rem; margin-bottom: .7rem; }
.editor h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.tag-state { font-size: .8rem; font-weight: 500; border-radius: 4px; padding: .05rem .5rem; background: var(--warn-soft); color: var(--warn); }
.tag-state.ok { background: var(--ok-soft); color: var(--ok); }

@media (max-width: 760px) {
  .banner { min-height: 220px; padding: 1.4rem 1.3rem; }
  .banner .art { opacity: .28; }
  .banner-text h1 { font-size: 2.1rem; }
  /* 手机上五个标签固定在屏幕底部，大拇指够得着 */
  .stabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0; padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom)); gap: .15rem; flex-wrap: nowrap; background: var(--surface); border-top: 1px solid var(--line); }
  .stab { flex: 1 1 0; min-width: 0; min-height: 52px; justify-content: center; text-align: center; font-size: .86rem; line-height: 1.25; letter-spacing: 0; padding: .3rem .15rem; border-color: transparent; }
  .view { padding-bottom: 6.5rem; }
  .toast { bottom: 5.5rem; }
  .panel { padding: 1.3rem 1.2rem; }
  .ai-headline { font-size: 1.7rem; } .focus-headline, .dreambox .dream { font-size: 1.9rem; }
  .dreambox { padding: 1.6rem 1.3rem; }
  .timeline { padding: 1.2rem .9rem .2rem; } .timeline li { grid-template-columns: 4.6em 1.2em 1fr; gap: 0 .5rem; }
  .themepick { grid-column: 1 / -1; padding-bottom: .5rem; }
  .themepick button { min-height: 40px; flex: 1; }
}

/* 手机上，工作台顶上的四个数字排成两行两列，不占满一屏 */
@media (max-width: 760px) { .counters { grid-template-columns: 1fr 1fr; } .counters div { padding: .7rem 1rem; } .counters b { font-size: 1.6rem; } }

/* 挑战卡：记录没自动回来时，自己贴 */
.paste { margin-top: .7rem; } .paste summary { cursor: pointer; color: var(--accent); } .paste textarea { min-height: 7rem; margin: .5rem 0; }
