/* ==========================================================================
   华阳学知 · 设计系统
   依据《华阳学知 · UI 设计方案 v1.0》落地：
   - 品牌红 #D8282F，十级色阶；暖橙 #EA6A1E 只用于积分/打卡/奖励
   - 正误反馈保留绿/红（学生通用认知），错误红 #E5484D 必带叉号且不与品牌红同屏出现在按钮上
   - 学生端页面底偏暖 #FAF8F7
   ========================================================================== */

:root {
  /* 品牌红 */
  --brand-900: #7C0F15;
  --brand-800: #9C181F;
  --brand-700: #BC2027;
  --brand: #D8282F;
  --brand-500: #E8413F;
  --brand-400: #F2665F;
  --brand-300: #F79A93;
  --brand-200: #FBC9C5;
  --brand-100: #FDE7E5;
  --brand-50: #FFF5F4;

  /* 暖橙：积分 / 打卡 / 奖励 */
  --orange-700: #C2410C;
  --orange: #EA6A1E;
  --orange-400: #F58A3C;
  --orange-100: #FFEDD9;
  --orange-50: #FFF8F1;

  /* 语义 */
  --ok: #12A150;
  --ok-bg: #E8F7EE;
  --danger: #E5484D;
  --danger-bg: #FDEBEC;
  --warn: #E0A008;
  --warn-bg: #FDF6E3;
  --info: #2C6BE8;
  --info-bg: #EAF1FE;

  /* 中性 */
  --ink-900: #0F172A;
  --ink-800: #1E293B;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748B;
  --ink-400: #94A3B8;
  --ink-300: #CBD5E1;
  --ink-200: #E2E8F0;
  --ink-100: #F1F5F9;
  --ink-50: #F8FAFB;
  --white: #fff;

  --page: #FAF8F7;
  --page-cool: #F8FAFB;

  /* 圆角 */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* 阴影：只表达层级，不做装饰 */
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06);
  --sh-2: 0 4px 14px rgba(15, 23, 42, .08);
  --sh-3: 0 12px 32px rgba(15, 23, 42, .12);

  --side-w: 228px;
  /* 内容区上限：1800px。常见屏幕（≤1920）下等于铺满，只在超宽屏才居中留边 */
  --maxw: 1800px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; color: var(--ink-900); }
h1 { font-size: 22px; letter-spacing: -.2px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- 应用框架 ---------- */
.shell { display: flex; min-height: 100vh; }

.side {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--white);
  border-right: 1px solid var(--ink-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  font-size: 17px; font-weight: 800; color: var(--ink-900);
  letter-spacing: .3px;
}
.logo .mark {
  width: 42px; height: 42px; border-radius: 0;
  object-fit: contain; display: block; flex-shrink: 0;
  background: transparent;
}

.nav { padding: 4px 10px; overflow-y: auto; flex: 1; }
.nav-cap {
  font-size: 11px; font-weight: 700; color: var(--ink-400);
  letter-spacing: 1px; padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--r); color: var(--ink-700);
  font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: var(--ink-50); color: var(--ink-900); }
.nav-item.on { background: var(--brand-50); color: var(--brand-800); }
.nav-item.on::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--brand);
}
/* 图标默认尺寸：凡是渲染 ICONS.* 的 svg 都受这条约束，
   否则浏览器会按 SVG 默认尺寸（很大）撑开容器。
   需要更大尺寸的地方用更高特异性的规则覆盖即可（如 .empty .ei svg） */
.ic { width: 16px; height: 16px; flex: 0 0 16px; }
.nav-item .ic { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-item .badge {
  margin-left: auto; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-pill);
}
.side-foot { padding: 12px; border-top: 1px solid var(--ink-100); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); }
.who:hover { background: var(--ink-50); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  background: var(--brand-100); color: var(--brand-800);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.who .nm { font-weight: 700; font-size: 13px; color: var(--ink-900); }
.who .sub { font-size: 11.5px; color: var(--ink-500); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 248, 247, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ink-200);
  padding: 13px 28px;
}
/* 顶栏内容与内容区同宽同位置，避免宽屏下两者错位 */
.topbar .tb-inner {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: flex; align-items: center; gap: 14px;
}
.topbar .tb-t { font-size: 16px; font-weight: 800; color: var(--ink-900); }
.topbar .tb-d { font-size: 12.5px; color: var(--ink-500); }
.topbar .tb-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 内容区：铺满可用宽度（超宽屏才居中），修掉「右侧空白」问题 */
.content { padding: 22px 28px 72px; max-width: var(--maxw); width: 100%; margin: 0 auto; }

