/* ============ 设计变量 ============ */
:root {
  --fs: 1;
  --bg: #f5f6fb;
  --bg-2: #eceefa;
  --card: #ffffff;
  --text: #1b1c2b;
  --muted: #6b6f86;
  --line: #e4e6f0;
  --brand: #5b5bf0;
  --brand-2: #7c3aed;
  --brand-soft: #ecebff;
  --good: #15a34a;
  --good-soft: #e3f7ea;
  --bad: #e5484d;
  --bad-soft: #fde8e9;
  --warn: #f59e0b;
  --warn-soft: #fff4dc;
  --teal: #0ea5a4;
  --teal-soft: #ddf6f5;
  --amber: #f59e0b;
  --amber-soft: #fff1d6;
  --indigo: #5b5bf0;
  --indigo-soft: #ecebff;
  --shadow: 0 1px 2px rgba(20, 22, 50, .04), 0 6px 20px rgba(20, 22, 50, .06);
  --radius: 18px;
  --tabbar-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1020;
    --bg-2: #171930;
    --card: #1a1c33;
    --text: #ecedf6;
    --muted: #9a9db8;
    --line: #2b2e4a;
    --brand: #8b8cff;
    --brand-2: #a78bfa;
    --brand-soft: #25264a;
    --good: #34d17a;
    --good-soft: #153325;
    --bad: #ff6b6f;
    --bad-soft: #3a1d24;
    --warn-soft: #3a2e12;
    --teal-soft: #113333;
    --amber-soft: #392c12;
    --indigo-soft: #25264a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: calc(17px * var(--fs)); -webkit-text-size-adjust: 100%; }
@media (min-width: 768px) { html { font-size: calc(18px * var(--fs)); } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
b { font-weight: 650; }
mark { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--warn) 45%, transparent) 55%); color: inherit; padding: 0 1px; }
s { opacity: .65; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hidden { display: none !important; }

/* ============ 布局 ============ */
#app { min-height: 100dvh; }
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 18px) 18px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  animation: fadein .25s ease;
}
.page.full { padding-bottom: calc(var(--safe-b) + 110px); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem;
}
.tabbar a .ico { font-size: 1.35rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabbar a.on { color: var(--brand); font-weight: 600; }
.tabbar a.on .ico { filter: none; opacity: 1; }
.tabbar .brand { display: none; }

@media (min-width: 1100px) {
  .tabbar {
    top: 0; right: auto; width: 230px; height: 100%;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 28px 14px; border-top: 0; border-right: 1px solid var(--line);
  }
  .tabbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; padding: 0 10px 22px; }
  .tabbar .brand img { width: 36px; height: 36px; border-radius: 10px; }
  .tabbar a { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: .95rem; padding: 12px 14px; border-radius: 12px; }
  .tabbar a.on { background: var(--brand-soft); }
  #app.has-tabs .page { margin-left: max(250px, calc((100vw - 760px) / 2)); }
  .page { max-width: 860px; padding-bottom: 48px; }
}

/* ============ 通用组件 ============ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; font-size: 1.02rem; font-weight: 700; }
.section-title .muted { font-weight: 400; font-size: .82rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 16px;
  background: var(--brand); color: #fff; font-weight: 650; font-size: 1rem;
  transition: transform .08s ease, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
a.btn, a.x, a.mini-card { text-decoration: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.line { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.good { background: var(--good); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: .88rem; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--bg-2); color: var(--muted); white-space: nowrap; }
.tag.ai { background: var(--brand-soft); color: var(--brand); }
.tag.var { background: var(--teal-soft); color: var(--teal); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: #b7791f; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* 可点读英文 */
.en { font-family: ui-rounded, -apple-system, "SF Pro Rounded", "Segoe UI", sans-serif; letter-spacing: .1px; }
.say {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 4px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .8rem; vertical-align: middle;
}
.say.playing { animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.term { color: var(--brand); border-bottom: 1.5px dashed currentColor; font-weight: 600; line-height: 1.2; }

/* ============ 登录（口令） ============ */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }
.login h1 { margin: 18px 0 4px; font-size: 1.5rem; }
.pin-dots { display: flex; gap: 16px; margin: 28px 0 30px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); transition: background .15s; }
.pin-dots i.on { background: var(--brand); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 26px; }
.pinpad button { width: 76px; height: 76px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 1.7rem; font-weight: 500; }
.pinpad button:active { background: var(--brand-soft); }
.pinpad button.fn { background: transparent; box-shadow: none; font-size: 1rem; color: var(--muted); }

