* { margin: 0; padding: 0; box-sizing: border-box; }
  :root {
    --brand-from:#2f54eb; --brand-to:#1d39c4; --brand:#2f54eb; --brand-hover:#1d39c4;
    --brand-soft:#e6efff; --brand-border:#bcd3ff; --brand-wash:#f0f5ff;
    --bg:#f5f6f8; --surface:#ffffff; --surface-subtle:#f8f9fb;
    --text:#1f2329; --text-2:#646a73; --text-3:#8f959e;
    --border:#dee0e3; --border-light:#eff0f1; --disabled:#bcc4d0;
    --success:#2ea44f; --success-soft:#e8f6ed;
    --error:#d83931; --error-soft:#fdeceb;
    --warning:#d48806; --warning-soft:#fff7e6;
    --timer:#646a73; --timer-warn:#d48806;
    --accent:#ff8f1f; --accent-soft:#fff3e6;
    --font:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
    --r-sm:6px; --r-md:8px; --r-card:10px; --r-panel:12px; --r-lg:14px; --r-pill:999px;
    --sh-card:0 1px 3px rgba(0,0,0,.06); --sh-hover:0 4px 10px rgba(31,35,41,.10); --sh-pop:0 6px 20px rgba(31,35,41,.16);
    --t-fast:150ms ease; --t-norm:200ms ease;
  }
  body[data-tone="grade7"] { --accent:#2f54eb; --accent-soft:#eef2ff; }
  body[data-tone="parent"] { --accent:#6b7a99; --accent-soft:#f0f2f6; }
  body { font-family:var(--font); font-size:14px; line-height:1.6; color:var(--text); background:var(--bg); -webkit-tap-highlight-color:transparent; }
  .wrap { max-width:720px; margin:0 auto; padding:16px 16px 92px; }

  header.hd { background:linear-gradient(135deg,var(--brand-from),var(--brand-to)); color:#fff; border-radius:var(--r-panel); padding:20px 18px; margin-bottom:14px; }
  header.hd h1 { font-size:20px; font-weight:700; margin-bottom:4px; }
  header.hd p { font-size:13px; opacity:.85; }
  .hd-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .hd-timer { display:flex; align-items:center; gap:6px; font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; color:#fff; }
  .hd-timer svg { width:20px; height:20px; opacity:.9; }

  .panel { background:var(--surface); border-radius:var(--r-panel); padding:16px; margin-bottom:14px; box-shadow:var(--sh-card); }
  .panel h2 { font-size:16px; font-weight:600; margin-bottom:12px; }
  .hint { font-size:12px; color:var(--text-3); margin-top:8px; }
  .notice { font-size:13px; background:var(--brand-wash); color:var(--brand-hover); border-radius:var(--r-md); padding:10px 12px; margin-bottom:14px; }
  .page { display:none; }
  .page.on { display:block; animation:fade var(--t-norm); }
  @keyframes fade { from { opacity:0; } to { opacity:1; } }

  label.fld { display:block; font-size:12px; color:var(--text-2); margin-bottom:4px; }
  input.txt { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--r-md); font-size:14px; background:#fff; font-family:var(--font); }
  input.txt:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(47,84,235,.15); }
  .field { margin-bottom:14px; }

  .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:none; border-radius:var(--r-md); font-family:var(--font); font-size:14px; font-weight:500; cursor:pointer; transition:all var(--t-fast); user-select:none; padding:10px 20px; }
  .btn svg { width:18px; height:18px; }
  .btn-primary { background:var(--brand); color:#fff; }
  .btn-primary:hover:not(:disabled) { background:var(--brand-hover); transform:translateY(-1px); }
  .btn-primary:disabled { background:var(--disabled); cursor:not-allowed; }
  .btn-secondary { background:var(--brand-soft); color:var(--brand); border:1px solid var(--brand-border); }
  .btn-secondary:hover { background:#dbe7ff; }
  .btn:focus-visible, .icon-btn:focus-visible, .opt:focus-visible, .chip:focus-visible, a:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }

  .icon-btn { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border:none; border-radius:var(--r-panel); background:var(--surface-subtle); color:var(--text-2); cursor:pointer; transition:all var(--t-fast); flex-shrink:0; }
  .icon-btn svg { width:22px; height:22px; }
  .icon-btn:hover { background:var(--brand-soft); color:var(--brand); }
  .icon-btn.primary { background:var(--brand); color:#fff; }
  .icon-btn.primary:hover { background:var(--brand-hover); }
  .icon-btn.danger { color:var(--error); }
  .icon-btn.success { color:var(--success); }

  .grade-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .grade-card { position:relative; overflow:hidden; text-align:left; background:var(--surface); border-radius:var(--r-lg); padding:16px 14px; border:1px solid var(--border-light); box-shadow:var(--sh-card); cursor:pointer; transition:all var(--t-norm); }
  .grade-card:hover { box-shadow:var(--sh-hover); transform:translateY(-2px); }
  .grade-card::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--accent); }
  .grade-card.on { border-color:var(--brand); background:var(--brand-wash); }
  .grade-card .gname { font-size:16px; font-weight:700; }
  .grade-card .gsub { font-size:12px; color:var(--text-2); margin-top:2px; }

  .sub-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
  .sub-card { background:var(--surface); border-radius:var(--r-card); padding:14px 8px; text-align:center; border:1px solid var(--border-light); box-shadow:var(--sh-card); cursor:pointer; transition:all var(--t-fast); }
  .sub-card:hover { transform:translateY(-2px); box-shadow:var(--sh-hover); border-color:var(--brand-border); }
  .sub-card .sico { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:var(--r-card); background:var(--accent-soft); color:var(--accent); margin-bottom:6px; }
  .sub-card .sico svg { width:22px; height:22px; }
  .sub-card .sname { font-size:14px; font-weight:500; }

  .progress-wrap { margin-bottom:14px; }
  .progress-top { display:flex; align-items:center; justify-content:space-between; font-size:13px; color:var(--text-2); margin-bottom:6px; }
  .progress-segs { display:flex; gap:4px; }
  .progress-segs span { flex:1; height:6px; border-radius:var(--r-pill); background:var(--border); transition:background var(--t-fast); }
  .progress-segs span.done { background:var(--brand); }
  .progress-segs span.cur { background:var(--brand-hover); }

  .q-card { background:var(--surface); border-radius:var(--r-panel); padding:16px; margin-bottom:14px; box-shadow:var(--sh-card); }
  .badge { display:inline-block; font-size:12px; padding:1px 8px; border-radius:var(--r-pill); background:var(--surface-subtle); color:var(--text-2); margin-right:6px; white-space:nowrap; }
  .badge.sample { background:var(--warning-soft); color:var(--warning); }
  .badge.ok { background:var(--success-soft); color:var(--success); }
  .badge.err { background:var(--error-soft); color:var(--error); }
  .badge.redo1 { background:var(--warning-soft); color:var(--warning); }
  .badge.redo2 { background:var(--warning-soft); color:var(--warning); }
  .badge.passed { background:var(--success-soft); color:var(--success); }
  .badge.removed { background:var(--surface-subtle); color:var(--text-3); }
  .q-stem { font-size:16px; font-weight:500; line-height:1.7; margin:10px 0 14px; }
  .opts { display:flex; flex-direction:column; gap:10px; }
  .opt { display:flex; align-items:center; gap:12px; min-height:52px; padding:12px 14px; border:1px solid var(--border); border-radius:var(--r-md); background:#fff; cursor:pointer; text-align:left; font-family:var(--font); font-size:14px; color:var(--text); transition:all var(--t-fast); }
  .opt:hover { border-color:var(--brand-border); }
  .opt .letter { width:24px; height:24px; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; border-radius:var(--r-sm); background:var(--surface-subtle); color:var(--text-2); font-weight:600; font-size:13px; }
  .opt.sel { border-color:var(--brand); background:var(--brand-soft); font-weight:600; }
  .opt.sel .letter { background:var(--brand); color:#fff; }
  .opt.correct { border-color:var(--success); background:var(--success-soft); }
  .opt.correct .letter { background:var(--success); color:#fff; }
  .opt.wrong { border-color:var(--error); background:var(--error-soft); }
  .opt.wrong .letter { background:var(--error); color:#fff; }
  .opt .mark { margin-left:auto; font-weight:700; }

  .action-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .action-bar .hint { flex:1; text-align:center; margin:0; }

  .score-hero { text-align:center; padding:24px 0 16px; }
  .score-num { font-size:36px; font-weight:700; color:var(--brand); line-height:1.2; }
  .score-sub { font-size:13px; color:var(--text-2); margin-top:4px; }
  .res-list { display:flex; flex-direction:column; }
  .res-item { padding:12px 0; border-bottom:1px solid var(--border-light); }
  .res-item:last-child { border-bottom:none; }
  .res-item .r1 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .res-item .r1 .idx { font-weight:600; }
  .res-item .r2 { font-size:13px; color:var(--text-2); margin-top:4px; word-break:break-all; }
  .res-item .r3 { display:flex; align-items:center; gap:8px; margin-top:8px; flex-wrap:wrap; }
  .reason-box { margin-top:10px; padding:10px; background:var(--surface-subtle); border-radius:var(--r-md); }
  .reason-box .rt { font-size:12px; color:var(--text-2); margin-bottom:8px; }
  .chips { display:flex; flex-wrap:wrap; gap:8px; }
  .chip { border:1px solid var(--border); background:#fff; border-radius:var(--r-pill); padding:6px 12px; font-size:12px; font-family:var(--font); color:var(--text-2); cursor:pointer; transition:all var(--t-fast); }
  .chip:hover, .chip.on { border-color:var(--brand); color:var(--brand); background:var(--brand-soft); }

  .list { display:flex; flex-direction:column; }
  .li-row { display:flex; align-items:flex-start; gap:10px; padding:12px 0; border-bottom:1px solid var(--border-light); }
  .li-row:last-child { border-bottom:none; }
  .li-main { flex:1; min-width:0; }
  .li-main .l1 { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
  .li-main .l2 { font-size:13px; color:var(--text-2); margin-top:4px; word-break:break-all; }
  .li-main .l3 { font-size:12px; color:var(--text-3); margin-top:4px; }
  .li-actions { display:flex; gap:6px; align-items:center; }
  .li-actions .icon-btn { width:40px; height:40px; border-radius:var(--r-md); }
  .li-actions .icon-btn svg { width:20px; height:20px; }

  .filter-bar { display:flex; align-items:center; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
  .filter-chips { display:flex; gap:6px; flex-wrap:wrap; }

  .empty { text-align:center; color:var(--text-3); padding:28px 8px; font-size:13px; }
  .empty .eico { width:40px; height:40px; margin:0 auto 10px; color:var(--text-3); opacity:.6; }
  .empty .eico svg { width:40px; height:40px; }

  .stat-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:14px; }
  .stat { background:var(--surface); border-radius:var(--r-card); padding:12px 8px; text-align:center; box-shadow:var(--sh-card); }
  .stat .num { font-size:22px; font-weight:700; color:var(--brand); }
  .stat .lbl { font-size:12px; color:var(--text-2); margin-top:2px; }
  .bar-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
  .bar-row .bl { width:44px; font-size:13px; color:var(--text-2); flex-shrink:0; }
  .bar-track { flex:1; height:10px; background:var(--surface-subtle); border-radius:var(--r-pill); overflow:hidden; }
  .bar-fill { height:100%; background:var(--brand); border-radius:var(--r-pill); }
  .bar-row .bv { width:28px; text-align:right; font-size:12px; color:var(--text-2); }

  .bottom-nav { position:fixed; left:50%; transform:translateX(-50%); bottom:0; width:100%; max-width:720px; background:#fff; border-top:1px solid var(--border-light); display:flex; z-index:20; box-shadow:0 -2px 10px rgba(0,0,0,.05); }
  .bottom-nav .tab { flex:1; min-height:56px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border:none; background:none; cursor:pointer; color:var(--text-3); font-family:var(--font); font-size:11px; }
  .bottom-nav .tab svg { width:22px; height:22px; }
  .bottom-nav .tab.on { color:var(--brand); }
  .bottom-nav.hidden { display:none; }

  .toast { position:fixed; left:50%; bottom:96px; transform:translate(-50%,10px); background:rgba(31,35,41,.92); color:#fff; font-size:13px; padding:10px 16px; border-radius:var(--r-md); box-shadow:var(--sh-pop); opacity:0; pointer-events:none; transition:opacity var(--t-norm), transform var(--t-norm); z-index:50; max-width:90%; text-align:center; }
  .toast.show { opacity:1; transform:translate(-50%,0); }
  .demo-links { font-size:12px; color:var(--text-3); text-align:center; margin-top:8px; }
  .demo-links a { color:var(--brand); text-decoration:none; cursor:pointer; }

  @media (min-width:640px) { .wrap { padding-left:24px; padding-right:24px; } }
  @media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; transition-duration:.01ms !important; } }

  /* API 版新增: toast 错误态 */
  .toast.err { background:rgba(180,48,40,.94); }

  /* 正式上线：答案与解析展示 */
  .res-item .r4 { font-size:12px; color:var(--text-2); margin-top:6px; line-height:1.55; word-break:break-all; }
  .li-main .l4 { font-size:12px; color:var(--text-2); margin-top:4px; line-height:1.55; word-break:break-all; }
