/* ============ 数学忍道 · Apple 风格 + 忍者主题 ============ */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card2: #f2f2f7;
  --label: #000000;
  --label2: rgba(60, 60, 67, .62);
  --label3: rgba(60, 60, 67, .32);
  --sep: rgba(60, 60, 67, .18);
  --fill: rgba(120, 120, 128, .12);
  --accent: #ff6a00;        /* 忍者橙 */
  --accent-soft: rgba(255, 106, 0, .12);
  --ink: #1b1f3b;           /* 夜色卷轴 */
  --green: #34c759;
  --red: #ff3b30;
  --blue: #007aff;
  --yellow: #ffcc00;
  --purple: #af52de;
  --radius: 14px;
  --tabh: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card2: #2c2c2e;
    --label: #ffffff;
    --label2: rgba(235, 235, 245, .62);
    --label3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .55);
    --fill: rgba(120, 120, 128, .24);
    --accent: #ff7a1a;
    --accent-soft: rgba(255, 122, 26, .18);
    --green: #30d158;
    --red: #ff453a;
    --blue: #0a84ff;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); }
body { font-size: 17px; line-height: 1.5; overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }

.view {
  max-width: 720px; margin: 0 auto;
  padding: calc(var(--safe-t) + 8px) 16px calc(var(--tabh) + var(--safe-b) + 90px);
  animation: fadein .25s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 大标题 / 导航 ---------- */
.navbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.back { color: var(--accent); display: inline-flex; align-items: center; gap: 2px; font-size: 17px; padding: 8px 0; }
.back::before { content: ""; width: 11px; height: 11px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); margin-right: 4px; }
.navbtn { color: var(--accent); font-size: 17px; padding: 8px 0; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: .3px; margin: 6px 0 2px; line-height: 1.2; }
.subtitle { color: var(--label2); font-size: 15px; margin: 0 0 18px; }
.section-h { font-size: 22px; font-weight: 700; margin: 28px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.section-h small { font-size: 15px; font-weight: 400; color: var(--accent); }
.group-h { font-size: 13px; color: var(--label2); text-transform: uppercase; margin: 22px 16px 6px; letter-spacing: .2px; }

/* ---------- 卡片 & 分组列表 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; height: .5px; background: var(--sep); }
.list.plain .row + .row::before { left: 16px; }
.row:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 17px; }
.row .s { font-size: 13px; color: var(--label2); margin-top: 1px; }
.chev::after { content: ""; display: inline-block; width: 8px; height: 8px; border-right: 2px solid var(--label3); border-top: 2px solid var(--label3); transform: rotate(45deg); }
.seal { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; background: linear-gradient(135deg, #ff8a2a, #e8430c); flex: none; font-family: "Songti SC", "STSong", serif; }
.seal.ink { background: linear-gradient(135deg, #2c335e, #12152b); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.badge.red { background: rgba(255, 59, 48, .12); color: var(--red); }
.badge.green { background: rgba(52, 199, 89, .14); color: var(--green); }
.badge.blue { background: rgba(0, 122, 255, .12); color: var(--blue); }
.badge.gray { background: var(--fill); color: var(--label2); }
.stars { color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.pill-count { min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-size: 13px; display: inline-grid; place-items: center; padding: 0 6px; }

/* ---------- 忍者 Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 20px; margin: 8px 0 16px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #ff7a1a 0%, #e5420d 38%, #1b1f3b 100%);
  box-shadow: 0 10px 30px rgba(229, 66, 13, .25);
}
.hero::after { /* 手里剑水印 */
  content: ""; position: absolute; right: -30px; top: -30px; width: 170px; height: 170px; opacity: .14;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='white' d='M50 0l9 41 41 9-41 9-9 41-9-41-41-9 41-9z'/%3E%3Ccircle cx='50' cy='50' r='7' fill='%23e5420d'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero .rank { font-size: 13px; opacity: .85; letter-spacing: 2px; }
.hero .rank-name { font-size: 30px; font-weight: 800; margin: 2px 0 2px; font-family: "Songti SC", "STSong", serif; letter-spacing: 4px; }
.hero .rank-desc { font-size: 14px; opacity: .85; }
.chakra { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .22); margin: 14px 0 6px; overflow: hidden; }
.chakra > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #ffd27a, #fff); box-shadow: 0 0 12px rgba(255, 220, 150, .9); transition: width .6s ease; }
.hero .meta { display: flex; justify-content: space-between; font-size: 13px; opacity: .9; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.hero-stats div { background: rgba(255, 255, 255, .14); border-radius: 12px; padding: 8px 10px; backdrop-filter: blur(8px); }
.hero-stats b { display: block; font-size: 20px; }
.hero-stats span { font-size: 12px; opacity: .85; }

.quote { font-family: "Songti SC", "STSong", serif; font-size: 16px; color: var(--label2); text-align: center; padding: 6px 12px 0; }
.quote::before { content: "忍道 · "; color: var(--accent); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 16px; background: var(--accent); color: #fff; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.97); opacity: .85; }
.btn.block { width: 100%; height: 50px; font-size: 17px; border-radius: 14px; }
.btn.tinted { background: var(--accent-soft); color: var(--accent); }
.btn.gray { background: var(--fill); color: var(--label); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* ---------- 分段控件 & 筛选 ---------- */
.segmented { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin-bottom: 10px; }
.segmented button { flex: 1; height: 30px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.segmented button.on { background: var(--card); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 1px rgba(0,0,0,.1); font-weight: 600; }
@media (prefers-color-scheme: dark) { .segmented button.on { background: #636366; } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 14px; border-radius: 16px; background: var(--card); font-size: 14px; color: var(--label); border: .5px solid var(--sep); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.search { width: 100%; height: 36px; border-radius: 10px; border: 0; background: var(--fill); padding: 0 12px 0 34px; font-size: 16px; margin-bottom: 10px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: 11px center; }

/* ---------- 题目卡 ---------- */
.qcard { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.qhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.qhead .no { font-weight: 700; color: var(--label2); font-size: 14px; margin-right: 2px; }
.qhead .spacer { flex: 1; }
.rankchip { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #fff; letter-spacing: .5px; }
.rankchip.l1 { background: #8e8e93; }
.rankchip.l2 { background: #34a853; }
.rankchip.l3 { background: #ff6a00; }
.rankchip.l4 { background: linear-gradient(90deg, #d4145a, #7b2ff7); }
.qbody { font-size: 17px; line-height: 1.75; word-break: break-word; }
.qbody .katex { font-size: 1.08em; }
.fig { margin: 12px auto 4px; max-width: 260px; color: var(--label); }
.fig svg { width: 100%; height: auto; display: block; }
.opts { display: grid; gap: 8px; margin-top: 12px; }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1.5px solid transparent; min-height: 48px; transition: background .15s, border-color .15s; }
.opt .L { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--card); flex: none; }
.opt.right { border-color: var(--green); background: rgba(52, 199, 89, .12); }
.opt.right .L { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: rgba(255, 59, 48, .1); }
.opt.wrong .L { background: var(--red); color: #fff; }
.opts.locked .opt { pointer-events: none; }
.qactions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.qactions .btn { flex: 1; min-width: 110px; }
.iconbtn { width: 36px; height: 36px; border-radius: 18px; background: var(--fill); display: grid; place-items: center; font-size: 16px; }
.iconbtn.on { background: var(--accent); color: #fff; }

.sol { margin-top: 14px; border-top: .5px solid var(--sep); padding-top: 12px; display: none; }
.sol.show { display: block; animation: fadein .25s; }
.ans { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-weight: 600; margin-bottom: 10px; }
.ans::before { content: "答案　"; color: var(--accent); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: st; }
.steps li { counter-increment: st; position: relative; padding: 6px 0 6px 38px; line-height: 1.75; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 7px; width: 26px; height: 26px; border-radius: 13px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
@media (prefers-color-scheme: dark) { .steps li::before { background: #3a3f6b; } }
.steps li.hide { display: none; }
.tip { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 204, 0, .16); font-size: 15px; }
.tip::before { content: "⚡ 提分提醒　"; font-weight: 700; color: #c48a00; }
.selfgrade { margin-top: 12px; }
.selfgrade p { margin: 0 0 8px; font-size: 14px; color: var(--label2); text-align: center; }
.qt { border-collapse: collapse; margin: 8px 0; font-size: 15px; }
.qt th, .qt td { border: 1px solid var(--sep); padding: 4px 8px; text-align: center; }
.qt th { background: var(--card2); font-weight: 600; }

/* ---------- 考点页 ---------- */
.kp-points { padding-left: 0; list-style: none; margin: 0; }
.kp-points li { padding: 8px 0 8px 22px; position: relative; line-height: 1.75; border-bottom: .5px solid var(--sep); }
.kp-points li:last-child { border-bottom: 0; }
.kp-points li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 8px; height: 8px; transform: rotate(45deg); background: var(--accent); }
.traps li::before { background: var(--red); }
.mastery { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; width: 64px; }
.mastery > i { display: block; height: 100%; background: var(--green); border-radius: 3px; }

/* ---------- 公式 ---------- */
.frow { padding: 12px 16px; position: relative; }
.frow + .frow::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.frow .fn { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.frow .fv { font-size: 16px; line-height: 1.8; overflow-x: auto; }
.ft { width: 100%; border-collapse: collapse; text-align: center; margin: 4px 0; }
.ft th, .ft td { padding: 10px 4px; border-bottom: .5px solid var(--sep); }
.ft th { color: var(--accent); }
.fnote { font-size: 14px; color: var(--label2); margin: 8px 0 0; }

/* ---------- 计划 ---------- */
.phase { border-left: 3px solid var(--accent); padding-left: 12px; margin: 4px 0 14px; }
.phase h4 { margin: 0; font-size: 17px; }
.phase .w { font-size: 13px; color: var(--label2); }
.phase ul { margin: 6px 0; padding-left: 18px; font-size: 15px; }
.kp-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kp-links a { font-size: 13px; padding: 3px 9px; border-radius: 8px; background: var(--fill); }
.kp-links a.ok { background: rgba(52, 199, 89, .15); color: var(--green); }
.stbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.stbl td { padding: 8px 4px; border-bottom: .5px solid var(--sep); vertical-align: top; }
.stbl td:nth-child(2) { white-space: nowrap; color: var(--accent); font-weight: 600; }

/* ---------- 每日任务 ---------- */
.mission { display: flex; align-items: center; gap: 10px; }
.mission .dot { width: 26px; height: 26px; border-radius: 13px; border: 2px solid var(--sep); display: grid; place-items: center; font-size: 13px; flex: none; }
.mission .dot.ok { background: var(--green); border-color: var(--green); color: #fff; }
.mission .dot.bad { background: var(--red); border-color: var(--red); color: #fff; }
.progress-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.progress-dots i { width: 28px; height: 5px; border-radius: 3px; background: var(--fill); }
.progress-dots i.ok { background: var(--green); }
.progress-dots i.bad { background: var(--red); }
.progress-dots i.cur { background: var(--accent); }
.celebrate { text-align: center; padding: 30px 10px; }
.celebrate .big { font-size: 64px; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.2) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 底部 Tab Bar（毛玻璃） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; padding: 4px 0 calc(var(--safe-b) + 2px);
  background: rgba(249, 249, 249, .82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
@media (prefers-color-scheme: dark) { .tabbar { background: rgba(22, 22, 24, .82); } }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; font-weight: 500; color: #8e8e93; height: 48px; justify-content: center; }
.tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on svg { stroke-width: 2.2; }

/* ---------- 打印篮浮条 ---------- */
.basketbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabh) + var(--safe-b) + 10px); z-index: 40; max-width: 696px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 16px;
  background: rgba(27, 31, 59, .92); color: #fff; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.basketbar .grow { flex: 1; font-size: 15px; }
.basketbar[hidden] { display: none; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translate(-50%, -140%); z-index: 100; padding: 10px 18px; border-radius: 22px; font-size: 15px; font-weight: 600; color: #fff; background: rgba(27, 31, 59, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: transform .35s cubic-bezier(.2, 1.3, .4, 1); white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); }
.toast .sh { display: inline-block; animation: spin .8s linear infinite; margin-right: 6px; }

/* ---------- 表单 ---------- */
.field { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 10px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.field input[type=text], .field input[type=number], .field select { border: 0; background: transparent; text-align: right; outline: none; font-size: 17px; color: var(--label2); max-width: 60%; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15); transition: transform .2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.check { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--label3); flex: none; display: grid; place-items: center; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on::after { content: ""; width: 6px; height: 11px; border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(45deg) translate(-1px, -1px); }
.qprev { font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; color: var(--label2); padding: 40px 10px; }
.empty .e { font-size: 44px; }
.bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.pager { display: flex; gap: 10px; margin-top: 4px; }
.pager .btn { flex: 1; }
.hint { font-size: 13px; color: var(--label2); margin: 6px 16px 0; }

/* ============ 打印 ============ */
.print-area { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff !important; color: #000 !important; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; font-size: 11pt; line-height: 1.65; color: #000; font-family: "Songti SC", "STSong", "SimSun", serif; }
  .pa-head { text-align: center; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
  .pa-head h1 { font-size: 18pt; margin: 0 0 4px; }
  .pa-head .info { display: flex; justify-content: space-between; font-size: 10.5pt; }
  .pa-sec { font-weight: 700; font-size: 12.5pt; margin: 14px 0 6px; font-family: -apple-system, "PingFang SC", sans-serif; }
  .pa-q { break-inside: avoid; margin-bottom: 10px; }
  .pa-q .n { font-weight: 700; }
  .pa-q .src { font-size: 8.5pt; color: #555; }
  .pa-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; margin: 4px 0 0 1.5em; }
  .pa-opts.long { grid-template-columns: 1fr; }
  .pa-fig { width: 46mm; margin: 4px 0 4px 1.5em; color: #000; }
  .pa-fig svg { width: 100%; height: auto; }
  .pa-space { border: 1px dashed #bbb; border-radius: 4px; margin: 6px 0 0; }
  .pa-ans { background: #f4f4f4; border-left: 3px solid #000; padding: 4px 8px; margin: 6px 0 0; font-size: 10pt; break-inside: avoid; }
  .pa-ans ol { margin: 2px 0; padding-left: 18px; }
  .pa-break { break-before: page; }
  .pa-foot { text-align: center; font-size: 8.5pt; color: #777; margin-top: 16px; }
  .qt, .ft { border-collapse: collapse; }
  .qt th, .qt td, .ft th, .ft td { border: 1px solid #999; padding: 2px 6px; }
  .pa-f { break-inside: avoid; }
  .pa-f .row2 { display: grid; grid-template-columns: 34mm 1fr; gap: 8px; padding: 3px 0; border-bottom: .5px solid #ddd; }
  .pa-f .row2 b { font-family: -apple-system, "PingFang SC", sans-serif; font-size: 10pt; }
}

/* ============ AI 师傅 ============ */
.airow { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.aibtn { flex: 1; min-width: 140px; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #5b3df5; background: linear-gradient(135deg, rgba(91, 61, 245, .1), rgba(255, 106, 0, .1)); }
.aibtn i { font-style: normal; font-size: 15px; }
@media (prefers-color-scheme: dark) { .aibtn { color: #b4a6ff; background: linear-gradient(135deg, rgba(124, 99, 255, .22), rgba(255, 122, 26, .16)); } }
.aibtn:active { transform: scale(.97); }
.askstep { display: inline-block; margin-left: 6px; font-size: 12px; padding: 1px 8px; border-radius: 10px; color: #5b3df5; background: rgba(91, 61, 245, .1); vertical-align: 1px; }
@media (prefers-color-scheme: dark) { .askstep { color: #b4a6ff; background: rgba(124, 99, 255, .2); } }
.aicard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aicard button { text-align: left; padding: 14px; border-radius: var(--radius); color: #fff; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #6a4cff, #3a2fb8); box-shadow: 0 6px 18px rgba(91, 61, 245, .25); }
.aicard button:last-child { background: linear-gradient(135deg, #2c335e, #12152b); box-shadow: 0 6px 18px rgba(18, 21, 43, .25); }
.aicard b { font-size: 16px; }
.aicard span { font-size: 12px; opacity: .85; }
.aicard button:active { transform: scale(.97); }

.sheet-mask { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0); transition: background .25s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-mask.show { background: rgba(0, 0, 0, .4); }
.sheet-mask[hidden] { display: none; }
.sheet { width: 100%; max-width: 720px; height: 88vh; height: 88dvh; background: var(--bg); border-radius: 14px 14px 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); }
.sheet-mask.show .sheet { transform: none; }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 6px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 8px; border-bottom: .5px solid var(--sep); flex: none; }
.sheet-head b { font-size: 17px; }
.sheet-sub { font-size: 12px; color: var(--label2); }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 14px 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); border-top: .5px solid var(--sep); background: var(--card); flex: none; }
.sheet-foot textarea { flex: 1; resize: none; border: .5px solid var(--sep); border-radius: 18px; padding: 8px 14px; font-size: 16px; line-height: 1.35; background: var(--bg); outline: none; max-height: 120px; font-family: inherit; }
.sendbtn { width: 36px; height: 36px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; flex: none; }
.sheet-img { position: relative; padding: 8px 14px 0; background: var(--card); flex: none; }
.sheet-img[hidden] { display: none; }
.sheet-img img { height: 72px; border-radius: 10px; display: block; }
.sheet-img button { position: absolute; left: 84px; top: 2px; width: 24px; height: 24px; border-radius: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; }

.bub { max-width: 92%; padding: 10px 14px; border-radius: 18px; margin: 0 0 10px; line-height: 1.7; font-size: 16px; word-break: break-word; animation: fadein .2s; }
.bub.me { margin-left: auto; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; width: fit-content; }
.bub.me .katex { color: #fff; }
.bub.ai { background: var(--card); border-bottom-left-radius: 6px; }
.bub.intro { color: var(--label2); font-size: 15px; }
.bub.err { background: rgba(255, 59, 48, .1); color: var(--red); }
.bub p { margin: 0; }
.bub .gap { height: 8px; }
.bub ul, .bub ol { margin: 4px 0; padding-left: 20px; }
.bub li { margin: 2px 0; }
.bub .katex-display { margin: 6px 0; overflow-x: auto; overflow-y: hidden; }
.bub-img { max-width: 180px; border-radius: 12px; display: block; margin-bottom: 4px; }
.bub-card .qcard { border: 1px solid rgba(91, 61, 245, .25); }
.aihint { font-size: 13px; color: var(--label2); }
.thinking { color: var(--label2); font-size: 15px; }
.thinking .sh { display: inline-block; animation: spin 1s linear infinite; margin-right: 6px; color: #6a4cff; }
/* ===== 题型卡 ===== */
.tktable { width: 100%; border-collapse: collapse; font-size: 15px; }
.tktable td { padding: 8px 8px 8px 0; vertical-align: top; line-height: 1.68; border-bottom: 1px solid var(--fill); }
.tktable tr:last-child td { border-bottom: 0; }
.tktable td.k { color: var(--label2); white-space: nowrap; padding-right: 12px; }
.tktable td.bad { color: var(--red); width: 46%; }
.tktable td.good { color: var(--green); }
.tksteps { margin: 0; padding-left: 20px; }
.tksteps li { margin-bottom: 12px; line-height: 1.75; font-size: 16px; }
.tksteps li:last-child { margin-bottom: 0; }
.tksteps .why { margin-top: 4px; font-size: 14px; line-height: 1.65; color: var(--label2); border-left: 2px solid var(--accent-soft); padding-left: 9px; }
.tkone { background: var(--accent-soft); border: 1px solid rgba(255, 106, 0, .28); }
.tkone .s { font-size: 13px; color: var(--label2); margin-bottom: 6px; }
.tkone .t { font-size: 17px; font-weight: 600; line-height: 1.6; }

/* ===== 一句话方法 ===== */
.method { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: 9px 12px; font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.method::before { content: '一句话方法 · '; color: var(--accent); font-weight: 600; }

.stephelp { margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: rgba(91, 61, 245, .06); border: 1px solid rgba(91, 61, 245, .18); font-size: 14px; line-height: 1.65; }
.stephelp .sw { margin-bottom: 8px; }
.stephelp .sw b, .rulecard .rl b { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; font-size: 12px; color: #fff; background: #5b3df5; vertical-align: 1px; }
.rulecard { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: var(--card, rgba(255,255,255,.6)); }
.rulecard .rn { font-weight: 600; margin-bottom: 4px; }
.rulecard .rl { margin: 4px 0; }
.rulecard .rl.bad b { background: #d9480f; }
.stephelp .swlink { display: block; margin: 6px 0; color: var(--accent, #5b3df5); font-size: 13px; }
.stephelp .swai { margin-top: 6px; width: 100%; }
@media (prefers-color-scheme: dark) { .stephelp { background: rgba(124, 99, 255, .12); border-color: rgba(124, 99, 255, .3); } .rulecard { background: rgba(255,255,255,.05); } }
@media print { .stephelp, .airow, .askstep, .whybtn, .sheet-mask { display: none !important; } }

.duecard { display: block; margin: 14px 0 0; padding: 12px 14px; text-decoration: none; color: inherit; border-left: 4px solid var(--accent, #f4700c); }
.duecard b { display: block; font-size: 16px; }
.duecard span { display: block; font-size: 13px; color: var(--label2); margin-top: 2px; }
.mockbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; padding: 10px 14px; border-radius: 14px; background: var(--card, #fff); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.mockq .opt.picked { outline: 2px solid var(--accent, #f4700c); background: rgba(244, 112, 12, .08); }
.mockres { text-align: center; }
.mockres .big { font-size: 44px; font-weight: 800; color: var(--accent, #f4700c); }
.mockres .big small { font-size: 18px; color: var(--label2); font-weight: 600; }
.mockline { font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.mockline.ok { color: var(--green, #2f9e44); } .mockline.bad { color: var(--red, #d9480f); }
.mockgrade { font-size: 13px; margin: 0 0 8px; color: var(--label2); }
.mockgrade .chip { margin: 6px 6px 0 0; }
