:root {
  --bg: #0f1115; --bg2: #151820; --card: #1a1e27; --line: #262b36; --line2: #323846;
  --text: #e9ecf2; --muted: #9aa3b2; --dim: #6b7383;
  --accent: #4fd1a5; --accent-ink: #062b1f; --amber: #f2b84b; --blue: #6aa8ff; --red: #ff6b6b;
  --radius: 14px; --zh-size: 19px; --en-size: 15px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 11px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; } .between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--card); padding: 10px 16px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--red); border-color: var(--red); color: #2a0606; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.big { padding: 15px 26px; font-size: 17px; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 顶栏 */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 18px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(15,17,21,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 8px; font-weight: 500; }
.nav a.on, .nav a:hover { color: var(--text); background: var(--card); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill b { color: var(--text); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.dot.live { background: var(--accent); box-shadow: 0 0 0 4px rgba(79,209,165,.18); animation: pulse 1.6s infinite; }
.dot.warn { background: var(--amber); } .dot.err { background: var(--red); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(79,209,165,.05); } }

.page { max-width: 1080px; margin: 0 auto; padding: 26px 18px 60px; }
.narrow { max-width: 460px; }
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } .nav { display: none; } h1 { font-size: 24px; } }
label.field { display: block; } label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.seg-ctl { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; }
.seg-ctl button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.seg-ctl button.on { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.notice { border-radius: 10px; padding: 11px 13px; font-size: 14px; background: rgba(242,184,75,.1); border: 1px solid rgba(242,184,75,.3); color: #f6d58f; }
.notice.ok { background: rgba(79,209,165,.08); border-color: rgba(79,209,165,.3); color: #a6ecd3; }
.notice.err { background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.3); color: #ffb3b3; }
.big-num { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.t th, table.t td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.tag.lecture { background: rgba(79,209,165,.15); color: var(--accent); }
.tag.ai { background: rgba(242,184,75,.15); color: var(--amber); }
.tag.none { background: var(--line); color: var(--muted); }
.tag.task { background: rgba(106,168,255,.15); color: var(--blue); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #222836; border: 1px solid var(--line2); padding: 11px 16px; border-radius: 12px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 90vw; }

/* 账户邀请 */
.account-mode { min-height: 100dvh; }
.account-referral { margin: 0 0 16px; overflow-wrap: anywhere; }
.account-referral h2 { margin: 0 0 6px; font-size: 1.25rem; }
.account-referral p { margin: 0; }
.referral-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 20px; }
.referral-intro h2 { margin: 0; }
.referral-intro > :not(.btn) { grid-column: 1; }
.referral-intro .btn { grid-area: 1 / 2 / span 3; justify-self: start; min-height: 44px; max-width: 100%; white-space: normal; }
.referral-meter { display: block; appearance: none; width: min(16rem, 100%); height: 6px; margin-top: 6px; border: 0; border-radius: 99px; background: var(--line2); }
.referral-meter::-webkit-progress-bar { border-radius: inherit; background: var(--line2); }
.referral-meter::-webkit-progress-value { border-radius: inherit; background: var(--accent); }
.referral-meter::-moz-progress-bar { border-radius: inherit; background: var(--accent); }
.account-referral .referral-earned { margin-top: 8px; }
.referral-feedback:not(:empty) { margin-top: 8px; color: var(--accent); }
.account-referral .field:not(.hidden) { margin-top: 8px; }
.referral-history summary { display: list-item; padding: 10px 0; min-height: 44px; cursor: pointer; }
.referral-history h3 { margin: 12px 0 4px; font-size: 1rem; }
.referral-history ul { margin: 0; padding: 0; list-style: none; }
.referral-history li { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .referral-intro { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .referral-intro .btn { grid-area: auto; }
}
@media (max-width: 760px) {
  .account-mode .top { flex-wrap: wrap; gap: 6px; padding-inline: 12px; }
  .account-mode .mobile-menu summary { white-space: nowrap; }
}
@media (prefers-color-scheme: light) {
  .account-mode {
    color-scheme: light;
    --bg: #f2f5f3; --bg2: #eaf1ed; --card: #fff; --line: #d2e0d8; --line2: #9db9ad;
    --text: #142823; --muted: #435e55; --dim: #506962; --accent: #096c54; --accent-ink: #fff; --red: #a62029;
  }
  .account-mode .top { background: #f7fbf9; }
}

/* 套餐 */
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; }
.plan .price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.plan .per { color: var(--muted); font-size: 13px; }
.plan.best { border-color: var(--accent); }
.plan .badge { position: absolute; top: -10px; right: 14px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }

/* ---------- 课堂 ---------- */
body.lesson-mode { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; overflow: hidden; }
.lesson-mode #view { min-height: 0; }
@media (prefers-color-scheme: light) {
  body.lesson-mode { color-scheme: light; --bg: #f6f8fa; --bg2: #edf1f5; --card: #fff; --line: #d6dee6; --line2: #bbc8d5;
    --text: #142431; --muted: #46596c; --dim: #57687b; --accent: #8ce3c4; --accent-ink: #063726; }
  .lesson-mode .top { background: #f6f8faf2; }
  .lesson .notice { color: #5e3708; }
  .lesson .notice.err { color: #781d20; }
  .lesson .notice.ok { color: #164d34; }
}
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 28%); grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.lesson-main { grid-area: 1 / 1; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.lesson-bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.caption-settings { position: relative; }
.caption-options { display: flex; gap: 8px; }
.lesson-title { font-weight: 700; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.transcript { flex: 1; overflow-y: auto; overflow-anchor: none; padding: 18px 22px 20px; }
.seg { padding: 10px 12px; margin: 0 -12px; border-radius: 10px; transition: background .4s; }
.seg .t { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.seg .zh { font-size: var(--zh-size); line-height: 1.6; color: var(--text); }
.seg .en { font-size: var(--en-size); color: var(--muted); line-height: 1.5; }
.seg.open .en { color: var(--muted); }
.caption-line { display: flex; align-items: baseline; gap: 8px; overflow-wrap: anywhere; }
.caption-label { flex: none; color: var(--muted); font-size: .78rem; }
.caption-preview .caption-line [lang] {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.caption-details summary { width: max-content; max-width: 100%; color: var(--muted); font-size: .82rem; cursor: pointer; padding-block: .25rem; }
.seg:has(.caption-details[open]) .caption-preview { display: none; }
.seg .original { font-size: var(--zh-size); color: var(--text); }
@media (max-width: 520px) {
  .caption-line { display: block; }
  .caption-line .caption-label { display: block; }
  .caption-preview .caption-line [lang] { -webkit-line-clamp: 2; }
}
.seg .ai-mark { font-size: 11px; color: var(--amber); margin-left: 6px; }
.seg.flash { background: rgba(79,209,165,.12); }
.only-zh .transcript .en { display: none; }
.only-en .transcript .zh { display: none; }
.partial { color: var(--muted); font-size: var(--en-size); padding: 4px 0; }
.partial:empty { display: none; }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; }
.jump { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; }
.lesson-actions { grid-area: 2 / 1; background: var(--bg); }
.lesson-actions .notice { margin: 0 12px 6px; }
.dock { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.meter { width: 70px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s; }

.cards { grid-area: 1 / 2 / 3 / 3; display: flex; flex-direction: column; min-height: 0; background: var(--bg2); }
.cards-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.cards-list { flex: 1; overflow-y: auto; padding: 14px; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; animation: in .35s ease; }
.qcard.fresh { border-color: var(--accent); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.qcard .q-en { font-size: 14px; color: var(--muted); margin: 8px 0 2px; }
.qcard .q-zh { font-size: 15px; font-weight: 600; }
.qcard .ans { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line2); }
.qcard .a-en { font-size: 17px; font-weight: 600; line-height: 1.45; }
.qcard .a-zh { font-size: 14px; color: var(--muted); margin-top: 4px; }
.qcard .cites { margin-top: 10px; font-size: 13px; }
.qcard .cites summary { color: var(--muted); cursor: pointer; }
.qcard .cite { display: block; text-align: start; width: 100%; border: 0; color: var(--muted); padding: 6px 8px; border-left: 2px solid var(--accent); margin-top: 6px; background: var(--bg2); border-radius: 0 6px 6px 0; cursor: pointer; }
.qcard .cite:hover { color: var(--text); }
.mob-tabs { display: none; }
@media (max-width: 900px) {
  .lesson { grid-template-columns: 1fr; }
  .lesson-main { border-right: 0; }
  .cards { display: none; }
  .lesson.show-cards .cards { display: flex; grid-area: 1 / 1; }
  .lesson.show-cards .lesson-main { display: none; }
  .caption-options { display: none; position: absolute; z-index: 7; inset-inline: 12px; top: calc(100% + 4px); padding: 8px; flex-wrap: wrap; max-width: max-content;
    border: 1px solid var(--line2); border-radius: var(--radius); background: var(--bg); box-shadow: 0 8px 20px #0002; }
  .caption-options.open { display: flex; }
  .caption-settings { position: static; order: 3; }
  .caption-settings .mob-tabs, #tabCards { min-height: 44px; }
  .dock .remaining-balance { display: none; } /* 顶栏已经显示余额。 */
  .mob-tabs { display: inline-flex; }
  .transcript { padding: 14px 16px 15px; }
  .lesson-bar .seg-ctl button, .cards-head .mob-tabs { min-height: 44px; }
  .lesson-title { flex: 1 1 100%; max-width: none; overflow-wrap: anywhere; white-space: normal; font-size: 14px; }
  .lesson-bar { gap: 6px; padding: 8px 12px; }
  .lesson-bar .seg-ctl button { padding: 5px 9px; font-size: 13px; }
  .lesson-bar .pill { padding: 4px 9px; }
}

/* 官网 */
.hero { padding: 64px 0 30px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; letter-spacing: -.02em; }
.hero p.lead { font-size: 18px; color: var(--muted); }
.demo-screen { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.feature { padding: 20px; }
.feature .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--line2); margin-bottom: 10px; font-weight: 800; color: var(--accent); }
.foot { border-top: 1px solid var(--line); padding: 26px 18px; color: var(--dim); font-size: 13px; text-align: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 30px; } .hero h1 { font-size: 32px; } }

/* 窄屏导航保留账户、历史和购买入口。 */
.mobile-menu { display: none; position: relative; }
.mobile-menu summary { min-height: 40px; display: grid; place-items: center; padding-inline: .5rem; cursor: pointer; list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav { position: absolute; z-index: 30; top: 100%; right: 0; min-width: 8rem; padding: .3rem; background: var(--card); border: 1px solid var(--line2); border-radius: .6rem; }
.mobile-menu nav a { display: block; min-height: 44px; padding: .58rem .65rem; color: var(--text); }
.mobile-menu nav a:hover, .mobile-menu nav a:focus-visible { background: var(--bg2); border-radius: .35rem; }
@media (max-width: 760px) {
  body:not(.lesson-mode) .mobile-menu { display: block; }
}

/* 学生界面 */
.student-page:not(.auth-mode) {
  color-scheme: dark;
  --bg: #101a17;
  --bg2: #16231e;
  --card: #1b2b24;
  --line: #31443a;
  --line2: #51675a;
  --text: #f0f7f2;
  --muted: #b6c9be;
  --dim: #a5b9ad;
  --accent: #72e0b7;
  --accent-ink: #10291f;
  --highlight: #203a2e;
  --focus: #9beece;
  --danger-ink: #2a0606;
  --radius: 16px;
  min-height: 100dvh;
  font-size: max(15px, 1rem);
}
@media (prefers-color-scheme: light) {
  .student-page:not(.auth-mode) {
    color-scheme: light;
    --bg: #f0f4f1;
    --bg2: #e9f0eb;
    --card: #fcfefc;
    --line: #cfddd4;
    --line2: #9db6a8;
    --text: #132820;
    --muted: #3c584b;
    --dim: #466155;
    --accent: #087b60;
    --accent-ink: #fff;
    --highlight: #e1f2ea;
    --focus: #076651;
    --amber: #7d520b;
    --blue: #245b9a;
    --red: #a62029;
    --danger-ink: #fff;
  }
  .student-page:not(.auth-mode) .notice { color: #69450b; }
  .student-page:not(.auth-mode) .notice.ok { color: #145b45; }
  .student-page:not(.auth-mode) .notice.err { color: #8b2527; }
}
.student-page:not(.auth-mode) :focus-visible { outline-color: var(--focus); }
.student-page:not(.auth-mode) .btn.danger { color: var(--danger-ink); }
.student-page:not(.auth-mode) .top {
  background: var(--card);
  gap: .8rem;
  min-height: 54px;
  padding: max(.55rem, env(safe-area-inset-top)) clamp(.85rem, 2.8vw, 2rem) .55rem;
}
.student-page .brand { gap: .55rem; font-size: 1.12rem; }
.student-page .logo { flex: 0 0 32px; width: 32px; height: 32px; font-size: 1.05rem; border-radius: 9px; }
.student-page .nav { gap: .25rem; }
.student-page .nav a, .student-page .mobile-menu nav a { font-weight: 600; white-space: nowrap; }
.student-page .nav a.on, .student-page .mobile-menu a.on { color: var(--text); background: var(--highlight, var(--bg2)); }
.student-page .nav a { padding: .4rem .72rem; }
.student-page:not(.auth-mode) .pill { border-color: var(--line2); color: var(--muted); }
.student-page:not(.auth-mode) .top .pill .dot { animation: none; box-shadow: none; }
.student-page:not(.auth-mode) .toast { background: var(--card); box-shadow: 0 10px 30px #14282324; }
.student-page .deck { min-width: 0; }
.student-page .deck > * { min-width: 0; }

.student-page .student-workspace {
  max-width: 72rem;
  padding: clamp(.9rem, 3vh, 2.25rem) clamp(.85rem, 3vw, 2rem) 3.6rem;
}
.student-workspace h1, .student-workspace h2, .student-workspace p { margin: 0; }
.student-workspace h1 { font-size: clamp(1.55rem, 1.25rem + 1vw, 2.15rem); line-height: 1.2; overflow-wrap: anywhere; }
.student-workspace h2 { font-size: 1.14rem; line-height: 1.32; }
.student-workspace .panel { padding: clamp(.9rem, 2.3vw, 1.5rem); }
.student-workspace .btn { min-height: 44px; max-width: 100%; white-space: normal; }
.student-heading { margin-block-end: .85rem; }
.student-heading p { margin-top: .45rem; }
.student-heading > .btn { margin-top: .6rem; }
.history-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .65rem 1rem; }
.history-filter { flex: 0 1 17rem; min-width: 0; max-width: 100%; }
.history-filter select { min-height: 44px; font-size: max(16px, 1rem); text-overflow: ellipsis; }
.history-heading > .btn { margin-top: 0; min-height: 44px; }
.student-workspace .text-action { display: inline-flex; align-items: center; min-height: 44px; font-weight: 640; }
.student-workspace .text-action:hover { text-decoration: underline; text-underline-offset: .2em; }
.student-section-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .1rem .75rem; }
.student-section-heading .text-action { font-size: .9rem; }
.student-empty { color: var(--muted); margin-top: .45rem; }
.student-empty-panel { display: grid; justify-items: start; gap: .8rem; background: var(--card); }
.student-dashboard { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(.85rem, 3vw, 1.7rem); align-items: start; }
.dashboard-side, .purchase-plans { display: grid; gap: .85rem; }
.start-panel { display: grid; gap: .82rem; }
.start-panel .demo-hint { margin-top: -.45rem; }
.start-fields { display: grid; gap: .82rem; }
.start-fields > .field { min-width: 0; }
.student-workspace .field > span, .student-workspace .field > .small { font-size: .88rem; font-weight: 600; }
.course-field > label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.start-panel input:not([type="checkbox"]), .start-panel select { min-height: 44px; font-size: max(16px, 1rem); padding-block: .44rem; }
.start-consent { font-size: .95rem; line-height: 1.42; margin-block: .12rem; }
.start-consent input { width: 20px; height: 20px; }
.start-panel .btn.big { justify-self: start; min-width: min(11rem, 100%); font-size: 1.04rem; padding: .64rem 1.15rem; }
.course-entry { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.course-entry:has(.course-picker) #course { border-start-end-radius: 0; border-end-end-radius: 0; }
.course-picker summary {
  display: grid; place-items: center; min-inline-size: 44px; min-block-size: 44px; height: 100%; list-style: none;
  background: var(--bg2); border: 1px solid var(--line2); border-inline-start: 0;
  border-start-end-radius: 10px; border-end-end-radius: 10px; color: var(--muted); cursor: pointer;
}
.course-picker summary::-webkit-details-marker { display: none; }
.course-picker summary::after { content: ""; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.1rem) rotate(45deg); }
.course-picker[open] summary::after { transform: translateY(.1rem) rotate(225deg); }
.course-picker summary:hover, .course-picker[open] summary { background: var(--card); color: var(--text); }
.course-menu {
  position: absolute; z-index: 2; inset-inline: 0; inset-block-start: calc(100% + .28rem);
  display: grid; gap: .1rem; max-block-size: min(15rem, 39vh); overflow: auto; overscroll-behavior: contain;
  margin: 0; padding: .28rem; list-style: none; background: var(--card); border: 1px solid var(--line2);
  border-radius: 10px; box-shadow: 0 .45rem 1.1rem rgba(0, 0, 0, .16);
}
.course-menu button {
  display: block; width: 100%; min-height: 44px; padding: .5rem .62rem; border: 0;
  border-radius: 7px; background: transparent; color: var(--text); font: inherit; text-align: start; overflow-wrap: anywhere; cursor: pointer;
}
.course-menu button:hover, .course-menu button:focus-visible { background: var(--bg2); }
.balance-panel .big-num { font-size: clamp(1.72rem, 1.5rem + .7vw, 2.18rem); font-variant-numeric: tabular-nums; margin: .2rem 0 .45rem; }
.balance-list .record-row { font-size: .88rem; }
.record-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.record-row { display: flex; flex-wrap: wrap; min-width: 0; align-items: center; gap: .3rem 1rem; padding: .65rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.record-main { display: grid; flex: 1 1 12rem; min-width: min(100%, 9.5rem); gap: .12rem; }
.record-main a { color: var(--text); width: fit-content; }
.record-main a:hover { text-decoration: underline; text-underline-offset: .2em; }
.record-date { color: var(--dim); font-size: .84rem; font-variant-numeric: tabular-nums; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .55rem; min-width: 0; }
.record-actions .btn { font-size: .85rem; }
.purchase-plans .plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem 1.45rem; align-items: center; border-color: var(--line2); }
.plan-copy .price { font-size: clamp(2rem, 1.5rem + 1vw, 2.65rem); line-height: 1.2; margin-block: .22rem; font-variant-numeric: tabular-nums; }
.plan-copy .per { font-size: .88rem; }
.plan-action { min-width: 0; }
.plan-action .btn { padding-inline: 1.35rem; }
.plan-action .small { margin-top: .38rem; font-size: .85rem; }
.purchase-workspace > #payStatus, .purchase-workspace > #payBox, .orders-panel { margin-top: .85rem; }
.student-workspace .purchase-terms, .student-workspace .history-storage { margin-top: .75rem; }
.purchase-workspace > #payStatus { margin-bottom: .85rem; }
.purchase-workspace .record-main { flex-basis: 15rem; }
.saved-heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .55rem .9rem; }
.saved-heading > div { min-width: min(100%, 12rem); flex: 1 1 12rem; }
.saved-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.saved-grid > #nSegs { padding-block: .4rem; }
.saved-grid .seg:last-child { border-bottom: 0; }
.account-grid { align-items: start; }
.account-details > p { margin-top: .72rem; }
.account-details .account-manage-link { color: var(--muted); }
.student-page .student-workspace.account-manage { max-width: 44rem; }
.account-manage-heading, .account-manage-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .9rem;
}
.account-manage-heading { justify-content: space-between; }
.account-delete-settings { display: grid; gap: .65rem; }
.account-delete-settings .account-manage-actions { justify-content: space-between; }
.account-manage-actions .btn { min-height: 44px; }
.account-delete-dialog {
  width: min(28rem, calc(100% - 1.5rem)); max-width: none;
  max-block-size: calc(100dvh - 1.5rem); overflow: auto; overscroll-behavior: contain;
  background: var(--card); color: var(--text);
}
.account-delete-dialog[open] { display: grid; gap: .7rem; }
.account-delete-dialog::backdrop { background: #08191099; }
.account-delete-dialog .account-manage-actions { justify-content: flex-end; }
.account-manage-heading h1:focus, .account-delete-dialog h2:focus { outline: none; }
.positive-time { color: var(--accent); font-weight: 640; }
.student-workspace .account-referral h2 { margin-bottom: .12rem; }
@media (max-width: 760px) {
  .student-dashboard, .saved-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .purchase-plans .plan { grid-template-columns: minmax(0, 1fr); }
  .student-workspace .plan-action .btn, .start-panel .btn.big { width: 100%; }
  .history-filter { flex-basis: 100%; }
}
@media (max-height: 460px) {
  .student-page .student-workspace { padding-top: .6rem; }
  .student-workspace .start-panel { gap: .48rem; padding-block: .62rem; }
  .start-fields { gap: .48rem; }
}
@media (min-width: 500px) and (max-height: 460px) {
  .start-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 250px) {
  .student-page .student-workspace:has(.start-panel) { padding-top: .4rem; }
  .student-workspace .start-panel, .start-fields { gap: .42rem; }
}

/* 课堂阅读和问答 */
.student-page.lesson-mode .lesson { grid-template-columns: minmax(0, 1fr) minmax(310px, 36%); }
.student-page .lesson-main { background: var(--card); }
.student-page .lesson-bar { flex: none; padding: .6rem 1rem; background: var(--card); min-height: 3.2rem; }
.student-page .lesson-title { font-size: 1.05rem; letter-spacing: -.015em; overflow: visible; overflow-wrap: anywhere; white-space: normal; }
.student-page .lesson-bar .pill { padding: .23rem .55rem; border-color: var(--line); }
.student-page .lesson-bar .seg-ctl { border-color: var(--line); }
.student-page .lesson-bar .seg-ctl button.on { box-shadow: 0 0 0 1px var(--line2); }
.student-page .transcript { padding: .55rem clamp(.9rem, 2.4vw, 1.7rem) 1rem; }
.student-page .seg { padding: .68rem .72rem; margin: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.student-page #segList > .seg:first-child { background: var(--highlight); border: 1px solid var(--line); border-radius: .78rem; margin-block: .35rem .15rem; }
.student-page .seg.flash { background: var(--highlight); box-shadow: inset 3px 0 var(--accent); }
.student-page .seg .t { font-size: .79rem; font-weight: 650; margin-bottom: .28rem; }
.student-page .seg .zh { font-weight: 580; }
.student-page .seg .en { margin-top: .15rem; }
.student-page .caption-label { color: var(--dim); font-size: .78rem; font-weight: 520; }
.student-page .cards { background: var(--bg); }
.student-page .cards-head { min-height: 3.2rem; padding: .55rem .95rem; background: var(--bg); }
.student-page .cards-head > b { font-size: 1rem; }
.student-page .cards-list { padding: .7rem .85rem; }
.student-page .qcard { padding: .85rem; border-radius: .85rem; overflow-wrap: anywhere; }
.student-page .qcard > .row { margin-bottom: .6rem; }
.student-page .qcard > .caption-line { margin-top: .18rem; }
.student-page .qcard .ans { border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .65rem; }
.student-page .qcard .a-en { font-size: 1.11rem; }
.student-page .qcard .a-zh { color: var(--text); opacity: .89; font-size: .97rem; }
.student-page .qcard.concise .ans {
  display: grid; gap: .24rem; padding: .55rem .64rem;
  border: 0; border-radius: .55rem; background: var(--highlight);
}
.student-page .qcard.concise .ans > div { margin: 0; opacity: 1; color: var(--muted); font-size: .94rem; font-weight: 400; }
.student-page .qcard.concise .ans > .a-primary { color: var(--text); font-size: 1.08rem; font-weight: 680; line-height: 1.42; }
.student-page .qcard .card-prompt > .caption-line,
.student-page .qcard .card-question-preview > .caption-line,
.student-page .qcard .card-question > .caption-line { margin-top: .18rem; }
.student-page .qcard .card-prompt:has(.card-question[open]) .card-question-preview { display: none; }
.student-page .qcard .card-question summary { color: var(--muted); font-size: .87rem; padding-block: .24rem; cursor: pointer; }
.student-page .qcard .cites { font-size: .87rem; }
.student-page .qcard .cites summary { color: var(--muted); padding-block: .24rem; }
.student-page .qcard .cite { border-radius: 0 .45rem .45rem 0; padding: .5rem .64rem; }
.student-page .qcard .cite > .caption-label { display: block; margin-bottom: .28rem; }
.student-page .dock { background: var(--card); gap: .55rem; padding: .57rem .95rem max(.57rem, env(safe-area-inset-bottom)); }
.student-page .dock .btn { min-height: 44px; white-space: normal; }
.student-page .dock .btn.big { padding: .55rem .98rem; font-size: 1.02rem; border-radius: .7rem; }
.student-page .dock > button:first-child { min-width: min(7.5rem, 44%); }
.student-page .jump { bottom: .65rem; }
@media (max-width: 900px) {
  .student-page.lesson-mode .lesson { grid-template-columns: minmax(0, 1fr); }
  .student-page .lesson-bar { padding-inline: .8rem; gap: .36rem; }
  .student-page .cards-head { gap: .4rem; }
  .student-page .cards-head .btn { white-space: normal; }
}
@media (max-width: 760px) {
  .student-page:not(.auth-mode) .top { flex-wrap: wrap; gap: .35rem .6rem; }
  .student-page .mobile-menu summary { min-height: 44px; white-space: nowrap; }
  .student-page .mobile-menu nav { max-width: calc(100vw - 2rem); }
  .student-page .dock .meter { width: min(4.5rem, 15vw); }
}
@media (min-width: 500px) and (max-width: 900px) and (max-height: 430px) {
  .student-page.lesson-mode .cards-head { min-height: 44px; padding-block: 0; }
  .student-page.lesson-mode .cards-list { padding-block-start: .35rem; }
  .student-page.lesson-mode .qcard .card-body:has(.ans) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; align-items: start;
  }
  .student-page.lesson-mode .qcard.concise .ans { margin-top: 0; }
}
@media (max-width: 250px) {
  .student-page.lesson-mode .lesson.show-cards .cards-head {
    min-height: 44px; padding: 0 .52rem; gap: .28rem; white-space: nowrap;
  }
  .student-page.lesson-mode .lesson.show-cards .cards-head .btn { padding-inline: .4rem; }
  .student-page.lesson-mode .lesson.show-cards .dock { padding-inline: .52rem; gap: .32rem; }
  .student-page.lesson-mode .lesson.show-cards .dock .btn { padding-inline: .52rem; min-width: 0; }
  .student-page.lesson-mode .cards-list { padding-block-start: .35rem; }
  .student-page.lesson-mode .qcard.concise { padding-block: .58rem; }
  .student-page.lesson-mode .qcard.concise > .row { margin-bottom: .38rem; }
  .student-page.lesson-mode .qcard.concise .card-body { display: flex; flex-direction: column; gap: .55rem; }
  .student-page.lesson-mode .qcard.concise .ans { order: -1; margin-top: 0; padding-block: .45rem; }
}
@media (prefers-reduced-motion: reduce) {
  .student-page .dot.live, .student-page .qcard { animation: none; }
  .student-page .seg, .student-page .meter i { transition: none; }
}
