/* ============================================================
   普梅星工作台 · 高级响应式 UI
   设计令牌 + 深色 hero 登录 + 顶部导航 + 工作台卡片网格 + 微动效
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --primary-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --text: #1e293b;
  --muted: #64748b;
  --border: #e7eaf3;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --success: #10b981;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 8px 28px rgba(15, 23, 42, .09);
  --shadow-lg: 0 20px 60px rgba(79, 70, 229, .20);
  --r: 16px;
  --r-sm: 10px;
  /* 强调色（智能讲义分段控件等，随主题切换） */
  --accent: #1d4ed8;
  --accent-soft: #eef2f7;
  --compose-ink: #1f2937;
  --compose-muted: #6b7280;
}
html { background: var(--bg); }

/* ============================================================
   主题：深色（data-theme="dark"）与跟随系统（prefers-color-scheme）
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1017;
  --surface: #161b26;
  --surface-2: #1d2433;
  --text: #e7ebf3;
  --muted: #98a2b8;
  --border: #2a3342;
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, .12);
  --success: #34d399;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
  --accent: #60a5fa;
  --accent-soft: #16233b;
  --compose-ink: #e7ebf3;
  --compose-muted: #9aa6bd;
}
/* 跟随系统：仅当未显式选择（无 data-theme 属性）且系统为深色时生效 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0d1017;
    --surface: #161b26;
    --surface-2: #1d2433;
    --text: #e7ebf3;
    --muted: #98a2b8;
    --border: #2a3342;
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, .12);
    --success: #34d399;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 8px 28px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
    --accent: #60a5fa;
    --accent-soft: #16233b;
    --compose-ink: #e7ebf3;
    --compose-muted: #9aa6bd;
  }
}
[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(139, 92, 246, .18), transparent 55%),
    radial-gradient(1000px 520px at -10% 0%, rgba(99, 102, 241, .16), transparent 55%),
    linear-gradient(160deg, #11151f 0%, #0d1017 100%);
}
/* 讲义深色模式增强 */
[data-theme="dark"] #page-compose .compose-result .lec-math {
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(139,92,246,.07));
  border-color: rgba(139,92,246,.22);
}
[data-theme="dark"] #page-compose .compose-result .lec-sec { border-left-color: #a78bfa; }
[data-theme="dark"] #page-compose .compose-result .lec-sec::before { color: #c4b5fd; }
[data-theme="dark"] #page-compose .compose-result p > strong:first-child,
[data-theme="dark"] #page-compose .compose-result p > strong:nth-child(-n+2):first-child {
  background: rgba(139,92,246,.15); border-color: rgba(139,92,246,.28); color: #a78bfa;
}
[data-theme="dark"] #page-compose .compose-result .lec-ol > li::before {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
}
[data-theme="dark"] #page-compose .compose-result .lec-ul > li::before { color: #c4b5fd; }
[data-theme="dark"] .topbar { background: rgba(15, 18, 28, .72); }
[data-theme="dark"] .card,
[data-theme="dark"] .module-card,
[data-theme="dark"] .q-item,
[data-theme="dark"] .a-item,
[data-theme="dark"] #bankRoot .qcard,
[data-theme="dark"] #bankRoot .filters,
[data-theme="dark"] #bankRoot .bank-tab,
[data-theme="dark"] #bankRoot .compose-form,
[data-theme="dark"] #bankRoot .ai-box {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}
/* 个人题库作用域变量（深色） */
[data-theme="dark"] #bankRoot {
  --card: #161b26; --line: #2a3342; --soft: #1d2433; --ink: #e7ebf3; --muted: #98a2b8;
  --primary: #6366f1; --primary-d: #818cf8; --ok: #34d399; --warn: #fbbf24; --danger: #f87171;
  --shadow: 0 6px 24px rgba(0, 0, 0, .4);
}
[data-theme="dark"] #bankRoot .qcard .meta span { color: var(--muted); }
[data-theme="dark"] #bankRoot .qcard .opts { color: #cbd5e1; }
[data-theme="dark"] #bankRoot .qcard .ans { color: var(--ink); }
[data-theme="dark"] #bankRoot .ph-item { background: var(--card); }
[data-theme="dark"] #bankRoot .ph-item img { background: var(--soft); }
[data-theme="dark"] #bankRoot .fmt { color: var(--muted); }
[data-theme="dark"] #bankRoot .paper-preview { background: var(--card); }
[data-theme="dark"] #bankRoot .modal { background: var(--card); }
[data-theme="dark"] #bankRoot .paper-preview .paper-title { border-bottom-color: var(--ink); }

/* 平滑过渡：首屏加载完成（加 .theme-anim）后才启用，避免初次闪动 */
html.theme-anim body,
html.theme-anim .topbar,
html.theme-anim .card,
html.theme-anim .module-card,
html.theme-anim .q-item,
html.theme-anim .a-item,
html.theme-anim .topnav-btn,
html.theme-anim input,
html.theme-anim select,
html.theme-anim textarea,
html.theme-anim .table,
html.theme-anim #bankRoot .qcard,
html.theme-anim #bankRoot .filters,
html.theme-anim #bankRoot .bank-tab {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(139, 92, 246, .10), transparent 55%),
    radial-gradient(1000px 520px at -10% 0%, rgba(99, 102, 241, .10), transparent 55%),
    linear-gradient(160deg, #f6f8ff 0%, #eef1f8 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-size: 14px; font-family: inherit; }
input, select, textarea {
  font-size: 14px; font-family: inherit;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: 100%; background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}
[hidden] { display: none !important; }

/* ---------------- 通用按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary-grad); color: #fff; border: none;
  padding: 11px 18px; border-radius: var(--r-sm); font-weight: 600;
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn:hover { filter: brightness(1.05); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; filter: none; box-shadow: none; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #eef2f7; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); box-shadow: 0 6px 18px rgba(220, 38, 38, .35); }
.danger-card { border: 1px solid #fca5a5; background: #fef2f2; }
.danger-card h3 { color: #b91c1c; }
.danger-card .muted b { color: #b91c1c; }
.link { background: none; border: none; color: #a5b4fc; font-weight: 600; padding: 6px 10px; border-radius: 8px; transition: background .15s; }
.link:hover { background: rgba(99, 102, 241, .12); }

/* ============================================================
   登录 / 注册：深色 hero
   ============================================================ */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.05fr .95fr;
  position: relative; overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px),
    radial-gradient(900px 520px at 12% 8%, rgba(124, 92, 255, .40), transparent 58%),
    radial-gradient(760px 560px at 92% 96%, rgba(56, 189, 248, .22), transparent 55%),
    linear-gradient(135deg, #0e1130 0%, #1a1b40 48%, #2a1c47 100%);
  background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%, 100% 100%;
  color: #fff;
}
.hero {
  padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px;
  position: relative; z-index: 1;
}
.hero-brand {
  display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: .3px;
}
.hero-mark {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: var(--primary-grad); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.hero-mark svg { width: 22px; height: 22px; }
.hero-title {
  font-size: 42px; font-weight: 800; line-height: 1.18; letter-spacing: -1px;
  background: linear-gradient(120deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 16px; color: rgba(226, 232, 240, .82); max-width: 460px; line-height: 1.7; }
.hero-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.hero-list li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(241, 245, 249, .9); }
.hero-list .tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(99, 102, 241, .25); color: #c4b5fd; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.hero-foot {
  margin-top: 18px; font-size: 13px; color: rgba(148, 163, 184, .8);
  padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12);
}
.auth-panel {
  display: flex; align-items: center; justify-content: flex-end; padding: 40px 48px;
  position: relative; z-index: 1;
}
.auth-panel::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(255, 255, 255, .04); backdrop-filter: blur(2px);
  border-left: 1px solid rgba(255, 255, 255, .10);
}
.auth-cols { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 760px; position: relative; z-index: 1; }
.auth-card {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px; padding: 30px; width: 340px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  animation: slideUp .5s ease both;
  /* 登录卡固定“白底深字”，不随站点主题变化——避免深色主题下 .auth-wrap 的 #fff
     继承进白卡，导致标题/输入框白底白字看不见 */
  color: #1e293b;
  --text: #1e293b;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: rgba(15, 23, 42, .18);
}
.auth-card h2 { color: #1e293b; }
.auth-card h2 { font-size: 18px; margin-bottom: 18px; font-weight: 700; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.msg { font-size: 13px; min-height: 18px; color: var(--danger); }
.consent-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; cursor: pointer; user-select: none; }
.consent-row input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); flex: 0 0 auto; cursor: pointer; }