/* ============ 首页 ============ */
.hello { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hello h1 { margin: 0; font-size: 1.55rem; }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--warn-soft); color: #b7791f; font-weight: 700; }
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 22px;
  background: linear-gradient(135deg, var(--indigo), var(--brand-2));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--brand) 35%, transparent);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.hero h2 { margin: 0 0 4px; font-size: 1.25rem; }
.hero .meta { opacity: .85; font-size: .9rem; }
.hero .segs { display: flex; gap: 6px; margin: 16px 0 18px; }
.hero .segs i { flex: 1; height: 8px; border-radius: 9px; background: rgba(255, 255, 255, .25); }
.hero .segs i.done { background: #fbbf24; }
.hero .btn { background: #fff; color: var(--indigo); }
.install-tip { margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1.5px dashed var(--brand); border-radius: 16px; padding: 12px 14px; font-size: .88rem; }
.install-tip button { margin-left: auto; color: var(--muted); font-size: 1.1rem; }

.lesson-item { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.lesson-item .emo { width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; }
.lesson-item h3 { margin: 0; font-size: 1rem; }
.lesson-item .f { font-family: ui-rounded, -apple-system, sans-serif; color: var(--muted); font-size: .86rem; }
.lesson-item .go { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.lesson-item.locked { opacity: .55; }
.c-indigo { background: var(--indigo-soft); }
.c-amber { background: var(--amber-soft); }
.c-teal { background: var(--teal-soft); }
.list > * + * { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.bars .bar { display: grid; grid-template-columns: 5.6em 1fr 3em; gap: 10px; align-items: center; font-size: .88rem; }
.bars .bar + .bar { margin-top: 8px; }
.bars .track { height: 10px; border-radius: 9px; background: var(--bg-2); overflow: hidden; }
.bars .track i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.bars .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat3 b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.stat3 span { font-size: .78rem; color: var(--muted); }

/* ============ 微课 ============ */
.ltop {
  position: sticky; top: 0; z-index: 15;
  padding: calc(var(--safe-t) + 10px) 14px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.ltop-inner { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.ltop .x { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; color: var(--muted); background: var(--card); box-shadow: var(--shadow); flex: none; }
.steps { flex: 1; display: flex; gap: 6px; }
.steps i { flex: 1; height: 8px; border-radius: 9px; background: var(--line); position: relative; overflow: hidden; }
.steps i.done { background: var(--good); }
.steps i.cur { background: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.steps i.cur::after { content: ""; position: absolute; inset: 0; width: var(--p, 30%); background: var(--brand); border-radius: 9px; transition: width .3s; }
.step-name { font-size: .78rem; color: var(--muted); min-width: 3.5em; text-align: right; }

.lpage { max-width: 760px; margin: 0 auto; padding: 8px 18px calc(var(--safe-b) + 120px); }
@media (min-width: 1100px) { .lpage { max-width: 860px; } }
.lhead { margin: 10px 2px 16px; }
.lhead .k { font-size: .8rem; color: var(--muted); }
.lhead h2 { margin: 2px 0 0; font-size: 1.35rem; }

.qbox { font-size: 1.04rem; }
.qbox .stem { margin: 0 0 14px; }
.qbox u { text-decoration: none; display: inline-block; min-width: 3em; border-bottom: 2px solid var(--text); text-align: center; color: var(--muted); font-size: .8em; }
.opts { display: grid; gap: 10px; }
@media (min-width: 768px) { .opts.two { grid-template-columns: 1fr 1fr; } }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: 14px; background: var(--card); border: 2px solid var(--line);
  transition: border-color .15s, background .15s, transform .08s;
}
.opt:active { transform: scale(.99); }
.opt .id { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); font-weight: 700; font-size: .9rem; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .id { background: var(--brand); color: #fff; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .id { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .id { background: var(--bad); color: #fff; }
.opt > span:nth-child(2) { flex: 1; min-width: 0; }
.opt .mark { margin-left: auto; flex: none; white-space: nowrap; font-size: .74rem; font-weight: 700; }
.opt.right .mark { color: var(--good); }
.opt.wrong .mark { color: var(--bad); }
.opt[disabled] { cursor: default; }

.recap .mine { color: var(--bad); font-weight: 700; }
.recap .pits { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); font-size: .92rem; }
.recap .pits div + div { margin-top: 4px; }
.recap .note { margin-top: 14px; font-size: .95rem; }
.scan { margin-top: 12px; border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; font-size: .82rem; color: var(--muted); text-align: center; }

/* 讲解：风格切换 */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--bg-2); gap: 2px; margin-bottom: 14px; }
.seg button { padding: 7px 14px; border-radius: 11px; font-size: .86rem; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* 讲解：学长消息流 */
.feed { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; background: linear-gradient(135deg, #fde68a, #fca5a5); }
.avatar.me { background: linear-gradient(135deg, #a5b4fc, #c4b5fd); }
.bubble { background: var(--card); border-radius: 6px 18px 18px 18px; padding: 13px 15px; box-shadow: var(--shadow); max-width: 100%; min-width: 0; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bubble { border-radius: 18px 6px 18px 18px; background: var(--brand); color: #fff; }
.msg.me .bubble .term, .msg.me .bubble .say { color: #fff; }
.msg.me .bubble .say { background: rgba(255, 255, 255, .2); }
.bubble .alt { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.bubble .tools { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bubble .tools button { font-size: .8rem; color: var(--muted); padding: 4px 10px; border-radius: 99px; background: var(--bg-2); }
.ex { list-style: none; margin: 0 0 10px; padding: 0; }
.ex li { padding: 9px 12px; border-radius: 12px; background: var(--bg-2); }
.ex li + li { margin-top: 8px; }
.ex .zh { display: block; color: var(--muted); font-size: .84rem; }
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.flow .chip { padding: 6px 11px; border-radius: 11px; background: var(--bg-2); font-family: ui-rounded, -apple-system, sans-serif; font-weight: 600; }
.flow .chip.good { background: var(--good-soft); color: var(--good); }
.flow .chip.stop { background: var(--bad-soft); color: var(--bad); }
.flow .arrow { font-weight: 800; color: var(--brand); font-size: 1.2rem; }
.flow-zh { font-size: .84rem; color: var(--muted); margin-bottom: 10px; }
.seesaw { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; padding: 12px; border-radius: 14px; background: var(--bg-2); font-size: .95rem; }
.seesaw .pivot { font-size: 1.6rem; }
.howmap { display: grid; gap: 8px; margin: 12px 0 4px; }
.howmap div { display: grid; grid-template-columns: 6.2em 1fr; gap: 0 10px; padding: 9px 12px; border-radius: 12px; background: var(--bg-2); }
.howmap b { font-family: ui-rounded, -apple-system, sans-serif; color: var(--brand); grid-row: span 2; align-self: center; }
.howmap em { font-style: normal; font-size: .8rem; color: var(--muted); font-family: ui-rounded, -apple-system, sans-serif; }
.timeline { margin: 12px 0; padding: 12px; border-radius: 14px; background: var(--bg-2); display: grid; gap: 12px; }
.tl-row { display: grid; grid-template-columns: 5.6em 1fr; gap: 4px 10px; align-items: center; }
.tl-label { font-weight: 700; color: var(--brand); font-family: ui-rounded, -apple-system, sans-serif; }
.tl-viz { display: flex; align-items: center; height: 30px; font-style: normal; }
.tl-viz i { font-style: normal; font-size: .74rem; font-weight: 700; }
.tl-seg { flex: 1; margin: 0 8%; height: 22px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.tl-now, .tl-dot { flex: none; padding: 2px 8px; border-radius: 99px; }
.tl-now { background: var(--card); color: var(--muted); border: 1.5px solid var(--line); }
.tl-dot { background: var(--warn); color: #fff; }
.tl-dash { flex: 1; height: 0; margin: 0 6px; border-top: 2.5px dashed var(--warn); position: relative; }
.tl-dash::after { content: "▶"; position: absolute; right: -4px; top: -10px; font-size: .7rem; color: var(--warn); }
.tl-note { grid-column: 2; font-size: .8rem; color: var(--muted); }
.check-q { font-weight: 600; margin-bottom: 10px; }
.check .opts { gap: 8px; }
.check .fb { margin-top: 10px; font-size: .92rem; }
.motto {
  border-radius: 20px; padding: 18px; color: #fff; text-align: center;
  background: linear-gradient(135deg, var(--indigo), var(--brand-2));
}
.motto .lbl { font-size: .78rem; opacity: .8; letter-spacing: 2px; }
.motto .m { font-size: 1.15rem; margin: 6px 0; line-height: 1.5; }
.motto .term { color: #fff; }
.motto .fam { font-size: .84rem; opacity: .9; }
.brief { margin: 0; padding: 0; list-style: none; counter-reset: b; }
.brief li { counter-increment: b; position: relative; padding: 12px 14px 12px 50px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.brief li + li { margin-top: 10px; }
.brief li::before { content: counter(b); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.ask { margin-top: 16px; display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; }

/* 练习 */
.pq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pq-head .num { font-weight: 700; color: var(--muted); font-size: .86rem; }
.lead { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.quote { padding: 10px 14px; border-left: 4px solid var(--brand); background: var(--bg-2); border-radius: 0 12px 12px 0; margin-bottom: 12px; }
.fillstem { line-height: 2.5; font-size: 1.06rem; }
.blank {
  display: inline-block; width: 6.2em; height: 40px; margin: 0 3px; padding: 0 8px; vertical-align: middle;
  border: 0; border-bottom: 2.5px solid var(--brand); border-radius: 10px 10px 4px 4px; background: var(--brand-soft);
  text-align: center; font-size: max(16px, 1rem); font-family: ui-rounded, -apple-system, sans-serif; font-weight: 600; outline: none;
}
.blank:focus { background: color-mix(in srgb, var(--brand) 18%, var(--card)); }
.blank.right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.blank.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.chunks { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chunks button { padding: 9px 13px; border-radius: 12px; background: var(--card); border: 2px solid var(--line); font-family: ui-rounded, -apple-system, sans-serif; font-weight: 600; font-size: 1rem; }
.chunks button.sel { border-color: var(--brand); background: var(--brand-soft); }
.chunks button.right { border-color: var(--good); background: var(--good-soft); }
.chunks button.wrong { border-color: var(--bad); background: var(--bad-soft); }
.fixin { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.fixin input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--brand); background: var(--card); font-size: max(16px, 1rem); font-family: ui-rounded, -apple-system, sans-serif; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px calc(var(--safe-b) + 12px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.actionbar .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.actionbar .inner > * { flex: 1; }
.conf-label { max-width: 760px; margin: 0 auto 8px; font-size: .78rem; color: var(--muted); text-align: center; }
.conf .btn { padding: 0 8px; font-size: .9rem; flex-direction: column; gap: 0; height: 58px; line-height: 1.2; }
.conf .btn small { font-weight: 500; opacity: .85; font-size: .72rem; }

.fb-card { margin-top: 14px; border-radius: var(--radius); padding: 16px; animation: pop .3s; }
.fb-card.ok { background: var(--good-soft); }
.fb-card.no { background: var(--bad-soft); }
.fb-card h4 { margin: 0 0 6px; font-size: 1.05rem; }
.fb-card.ok h4 { color: var(--good); }
.fb-card.no h4 { color: var(--bad); }
.fb-card .ans { margin-top: 8px; font-size: .92rem; }
.fb-card .links { display: flex; gap: 14px; margin-top: 12px; font-size: .84rem; }
.fb-card .links button { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.reason { margin-top: 14px; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); animation: pop .3s; }
.reason .opts { gap: 8px; }
.added { margin-top: 10px; font-size: .84rem; }

@media (min-width: 1100px) {
  .practice-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
  .practice-grid .fb-col .fb-card:first-child, .practice-grid .fb-col .reason:first-child { margin-top: 0; }
}

/* 技能卡 */
.skillcard {
  position: relative; border-radius: 24px; padding: 24px 20px; color: #fff; text-align: center; overflow: hidden;
  background: linear-gradient(140deg, var(--indigo), var(--brand-2));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--brand) 40%, transparent);
}
.skillcard.amber { background: linear-gradient(140deg, #f59e0b, #ef4444); box-shadow: 0 16px 40px rgba(245, 158, 11, .35); }
.skillcard.teal { background: linear-gradient(140deg, #0ea5a4, #2563eb); box-shadow: 0 16px 40px rgba(14, 165, 164, .35); }
.skillcard .em { font-size: 2.6rem; }
.skillcard h3 { margin: 6px 0 2px; font-size: 1.3rem; }
.skillcard .f { font-family: ui-rounded, -apple-system, sans-serif; opacity: .9; }
.skillcard .m { margin: 14px 0 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .16); }
.skillcard .term { color: #fff; }
.skillcard .stars { font-size: 1.3rem; letter-spacing: 3px; }
.skillcard.reveal { animation: flip .7s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes flip { from { transform: perspective(800px) rotateY(90deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.result3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; text-align: center; }
.result3 > div { background: var(--card); border-radius: 16px; padding: 12px 6px; box-shadow: var(--shadow); }
.result3 b { display: block; font-size: 1.3rem; }
.result3 span { font-size: .76rem; color: var(--muted); }
.next-review { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 6px 0 2px; font-size: .78rem; }
.next-review span { padding: 3px 9px; border-radius: 99px; background: var(--bg-2); color: var(--muted); }
.next-review span.on { background: var(--brand); color: #fff; }

.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
.mini-card { border-radius: 18px; padding: 16px 12px; text-align: center; color: #fff; min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 4px; background: linear-gradient(140deg, var(--indigo), var(--brand-2)); }
.mini-card.amber { background: linear-gradient(140deg, #f59e0b, #ef4444); }
.mini-card.teal { background: linear-gradient(140deg, #0ea5a4, #2563eb); }
.mini-card.locked { background: var(--card); color: var(--muted); box-shadow: var(--shadow); border: 2px dashed var(--line); }
.mini-card .em { font-size: 2rem; }
.mini-card b { font-size: .95rem; }
.mini-card small { opacity: .85; font-family: ui-rounded, -apple-system, sans-serif; }

/* 错题本 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; padding: 7px 14px; border-radius: 99px; background: var(--card); border: 1.5px solid var(--line); font-size: .86rem; }
.chips button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.bq { cursor: pointer; }
.bq .s { font-family: ui-rounded, -apple-system, sans-serif; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bq .meta { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .76rem; color: var(--muted); }

/* 底部弹层 */
.sheet-mask { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 30, .4); animation: fadein .2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: 86dvh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 20px calc(var(--safe-b) + 22px); animation: up .28s cubic-bezier(.2, .9, .3, 1); }
@media (min-width: 768px) { .sheet-mask { align-items: center; } .sheet { border-radius: 24px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 8px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 100px); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: .88rem; animation: pop .25s; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }

/* 撒花 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.4s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }

/* 我的 / 家长 */
.spark { width: 100%; height: 90px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal i { aspect-ratio: 1; border-radius: 7px; background: var(--bg-2); }
.cal i.l1 { background: color-mix(in srgb, var(--brand) 35%, var(--bg-2)); }
.cal i.l2 { background: color-mix(in srgb, var(--brand) 65%, var(--bg-2)); }
.cal i.l3 { background: var(--brand); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.setting + .setting { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.parent-banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); font-size: .86rem; margin-bottom: 14px; }
.skillrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.skillrow + .skillrow { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.skillrow .track { grid-column: 1 / -1; height: 8px; border-radius: 9px; background: var(--bg-2); overflow: hidden; }
.skillrow .track i { display: block; height: 100%; background: var(--good); border-radius: 9px; }
.rv + .rv { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.rv .s { font-family: ui-rounded, -apple-system, sans-serif; font-weight: 600; }
.rv .btns { display: flex; gap: 8px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