/* 全局页脚：ICP 备案号悬挂（工信部要求） */
.site-footer {
  margin-top: auto;
  padding: 14px 28px 20px;
  max-width: var(--maxw); width: 100%; margin-left: auto; margin-right: auto;
  text-align: center;
  font-size: 12px; color: var(--ink-400);
  border-top: 1px solid var(--ink-100);
}
.site-footer a { color: var(--ink-400); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }

/* 手机底部 Tab */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--ink-200);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar .t {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0; color: var(--ink-500); font-size: 10.5px; font-weight: 600;
}
.tabbar .t .ic { width: 20px; height: 20px; }
.tabbar .t.on { color: var(--brand); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--ink-100);
}
.card-h h2 { display: flex; align-items: center; gap: 8px; }
.card-h h2::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--brand);
}
.card-h .more { margin-left: auto; font-size: 12.5px; color: var(--ink-500); font-weight: 600; }
.card-b { padding: 16px 18px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* 欢迎横幅 */
.hero {
  background: linear-gradient(120deg, var(--brand-800) 0%, var(--brand) 55%, var(--brand-500) 100%);
  color: #fff; border-radius: var(--r-lg);
  padding: 22px 24px; margin-bottom: 16px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(216, 40, 47, .22);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.hero h1 { color: #fff; font-size: 21px; margin-bottom: 6px; }
.hero p { color: rgba(255, 255, 255, .88); font-size: 13.5px; }
.hero .hero-acts { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r); border: 1px solid transparent;
  background: var(--brand); color: #fff;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap; box-shadow: 0 1px 2px rgba(216, 40, 47, .25);
}
.btn:hover { background: var(--brand-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--white); color: var(--brand-700); border-color: var(--brand-200); box-shadow: none; }
.btn.ghost:hover { background: var(--brand-50); color: var(--brand-800); }
.btn.gray { background: var(--ink-100); color: var(--ink-700); box-shadow: none; }
.btn.gray:hover { background: var(--ink-200); color: var(--ink-800); }
.btn.on-hero { background: #fff; color: var(--brand-800); box-shadow: none; }
.btn.on-hero:hover { background: var(--brand-50); color: var(--brand-900); }
.btn.ghost-hero { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .45); box-shadow: none; }
.btn.ghost-hero:hover { background: rgba(255, 255, 255, .24); }
.btn.orange { background: var(--orange); box-shadow: 0 1px 2px rgba(234, 106, 30, .3); }
.btn.orange:hover { background: var(--orange-700); }
.btn.sm { padding: 6px 13px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn.lg { padding: 12px 24px; font-size: 15px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700;
  background: var(--ink-100); color: var(--ink-600);
}
.tag.b { background: var(--brand-100); color: var(--brand-800); }
.tag.g { background: var(--ok-bg); color: var(--ok); }
.tag.o { background: var(--orange-100); color: var(--orange-700); }
.tag.r { background: var(--danger-bg); color: var(--danger); }
.tag.i { background: var(--info-bg); color: var(--info); }
.tag.w { background: var(--warn-bg); color: #8A6200; }

/* 「永久免费 · 不消耗积分」标记：必须单行显示，不能被 flex 压wrap */
.freeflag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--ok-bg); color: #0B6B36;
  font-size: 11.5px; font-weight: 700; line-height: 1.5;
  padding: 3px 10px; border-radius: var(--r-pill);
  white-space: nowrap;
  flex: 0 0 auto;
}
.freeflag svg { width: 13px; height: 13px; flex: 0 0 13px; }

/* ---------- 统计卡 ---------- */
.stat {
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--r-lg); padding: 15px 16px; box-shadow: var(--sh-1);
}
.stat .lb { font-size: 13px; color: var(--ink-500); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .lb .ic { width: 14px; height: 14px; flex: 0 0 14px; opacity: .85; }
.stat .vl { font-size: 26px; font-weight: 800; color: var(--ink-900); line-height: 1.2; margin-top: 4px; }
.stat .vl small { font-size: 13px; font-weight: 700; color: var(--ink-400); margin-left: 2px; }
.stat .ft { font-size: 12.5px; color: var(--ink-500); margin-top: 3px; }
.stat.brand .vl { color: var(--brand); }
.stat.orange .vl { color: var(--orange); }
.stat.ok .vl { color: var(--ok); }

/* 统计卡做成链接后：整卡可点，右下角给个箭头提示 */
a.stat { display: block; text-decoration: none; color: inherit; position: relative; padding-right: 34px;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
a.stat:hover { border-color: var(--brand-300); box-shadow: var(--sh-2); transform: translateY(-1px); }
a.stat::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-right: 2px solid var(--ink-300); border-bottom: 2px solid var(--ink-300);
  transform: rotate(-45deg); transition: border-color .15s, right .15s;
}
a.stat:hover::after { border-color: var(--brand); right: 14px; }

/* ---------- 进度条 ---------- */
.bar { height: 7px; border-radius: var(--r-pill); background: var(--ink-100); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--brand); transition: width .4s ease; }
.bar.ok > i { background: var(--ok); }
.bar.orange > i { background: var(--orange); }
.bar.thin { height: 5px; }
.bar.lg { height: 10px; }

/* ---------- 行 / 列表 ---------- */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--ink-100);
}
.row:last-child { border-bottom: none; }
.row.hov { cursor: pointer; transition: background .12s; }
.row.hov:hover { background: var(--ink-50); }
.kbody { flex: 1; min-width: 0; }
.kt { font-weight: 700; font-size: 13.5px; color: var(--ink-900); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.kd { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.kd span { display: inline-flex; align-items: center; gap: 4px; }
.kact { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------- 单元卡 ---------- */
.ucard {
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--r-lg); padding: 15px 16px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  box-shadow: var(--sh-1); position: relative;
}
.ucard:hover { border-color: var(--brand-200); box-shadow: var(--sh-2); transform: translateY(-1px); }
.ucard .code {
  font-size: 11.5px; font-weight: 800; color: var(--brand-700);
  letter-spacing: .4px; text-transform: uppercase;
}
.ucard .ttl { font-size: 15px; font-weight: 700; color: var(--ink-900); margin: 4px 0 3px; }
.ucard .tp { font-size: 12.5px; color: var(--ink-500); margin-bottom: 11px; }
.ucard.locked { opacity: .62; cursor: not-allowed; background: var(--ink-50); }
.ucard.locked:hover { transform: none; box-shadow: var(--sh-1); border-color: var(--ink-200); }

/* 已上线但教师尚未开放：橙色一点，区别于「内容待录入」的灰 */
.ucard.pending { background: #FFFBF6; border-color: #FBE0C4; }
.ucard.pending .code { color: var(--orange-700); }
.ucard.pending:hover { transform: none; box-shadow: var(--sh-1); border-color: #FBE0C4; }

/* 未分配学段/教材时的引导提示 */
.setup-guide {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(120deg, #FFF8F1 0%, var(--brand-50) 100%);
  border: 1px solid #FBE0C4;
  border-radius: var(--r-lg); padding: 20px;
  margin-bottom: 16px;
}
.setup-guide .sg-ic {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%;
  background: var(--white); color: var(--brand); border: 1px solid var(--brand-200);
  display: grid; place-items: center;
}
.setup-guide .sg-ic svg { width: 20px; height: 20px; }
.setup-guide h3 { font-size: 15.5px; margin-bottom: 5px; }
.setup-guide p { font-size: 13px; color: var(--ink-600); line-height: 1.75; }
.setup-guide .sg-steps { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; }
.setup-guide .sg-steps div { font-size: 12.5px; color: var(--ink-600); display: flex; gap: 8px; align-items: flex-start; }
.setup-guide .sg-steps b {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand-100); color: var(--brand-800);
  display: grid; place-items: center; font-size: 11px; margin-top: 1px;
}

/* ---------- 徽标数字 ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--ink-100); color: var(--ink-600);
  font-size: 12px; font-weight: 700;
}
.pill.b { background: var(--brand-100); color: var(--brand-800); }
.pill.o { background: var(--orange-100); color: var(--orange-700); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 52px 20px; color: var(--ink-500); }
.empty .ei {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand-300);
  display: grid; place-items: center;
}
.empty .ei svg { width: 26px; height: 26px; }
.empty h3 { font-size: 15px; margin-bottom: 5px; color: var(--ink-700); }
.empty p { font-size: 13px; }
.empty .btn { margin-top: 16px; }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 13px; border-radius: var(--r); font-size: 12.8px; line-height: 1.6;
}
.notice .ni { flex: 0 0 auto; font-size: 14px; line-height: 1.4; }
.notice.info { background: var(--info-bg); color: #1E4FB0; }
.notice.warn { background: var(--warn-bg); color: #7A5700; }
.notice.ok { background: var(--ok-bg); color: #0B6B36; }
.notice.brand { background: var(--brand-50); color: var(--brand-800); }
.notice.gray { background: var(--ink-50); color: var(--ink-600); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-600); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--ink-200); border-radius: var(--r);
  background: var(--white); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-50);
}
.textarea { resize: vertical; min-height: 88px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.7; }
.hint { font-size: 11.8px; color: var(--ink-400); margin-top: 5px; }
/* 表单里的「必填」小标 */
.req { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-200); border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
/* 编码类文本：等宽 + 大字距，方便口头念给老师/学生 */
.code-text { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; font-weight: 700; }

.seg { display: inline-flex; background: var(--ink-100); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; padding: 6px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 700; color: var(--ink-600); cursor: pointer;
}
.seg button.on { background: var(--white); color: var(--brand-700); box-shadow: var(--sh-1); }

/* ---------- 选项卡 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ink-200); overflow-x: auto; }
.tabs button {
  border: none; background: transparent; padding: 11px 15px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-500);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
  margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.tabs button:hover { color: var(--ink-800); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--white); }
.auth-left {
  background: linear-gradient(150deg, var(--brand-900) 0%, var(--brand) 60%, var(--brand-500) 100%);
  color: #fff; padding: 52px 48px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-left::after {
  content: ""; position: absolute; right: -80px; bottom: -80px;
  width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .09);
}
.auth-left .brand-row { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.auth-left .brand-row .mark {
  width: 64px; height: 64px; border-radius: 0;
  object-fit: contain; display: block; flex-shrink: 0;
  background: transparent;
}
.auth-left .brand-row b { font-size: 20px; letter-spacing: .5px; }
.auth-left h1 { color: #fff; font-size: 30px; line-height: 1.35; margin-bottom: 14px; letter-spacing: -.4px; }
.auth-left p { color: rgba(255, 255, 255, .86); font-size: 14.5px; max-width: 380px; }
.auth-feats { margin-top: 30px; display: flex; flex-direction: column; gap: 11px; }
.auth-feats .f { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, .93); }
.auth-feats .f .ic { width: 26px; height: 26px; border-radius: 7px; background: rgba(255, 255, 255, .17); display: grid; place-items: center; flex: 0 0 26px; }
.auth-feats .f .ic svg { width: 14px; height: 14px; }
.auth-right { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 356px; }
.auth-card h2 { font-size: 22px; margin-bottom: 5px; }
.auth-card .sub { font-size: 13.2px; color: var(--ink-500); margin-bottom: 24px; }
.auth-footer { margin-top: 28px; text-align: center; font-size: 12px; color: var(--ink-400); }
.auth-footer a { color: var(--ink-400); text-decoration: none; }
.auth-footer a:hover { color: var(--brand); }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-left { display: none; }
}

/* ---------- 背单词卡 ---------- */
.flip-stage { perspective: 1400px; margin: 0 auto; max-width: 460px; }
.flip-card {
  position: relative; height: 320px; cursor: pointer;
  transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4, .2, .2, 1);
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--r-xl); border: 1px solid var(--ink-200);
  background: var(--white); box-shadow: var(--sh-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px; text-align: center;
}
.flip-face.back { transform: rotateY(180deg); background: var(--brand-50); border-color: var(--brand-200); }
.flip-face .w { font-size: 42px; font-weight: 800; color: var(--ink-900); letter-spacing: -.5px; }
.flip-face .ph { font-size: 16px; color: var(--ink-500); margin-top: 8px; }
.flip-face .pos { font-size: 13px; color: var(--brand-700); font-weight: 700; margin-top: 12px; }
.flip-face .mg { font-size: 19px; font-weight: 700; color: var(--ink-900); margin-top: 6px; }
.flip-face .eg { font-size: 13.5px; color: var(--ink-600); margin-top: 16px; line-height: 1.7; max-width: 330px; }
.flip-face .eg b { color: var(--ink-900); }
.flip-tip { text-align: center; font-size: 12px; color: var(--ink-400); margin-top: 12px; }

/* 自然拼读 · 音节分块（F-自然拼读） */
.phonics-row { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.phonics-seg {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 34px; padding: 5px 8px; border-radius: 9px;
  background: var(--ink-50); border: 1px solid var(--ink-200); cursor: pointer;
  transition: all .12s; user-select: none;
}
.phonics-seg b {
  font-family: ui-monospace, Consolas, monospace; font-size: 16px; font-weight: 700;
  color: var(--brand-700); line-height: 1.2;
}
.phonics-seg i {
  font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-500);
  line-height: 1.3; margin-top: 1px;
}
.phonics-seg:hover { background: var(--brand-50); border-color: var(--brand-300); }
.phonics-seg.on { background: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.phonics-seg.on b, .phonics-seg.on i { color: #fff; }
.phonics-dot { color: var(--ink-300); font-weight: 800; font-size: 15px; }
.phonics-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.phonics-hint { text-align: center; font-size: 11px; color: var(--ink-400); margin-top: 8px; }

/* ---------- 刷题 ---------- */
.q-wrap { max-width: 780px; margin: 0 auto; }
.q-card { background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; }
.q-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: var(--ink-50); border-bottom: 1px solid var(--ink-200); font-size: 12.8px; }
.q-body { padding: 20px 22px; }
.q-passage {
  background: var(--ink-50); border-left: 3px solid var(--brand-300);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 18px;
  font-size: 14px; line-height: 1.85; color: var(--ink-700); white-space: pre-wrap;
}
.q-stem { font-size: 15.5px; font-weight: 700; color: var(--ink-900); line-height: 1.75; margin-bottom: 16px; }
.q-stem .idx { color: var(--brand); margin-right: 4px; }

.opt {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; margin-bottom: 10px;
  border: 1.5px solid var(--ink-200); border-radius: var(--r);
  background: var(--white); cursor: pointer; transition: all .15s;
  font-size: 14.2px; line-height: 1.6;
}
.opt:hover { border-color: var(--brand-300); background: var(--brand-50); }
.opt .k {
  flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%;
  background: var(--ink-100); color: var(--ink-600);
  display: grid; place-items: center; font-weight: 800; font-size: 12.5px;
}
.opt.picked { border-color: var(--brand); background: var(--brand-50); }
.opt.picked .k { background: var(--brand); color: #fff; }
/* 正误反馈保留绿/红：错误红必带叉号 */
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.correct .k { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--danger); background: var(--danger-bg); }
.opt.wrong .k { background: var(--danger); color: #fff; }
.opt.locked { cursor: default; }
.opt.locked:hover { border-color: var(--ink-200); background: var(--white); }
.opt.locked.correct:hover { border-color: var(--ok); background: var(--ok-bg); }
.opt.locked.wrong:hover { border-color: var(--danger); background: var(--danger-bg); }
.opt .mk { margin-left: auto; font-weight: 800; font-size: 13px; flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.opt .mk svg { width: 15px; height: 15px; }

.verdict { border-radius: var(--r-lg); padding: 15px 17px; margin-top: 16px; border: 1px solid; }
.verdict.right { background: var(--ok-bg); border-color: #B7E4C7; }
.verdict.bad { background: var(--danger-bg); border-color: #F5C2C4; }
.verdict .vh { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14.5px; margin-bottom: 11px; }
.verdict.right .vh { color: #0B6B36; }
.verdict.bad .vh { color: #A81E23; }
.verdict .vh .vi { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.verdict.right .vh .vi { background: var(--ok); }
.verdict.bad .vh .vi { background: var(--danger); }
.verdict .vh .vi svg { width: 13px; height: 13px; color: #fff; }
.vblock { background: rgba(255, 255, 255, .72); border-radius: var(--r); padding: 11px 13px; margin-bottom: 9px; font-size: 13.3px; line-height: 1.75; }
.vblock:last-child { margin-bottom: 0; }
.vblock .vt { font-weight: 800; font-size: 12.3px; color: var(--ink-600); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.vblock .vt svg { width: 13px; height: 13px; }
.vblock.why { border-left: 3px solid var(--danger); }
.vblock.ans { border-left: 3px solid var(--ok); }
.vblock.tip { border-left: 3px solid var(--brand); }

.q-foot { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--ink-50); border-top: 1px solid var(--ink-200); }
.q-foot .st { font-size: 12.8px; color: var(--ink-500); font-weight: 600; }
.q-foot .sp { margin-left: auto; display: flex; gap: 9px; }

/* ---------- 图表 ---------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 10px 2px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .cb { width: 100%; max-width: 40px; border-radius: 6px 6px 3px 3px; background: var(--brand-200); position: relative; transition: height .4s; min-height: 3px; }
.chart .cb.hi { background: linear-gradient(180deg, var(--brand-500), var(--brand)); }
.chart .cl { font-size: 11px; color: var(--ink-500); font-weight: 600; }
.chart .cv { font-size: 11.5px; font-weight: 800; color: var(--ink-700); }

/* ---------- 背词结算 ---------- */
.done-wrap { text-align: center; padding: 34px 20px; }
.done-ring {
  width: 108px; height: 108px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--brand-50); display: grid; place-items: center;
  border: 3px solid var(--brand-100);
}
.done-ring .big { font-size: 34px; font-weight: 800; color: var(--brand); line-height: 1; }
.done-ring .sm { font-size: 11.5px; color: var(--brand-700); font-weight: 700; margin-top: 3px; }

/* ---------- 页脚合规声明 ----------
   所有讲「内容从哪来」的学生页统一用它：不含教材原文与配套音频，听力由系统合成。 */
.compliance {
  padding: 12px 18px; background: var(--ink-50); border-radius: var(--r-lg);
  font-size: 12.2px; color: var(--ink-500); margin-top: 18px;
  display: flex; gap: 9px; line-height: 1.75;
}
.compliance > span { color: var(--ink-400); font-weight: 800; flex: 0 0 auto; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px; background: var(--ink-50);
  font-size: 12px; font-weight: 800; color: var(--ink-600);
  border-bottom: 1px solid var(--ink-200); white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--ink-100); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--ink-50); }

/* ---------- 代码块 ---------- */
.code {
  background: var(--ink-900); color: #E2E8F0;
  border-radius: var(--r); padding: 12px 14px;
  font-family: ui-monospace, Consolas, "Cascadia Mono", monospace;
  font-size: 12px; line-height: 1.75; overflow-x: auto; white-space: pre;
}
.code .c { color: #94A3B8; }

/* ---------- Toast ---------- */
#toast-layer { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  background: var(--ink-900); color: #fff; padding: 10px 18px;
  border-radius: var(--r); font-size: 13.3px; font-weight: 600;
  box-shadow: var(--sh-3); animation: tin .22s ease;
  display: flex; align-items: center; gap: 8px; max-width: 88vw;
}
.toast.ok { background: #0B6B36; }
.toast.err { background: #A81E23; }
.toast.warn { background: #7A5700; }
@keyframes tin { from { opacity: 0; transform: translateY(-9px); } to { opacity: 1; transform: none; } }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .48);
  display: grid; place-items: center; z-index: 200; padding: 20px;
  animation: fin .18s ease;
}
@keyframes fin { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--white); border-radius: var(--r-lg); width: 100%; max-width: 460px;
  box-shadow: var(--sh-3); overflow: hidden; max-height: 88vh; display: flex; flex-direction: column;
}
/* 宽模态：布置作业这类「左边填信息、右边挑题目」的场景需要横空间 */
.modal.wide { max-width: 900px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--ink-100); font-weight: 800; font-size: 15.5px; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { padding: 13px 20px; border-top: 1px solid var(--ink-100); display: flex; gap: 9px; justify-content: flex-end; background: var(--ink-50); }

/* ---------- 工具类 ---------- */
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; }
.gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; } .mb20 { margin-bottom: 20px; }
.mr-auto { margin-right: auto; } .ml-auto { margin-left: auto; }
.muted { color: var(--ink-500); } .dim { color: var(--ink-400); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.bold { font-weight: 800; } .brand-c { color: var(--brand); } .ok-c { color: var(--ok); } .danger-c { color: var(--danger); }
.center-t { text-align: center; } .right-t { text-align: right; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .side { display: none; }
  .topbar { padding: 11px 14px; }
  .content { padding: 14px 14px 88px; }
  .tabbar { display: flex; }
  /* 手机底部 Tab 会盖住页脚，给页脚预留底部安全间距 */
  .site-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  h1 { font-size: 19px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 18px; }
  .card-h { padding: 12px 14px; }
  .card-b { padding: 14px; }
  .row { padding: 11px 14px; }
  .q-body { padding: 16px; }
  .flip-card { height: 280px; }
  .flip-face .w { font-size: 34px; }
  .stat .vl { font-size: 22px; }
  .tbl { font-size: 12.3px; }
  .tbl th, .tbl td { padding: 8px 9px; }
}
