  :root { --bottom-nav-height: 62px; --wrong-training-bar-height: 92px; }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scrollbar-gutter: stable; }
  body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f6fb; color: #1f2330; line-height: 1.6;
  }
  header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff; padding: 13px 20px 12px; text-align: center;
    overflow: hidden; position: relative;
    max-height: 120px;
    transition: max-height .6s ease, opacity .55s ease, transform .6s ease, padding .6s ease;
  }
  header.splash-out {
    max-height: 0; opacity: 0; transform: translateY(-24px);
    padding-top: 0; padding-bottom: 0;
  }
  header .logo { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
  header .logo span { color: #fbbf24; }
  header .sub { font-size: 11px; opacity: .9; margin-top: 2px; }
  main { max-width: 860px; margin: 0 auto; padding: 18px 16px 80px; }
  .view { display: none; }
  .view.active { display: block; }
  /* 统一栏目小顶部 */
  .page-head { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 2px 2px 12px; }
  .page-head .ph-ico { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; box-shadow: 0 5px 14px rgba(79,70,229,.28); flex-shrink: 0; }
  .page-head .ph-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .page-head .ph-title { font-size: 18px; font-weight: 800; color: #1f2330; line-height: 1.15; }
  .page-head .ph-sub { font-size: 12px; color: #8a90a2; margin-top: 3px; line-height: 1.35; }
  .page-head .ph-action { margin-left: auto; font-size: 13px; color: #ef4444; background: none; border: none; cursor: pointer; white-space: nowrap; }
  .page-head .ph-actions { margin-left: auto; display: flex; gap: 14px; align-items: center; white-space: nowrap; }
  .nav-item,.wb-print,.wb-book,.child-card,.cc-edit,.modal-close,.modal-x,.me-gear {
    font: inherit; appearance: none; -webkit-appearance: none;
    background: none; border: 0; padding: 0; color: inherit;
  }
  .nav-item,.wb-book,.child-card { border: 0; }
  :where(.nav-item,.wb-print,.wb-book,.child-card,.cc-edit,.modal-close,.modal-x,.me-gear):focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 3px;
  }
  .wb-print { font-size: 13px; color: #4f46e5; background: #eef0fb; border: 1px solid #c7d2fe; border-radius: 8px; padding: 5px 10px; cursor: pointer; transition: .15s; }
  .wb-print:hover { background: #e4e7ff; }
  .wb-print[aria-busy="true"] { opacity: .65; cursor: wait; pointer-events: none; }
  .print-ticket-content { text-align: center; }
  .print-ticket-code { font: 700 32px/1.2 monospace; letter-spacing: 2px; color: #111827; }
  .print-ticket-qr { display: flex; justify-content: center; margin: 16px 0; }
  .print-ticket-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .print-ticket-actions .btn { min-width: 0; margin-top: 0; }
  @media (max-width: 390px) {
    .print-ticket-actions { grid-template-columns: 1fr; }
  }
  .card {
    background: #fff; border-radius: 16px; padding: 22px;
    box-shadow: 0 6px 24px rgba(60,40,120,.08); margin-bottom: 20px;
  }
  .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field.full { grid-column: 1 / -1; }
  label { font-size: 13px; color: #555; font-weight: 600; }
  select, input {
    padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px;
    font-size: 14px; background: #fafbff; outline: none; transition: .15s;
  }
  select:focus, input:focus { border-color: #7c3aed; background: #fff; }
  .btn {
    margin-top: 18px; width: 100%; padding: 13px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
    font-size: 15px; font-weight: 700; cursor: pointer; transition: .15s;
  }
  .btn:hover { opacity: .92; transform: translateY(-1px); }
  .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
  .btn.ghost { background: #f3f4ff; color: #4f46e5; margin-top: 12px; border: 1.5px solid #c7d2fe; font-weight: 600; padding: 9px 15px; box-sizing: border-box; }
  /* 出题模式切换 + 章节级联 + 自由组合 */
  .seg { display: flex; gap: 8px; }
  .seg-btn { flex: 1; padding: 10px; border: 1.5px solid #e5e7eb; background: #fff; border-radius: 10px; cursor: pointer; font-size: 14px; color: #6b7280; transition: .15s; }
  .seg-btn.active { border-color: #4f46e5; background: #eef0fb; color: #4f46e5; font-weight: 600; }
  .combo-box { max-height: 180px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 8px; }
  .combo-box label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; background: #f8f9fc; border: 1px solid #eceef5; border-radius: 8px; padding: 5px 9px; cursor: pointer; }
  .combo-box input { margin: 0; }
  /* 设置面板 */
  .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid #f1f1f4; }
  .set-row:last-of-type { border-bottom: none; }
  .set-label { font-size: 14px; color: #1f2330; font-weight: 600; }
  .set-sub { font-size: 12px; color: #9aa0ad; margin-top: 2px; }
  .set-val { font-size: 14px; color: #4f46e5; font-weight: 700; text-align: right; }
  .set-val.muted { color: #f59e0b; }
  .set-val.link { color: #4f46e5; cursor: pointer; text-decoration: underline; }
  .set-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg,#4f46e5,#7c3aed); color:#fff; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:800; flex-shrink:0; }
  .btn.alt { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
  .btn.green { background: linear-gradient(135deg, #16a34a, #15803d); }
  .q {
    border: 1px solid #eee; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
    background: #fff;
  }
  .q-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
  .q-no { font-weight: 800; color: #4f46e5; }
  .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eef0fb; color: #5b54d6; }
  .tag.diff-简单 { background: #e7f7ee; color: #1a9e5a; }
  .tag.diff-中等 { background: #fff4e0; color: #c97a13; }
  .tag.diff-困难 { background: #fdeaea; color: #d6453d; }
  .tag.kp { background: #eef2ff; color: #4338ca; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tag.master { background: #dcfce7; color: #15803d; }
  .stem { font-size: 15px; margin-bottom: 10px; white-space: pre-wrap; }
  .opts { display: flex; flex-direction: column; gap: 8px; }
  .opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e6e6f0; border-radius: 9px; cursor: pointer; transition: .12s; }
  .opt:hover { border-color: #c9b8f5; background: #faf8ff; }
  .opt input { margin: 0; }
  .ans-input { width: 100%; padding: 9px 12px; border: 1px solid #e6e6f0; border-radius: 9px; font-size: 14px; }
  .blank-inputs { display: grid; gap: 9px; margin-top: 10px; }
  .blank-row { display: flex; align-items: center; gap: 9px; }
  .blank-label { color: #6366f1; font-size: 12px; font-weight: 700; white-space: nowrap; min-width: 42px; }
  .blank-row .ans-input { flex: 1; min-width: 0; }
  .blank-results { margin-top: 7px; display: grid; gap: 3px; font-size: 12px; }
  .blank-result.ok { color: #15803d; }
  .blank-result.no { color: #b91c1c; }
  .result-line { font-size: 14px; padding: 8px 12px; border-radius: 9px; margin-top: 10px; display: none; }
  .result-line.ok { display: block; background: #e7f7ee; color: #1a9e5a; }
  .result-line.no { display: block; background: #fdeaea; color: #d6453d; }
  .result-line .exp { display: block; margin-top: 6px; font-size: 13px; color: #666; }
  .score-bar { text-align: center; font-size: 16px; font-weight: 700; color: #4f46e5; padding: 14px; }
  .loading { text-align: center; color: #888; padding: 20px; }
  .err { background: #fdeaea; color: #d6453d; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; display: none; }
  .hidden { display: none !important; }
  .round-title { font-size: 15px; font-weight: 700; color: #4338ca; margin-bottom: 14px; }
  .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
  .actions .btn { margin-top: 0; }
  .report-text { white-space: pre-wrap; font-size: 14px; line-height: 1.9; color: #2b2f3a; }
  .report-head { font-weight: 800; color: #4338ca; margin-bottom: 12px; font-size: 16px; }
  .wb-head { display: flex; justify-content: space-between; align-items: center; }
  .wb-head .t { font-weight: 800; color: #4f46e5; font-size: 16px; }
  .wb-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
  .wb-item { border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; }
  .wb-item .kp { font-weight: 700; font-size: 14px; }
  .wb-item .meta { font-size: 12px; color: #888; margin-top: 4px; }
  .wb-item-compact { padding: 9px 10px; }
  .wb-compact-row { display: flex; align-items: center; gap: 8px; }
  .wb-compact-row > .tag { flex: 0 0 auto; }
  .wb-compact-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; line-height: 1.45; }
  .wb-compact-copy strong { overflow: hidden; color: #2f3342; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .wb-compact-copy > span { color: #858a9a; font-size: 11px; }
  /* 年级适配复核面板 */
  .gc-card { margin-top: 16px; border: 1px solid #e3e8ff; background: #fbfcff; }
  .gc-head { font-weight: 800; color: #4338ca; font-size: 15px; margin-bottom: 10px; }
  .gc-overall { font-size: 14px; line-height: 1.8; color: #2b2f3a; background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
  .gc-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.7; padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; }
  .gc-item.ok { background: #eafaf0; color: #1f8a4c; }
  .gc-item.bad { background: #fff3e6; color: #c2560b; }
  .gc-ico { flex: 0 0 auto; }
  .gc-body { flex: 1; }
  .wb-empty { color: #999; font-size: 13px; padding: 8px 0; }
  .wb-clear { font-size: 12px; color: #d6453d; cursor: pointer; background: none; border: none; }
  .wb-prac { margin-top: 8px; font-size: 12px; padding: 5px 12px; border: 1px solid #c9b8f5; background: #faf8ff; color: #4f46e5; border-radius: 8px; cursor: pointer; }
  .wb-prac:hover { background: #efe9ff; }
  .wrong-training-choice {
    min-width: 0; min-height: 44px; margin: 0; padding: 5px 7px; display: flex; flex: 1;
    align-items: center; gap: 9px; border: 1px solid #e4e7ff; border-radius: 9px;
    background: #f8f9ff; color: #4f46e5; cursor: pointer;
  }
  .wrong-training-choice input { margin: 0; flex: 0 0 auto; }
  .wrong-training-static { min-width: 0; min-height: 44px; padding: 5px 7px; display: flex; flex: 1; align-items: center; }
  .wb-item-details { margin: 5px 3px 0; }
  .wb-item-details summary { width: fit-content; min-height: 34px; display: flex; align-items: center; color: #6d63dc; font-size: 11px; cursor: pointer; }
  .wb-item-details .meta { padding: 2px 0 5px; line-height: 1.65; }
  .wb-item-details .wb-prac { margin: 2px 0 4px; }
  .batch-wrong-training-bar {
    align-self: stretch; padding: 10px; border: 1px solid #e4e7ff; border-radius: 12px;
    background: rgba(255,255,255,.96); box-shadow: 0 5px 18px rgba(60,40,120,.1);
  }
  .batch-wrong-training-bar .btn { margin-top: 0; }
  .batch-wrong-training-bar .wb-training-status { margin: 0 0 8px; }
  /* 错题本：学科分册书架 */
  .wb-shelf-hint { font-size: 13px; color: #888; margin: 2px 0 12px; }
  .wb-shelf { display: flex; flex-wrap: wrap; gap: 16px 14px; padding: 4px 2px 8px; }
  .wb-book {
    --bc: #6366f1;
    width: 132px; min-height: 168px; border-radius: 7px 11px 11px 7px; position: relative; overflow: hidden;
    cursor: pointer; color: #fff; box-shadow: 0 5px 12px rgba(0,0,0,.18);
    background: var(--bc);
    background: linear-gradient(135deg, var(--bc), color-mix(in srgb, var(--bc) 55%, #000));
    transition: transform .15s, box-shadow .15s; display: flex;
  }
  .wb-book:hover { transform: translateY(-4px); box-shadow: 0 9px 18px rgba(0,0,0,.26); }
  .wb-book:active { transform: translateY(-1px); }
  .wb-book-spine { width: 9px; background: rgba(0,0,0,.28); flex: 0 0 9px; }
  .wb-book-body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 8px 8px 8px 4px; gap: 5px; }
  .wb-book-emoji { font-size: 24px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
  .wb-book-title { font-size: 18px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
  .wb-book-sub { font-size: 12px; opacity: .95; }
  .wb-book-stat { display: flex; flex-direction: column; gap: 1px; font-size: 10px; line-height: 1.35; opacity: .88; margin-top: 2px; }
  .wb-back { align-self: flex-start; font-size: 13px; color: #4f46e5; background: none; border: none; cursor: pointer; padding: 4px 0 10px; font-weight: 600; }
  .wb-scope-tabs { display: flex; gap: 7px; padding: 4px; border-radius: 11px; background: #f1f3f9; }
  .wb-scope-tab { flex: 1; border: none; border-radius: 8px; padding: 8px 10px; background: transparent; color: #7a7f90; font-size: 13px; font-weight: 700; cursor: pointer; }
  .wb-scope-tab.active { background: #fff; color: #4f46e5; box-shadow: 0 2px 7px rgba(79,70,229,.13); }
  .wb-scope-note { margin-top: 9px; color: #8a8fa0; font-size: 12px; }
  .report-insight-card { margin: 14px 0; padding: 16px 18px; border: 1px solid #dddffd; border-radius: 14px; background: linear-gradient(135deg, #f8f7ff, #eef4ff); }
  .report-insight-eyebrow { color: #4f46e5; font-size: 12px; font-weight: 800; }
  .report-insight-score { margin-top: 5px; color: #24263a; font-size: 19px; font-weight: 800; }
  .report-insight-comparison { margin-top: 5px; color: #626779; font-size: 13px; line-height: 1.55; }
  .report-insight-next { margin-top: 13px; padding-top: 12px; border-top: 1px solid #dddffd; color: #454a5b; font-size: 13px; line-height: 1.6; }
  .report-insight-action { color: #3730a3; font-size: 14px; font-weight: 800; }
  .report-insight-action.standalone { margin-top: 12px; padding-top: 11px; border-top: 1px solid #dddffd; }
  .report-insight-targets { margin-top: 3px; color: #626779; overflow-wrap: anywhere; }
  .report-insight-next .btn { width: auto; margin-top: 10px; }
  .wb-training-status { margin-top: 12px; padding: 14px; border: 1px solid #e4e7ff; border-radius: 10px; background: #f7f8fd; color: #6b7280; font-size: 13px; text-align: center; }
  .wb-training-error { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #fdeaea; color: #d6453d; font-size: 14px; }
  .hist-item { border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
  .hist-item .h-main { font-size: 14px; font-weight: 600; }
  .hist-item .h-meta { font-size: 12px; color: #888; margin-top: 3px; }
  .hist-item .h-score { font-weight: 800; color: #4f46e5; font-size: 15px; }
  .hist-item.clickable { cursor: pointer; transition: .15s; }
  .hist-item.clickable:hover { border-color: #4f46e5; background: #f5f3ff; }
  .hist-item .h-right { text-align: right; }
  .hist-item .h-go { font-size: 12px; color: #4f46e5; margin-top: 2px; }

  /* 历史明细弹窗 */
  #histModal.modal-hidden { display: none; }
  #histModal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
  .modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
  .hist-modal { position: relative; width: 100%; max-width: 640px; max-height: 86vh; background: #fff; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; animation: slideUp .2s ease; }
  @keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
  .modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 10px; border-bottom: 1px solid #f0f0f0; }
  .hm-title { font-size: 16px; font-weight: 700; }
  .hm-sub { font-size: 12px; color: #888; margin-top: 3px; }
  .modal-x { border: none; background: #f2f2f2; width: 30px; height: 30px; border-radius: 50%; font-size: 15px; cursor: pointer; color: #555; }
  .modal-body { padding: 14px 18px; overflow-y: auto; }
  .hm-loading { text-align: center; color: #888; padding: 30px; }
  .modal-foot { padding: 12px 18px 18px; border-top: 1px solid #f0f0f0; display: flex; gap: 8px; flex-wrap: wrap; }
  .ho-item { border: 1px solid #eee; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
  .ho-no { font-size: 14px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .ho-stem { margin: 4px 0 8px; line-height: 1.6; }
  .ho-opts { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
  .ho-opt { font-size: 14px; padding: 4px 8px; border-radius: 6px; background: #f7f7fb; }
  .ho-opt.ans { background: #e9f7ee; color: #1a7f37; font-weight: 600; }
  .ho-ans { font-size: 14px; color: #1a7f37; font-weight: 600; margin-top: 4px; }
  .ho-my { font-size: 13px; color: #b45309; margin-top: 4px; }
  .ho-exp { font-size: 13px; color: #555; margin-top: 4px; }
  .ho-flag { font-size: 12px; font-weight: 600; }
  .ho-flag.ok { color: #1a7f37; }
  .ho-flag.no { color: #dc2626; }
  @media (min-width: 560px) { .hist-modal { border-radius: 16px; margin: auto; } #histModal { align-items: center; } }


  /* 底部菜单 */
  .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: 62px;
    background: #fff; display: flex; box-shadow: 0 -2px 12px rgba(0,0,0,.06); z-index: 50;
  }
  .nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: #9aa0b5; font-size: 11px; cursor: pointer;
  }
  .nav-item .ico { font-size: 20px; line-height: 1; }
  .nav-item.active { color: #4f46e5; font-weight: 700; }

  /* 会员中心 / 登录弹窗 */
  .profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
  .me-gear {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid #e5e7eb; background: #fff;
    color: #6b7280; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: .15s; flex-shrink: 0;
  }
  .me-gear:hover { background: #f3f4ff; color: #4f46e5; border-color: #c7d2fe; }
  .avatar {
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
  }
  .uname { font-size: 17px; font-weight: 800; }
  /* 微信授权登录按钮 */
  .btn.wx-btn { background: #07c160; border: none; color: #fff; font-weight: 700; }
  .btn.wx-btn:hover { background: #06ad56; }
  .auth-divider { display: flex; align-items: center; color: #bbb; font-size: 12px; margin: 12px 0 4px; }
  .auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #eee; }
  .auth-divider span { padding: 0 10px; }
  .me-avatar-img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
  .ulevel { font-size: 13px; color: #7c3aed; font-weight: 700; }
  .level-bar { height: 10px; background: #eef0fb; border-radius: 999px; overflow: hidden; }
  .level-bar .fill { height: 100%; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
  .lv-text { font-size: 12px; color: #888; margin: 6px 0 14px; }
  .stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
  .stat { background: #f7f8fd; border-radius: 12px; padding: 10px 4px; text-align: center; }
  .stat span { display: block; font-size: 18px; font-weight: 800; color: #4f46e5; }
  .stat b { font-size: 11px; color: #888; font-weight: 500; }
  .stat b small { display: block; margin-top: 3px; color: #a2a6b4; font-size: 9px; font-weight: 500; line-height: 1.3; }
  .badge-title { font-weight: 700; margin-bottom: 10px; }
  .medal-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
  .medal-row.empty { color: #b3b6c2; font-size: 13px; padding: 10px 0; }
  .medal {
    width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
    position: relative; background: var(--mg); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.12), inset 0 2px 4px rgba(255,255,255,.35);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .medal .medal-ico { font-size: 28px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
  .medal::after {
    content: ''; position: absolute; top: -40%; left: -30%; width: 60%; height: 160%;
    background: linear-gradient(120deg, rgba(255,255,255,.55), rgba(255,255,255,0));
    transform: rotate(20deg); pointer-events: none;
  }
  .medal.on:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 18px rgba(0,0,0,.18), inset 0 2px 4px rgba(255,255,255,.35); }
  .medal.off { background: #eef0f4; box-shadow: inset 0 0 0 2px #e2e5ec; }
  .medal.off .medal-ico { filter: grayscale(1); opacity: .45; }
  .medal.off::after { display: none; }
  .medal-cell { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 60px; }
  .medal-name { font-size: 11px; line-height: 1.2; color: #4b4f5c; text-align: center; }
  .medal-cell.cell-off .medal-name { color: #b3b6c2; }
  .locked-sec { margin-top: 4px; }
  .locked-label { font-size: 12px; color: #b3b6c2; margin-bottom: 8px; }
  /* 勋章详情弹窗 */
  .medal-modal { position: fixed; inset: 0; background: rgba(15,18,30,.5); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
  .medal-modal.hidden { display: none; }
  .mm-card { background: #fff; border-radius: 20px; width: 300px; max-width: 100%; padding: 24px 22px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: mmpop .2s ease; }
  @keyframes mmpop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  .mm-ico { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 36px; box-shadow: 0 6px 16px rgba(0,0,0,.15), inset 0 2px 4px rgba(255,255,255,.35); }
  .mm-name { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
  .mm-name.off { color: #b3b6c2; }
  .mm-desc { font-size: 14px; color: #4b5563; line-height: 1.6; margin-bottom: 14px; }
  .mm-at { font-size: 13px; color: #15803d; background: #e7f7ee; border-radius: 999px; padding: 6px 12px; display: inline-block; }
  .mm-close { margin-top: 18px; }
  .guest-tip { font-size: 13px; color: #666; line-height: 1.7; margin-bottom: 16px; }

  /* 个人中心新增模块 */
  .child-bar { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .child-bar::-webkit-scrollbar { height: 0; }
  .child-card-wrap { position: relative; flex: 0 0 auto; width: 62px; }
  .child-card { flex: 0 0 auto; width: 62px; text-align: center; cursor: pointer; user-select: none; }
  .cc-ava { position: relative; width: 56px; height: 56px; margin: 0 auto 5px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; background: #eef0f6; border: 2px solid transparent; transition: transform .12s, border-color .12s; }
  .cc-ava.boy { background: #e6f0ff; }
  .cc-ava.girl { background: #ffe9f3; }
  .cc-ava.all { background: #eef0f6; }
  .cc-ava.add { background: #fff; border: 2px dashed #c7cbe0; color: #9aa0b5; font-size: 26px; font-weight: 700; }
  .child-card.active .cc-ava { border-color: #4f46e5; transform: scale(1.06); box-shadow: 0 4px 12px rgba(79,70,229,.18); }
  .child-card.active .cc-name { color: #4f46e5; font-weight: 700; }
  .cc-name { font-size: 12px; color: #555; line-height: 1.2; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cc-edit { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: #4f46e5; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
  .child-hint { font-size: 11px; color: #aab; text-align: center; margin: -2px 0 14px; }
  .bind-banner { background: linear-gradient(135deg,#fff7ed,#fef2f2); border:1px solid #fed7aa; color:#c2410c; font-size:13px; font-weight:600; padding:11px 14px; border-radius:12px; margin-bottom:14px; cursor:pointer; text-align:center; }
  .bind-banner:active { transform: scale(.99); }

  /* 孩子新建/编辑弹窗 */
  .gender-row { display: flex; gap: 12px; margin-bottom: 16px; }
  .gender-opt { flex: 1; border: 2px solid #e6e8f0; border-radius: 14px; padding: 14px 0; text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
  .gender-opt .ge { font-size: 30px; }
  .gender-opt .gl { font-size: 13px; color: #666; margin-top: 4px; }
  .gender-opt.sel-boy { border-color: #3b82f6; background: #eef4ff; }
  .gender-opt.sel-girl { border-color: #ec4899; background: #ffeff7; }
  .child-modal-name { width: 100%; border: 1.5px solid #e6e8f0; border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-bottom: 16px; box-sizing: border-box; outline: none; }
  .child-modal-name:focus { border-color: #4f46e5; }
  .cm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .cm-field label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; }
  .cm-field select { width: 100%; border: 1.5px solid #e6e8f0; border-radius: 10px; padding: 9px 10px; font-size: 14px; box-sizing: border-box; background: #fff; outline: none; }
  .cm-field select:focus { border-color: #4f46e5; }
  .child-modal-actions { display: flex; gap: 10px; }
  .child-modal-actions .btn { flex: 1; }
  .child-del { display: block; width: 100%; margin-top: 14px; background: none; border: none; color: #ef4444; font-size: 13px; cursor: pointer; text-align: center; }
  .home-child { position: relative; flex: 0 0 auto; margin-left: auto; }
  .home-child-trigger, .home-child-empty { min-height: 40px; border: 1px solid #dfe3f2; border-radius: 12px; background: #fff; color: #35384a; cursor: pointer; font: inherit; }
  .home-child-trigger { max-width: 150px; padding: 6px 9px; display: flex; align-items: center; gap: 6px; box-shadow: 0 3px 10px rgba(60,40,120,.06); }
  .home-child-empty { padding: 6px 9px; display: flex; align-items: center; gap: 5px; color: #4f46e5; font-size: 12px; font-weight: 700; }
  .home-child-empty.error { color: #dc2626; }
  .home-child-empty:disabled { opacity: .72; cursor: wait; }
  .home-child-trigger:focus-visible, .home-child-empty:focus-visible, .home-child-option:focus-visible, .home-child-manage:focus-visible { outline: 3px solid rgba(79,70,229,.3); outline-offset: 2px; }
  .home-child-avatar { position: relative; flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%; background: #eef2ff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
  .home-child-name { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }
  .home-child-pending-dot { position: absolute; width: 7px; height: 7px; right: -1px; bottom: 0; border: 1px solid #fff; border-radius: 50%; background: #f59e0b; }
  .home-child-add { font-size: 18px; line-height: 1; }
  .home-child-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 55; width: min(270px, calc(100vw - 32px)); max-height: 280px; overflow-y: auto; padding: 7px; border: 1px solid #e4e6ef; border-radius: 14px; background: #fff; box-shadow: 0 14px 35px rgba(31,35,48,.16); }
  .home-child-option { width: 100%; min-height: 44px; padding: 7px 8px; border: 0; border-radius: 10px; background: transparent; display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: #35384a; }
  .home-child-option:hover, .home-child-option.active { background: #f1f2ff; }
  .home-child-option-avatar { font-size: 21px; }
  .home-child-option-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
  .home-child-option-text b, .home-child-option-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-child-option-text b { font-size: 13px; }
  .home-child-option-text small { color: #8a90a2; font-size: 11px; }
  .home-child-check { width: 16px; color: #4f46e5; font-weight: 800; }
  .home-child-manage { width: 100%; min-height: 40px; margin-top: 4px; border: 0; border-top: 1px solid #eceef5; background: transparent; color: #6b7280; font-size: 11px; cursor: pointer; }
  .smart-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 12px; padding: 16px 18px; border: 1px solid #dddffd; border-radius: 16px; background: linear-gradient(135deg, #f8f7ff, #eef4ff); box-shadow: 0 6px 20px rgba(60,40,120,.07); }
  .smart-plan-copy { min-width: 0; }
  .smart-plan-kicker { color: #4f46e5; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
  .smart-plan h2 { margin-top: 2px; color: #24263a; font-size: 17px; line-height: 1.35; }
  .smart-plan p { margin-top: 4px; color: #626779; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
  .smart-plan-progress { margin-top: 8px; color: #4338ca; font-size: 12px; font-weight: 800; }
  .smart-plan small { display: block; margin-top: 5px; color: #8a90a2; font-size: 11px; }
  .smart-plan .btn { width: auto; min-width: 116px; min-height: 44px; margin-top: 0; padding: 10px 16px; }
  .smart-plan .wb-training-status { grid-column: 1 / -1; margin-top: 0; }
  .manual-generate-details { margin: 0 0 20px; }
  .manual-generate-details summary {
    min-height: 58px; padding: 9px 13px; display: flex; align-items: center; gap: 10px;
    border: 1px solid #e1e4ef; border-radius: 14px; background: #fff; color: #35384a;
    box-shadow: 0 3px 12px rgba(60,40,120,.05); cursor: pointer; list-style: none;
  }
  .manual-generate-details summary::-webkit-details-marker { display: none; }
  .manual-generate-details summary:focus-visible { outline: 3px solid rgba(79,70,229,.3); outline-offset: 2px; }
  .manual-generate-icon { width: 34px; height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #f1f0ff; }
  .manual-generate-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
  .manual-generate-copy strong { font-size: 14px; }
  .manual-generate-copy small { margin-top: 1px; color: #858a9a; font-size: 11px; font-weight: 500; }
  .manual-generate-arrow { color: #6d63dc; font-size: 24px; transition: transform .18s ease; }
  .manual-generate-details[open] .manual-generate-arrow { transform: rotate(90deg); }
  .manual-generate-details[open] summary { margin-bottom: 10px; border-color: #cbc9f5; background: #faf9ff; }
  .manual-generate-details > .card { margin-bottom: 0; }
  .child-context { border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
  .child-context.ok { background: #eef4ff; color: #1e3a8a; }
  .child-context.ok strong { color: #4f46e5; }
  .child-context.ok .cc-tip { color: #94a3b8; font-size: 11px; }
  .child-context.warn { background: #fff7ed; color: #c2410c; }
  .child-context.empty { background: #f1f5f9; color: #64748b; }
  .today-goal { border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .today-goal-copy { min-width: 0; line-height: 1.55; overflow-wrap: anywhere; }
  .today-goal.todo { background: #fff7ed; color: #c2410c; }
  .today-goal.done { background: #ecfdf5; color: #15803d; }
  .mini-btn { border: none; background: #f97316; color: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
  .streak-box { background: #f7f8fd; border-radius: 12px; padding: 12px; margin-bottom: 14px; }
  .sb-head { font-size: 13px; color: #444; margin-bottom: 8px; }
  .sb-head b { color: #ef4444; }
  .week-cal { display: flex; gap: 6px; }
  .wk-cell { flex: 1; height: 22px; border-radius: 6px; background: #e5e7eb; }
  .wk-cell.on { background: #4f46e5; }
  .wk-cell.today { box-shadow: 0 0 0 2px #fbbf24; }
  .mastered-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px; font-size: 14px; color: #92400e; margin-bottom: 16px; }
  .mastered-box b { font-size: 20px; color: #b45309; }
  .sec-title { font-weight: 700; font-size: 14px; color: #1f2330; margin: 16px 0 10px; }
  .sb-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
  .sb-name { width: 56px; flex-shrink: 0; color: #444; }
  .sb-track { flex: 1; height: 10px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
  .sb-fill { height: 100%; border-radius: 999px; }
  .sb-val { width: 38px; text-align: right; color: #666; }
  .heatmap { display: flex; flex-wrap: wrap; gap: 3px; }
  .hm-cell { width: 11px; height: 11px; border-radius: 3px; }
  .hm-legend { display: flex; align-items: center; gap: 3px; font-size: 11px; color: #999; margin-top: 6px; }
  .hm-legend .hm-cell { width: 10px; height: 10px; }
  .rec-item { background: #f7f8fd; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
  .rec-book { font-weight: 700; font-size: 13px; color: #1f2330; }
  .rec-pub { font-size: 11px; color: #999; margin: 2px 0 4px; }
  .rec-scope { color: #5f6475; font-size: 11px; line-height: 1.5; }
  .rec-reason { font-size: 12px; color: #666; line-height: 1.6; }
  .rec-reviewed { margin-top: 6px; color: #15803d; font-size: 10px; font-weight: 700; }
  .rec-foot { font-size: 11px; color: #9aa0af; margin-top: 4px; }
  .rec-empty, .empty-tip { font-size: 13px; color: #999; padding: 6px 2px; }
  .growth-details { margin-top: 14px; }
  .growth-details summary {
    min-height: 64px; padding: 10px 12px; display: flex; align-items: center; gap: 10px;
    border: 1px solid #dddffd; border-radius: 14px; cursor: pointer; list-style: none;
    background: linear-gradient(135deg,#f8f7ff,#eef4ff); color: #24263a;
  }
  .growth-details summary::-webkit-details-marker { display: none; }
  .growth-summary-icon { font-size: 22px; }
  .growth-summary-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
  .growth-summary-copy strong { font-size: 15px; }
  .growth-summary-copy small { margin-top: 3px; color: #73788b; font-size: 11px; }
  .growth-summary-progress { color: #4f46e5; font-size: 12px; font-weight: 800; white-space: nowrap; }
  .growth-summary-arrow { color: #4f46e5; font-size: 25px; transition: transform .18s ease; }
  .growth-details[open] .growth-summary-arrow { transform: rotate(90deg); }
  .growth-details summary:focus-visible { outline: 3px solid #4338ca; outline-offset: 3px; }
  .growth-details-content { padding-bottom: 16px; }
  @media (prefers-reduced-motion: reduce) {
    .growth-summary-arrow { transition: none; }
    .manual-generate-arrow { transition: none; }
  }

  .modal { position: fixed; inset: 0; background: rgba(20,20,40,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
  .modal-box { background: #fff; border-radius: 18px; padding: 26px 22px; width: 88%; max-width: 340px; position: relative; }
  .modal-close { position: absolute; right: 14px; top: 12px; color: #999; cursor: pointer; font-size: 18px; }
  .modal-title { font-size: 18px; font-weight: 800; color: #1f2330; margin-bottom: 16px; text-align: center; }
  .modal-box input { width: 100%; margin-bottom: 12px; }
  .auth-switch { text-align: center; margin-top: 10px; color: #555; font-size: 14px; }
  .auth-switch .link { color: #3b6ef0; cursor: pointer; text-decoration: underline; }
  .auth-switch { text-align: center; font-size: 13px; color: #777; margin-top: 12px; }
  .auth-switch a { color: #4f46e5; cursor: pointer; font-weight: 600; }

  @media (max-width: 560px) {
    .smart-plan { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
    .smart-plan h2 { font-size: 16px; }
    .smart-plan .btn { width: 100%; }
    .manual-generate-details summary { min-height: 56px; padding: 9px 11px; }
    .manual-generate-details > .card { padding: 17px 15px; }
    .form-grid { grid-template-columns: 1fr; }
    .home-child-trigger { max-width: 125px; padding-inline: 7px; }
    .home-child-avatar { width: 24px; height: 24px; font-size: 15px; }
    .home-child-name { max-width: 60px; }
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { min-height: 86px; display: flex; flex-direction: column; justify-content: center; }
    .batch-wrong-training-bar {
      position: sticky; bottom: calc(var(--bottom-nav-height) + 8px); z-index: 40;
    }
    .wb-list.wrong-training-active {
      padding-bottom: calc(var(--wrong-training-bar-height) + env(safe-area-inset-bottom) + 16px);
    }
    .growth-details-content {
      padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    }
  }

  /* 通用确认弹窗 */
  .confirm-box { max-width: 320px; text-align: center; padding: 26px 22px 18px; }
  .confirm-ico { font-size: 38px; line-height: 1; margin-bottom: 12px; }
  .confirm-title { font-size: 17px; font-weight: 800; color: #1f2330; }
  .confirm-desc { font-size: 13px; color: #666; margin-top: 8px; line-height: 1.65; }
  .confirm-actions { display: flex; gap: 12px; margin-top: 22px; }
  .confirm-actions .btn { flex: 1; }
  .btn.danger { background: linear-gradient(135deg,#f43f5e,#e11d48); }

  /* 版本号按钮 + 更新日志 */
  .ver-wrap { text-align: center; }
  .ver-btn { margin: 18px auto 0; width: auto; min-height: 34px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid #e7e7ef; border-radius: 999px; background: #fafaff; color: #8a8aa0; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; transition: .15s; }
  .ver-btn:hover { background: #f2f1ff; color: #6b6bb0; border-color: #d9d7f5; transform: translateY(-1px); }
  .manual-btn { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
  .manual-btn:hover { color: #5b21b6; background: #ede9fe; border-color: #c4b5fd; }
  .ver-btn:focus-visible { outline: 3px solid rgba(99,102,241,.28); outline-offset: 2px; }
  .ver-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block; }
  .ver-wrap { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .fb-btn { color: #4f46e5; background: #f1f0ff; border-color: #e0defb; }
  .fb-btn:hover { background: #e8e6ff; color: #4338ca; border-color: #c9c5f5; }
  .brand-footer { text-align: center; padding: 24px 0 8px; }
  .lion-logo { width: 84px; height: 84px; object-fit: contain; border-radius: 16px; cursor: pointer; }
  @keyframes lion-bounce { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-10px); } 50% { transform: translateY(0); } 70% { transform: translateY(-6px); } 85% { transform: translateY(0); } }
  .lion-bounce { animation: lion-bounce 0.5s ease; }
  .brand-text { font-size: 12px; color: #aaa; margin-top: 6px; }
  .brand-sub { font-size: 11px; color: #6b6bb0; margin-top: 4px; font-weight: 600; }
  .toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: rgba(17,24,39,.92); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 90; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 80%; text-align: center; }
  .cl-item { padding: 12px 0; border-bottom: 1px solid #f2f2f5; }
  .cl-item:last-child { border-bottom: none; }
  .cl-ver { font-size: 15px; font-weight: 800; color: #1f2330; display: flex; align-items: center; gap: 8px; }
  .cl-tag { font-size: 11px; font-weight: 700; color: #fff; background: #4f46e5; border-radius: 6px; padding: 2px 7px; }
  .cl-date { font-size: 11px; color: #999; margin-left: auto; }
  .cl-list { margin: 8px 0 0; padding-left: 18px; }
  .cl-list li { font-size: 13px; color: #444; line-height: 1.75; }