/* 登录页右上书法：本地字体，竖排两列错开 + 普梅星寄语 */
@font-face {
  font-family: 'Zhi Mang Xing';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/ZhiMangXing-Regular.woff2') format('woff2');
}
.auth-calligraphy {
  position: absolute; top: 50%; transform: translateY(-50%);
  right: clamp(820px, 34vw, 940px); z-index: 4;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  user-select: none; pointer-events: none;
}
.auth-calligraphy .ac-cols { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 10px; }
.auth-calligraphy .ac-col {
  font-family: 'Zhi Mang Xing', 'Ma Shan Zheng', 'STXingkai', 'KaiTi', cursive;
  font-size: 120px; line-height: 1.25; letter-spacing: .12em;
  color: transparent;
  background: linear-gradient(180deg, #f6e6b8 0%, #e7c98f 55%, #c9a45a 100%);
  -webkit-background-clip: text; background-clip: text;
  writing-mode: vertical-rl; text-orientation: upright;
  text-shadow: 0 0 22px rgba(231,201,143,.16), 0 3px 16px rgba(0,0,0,.35);
  filter: drop-shadow(0 0 12px rgba(231,201,143,.10));
  opacity: .96;
}
.auth-calligraphy .ac-col.ac-shift { margin-top: 60px; }
.auth-calligraphy .ac-caption {
  font-size: 12px; letter-spacing: 3px; font-weight: 600; color: #e7c98f;
  border-top: 1px solid rgba(231,201,143,.30); padding-top: 8px; margin-top: 2px;
}

/* 登录 / 注册 标签（放大 + 右移） */
.auth-tabs { display: flex; gap: 22px; margin-bottom: 20px; border-bottom: 1px solid #e1e4ea; padding-bottom: 14px; padding-left: 20px; }
.auth-tabs a { font-size: 21px; font-weight: 700; color: #8b93a8; cursor: pointer; text-decoration: none; }
.auth-tabs a.active { color: #1f2332; border-bottom: 2px solid #4a3fd0; padding-bottom: 14px; margin-bottom: -15px; }
.consent-row a { color: var(--primary); text-decoration: underline; }

/* ============================================================
   主应用：顶部导航 + 内容区
   ============================================================ */
#app {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
}
.topbar {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 50;
}
.brand-area { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.2px; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--primary-grad); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 20px; height: 20px; }
.topnav { display: flex; align-items: center; gap: 4px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.topnav-btn {
  background: none; border: none; font-weight: 600; font-size: 14px;
  color: var(--muted); padding: 9px 16px; border-radius: 10px;
  transition: background .15s, color .15s;
}
.topnav-btn:hover { background: var(--surface-2); color: var(--text); }
.topnav-btn.active { background: rgba(99, 102, 241, .12); color: var(--primary); }
.topbar .user { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 600; flex: none; }
/* 主题切换器：跟随系统 / 浅色 / 深色 */
.theme-switcher { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.theme-switcher button { border: none; background: transparent; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; color: var(--muted); transition: background .15s, color .15s; cursor: pointer; padding: 0; }
.theme-switcher button:hover { color: var(--text); }
.theme-switcher button.active { background: var(--primary-grad); color: #fff; box-shadow: var(--shadow-sm); }
/* 学段分流开关：初中版 / 高中版（与主题切换同为胶囊分段控件） */
.phase-switcher { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.phase-switcher button { border: none; background: transparent; padding: 5px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.phase-switcher button:hover { color: var(--text); }
.phase-switcher button.active { background: var(--primary-grad); color: #fff; box-shadow: var(--shadow-sm); }

main {
  flex: 1; width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 28px 24px 60px;
}

/* 当前页标题条（随导航更新） */
.page-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(139,92,246,.08));
  border: 1px solid var(--border); border-radius: var(--r);
}
.pg-ico {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-grad); color: #fff; box-shadow: var(--shadow);
}
.pg-ico svg { width: 23px; height: 23px; }
.pg-text { min-width: 0; }
#pgTitle { font-size: 20px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
#pgSub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------------- 工作台首页（卡片网格） ---------------- */
.dash-head { margin-bottom: 18px; }
.dash-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.dash-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px;
}
.module-card {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: slideUp .4s ease both;
}
.module-card:hover { transform: translateY(-4px); border-color: rgba(99, 102, 241, .4); box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 18px 44px rgba(79, 70, 229, .14); }
.mc-ico {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-grad); color: #fff; box-shadow: var(--shadow);
}
.mc-ico svg { width: 24px; height: 24px; }
.mc-title { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.mc-desc { font-size: 13px; color: var(--muted); line-height: 1.6; flex: 1; }
.mc-go { font-size: 13px; font-weight: 700; color: var(--primary); }

/* ---------------- 页面 / 卡片 ---------------- */
.page { animation: fadeIn .3s ease; }
.page h2 { display: none; }
.page h3 { font-size: 16px; font-weight: 700; margin: 26px 0 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .05);
  display: flex; flex-direction: column; gap: 14px;
  animation: slideUp .4s ease both;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 16px 40px rgba(79, 70, 229, .10); }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card h3::before { content: ""; width: 8px; height: 8px; border-radius: 3px; flex: none; background: var(--primary-grad); }
.card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.card label.check { flex-direction: row; align-items: center; gap: 8px; }

/* ---------------- 列表项 ---------------- */
.q-item, .a-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  animation: slideUp .35s ease both;
}
.q-item .meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.tag {
  display: inline-block; background: var(--surface-2); color: var(--muted);
  font-size: 12px; padding: 3px 10px; border-radius: 999px; margin-right: 6px;
  border: 1px solid var(--border);
}
.answer { color: var(--success); font-weight: 700; margin-top: 8px; }

/* ---------------- 成绩行 + 进度条 ---------------- */
.score-row { display: flex; gap: 10px; align-items: center; }
.score-row input { width: auto; flex: 1; }
.score-row .full { max-width: 100px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: 13px; }
.bar-track { flex: 1; background: var(--surface-2); border-radius: 999px; height: 12px; overflow: hidden; border: 1px solid var(--border); }
.bar-fill { height: 100%; background: var(--primary-grad); border-radius: 999px; transition: width .6s ease; }

/* ---------------- 表格 ---------------- */
.table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px;
  background: var(--surface); border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border);
}
.table th, .table td { border-bottom: 1px solid var(--border); padding: 11px 12px; text-align: left; }
.table th { background: var(--surface-2); font-weight: 700; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }

/* ---------------- 删除类按钮 ---------------- */
.del { background: var(--danger-bg); color: var(--danger); border: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; width: auto; }
.del:hover { background: #fee2e2; }
.del-item { background: var(--danger-bg); color: var(--danger); border: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; margin-top: 8px; }
.del-item:hover { background: #fee2e2; }
.verify-confirm { background: linear-gradient(135deg,#10b981,#059669); color: #fff; border: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; margin-top: 8px; cursor: pointer; }
.verify-confirm:hover { filter: brightness(1.05); }
.verify-reset { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); padding: 7px 12px; border-radius: 8px; font-weight: 600; margin-top: 8px 0 0 6px; cursor: pointer; }
.verify-reset:hover { background: #eef2f7; }

/* ---------------- 状态提示条 ---------------- */
#openWarning, #errOverlay { animation: slideUp .3s ease; }

/* ---------------- 动效 ---------------- */
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   响应式
   ============================================================ */
/* 平板及以下 */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .hero { padding: 40px 28px 24px; gap: 16px; text-align: left; }
  .hero-title { font-size: 32px; }
  .hero-list li { font-size: 14px; }
  .auth-panel { padding: 24px 20px 40px; }
  .auth-panel::before { border-left: none; border-top: 1px solid rgba(255, 255, 255, .10); }
  .topbar { flex-wrap: wrap; row-gap: 10px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .brand-area { flex: 1 1 auto; min-width: 0; }
  .topnav { order: 4; flex-basis: 100%; margin: 0; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav-btn { white-space: nowrap; flex: none; }
  .theme-switcher { margin-left: auto; }
  .brand-name { display: none; }
  main { padding: 20px 16px 50px; }
  .auth-cols .auth-card { width: 100%; }
  .auth-calligraphy { position: static; align-items: center; margin: 6px auto 16px; right: auto; top: auto; transform: none; }
  .auth-calligraphy .ac-col { font-size: 64px; }
  .auth-calligraphy .ac-col.ac-shift { margin-top: 34px; }
  input, select, textarea, .paper-area { font-size: 16px; } /* 阻止 iOS 聚焦放大 */
}

/* 手机：微调间距、按钮组与表格 */
@media (max-width: 600px) {
  .card { padding: 16px; gap: 12px; }
  .page h3 { font-size: 15px; margin: 20px 0 10px; }
  .topbar { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 10px; }
  .topbar .user { gap: 10px; font-size: 13px; }
  .page-banner { padding: 14px 16px; margin-bottom: 18px; gap: 12px; }
  .pg-ico { width: 38px; height: 38px; }
  .pg-ico svg { width: 20px; height: 20px; }
  #pgTitle { font-size: 17px; }
  #pgSub { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .module-card { padding: 18px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; }
  .actions label { width: 100%; flex-direction: column; }
  .actions label input { width: 100%; }
  .auth-card { padding: 20px; }
  #invList, #userList { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; }
  .q-edit { gap: 10px; }
  .wrong-q { gap: 10px; padding: 12px; }
  .topnav-btn { padding: 10px 14px; }
  .theme-switcher { padding: 2px; }
  .theme-switcher button { width: 34px; height: 34px; font-size: 16px; }
  .phase-switcher { padding: 2px; }
  .phase-switcher button { padding: 6px 12px; font-size: 12px; }
  .btn { padding: 12px 18px; }
  .topbar .user { gap: 10px; font-size: 13px; }
}

/* ============================================================
   试卷变式
   ============================================================ */
.banner {
  background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c;
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; font-weight: 600;
}
.flow-hint { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.flow-hint::before { content: "🔄 "; }

/* 上传 */
.file-drop {
  display: flex; flex-direction: column; gap: 8px;
  border: 1.5px dashed var(--border); border-radius: var(--r-sm);
  padding: 18px; background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop:hover { border-color: var(--primary); background: rgba(99, 102, 241, .05); }
.file-drop input[type=file] { width: auto; border: none; padding: 0; background: none; }
.file-hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.paper-area {
  min-height: 140px; resize: vertical; line-height: 1.6; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* 上传 CTA（拍照/相册 + 文档 双入口，移动端友好） */
.upload-cta-row { display: flex; gap: 12px; }
.upload-cta-row .file-drop-cta {
  flex: 1; position: relative; overflow: hidden; margin: 0;
  align-items: center; justify-content: center; text-align: center;
  border: 1.5px solid var(--primary); background: rgba(99, 102, 241, .06);
  box-shadow: none; min-height: 92px;
}
.upload-cta-row .file-drop-cta:hover { background: rgba(99, 102, 241, .12); border-color: var(--primary); }
.upload-cta-row .file-drop-doc { border-color: var(--border); background: var(--surface-2); }
.upload-cta-row .file-drop-doc:hover { background: #eef2f7; }
.upload-cta-row .file-drop-cta .fd-ico { font-size: 26px; line-height: 1; }
.upload-cta-row .file-drop-cta .fd-title { font-weight: 700; font-size: 15px; color: var(--text); margin-top: 4px; display: block; }
.upload-cta-row .file-drop-cta .file-hint { color: var(--muted); margin-top: 2px; }
.upload-cta-row .file-drop-cta input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* 知识点 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(99, 102, 241, .1); color: var(--primary);
  border: 1px solid rgba(99, 102, 241, .25);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
}
.q-edit-list { display: flex; flex-direction: column; gap: 10px; }

/* 题目卡（识别结果 / 解析） */
.q-edit { display: flex; gap: 12px; align-items: flex-start; }
.q-no {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary-grad); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.q-body { flex: 1; min-width: 0; }
.q-stem { font-size: 14px; line-height: 1.6; }
.q-opts { margin: 6px 0; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border); }
.q-opt { font-size: 13.5px; line-height: 1.7; color: var(--ink); }

/* 进度条 */
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar { height: 100%; width: 0; background: var(--primary-grad); border-radius: 999px; transition: width .4s ease; }

/* 设置区 */
.coef-val { display: inline-block; min-width: 28px; font-weight: 700; color: var(--primary); }
.muted { color: var(--muted); font-weight: 500; }
input[type=range] { padding: 0; accent-color: var(--primary); }

/* 变式预览（可编辑） */
.paper-preview { display: flex; flex-direction: column; gap: 12px; }
.q-edit-area {
  flex: 1; min-width: 0; min-height: 84px; resize: vertical; line-height: 1.6;
  font-family: inherit;
}
.q-stem-rendered {
  flex: 1; min-width: 0; font-size: 14px; line-height: 1.7;
  padding: 10px 12px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--border);
}
.q-edit-actions { margin-top: 8px; }
.variant-item .q-body { flex: 1; min-width: 0; }
.variant-source-img { margin-bottom: 14px; padding: 12px; background: var(--surface-2); border-radius: 12px; border: 1px dashed var(--border); text-align: center; }
.variant-source-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.variant-source-img img { max-width: 100%; max-height: 320px; border-radius: 10px; display: block; margin: 0 auto; border: 1px solid var(--border); }
.variant-figure { margin-bottom: 12px; padding: 10px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); text-align: center; }
.variant-figure .geom-svg { max-width: 280px; max-height: 220px; display: block; margin: 0 auto; }

/* 解析框 */
.explain-box {
  margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.explain-box h4 { font-size: 15px; font-weight: 700; color: var(--primary); }

/* 操作按钮组 */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* 打印专用区域：平时移出屏幕，打印时显示 */
#aiPrintArea {
  position: fixed; left: -99999px; top: 0; width: 800px;
  background: #fff; padding: 24px; color: #000;
}
@media print {
  body * { visibility: hidden; }
  #aiPrintArea, #aiPrintArea * { visibility: visible; }
  #aiPrintArea { position: static; left: 0; width: 100%; padding: 0; }
}

/* ============================================================
   AI 学情报告
   ============================================================ */
.report-score { margin: 8px 0 16px; }
.report-score .rs-main { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.report-score .rs-num { font-size: 38px; font-weight: 800; color: var(--primary); line-height: 1; }
.report-score .rs-of { font-size: 18px; color: var(--muted); font-weight: 600; }
.report-score .rs-pct { margin-left: auto; font-size: 16px; font-weight: 700; color: var(--success); }
.report-summary { color: var(--text); line-height: 1.7; margin: 6px 0 14px; }

#reportResult h4 { font-size: 15px; font-weight: 700; color: var(--primary); margin: 18px 0 10px; }

.wrong-q {
  display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid #ef4444; border-radius: var(--r-sm); padding: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm); animation: slideUp .35s ease both;
}
.wrong-q .wq-no { font-weight: 800; color: #ef4444; min-width: 28px; }
.wrong-q .wq-body { flex: 1; min-width: 0; }
.wrong-q .wq-stem { line-height: 1.6; margin-bottom: 6px; }
.wrong-q .answer.ok { color: var(--success); }
.wrong-q .wq-reason { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.6; }

.weak-point {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 10px; line-height: 1.6; box-shadow: var(--shadow-sm);
}
.weak-point strong { color: var(--warning, #d97706); }

.plan-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.plan-step .ps-title { font-weight: 700; margin-bottom: 6px; }
.plan-step ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.8; }

/* ============================================================
   个人题库（集成版）组件样式 —— 全部作用域限定在 #bankRoot，避免与工作台其他模块冲突
   ============================================================ */
#bankRoot {
  --card: #ffffff; --line: #e7eaf3; --soft: #f8fafc; --ink: #1e293b; --muted: #64748b;
  --primary: #6366f1; --primary-d: #4f46e5; --ok: #10b981; --warn: #d97706; --danger: #ef4444;
  --radius: 14px; --shadow: 0 6px 24px rgba(15, 23, 42, .08);
}
#bankRoot .bank-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
#bankRoot .bank-tab {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 12px; transition: .18s;
}
#bankRoot .bank-tab:hover { border-color: rgba(99, 102, 241, .4); color: var(--primary); }
#bankRoot .bank-tab.active { background: var(--primary-grad); color: #fff; border-color: transparent; }
#bankRoot .bank-pane { display: none; animation: fadeIn .25s ease; }
#bankRoot .bank-pane.active { display: block; }

/* 题库管理 */
#bankRoot .toolbar { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
#bankRoot .count { color: var(--muted); font-size: 13px; }
#bankRoot .bank-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
#bankRoot .filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); height: fit-content; }
#bankRoot .filters h3 { font-size: 15px; }
#bankRoot .filters label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
#bankRoot .filters select { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
#bankRoot .qlist { display: flex; flex-direction: column; gap: 12px; }
#bankRoot .qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: .18s; }
#bankRoot .qcard:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20, 24, 48, .12); }
#bankRoot .qcard .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
#bankRoot .qcard .meta span { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; color: #444; }
#bankRoot .tag-type { background: #eef2ff !important; color: var(--primary) !important; border-color: #c7c9f7 !important; }
#bankRoot .tag-platform { background: #f5f3ff !important; color: #7c3aed !important; border-color: #ddd6fe !important; }
#bankRoot .tag-topic { background: #fff7e8 !important; color: #b45309 !important; border-color: #fde7c3 !important; }
[data-theme="dark"] #bankRoot .tag-topic { background: #3a2f1a !important; color: #f3c677 !important; border-color: #5a4a28 !important; }
#bankRoot .tag-gaokao { background: #e8f5ee !important; color: #0e7a4d !important; border-color: #c1e8d3 !important; }
[data-theme="dark"] #bankRoot .tag-gaokao { background: #14332a !important; color: #7ed3a8 !important; border-color: #24513f !important; }
#bankRoot .tag-doc { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; padding: 1px 7px; border-radius: 6px; font-size: 12px; }
#bankRoot .doc-card { border-left: 3px solid #0ea5e9; }
#bankRoot .gaokao-docs { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #e2e8f0; }
#bankRoot .docs-head { font-size: 14px; font-weight: 500; color: #0f172a; margin: 6px 2px 10px; }
#bankRoot .doc-modal-actions { padding: 8px 4px; border-bottom: 1px solid #e2e8f0; }
[data-theme="dark"] #bankRoot .tag-doc { background: #0c2a3a; color: #7dd3fc; border-color: #16435c; }
[data-theme="dark"] #bankRoot .gaokao-docs { border-top-color: #2a3340; }
[data-theme="dark"] #bankRoot .docs-head { color: #e5e7eb; }
[data-theme="dark"] #bankRoot .doc-modal-actions { border-bottom-color: #2a3340; }
#bankRoot .tag-phase { background: #e0f2fe !important; color: #0369a1 !important; border-color: #bae6fd !important; }
[data-theme="dark"] #bankRoot .tag-phase { background: #0c2a3a !important; color: #7dd3fc !important; border-color: #16465c !important; }
#bankRoot .doc-toggle { display: inline-flex; gap: 6px; }
#bankRoot .doc-toggle .btn { padding: 5px 14px; }
#bankRoot .doc-toggle .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.tag-admin { background: #fff3e0 !important; color: #b26a00 !important; border-color: #ffe0b2 !important; }
[data-theme="dark"] #bankRoot .tag-admin { background: #3a2e10 !important; color: #ffcf80 !important; border-color: #5a4516 !important; }
#bankRoot .bank-view-switch { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; }
#bankRoot .view-btn { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: #555; cursor: pointer; transition: all .15s; }
#bankRoot .view-btn:hover { border-color: var(--primary); color: var(--primary); }
#bankRoot .view-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
@media (max-width: 600px) { #bankRoot .bank-view-switch { display: flex; margin-bottom: 8px; } }
#bankRoot .tag-diff-易 { background: #ecfdf5 !important; color: var(--ok) !important; border-color: #bbf7d0 !important; }
#bankRoot .tag-diff-中 { background: #fffbeb !important; color: var(--warn) !important; border-color: #fde68a !important; }
#bankRoot .tag-diff-难 { background: #fef2f2 !important; color: var(--danger) !important; border-color: #fecaca !important; }
#bankRoot .qcard .stem { font-weight: 600; white-space: pre-wrap; margin-bottom: 6px; }
#bankRoot .qcard .opts { color: #374151; white-space: pre-wrap; font-size: 13px; margin-bottom: 6px; }
#bankRoot .qcard .ans { font-size: 13px; color: #111; white-space: pre-wrap; line-height: 1.7; }
#bankRoot .qcard .ans b { color: var(--primary); }
#bankRoot .qcard .ans strong { color: #111; font-weight: 700; }
[data-theme="dark"] #bankRoot .qcard .ans strong { color: var(--ink); }
#bankRoot .qcard .row-actions { margin-top: 10px; display: flex; gap: 8px; }
#bankRoot .qcard .row-actions .btn { padding: 5px 12px; font-size: 12px; }
#bankRoot .qimg { display: block; max-width: 100%; max-height: 300px; border-radius: 8px; margin: 6px 0; box-shadow: 0 2px 8px rgba(20, 24, 48, .1); }
#bankRoot .qimg-sm { max-height: 170px; }
#bankRoot .imgup-row { font-size: 12px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
#bankRoot .imgup-row input[type=file] { font-size: 12px; }
#bankRoot .imgprev { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
#bankRoot .imgprev img { max-width: 140px; max-height: 110px; border-radius: 8px; border: 1px solid var(--line); }
#bankRoot .imgprev-x { position: absolute; top: -9px; right: -9px; background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; line-height: 1; padding: 0; cursor: pointer; }
#bankRoot .imgprev-crop { position: absolute; bottom: -10px; left: 6px; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 11px; padding: 2px 7px; cursor: pointer; z-index: 2; }
#bankRoot .section-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 2px 0; }
#bankRoot .ph-tray { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
#bankRoot .ph-item { width: 128px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; box-shadow: var(--shadow); }
#bankRoot .ph-item img { width: 100%; height: 88px; object-fit: cover; border-radius: 6px; background: var(--soft); }
#bankRoot .ph-name { font-size: 11px; color: var(--muted); margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bankRoot .ph-acts { display: flex; gap: 6px; }
#bankRoot .ph-acts .btn { padding: 3px 8px; font-size: 12px; flex: 1; }
#bankRoot .crop-stage { position: relative; max-width: 100%; margin: 10px 0; user-select: none; touch-action: none; background: #000; border-radius: 8px; overflow: hidden; }
#bankRoot .crop-stage img { display: block; max-width: 100%; max-height: 58vh; }
#bankRoot .crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 100vmax rgba(15, 18, 32, .5); cursor: move; box-sizing: border-box; }
#bankRoot .crop-box .ch { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--primary); border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
#bankRoot .crop-box .ch.tl { left: -9px; top: -9px; cursor: nwse-resize; }
#bankRoot .crop-box .ch.tr { right: -9px; top: -9px; cursor: nesw-resize; }
#bankRoot .crop-box .ch.bl { left: -9px; bottom: -9px; cursor: nesw-resize; }
#bankRoot .crop-box .ch.br { right: -9px; bottom: -9px; cursor: nwse-resize; }
#bankRoot .pq-img { display: block; max-width: 100%; max-height: 320px; margin: 6px 0; border-radius: 6px; }

/* 智能组卷 */
#bankRoot .compose-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 8px 0; }
#bankRoot .compose-form h3 { font-size: 16px; }
#bankRoot .grid-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0; }
#bankRoot .grid-form label { display: block; font-size: 12px; color: var(--muted); }
#bankRoot .grid-form input, #bankRoot .grid-form select { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
#bankRoot .hint { color: var(--muted); font-size: 12.5px; margin: 8px 0; }
#bankRoot .paper-actions { display: flex; align-items: center; gap: 16px; margin: 10px 0; flex-wrap: wrap; }
#bankRoot .chk { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
#bankRoot .paper-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow); min-height: 120px; }
#bankRoot .paper-title { text-align: center; font-size: 20px; font-weight: 800; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 6px; }
#bankRoot .paper-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
#bankRoot .paper-section { margin: 16px 0; }
#bankRoot .paper-section h4 { font-size: 15px; border-left: 4px solid var(--primary); padding-left: 8px; margin-bottom: 10px; }
#bankRoot .pq { margin-bottom: 16px; }
#bankRoot .pq .no { font-weight: 700; }
#bankRoot .pq .qa { margin-top: 4px; color: var(--primary); font-weight: 600; }
#bankRoot .answer-zone { border-bottom: 1px dashed #cbd5e1; min-height: 46px; margin-top: 6px; }
#bankRoot .answer-key { margin-top: 26px; padding-top: 16px; border-top: 2px dashed var(--line); }
#bankRoot .answer-key h3 { font-size: 16px; }
#bankRoot .ak-row { display: flex; gap: 10px; margin-bottom: 8px; }
#bankRoot .ak-row .ak-no { font-weight: 700; min-width: 54px; }

/* AI 出题 */
#bankRoot .ai-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 8px 0; }
#bankRoot .ai-box h3 { font-size: 16px; }
#bankRoot .ai-input { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
#bankRoot .ai-input input { flex: 1; min-width: 200px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
#bankRoot .ai-result { display: flex; flex-direction: column; gap: 12px; }
#bankRoot .ai-result .qcard { border-color: #c7c9f7; }

/* modal（个人题库内部） */
#bankRoot .modal-mask { position: fixed; inset: 0; background: rgba(15, 18, 32, .5); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
#bankRoot .modal { background: #fff; border-radius: 16px; padding: 24px; width: 520px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
#bankRoot .modal-wide { width: 640px; }
#bankRoot .modal h3 { font-size: 18px; }
#bankRoot .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
#bankRoot .form-grid label { display: block; font-size: 12px; color: var(--muted); }
#bankRoot .form-grid .full { grid-column: 1 / 3; }
#bankRoot .form-grid input, #bankRoot .form-grid select, #bankRoot .form-grid textarea { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
#bankRoot .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
#bankRoot .fmt { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12px; white-space: pre-wrap; color: #374151; }

/* 批量导入弹窗：标签页 + 拆题预览 */
#bankRoot .import-tabs { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; margin: 4px 0 14px; flex-wrap: wrap; }
#bankRoot .itab { border: none; background: transparent; padding: 9px 16px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--muted); transition: all .2s ease; }
#bankRoot .itab:hover { color: var(--primary); }
#bankRoot .itab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15,23,42,.14); font-weight: 600; }
#bankRoot .import-pane { margin-top: 4px; }
#bankRoot .import-shared-actions { margin-top: 14px; }
#bankRoot .docq-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; margin: 10px 0; }
#bankRoot .docq-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); display: flex; gap: 10px; align-items: flex-start; }
#bankRoot .docq-check { display: flex; align-items: flex-start; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
#bankRoot .docq-check input { width: 16px; height: 16px; accent-color: var(--primary); margin-right: 6px; }
#bankRoot .docq-body { flex: 1; min-width: 0; }
#bankRoot .docq-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
#bankRoot .docq-stem { font-weight: 600; white-space: pre-wrap; line-height: 1.6; }
#bankRoot .docq-opt { font-size: 13px; color: #374151; margin-top: 4px; white-space: pre-wrap; }
#bankRoot .docq-ans { font-size: 13px; color: var(--ok); font-weight: 600; margin-top: 4px; }
#bankRoot .docq-anal { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; }

/* 打印区域（个人题库） */
#bankRoot .print-area { display: none; }
#bankRoot .print-area img { max-width: 100%; height: auto; margin: 6px 0; border-radius: 6px; }
@media print {
  /* 隐藏 bankRoot 中除打印区外的所有内容 */
  #bankRoot > *:not(#printArea) { display: none !important; }
  #bankRoot { display: block !important; visibility: visible !important; padding: 0 !important; margin: 0 !important; background: #fff !important; }
  /* 显示并定位打印区 */
  #printArea { display: block !important; visibility: visible !important; position: static !important; left: 0 !important; top: 0 !important; width: 100% !important; padding: 0 !important; margin: 0 !important; background: #fff !important; color: #000 !important; }
  #printArea, #printArea * { visibility: visible !important; }
  #bankRoot .paper-title { font-size: 22px; }
  .pq { page-break-inside: avoid !important; break-inside: avoid !important; }
  @page { margin: 16mm; }
}
@media (max-width: 760px) {
  #bankRoot .bank-layout { grid-template-columns: 1fr; }
  #bankRoot .grid-form { grid-template-columns: 1fr 1fr; }
  #bankRoot .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  #bankRoot .filters h3 { grid-column: 1 / 3; }
  #bankRoot .ai-input input { min-width: 0; }
  #bankRoot .paper-preview { padding: 18px 16px; }
  #bankRoot .form-grid { grid-template-columns: 1fr; }
}

/* 智能讲义 / 预习（主界面组题栏目替换） */
#page-compose .compose-mode { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
#page-compose .compose-mode-label { font-weight: 600; color: var(--muted); font-size: 14px; }
#page-compose .seg { display: inline-flex; background: var(--accent-soft); border-radius: 12px; padding: 4px; gap: 4px; }
#page-compose .seg-btn { border: none; background: transparent; padding: 9px 16px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--compose-muted); transition: all .2s ease; }
#page-compose .seg-btn:hover { color: var(--accent); }
#page-compose .seg-btn.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(15,23,42,.14); font-weight: 600; }
#page-compose .compose-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
#page-compose .compose-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--compose-muted); }
#page-compose .compose-row select { width: 100%; }
#page-compose .full { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 16px; font-size: 13px; color: var(--compose-muted); }
#page-compose .full textarea { width: 100%; }
#page-compose .compose-result {
  line-height: 1.85; font-size: 15px; color: var(--compose-ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 28px 36px; box-shadow: 0 8px 30px rgba(2,6,23,.07), 0 2px 8px rgba(2,6,23,.03);
  margin-top: 18px; position: relative; overflow: hidden;
}
#page-compose .compose-result::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa, #c084fc);
  border-radius: 16px 16px 0 0;
}
/* ===== 讲义排版增强 ===== */
#page-compose .compose-result .lec-title {
  font-size: 22px; font-weight: 800; margin: 4px 0 20px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
#page-compose .compose-result .lec-sec {
  font-size: 17px; font-weight: 700; margin: 24px 0 10px;
  padding-left: 14px; border-left: 4px solid #6366f1;
  color: var(--accent); display: flex; align-items: center; gap: 8px;
}
#page-compose .compose-result .lec-sec::before {
  content: '◆'; font-size: 10px; color: #a78bfa; flex-shrink: 0;
}
#page-compose .compose-result h2 { font-size: 21px; margin: 18px 0 8px; }
#page-compose .compose-result h3 { font-size: 17px; margin: 16px 0 6px; color: var(--accent); }
#page-compose .compose-result h4 { font-size: 15px; margin: 12px 0 4px; color: var(--compose-ink); opacity: .85; }
/* 公式块：居中、带背景色 */
#page-compose .compose-result .lec-math {
  margin: 14px auto; padding: 14px 20px; max-width: 100%;
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(139,92,246,.05));
  border: 1px solid rgba(99,102,241,.14); border-radius: 12px;
  text-align: center; overflow-x: auto; line-height: 2;
}
#page-compose .compose-result .lec-math .katex-display { margin: .5em 0; }
#page-compose .compose-result .lec-math .katex { font-size: 1.08em; }
/* 列表美化 */
#page-compose .compose-result .lec-ol, #page-compose .compose-result .lec-ul {
  margin: 8px 0 12px 20px; padding: 0;
}
#page-compose .compose-result .lec-ol { list-style: none; counter-reset: lec-li; }
#page-compose .compose-result .lec-ol > li {
  counter-increment: lec-li; position: relative;
  padding-left: 32px; margin: 10px 0; line-height: 1.75;
}
#page-compose .compose-result .lec-ol > li::before {
  content: counter(lec-li); position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; line-height: 22px;
}
#page-compose .compose-result .lec-ul { list-style: none; padding-left: 4px; }
#page-compose .compose-result .lec-ul > li {
  padding-left: 20px; margin: 7px 0; position: relative; line-height: 1.7;
}
#page-compose .compose-result .lec-ul > li::before {
  content: '•'; position: absolute; left: 4px; top: 0;
  color: #8b5cf6; font-weight: 900; font-size: 18px; line-height: 1.4;
}
#page-compose .compose-result ul, #page-compose .compose-result ol { margin: 6px 0 10px 24px; padding: 0; }
#page-compose .compose-result li { margin: 4px 0; }
#page-compose .compose-result p { margin: 7px 0; text-align: justify; }
#page-compose .compose-result strong {
  color: var(--text); font-weight: 700;
}
/* 定义/关键词高亮（段首加粗文字自动变成标签样式） */
#page-compose .compose-result p > strong:first-child,
#page-compose .compose-result p > strong:nth-child(-n+2):first-child {
  display: inline-block; background: rgba(99,102,241,.10);
  border: 1px solid rgba(99,102,241,.18); border-radius: 6px;
  padding: 1px 8px; font-size: 0.94em; color: #6366f1; margin-right: 4px;
}
.tex-err { color: #ef4444; font-family: monospace; font-size: 0.9em; background: rgba(239,68,68,.06); padding: 2px 6px; border-radius: 4px; }
/* 打印时讲义/预习排版（bank.js 试卷打印区同样复用 #printArea 样式，保留） */
#printArea h2 { font-size: 20px; margin: 16px 0 8px; }
#printArea h3 { font-size: 17px; margin: 14px 0 6px; color: var(--accent); }
#printArea h4 { font-size: 15px; margin: 12px 0 4px; }
#printArea p { margin: 6px 0; line-height: 1.7; }
#printArea ul, #printArea ol { margin: 6px 0 10px 24px; }
#printArea li { margin: 4px 0; }
@media (max-width: 760px) {
  #page-compose .compose-row { grid-template-columns: 1fr; }
  #page-compose .compose-result { padding: 16px; }
}

/* 错题本（个人题库内） */
#bankRoot .img-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
#bankRoot .imgprev-box { display: inline-flex; }
#bankRoot .imgprev { position: relative; display: inline-block; }
#bankRoot .imgprev img { max-width: 120px; max-height: 120px; border-radius: 10px; border: 1px solid var(--line); display: block; }
#bankRoot .imgprev-crop, #bankRoot .imgprev-x { position: absolute; top: 4px; border: none; border-radius: 6px; padding: 2px 7px; font-size: 12px; cursor: pointer; color: #fff; }
#bankRoot .imgprev-crop { right: 4px; background: #1d4ed8; }
#bankRoot .imgprev-x { right: 48px; background: #ef4444; }
#bankRoot #wrongDiag { margin-top: 16px; }
#bankRoot #wrongDiag h3 { color: #1d4ed8; margin: 14px 0 6px; }
#bankRoot #wrongDiag h4 { margin: 10px 0 4px; }
#bankRoot #wrongDiag ol, #bankRoot #wrongDiag ul { margin: 6px 0 10px 24px; }
#bankRoot #wrongDiag li { margin: 4px 0; }
#bankRoot .enc-row { margin: 4px 0 10px; }
#bankRoot .switch { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
#bankRoot .switch input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
#bankRoot .switch-label { font-size: 13px; color: var(--text); opacity: 0.85; line-height: 1.4; }
#bankRoot #wrongDiag p { margin: 6px 0; }
@media (max-width: 760px) {
  #bankRoot .imgprev img { max-width: 90px; max-height: 90px; }
}

/* 错题本改版：题库选题拾取器 + 已选展示 + 题库 OCR */
#bankRoot .pick-trigger { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
#bankRoot .picked-q { border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; padding: 14px; background: var(--soft); margin: 6px 0 14px; box-shadow: var(--shadow); }
#bankRoot .pq-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#bankRoot .pq-tag { font-weight: 700; color: var(--primary); font-size: 13px; }
#bankRoot .pq-stem { font-weight: 600; white-space: pre-wrap; margin-bottom: 6px; line-height: 1.6; }
#bankRoot .pq-ans { font-size: 13px; color: var(--ok); font-weight: 600; margin-bottom: 4px; }
#bankRoot .pq-meta { font-size: 12px; color: var(--muted); }
#bankRoot .pick-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow: auto; margin: 12px 0; }
#bankRoot .pick-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); cursor: pointer; transition: .15s; }
#bankRoot .pick-row:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(20, 24, 48, .12); }
#bankRoot .pick-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#bankRoot .pick-stem { font-weight: 600; white-space: pre-wrap; line-height: 1.6; }
#bankRoot .pick-ans { font-size: 13px; color: var(--ok); font-weight: 600; margin-top: 4px; }
#bankRoot .ocr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#bankRoot .btn.full { width: 100%; justify-content: center; }

/* 学员档案 + 薄弱知识点看板 */
#bankRoot .weak-bars { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
#bankRoot .weak-bar { cursor: pointer; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); transition: transform .15s ease, border-color .15s ease; }
#bankRoot .weak-bar:hover { transform: translateY(-1px); }
#bankRoot .weak-bar.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(29,78,216,.15); }
#bankRoot .wb-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 6px; }
#bankRoot .wb-num { font-weight: 700; color: var(--primary); }
#bankRoot .wb-track { height: 12px; background: rgba(29,78,216,.10); border-radius: 999px; overflow: hidden; }
#bankRoot .wb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #38bdf8, #1d4ed8); box-shadow: 0 0 12px rgba(29,78,216,.35); transition: width .4s cubic-bezier(.16,1,.3,1); }
#bankRoot .wb-practice { margin-left: 8px; font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--primary); background: rgba(29,78,216,.08); color: var(--primary); cursor: pointer; white-space: nowrap; transition: .15s; }
#bankRoot .wb-practice:hover { background: var(--primary); color: #fff; }
#bankRoot #stuStatus { margin-top: 8px; }

/* 薄弱点变式练习弹窗 */
#bankRoot .modal-wide { width: 720px; }
#bankRoot .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#bankRoot .modal-x { border: none; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
#bankRoot .modal-x:hover { color: var(--danger); }

/* 分享给家长弹窗（位于 #bankRoot 之外，使用全局样式） */
.modal-mask { position: fixed; inset: 0; background: rgba(15,18,32,.5); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 520px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-narrow { width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h3 { font-size: 18px; }
.modal-x { border: none; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: #6b7280; }
.modal-x:hover { color: #ef4444; }
.modal .hint { color: #6b7280; font-size: 12.5px; margin: 8px 0; }
.share-link-box { display: flex; gap: 8px; margin: 12px 0; }
.share-link-box input { flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; color: #374151; min-width: 0; }
.share-qr { text-align: center; margin: 6px 0 2px; }
.share-qr img { width: 168px; height: 168px; border: 1px solid #eceafb; border-radius: 12px; background: #fff; padding: 8px; box-shadow: 0 4px 14px rgba(83,74,183,.10); }
.share-qr-tip { font-size: 12px; color: #6b7280; margin-top: 8px; }
.share-views { margin: 10px 0 2px; padding: 10px 12px; background: #f3f1ff; border: 1px solid #e3ddff; border-radius: 10px; font-size: 14px; color: #4b3fae; line-height: 1.5; }
.share-views b { font-size: 16px; color: #372f86; }
.share-views .sv-zero { color: #6b7280; font-size: 13px; }
#bankRoot .wp-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0 6px; }
#bankRoot .wp-controls label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; }
#bankRoot .wp-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; max-height: 52vh; overflow: auto; }
#bankRoot .wp-card { padding: 14px 16px; }
#bankRoot .wp-options { white-space: pre-wrap; font-size: 14px; }
#bankRoot .wp-analysis { margin-top: 8px; }
#bankRoot .wp-analysis summary { cursor: pointer; color: var(--primary); font-size: 13px; }
#bankRoot .wp-analysis-body { margin-top: 6px; font-size: 14px; color: var(--text); line-height: 1.6; }
#bankRoot .wp-footer { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ============================================================
   轻量 toast 弹窗（限流等友好提示）
   ============================================================ */
#toast {
  position: fixed; left: 50%; top: 24px;
  transform: translateX(-50%) translateY(-20px);
  max-width: 90vw; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: #fff; background: #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 10000;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.warn { background: #f59e0b; }
#toast.error { background: #ef4444; }

/* ============================================================
   自动学情周报 / 月报 + 薄弱点 AI 点评
   ============================================================ */
.tag-auto { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px;
  background: #eef2ff; color: var(--primary); border: 1px solid #c7c9f7; font-size: 12px; font-weight: 600; vertical-align: middle; }

.ar-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 10px 0 16px; }
.ar-stat { display: flex; flex-direction: column; align-items: center; min-width: 84px;
  padding: 10px 14px; border-radius: 12px; background: linear-gradient(135deg, #eef2ff, #f8fafc); border: 1px solid #e2e8f0; }
.ar-num { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.ar-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ar-subjects { font-size: 13px; color: var(--muted); line-height: 1.7; }
.ar-subjects::before { content: '📚 '; }

.wb-num { font-weight: 700; color: var(--primary); }

.ar-comment { margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: #f0f9ff; border: 1px solid #bae6fd; color: #0c4a6e; line-height: 1.7; }
.ar-comment b { color: #075985; }
.ar-comment p { margin: 6px 0 0; }
.ar-firststep { margin-top: 8px !important; font-weight: 600; color: #0369a1; }
.ar-comment.err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

#bankRoot .ar-comment { background: #f0f9ff; border: 1px solid #bae6fd; color: #0c4a6e; }
#bankRoot .ar-comment.err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* 订正 / 掌握跟踪 */
.ms-badge { margin-left: auto; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ms-badge.ms-pending { background: #fef3c7; color: #b45309; }
.ms-badge.ms-corrected { background: #e0f2fe; color: #0369a1; }
.ms-badge.ms-mastered { background: #dcfce7; color: #15803d; }
.mastery-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.btn-mini { padding: 3px 10px; font-size: 12px; border-radius: 999px; line-height: 1.6; }
.btn-mini.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.wb-mastered { color: #15803d; font-weight: 700; margin-left: 4px; }

/* ============== AI 调用监控大屏（管理员） ============== */
.ai-dash {
  position: relative;
  margin: 0 0 26px;
  padding: 20px 22px 24px;
  border-radius: 18px;
  background:
    radial-gradient(1200px 400px at 12% -10%, rgba(56,189,248,.18), transparent 60%),
    radial-gradient(1000px 420px at 100% 0%, rgba(167,139,250,.18), transparent 55%),
    linear-gradient(180deg, #0b1224 0%, #0d1430 100%);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 20px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  color: #e8eefc;
  overflow: hidden;
}
.ai-dash::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 26px 26px; pointer-events: none; opacity: .5;
}
.ai-dash > * { position: relative; }
.ai-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ai-dash-title { display: flex; align-items: center; gap: 14px; }
.ai-dash-dot { width: 12px; height: 12px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 0 4px rgba(56,189,248,.18), 0 0 18px 2px rgba(56,189,248,.7); animation: aiPulse 2.4s ease-in-out infinite; }
@keyframes aiPulse { 0%,100%{ transform: scale(1); opacity:1 } 50%{ transform: scale(.82); opacity:.7 } }
.ai-dash-h { font-size: 20px; font-weight: 800; letter-spacing: .5px; background: linear-gradient(90deg,#7dd3fc,#c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-dash-sub { font-size: 12.5px; color: #9fb0d0; margin-top: 2px; }
.ai-dash-tools { display: flex; align-items: center; gap: 12px; }
.ai-dash-updated { font-size: 12px; color: #8ea2c6; }
.ai-dash-refresh { background: rgba(255,255,255,.08); color: #e8eefc; border: 1px solid rgba(255,255,255,.16); padding: 7px 14px; border-radius: 10px; font-size: 13px; cursor: pointer; transition: .2s; }
.ai-dash-refresh:hover { background: rgba(56,189,248,.18); border-color: rgba(56,189,248,.5); }

.ai-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 10px; }
.ai-kpi { padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); position: relative; overflow: hidden; }
.ai-kpi::after { content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; filter: blur(8px); opacity: .5; }
.ai-kpi-a::after { background: radial-gradient(circle, #38bdf8, transparent 70%); }
.ai-kpi-b::after { background: radial-gradient(circle, #a78bfa, transparent 70%); }
.ai-kpi-c::after { background: radial-gradient(circle, #34d399, transparent 70%); }
.ai-kpi-d::after { background: radial-gradient(circle, #fbbf24, transparent 70%); }
.ai-kpi-e::after { background: radial-gradient(circle, #f472b6, transparent 70%); }
.ai-kpi-f::after { background: radial-gradient(circle, #fb923c, transparent 70%); }
.ai-kpi-label { font-size: 13px; color: #aebbd6; margin-bottom: 6px; }
.ai-kpi-value { font-size: clamp(26px, 4vw, 40px); font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 2px 18px rgba(56,189,248,.25); }
.ai-kpi-unit { font-size: 14px; font-weight: 600; color: #9fb0d0; margin-left: 4px; }

.ai-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }
.ai-panel { padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.ai-panel-wide { margin-top: 14px; }
.ai-panel-h { font-size: 14px; font-weight: 700; color: #cdd8f0; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.ai-panel-h::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(#38bdf8,#a78bfa); }

.ai-bars { height: 170px; display: flex; align-items: flex-end; gap: 3px; padding-top: 6px; }
.ai-bar { flex: 1 1 0; min-width: 0; height: var(--h); background: linear-gradient(180deg,#7dd3fc,#3b82f6); border-radius: 4px 4px 2px 2px; transform-origin: bottom; animation: aiBarGrow .8s cubic-bezier(.2,.8,.2,1) both; position: relative; transition: filter .15s; }
.ai-bar:hover { filter: brightness(1.25); }
@keyframes aiBarGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.ai-bar-v { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: #bcd0f0; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.ai-bar:hover .ai-bar-v { opacity: 1; }
.ai-bars-axis { margin-top: 8px; font-size: 11px; color: #7e8db0; text-align: center; }

.ai-share-row { margin-bottom: 14px; }
.ai-share-top { display: flex; justify-content: space-between; font-size: 13px; color: #cdd8f0; margin-bottom: 6px; }
.ai-bar-track { height: 12px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.ai-bar-fill { height: 100%; width: var(--w); border-radius: 999px; animation: aiFill .9s ease both; }
@keyframes aiFill { from { width: 0; } to { width: var(--w); } }
.ai-fill-text { background: linear-gradient(90deg,#34d399,#10b981); box-shadow: 0 0 14px rgba(16,185,129,.5); }
.ai-fill-vision { background: linear-gradient(90deg,#38bdf8,#6366f1); box-shadow: 0 0 14px rgba(99,102,241,.5); }
.ai-model-tag { font-style: normal; font-size: 10.5px; font-weight: 600; color: #bbf7d0; background: rgba(16,185,129,.14); border: 1px solid rgba(16,185,129,.4); padding: 1px 7px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.ai-model-tag.vision { color: #bae6fd; background: rgba(56,189,248,.14); border-color: rgba(56,189,248,.4); }

.ai-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.ai-tbl th { text-align: left; color: #8ea2c6; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.ai-tbl th.ai-sortable { cursor: pointer; user-select: none; transition: color .15s; }
.ai-tbl th.ai-sortable:hover { color: #7dd3fc; }
.ai-tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.06); color: #e3eafc; }
.ai-tbl tr:hover td { background: rgba(255,255,255,.03); }
.ai-acc-name { font-weight: 600; color: #fff; }
.ai-acc-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ai-acc-bar > span { font-variant-numeric: tabular-nums; color: #cbd5f0; }
.ai-acc-fill { height: 8px; border-radius: 999px; background: linear-gradient(90deg,#7dd3fc,#a78bfa); box-shadow: 0 0 10px rgba(124,211,252,.4); width: var(--w); animation: aiFill .9s ease both; }

.ai-cost-note { font-size: 12px; color: #8ea2c6; margin: 0 0 16px; line-height: 1.5; }
.ai-cost-cell { font-variant-numeric: tabular-nums; color: #fde68a; font-weight: 600; white-space: nowrap; }
.ai-row-warn > td { background: rgba(251,191,36,.10); }
.ai-row-warn:hover > td { background: rgba(251,191,36,.16); }
.ai-row-danger > td { background: rgba(239,68,68,.14); }
.ai-row-danger:hover > td { background: rgba(239,68,68,.20); }
.ai-quota-badge { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.ai-quota-badge.warn { color: #fde68a; background: rgba(251,191,36,.18); border: 1px solid rgba(251,191,36,.5); }
.ai-quota-badge.danger { color: #fecaca; background: rgba(239,68,68,.22); border: 1px solid rgba(239,68,68,.6); }
.ai-quota-warn { margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(251,191,36,.10); border: 1px solid rgba(251,191,36,.35); color: #fde68a; font-size: 13px; line-height: 1.5; }
.ai-quota-warn b { color: #fff; }

/* ---------- 家长端（B 层付费家长账号） / 免费家长门户 共用样式 ---------- */
.parent-children { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.parent-child { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: .15s; }
.parent-child:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.parent-child.active { border-color: var(--primary); background: var(--accent-soft); box-shadow: var(--shadow-sm); }
.pc-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex: 0 0 auto; }
.pc-info { min-width: 0; }
.pc-name { font-weight: 600; color: var(--text); }
.pc-meta { font-size: 12px; color: var(--muted); }
.parent-empty { padding: 24px; text-align: center; color: var(--muted); background: var(--surface-2); border-radius: var(--r-sm); border: 1px dashed var(--border); }
.parent-children-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.parent-seat-hint { font-size: 13px; color: var(--muted); }
.parent-seat-hint a.link-upgrade { color: var(--primary); font-weight: 600; text-decoration: none; margin-left: 4px; }
.parent-seat-hint a.link-upgrade:hover { text-decoration: underline; }
.parent-add-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 16px; }
.parent-add-actions { display: flex; gap: 10px; margin-top: 10px; }
.parent-add-actions .btn { border-radius: 999px; }
.parent-add-form .msg { margin-top: 8px; min-height: 18px; font-size: 13px; color: #ef4444; }
.btn-primary.disabled, .btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.parent-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.btn-primary { background: var(--primary-grad); color: #fff; border: none; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); transition: .15s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.parent-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; }
.parent-block h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.parent-rep { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.parent-rep:last-child { border-bottom: none; }
.pr-date { font-size: 12px; color: var(--muted); flex: 0 0 auto; width: 72px; }
.pr-title { font-size: 14px; color: var(--text); flex: 1; min-width: 0; }
.pp-svg { width: 100%; height: auto; display: block; }
.pp-wrap { overflow-x: auto; }
.pp-legends { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.pp-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pp-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pp-head-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.pp-title { font-size: 15px; color: var(--ink); }
.pp-subj { font-size: 12px; color: var(--muted); background: rgba(99,102,241,.12); padding: 2px 9px; border-radius: 999px; }
.pp-trend { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pp-trend.up { color: #047857; background: rgba(16,185,129,.14); }
.pp-trend.down { color: #b45309; background: rgba(245,158,11,.14); }
.pp-drill { margin-top: 16px; border-top: 1px solid var(--line2); padding-top: 12px; }
.pp-drill-lbl { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.pp-select { width: 100%; max-width: 380px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 13px; }
.pp-drill-chart { margin-top: 10px; }
.pp-drill-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
@media (max-width: 560px) {
  .parent-actions { flex-direction: column; }
  .btn-primary { width: 100%; }
  .parent-children { grid-template-columns: 1fr; }
  .parent-block { padding: 14px; }
  .parent-children-head { gap: 8px; }
  .pp-svg { min-height: 150px; }
}

/* ===== 机构免费家长：升级横幅 + 高级功能锁态网格 ===== */
.parent-upgrade-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: linear-gradient(135deg,#eef0ff,#f6f3ff); border: 1px solid #d9dbf0; border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; }
.parent-upgrade-banner .pub-text { flex: 1; min-width: 200px; font-size: 13px; color: #4a3fd0; line-height: 1.6; }
.parent-upgrade-banner .pub-text b { color: #372f86; }
.parent-upgrade-banner .btn-sm { white-space: nowrap; }
.btn-sm { display: inline-block; padding: 7px 14px; font-size: 13px; border-radius: 999px; border: none; cursor: pointer; font-weight: 600; background: var(--primary-grad); color: #fff; text-decoration: none; }
.btn-sm:hover { transform: translateY(-1px); }
.parent-advanced { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.adv-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: .15s; }
.adv-card:hover { box-shadow: var(--shadow-sm); }
.adv-ico { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.adv-body { min-width: 0; }
.adv-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adv-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.adv-locked { opacity: .92; }
.adv-locked:hover { border-color: #c9c4f5; }
.adv-soon { opacity: .96; }
.locked-badge { display: inline-block; font-size: 11px; font-weight: 700; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px; padding: 1px 8px; }
.soon-badge { display: inline-block; font-size: 11px; font-weight: 700; color: #6b7280; background: #f1f2f6; border: 1px solid #e3e5ee; border-radius: 999px; padding: 1px 8px; }
@media (max-width: 560px) {
  .parent-advanced { grid-template-columns: 1fr; }
  .parent-upgrade-banner { flex-direction: column; align-items: stretch; }
  .parent-upgrade-banner .btn-sm { width: 100%; text-align: center; }
}
/* 老师端报告历史的「进步分享」按钮 */
.prog-share-item { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; margin-left: 6px; }
.prog-share-item:hover { background: #e0e7ff; }

@media (max-width: 760px) {
  .ai-kpis { grid-template-columns: repeat(2, 1fr); }
  .ai-grid { grid-template-columns: 1fr; }
}

/* ===== 移动端增强：拍卷诊断 / 报告页（2026-08-09 优化） ===== */
@media (max-width: 600px) {
  .upload-cta-row { flex-direction: column; }
  .file-drop {
    padding: 22px 16px; min-height: 96px;
    align-items: center; justify-content: center; text-align: center;
  }
  .file-drop .file-hint { font-size: 13px; line-height: 1.5; }
  #reportPaperFile, #paperFile { font-size: 15px; }
  .report-summary, .weak-point, .plan-step { font-size: 14px; line-height: 1.7; }
  .wrong-q { padding: 12px; gap: 10px; }
  .wrong-q .wq-no { width: 26px; height: 26px; font-size: 12px; }
  .wrong-q .wq-reason { font-size: 13px; }
  #reportResultCard .actions label { font-size: 13px; }
}

/* 流式输出光标（AI 逐字生成时的闪烁提示） */
.stream-caret { display: inline-block; color: #2563eb; font-weight: bold; margin-left: 1px; animation: stream-blink 1s steps(2, start) infinite; }
@keyframes stream-blink { to { visibility: hidden; } }

/* ===== 匿名免费试用：横幅 + 模块锁定（2026-08-09） ===== */
.trial-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(34,211,238,.10)); border: 1px solid rgba(99,102,241,.28); color: var(--text); }
.trial-banner .tb-badge { flex: 0 0 auto; font-size: 12px; font-weight: 800; letter-spacing: .5px; color: #fff; background: var(--primary-grad); padding: 5px 12px; border-radius: 999px; box-shadow: 0 6px 16px rgba(99,102,241,.28); }
.trial-banner .tb-text { flex: 1; min-width: 220px; font-size: 14px; color: #334155; line-height: 1.6; }
.trial-banner .tb-text b { color: var(--primary); font-weight: 800; }
.trial-banner .btn-sm { padding: 8px 16px; font-size: 13px; }
.module-card.locked { opacity: .55; cursor: not-allowed; }
.module-card.locked .mc-go { color: var(--danger); font-weight: 700; }

/* ===== 学情报告：深度诊断卡片（2026-08-10 增强） ===== */
.mastery-point { margin: 6px 0; font-size: 14px; line-height: 1.7; color: #374151; }
.mastery-point strong { color: #059669; }
.weak-card { margin: 12px 0; padding: 14px 16px; background: #faf9ff; border: 1px solid #eceafb; border-radius: 14px; }
.weak-card .wc-head { font-size: 15px; font-weight: 700; color: #372f86; margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.weak-card .wc-row { display: flex; gap: 10px; font-size: 13.5px; color: #374151; line-height: 1.65; margin: 6px 0; }
.weak-card .wc-k { flex: 0 0 70px; color: #7c6cf0; font-weight: 600; }
.weak-card .wc-v { flex: 1; min-width: 0; }
.weak-card .wc-fix { white-space: pre-wrap; }
.sev { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; }
.sev-high { background: #fee2e2; color: #dc2626; }
.sev-mid { background: #fef3c7; color: #d97706; }
.sev-low { background: #dcfce7; color: #059669; }
.et-tag { display: inline-block; font-size: 11px; padding: 1px 9px; border-radius: 999px; background: #eef0ff; color: #534AB7; }
.plan-step .ps-phase { display: inline-block; font-size: 11px; background: #534AB7; color: #fff; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.plan-step .ps-goal { font-size: 13px; color: #059669; margin-top: 4px; font-weight: 600; }
.parent-tips { margin: 6px 0 0 18px; line-height: 1.8; font-size: 14px; color: #374151; }
.parent-tips li { margin: 4px 0; }

/* ===== 解析中 弹窗 spinner（2026-08-10） ===== */
.busy-spin { width: 42px; height: 42px; border: 4px solid #e6e3fb; border-top-color: #534AB7; border-radius: 50%; margin: 6px auto 0; animation: busySpin .8s linear infinite; }
@keyframes busySpin { to { transform: rotate(360deg); } }

/* ===== 试卷OCR预览（2026-08-10） ===== */
.paper-preview { background: #f8f9fb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.paper-preview-warn { background: #fffbeb; border-color: #fcd34d; }
.paper-preview .pp-head { font-weight: 700; color: #374151; margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.paper-preview .pp-warn { color: #b45309; font-weight: 600; }
.paper-preview .pp-body { color: #6b7280; line-height: 1.6; max-height: 120px; overflow-y: auto; white-space: pre-wrap; font-family: "SFMono-Regular", Consolas, monospace; }
