﻿/* =========================================================
   LHT 数学竞赛刷题 · 全局样式
   风格：清爽、通透、有活力（青绿主色 + 暖橙点缀）
   ========================================================= */
:root {
  --primary: #0d9488;
  --primary-2: #0891b2;
  --primary-grad: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%);
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --ink: #1e293b;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --bg: #f6fafb;
  --card: #ffffff;
  --line: #e2e8f0;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(15, 40, 50, .07);
  --shadow-lg: 0 14px 40px rgba(15, 40, 50, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(900px 400px at 85% -60px, rgba(20, 184, 166, .14), transparent 60%),
    radial-gradient(700px 380px at -10% 10%, rgba(14, 165, 233, .10), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 22px;
  height: 64px; display: flex; align-items: center; gap: 22px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; color: var(--ink);
  letter-spacing: .5px; white-space: nowrap;
  transition: opacity .18s;
}
.brand:hover { opacity: .85; }
.brand-badge {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--primary-grad); color: #fff;
  display: grid; place-items: center; font-size: 18px;
  box-shadow: 0 4px 14px rgba(13, 148, 136, .35);
  transition: transform .2s;
}
.brand:hover .brand-badge { transform: rotate(-8deg) scale(1.05); }
.nav-links {
  display: flex; align-items: center; gap: 2px; flex: 1;
  min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  position: relative;
  padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--primary); background: rgba(13, 148, 136, .07); }
.nav-links a.active { color: var(--primary); font-weight: 600; background: rgba(13, 148, 136, .09); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 3px; width: 18px; height: 3px; border-radius: 2px;
  background: var(--primary-grad);
}
.nav-links a.nav-featured { color: var(--primary); font-weight: 600; }
.nav-links a.nav-featured::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; margin-right: 6px; vertical-align: 1px;
  background: var(--primary-grad); box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.nav-links a.nav-featured:hover,
.nav-links a.nav-featured.active { background: rgba(13, 148, 136, .09); }
.nav-links a.nav-featured.active::after { content: none; }
.user-box { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f97316); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 2px 6px rgba(249, 115, 22, .25);
}
.user-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.link-muted { color: var(--ink-3); font-size: 13.5px; }
.link-muted:hover { color: var(--danger); }

/* ---------- 布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 30px 20px 60px; width: 100%; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.page-head p { color: var(--ink-3); font-size: 14.5px; margin-top: 6px; }

/* ---------- Hero ---------- */
.hero {
  border-radius: 26px; color: #fff; padding: 46px 42px;
  background:
    radial-gradient(600px 300px at 90% -20%, rgba(255,255,255,.28), transparent 60%),
    linear-gradient(135deg, #0d9488 0%, #0891b2 55%, #0369a1 100%);
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.hero::after {
  content: "∫"; position: absolute; right: 26px; bottom: -46px;
  font-size: 210px; opacity: .12; font-family: Georgia, serif; line-height: 1;
}
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.hero p { margin-top: 10px; opacity: .92; font-size: 15px; max-width: 560px; }
.hero-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 14.5px; font-weight: 600; transition: .2s; line-height: 1.4;
  font-family: inherit;
}
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 6px 16px rgba(13,148,136,.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(13,148,136,.4); }
.btn-ghost { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.5); backdrop-filter: blur(4px); }
.btn-ghost:hover { background: rgba(255,255,255,.28); transform: translateY(-2px); }
.btn-soft { background: #e6f7f4; color: var(--primary); }
.btn-soft:hover { background: #d3f1ec; }
.btn-line { background: #fff; color: var(--ink-2); border: 1.5px solid var(--line); }
.btn-line:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger-soft { background: #fef2f2; color: var(--danger); }
.btn-danger-soft:hover { background: #fee2e2; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(226,232,240,.7);
  padding: 22px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- 统计卡片 ---------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card .num { font-size: 32px; font-weight: 800; line-height: 1.2; }
.stat-card .label { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.stat-card .ico {
  position: absolute; right: 14px; top: 14px; width: 42px; height: 42px;
  border-radius: 13px; display: grid; place-items: center; font-size: 20px;
}
.ico-teal { background: #e0f6f2; }
.ico-blue { background: #e0f2fe; }
.ico-amber { background: #fef3c7; }
.ico-rose { background: #ffe4e6; }

/* ---------- 组别切换 ---------- */
.group-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 20px; }
.group-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: #f1f5f9; color: var(--ink-2); border: 1px solid transparent;
  text-decoration: none; transition: .2s;
}
.group-tab:hover { background: #e2e8f0; color: var(--ink); }
.group-tab.active {
  background: var(--primary-grad); color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,.35);
}
.group-tab .tab-count {
  font-style: normal; font-size: 11.5px; background: rgba(0,0,0,.08);
  border-radius: 999px; padding: 1px 7px;
}
.group-tab.active .tab-count { background: rgba(255,255,255,.22); }

/* ---------- 章节卡片 ---------- */
.ch-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); border: 1px solid rgba(226,232,240,.7);
  transition: .22s; position: relative; overflow: hidden;
}
.ch-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--primary-grad); opacity: 0; transition: .22s;
}
.ch-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.ch-card:hover::before { opacity: 1; }
.ch-card h3 { font-size: 17px; font-weight: 700; }
.ch-card p { color: var(--ink-3); font-size: 13px; line-height: 1.55; flex: 1; }
.ch-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }

/* ---------- 进度条 ---------- */
.progress { height: 8px; background: #eef2f5; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--primary-grad); transition: width .5s; }

/* ---------- 标签 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.pill-choice { background: #e0f2fe; color: #0369a1; }
.pill-fill { background: #e0f6f2; color: #0f766e; }
.pill-calc { background: #fef3c7; color: #b45309; }
.pill-apply { background: #ede9fe; color: #6d28d9; }
.pill-proof { background: #ffe4e6; color: #be123c; }
.diff-1 { background: #dcfce7; color: #15803d; }
.diff-2 { background: #dbeafe; color: #1d4ed8; }
.diff-3 { background: #fed7aa; color: #c2410c; }
.diff-4 { background: #fecaca; color: #b91c1c; }
.src-tag { font-size: 12px; color: var(--ink-3); background: #f1f5f9; padding: 2px 9px; border-radius: 999px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fbfdfe;
  font-size: 14.5px; color: var(--ink); font-family: inherit; transition: .18s;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 刷题 ---------- */
.play-wrap { max-width: 760px; margin: 0 auto; }
.play-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.play-progress-text { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.q-card { padding: 30px 28px; }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.q-stem { font-size: 17px; line-height: 1.8; font-family: "Cambria", "Times New Roman", Georgia, serif; }
.q-stem .no { color: var(--primary); font-weight: 800; margin-right: 8px; font-family: inherit; }
.opt-list { margin-top: 20px; display: grid; gap: 10px; }
.opt-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fbfdfe; transition: .15s;
  font-size: 15px; line-height: 1.6;
}
.opt-item:hover { border-color: var(--primary-2); background: #f0fdfa; }
.opt-item .key {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #eef2f5; color: var(--ink-2); font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}
.opt-item.sel { border-color: var(--primary); background: #e6f9f6; }
.opt-item.sel .key { background: var(--primary); color: #fff; }
.opt-item.correct { border-color: var(--success); background: #f0fdf4; }
.opt-item.correct .key { background: var(--success); color: #fff; }
.opt-item.wrong { border-color: var(--danger); background: #fef2f2; }
.opt-item.wrong .key { background: var(--danger); color: #fff; }
.q-input { margin-top: 20px; }
.q-actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.feedback {
  margin-top: 20px; border-radius: 14px; padding: 18px 20px; display: none;
  border: 1.5px solid; animation: pop .25s ease;
}
.feedback.show { display: block; }
.feedback.ok { background: #f0fdf4; border-color: #bbf7d0; }
.feedback.no { background: #fef2f2; border-color: #fecaca; }
.feedback h4 { font-size: 15px; margin-bottom: 8px; }
.feedback .ans { font-weight: 700; }
.feedback .ana { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.7; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 倒计时 ---------- */
.timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px;
  color: var(--ink); background: #f1f5f9; padding: 6px 16px; border-radius: 999px;
}
.timer.warn { color: var(--danger); background: #fef2f2; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .6; } }

/* ---------- 题号导航 ---------- */
.qnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.qnav button {
  width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink-2); font-weight: 700; cursor: pointer; transition: .15s;
  font-size: 14px;
}
.qnav button.done { background: #e0f6f2; border-color: #99e6dc; color: var(--primary); }
.qnav button.cur { background: var(--primary-grad); color: #fff; border-color: transparent; }
.qnav button:hover { border-color: var(--primary); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 12px 14px; color: var(--ink-3); font-weight: 600;
  border-bottom: 2px solid var(--line); white-space: nowrap;
  background: #f8fafc;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:hover td { background: #f8fdfc; }
.tbl .stem-cell { max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 7px 13px; border-radius: 10px; border: 1.5px solid var(--line);
  font-size: 13.5px; color: var(--ink-2); background: #fff;
}
.pagination .current { background: var(--primary-grad); color: #fff; border-color: transparent; font-weight: 700; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%) translateY(-12px);
  background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99;
  box-shadow: var(--shadow-lg); max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 认证页 ---------- */
.auth-wrap {
  flex: 1; display: grid; place-items: center; padding: 40px 20px;
  background:
    radial-gradient(700px 360px at 15% 0%, rgba(20,184,166,.16), transparent 55%),
    radial-gradient(700px 360px at 90% 100%, rgba(14,165,233,.14), transparent 55%);
}
.auth-card { width: 100%; max-width: 420px; padding: 36px 34px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-title { text-align: center; font-size: 22px; font-weight: 800; margin: 8px 0 4px; }
.auth-sub { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-bottom: 26px; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: 18px; }

/* ---------- 错题本 ---------- */
.mistake-item { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; }
.mistake-item .m-body { flex: 1; min-width: 0; }
.mistake-item .m-stem { font-size: 15px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: "Cambria", Georgia, serif; }
.mistake-item .m-actions { display: flex; gap: 8px; flex-direction: column; }

/* ---------- 试卷结果 ---------- */
.score-hero {
  border-radius: 24px; padding: 34px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #0d9488, #0891b2 60%, #0369a1);
  box-shadow: var(--shadow-lg);
}
.score-hero .big { font-size: 52px; font-weight: 800; }
.score-hero .sub { opacity: .9; margin-top: 4px; }
.subj-item { border-left: 4px solid var(--accent); }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: auto; text-align: center; padding: 22px; color: var(--ink-3);
  font-size: 13px; border-top: 1px solid var(--line);
  background: rgba(255,255,255,.5);
}

/* ---------- 其他 ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty .big { font-size: 42px; margin-bottom: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.muted { color: var(--ink-3); font-size: 13px; }
.danger { color: var(--danger); } .success { color: var(--success); }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar { width: 70%; max-width: 38px; border-radius: 8px 8px 3px 3px; background: var(--primary-grad); opacity: .85; transition: .3s; min-height: 3px; }
.bar:hover { opacity: 1; }
.bar-label { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.chart-note { font-size: 12px; color: var(--ink-3); margin-top: 8px; text-align: center; }

/* ---------- 知识库 ---------- */
.art-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid rgba(226,232,240,.7);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); transition: .22s; position: relative; overflow: hidden;
}
.art-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--primary-grad); opacity: 0; transition: .22s;
}
.art-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.art-card:hover::before { opacity: 1; }
.art-card-head { display: flex; justify-content: space-between; align-items: center; }
.art-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.art-views { font-size: 12px; color: var(--ink-3); }
.art-card h3 { font-size: 16.5px; font-weight: 700; line-height: 1.45; }
.art-card:hover h3 { color: var(--primary); }
.art-summary {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--ink-3); margin-top: auto;
}

/* 详情 */
.art-breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); margin: 4px 0 14px; }
.art-breadcrumb a { color: var(--ink-3); text-decoration: none; }
.art-breadcrumb a:hover { color: var(--primary); }
.art-detail { padding: 34px 38px; }
.art-detail-head h1 { font-size: 26px; font-weight: 800; margin: 12px 0 10px; line-height: 1.4; }
.art-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.art-lead {
  margin-top: 16px; padding: 12px 16px; background: #f0fdf7;
  border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0;
  font-size: 14.5px; color: #065f46; line-height: 1.7;
}
.art-video {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-top: 20px; padding: 16px 18px; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 12px;
}
.art-video-info { display: flex; gap: 12px; align-items: center; }

.art-body { margin-top: 22px; font-size: 15.5px; line-height: 1.9; color: #334155; }
.art-body p { margin: 12px 0; }
.art-h3 {
  font-size: 19px; font-weight: 800; color: var(--ink);
  margin: 26px 0 10px; padding-left: 12px; border-left: 4px solid var(--primary);
}
.art-h4 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; }
.art-quote {
  margin: 14px 0; padding: 12px 16px; background: #f1f5f9;
  border-radius: 10px; border-left: 3px solid #94a3b8;
  font-size: 14.5px; color: #475569;
}
.art-ul { margin: 10px 0; padding-left: 22px; }
.art-ul li { margin: 6px 0; }
.art-hr { border: none; border-top: 1px dashed #e2e8f0; margin: 22px 0; }
.art-body .katex { font-size: 1.08em; }
.art-body strong { color: var(--ink); }
/* 知识库 · 表格 */
.art-table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid #eef2f7; border-radius: 10px; }
.art-table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; }
.art-table th { background: #f0fdf6; color: #0f766e; font-weight: 700; text-align: left; padding: 12px 18px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.art-table td { padding: 12px 18px; border-bottom: 1px solid #f3f6fa; color: var(--ink); line-height: 1.8; vertical-align: middle; white-space: nowrap; }
.art-table td .katex { font-size: 1.02em; }
.art-table tbody tr:last-child td { border-bottom: none; }
.art-table tbody tr:hover { background: #f8fafc; }
/* 题目反馈面板 */
.fb-open:hover { color: var(--primary); }
.fb-panel { margin-top: 14px; padding: 14px 16px; border: 1px dashed var(--line, #d8dee9); border-radius: 10px; background: rgba(15, 23, 42, 0.02); }
.fb-panel .select, .fb-panel .textarea { width: 100%; }

/* =========================================================
   移动端适配（平板 / 手机）
   全部包在媒体查询内，电脑端布局不受任何影响
   ========================================================= */

/* 汉堡按钮与移动面板（默认隐藏，桌面永远不出现） */
.nav-toggle { display: none; }
.mobile-nav { display: none; }

/* ---------- ≤860px：平板竖屏 / 手机 ---------- */
@media (max-width: 860px) {
  /* 导航：隐藏行内链接与用户区，改用汉堡 */
  .topbar-inner { gap: 12px; }
  .topbar-inner .nav-links,
  .topbar-inner > .user-box { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center;
    align-items: center; gap: 4px; width: 40px; height: 40px; margin-left: auto;
    border: none; background: transparent; cursor: pointer; padding: 0; flex: none;
  }
  .nav-toggle span {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: var(--ink-2); transition: .25s;
  }
  .nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .mobile-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(15, 40, 50, .12);
    padding: 10px 14px 16px; flex-direction: column; z-index: 49;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav-user {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 14px; border-bottom: 1px solid #f1f5f9; margin-bottom: 8px;
  }
  .mobile-nav-user .user-name { font-size: 15px; }
  .mobile-nav > a {
    padding: 12px 14px; border-radius: 12px; color: var(--ink-2);
    font-size: 15px; font-weight: 600; transition: .15s;
  }
  .mobile-nav > a:hover, .mobile-nav > a.active { background: rgba(13, 148, 136, .08); color: var(--primary); }

  /* 布局微调 */
  .container { padding: 22px 16px 48px; }
  .page-head h1 { font-size: 23px; }
  .hero { padding: 34px 26px; border-radius: 22px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14.5px; }
  .hero::after { font-size: 150px; right: 16px; bottom: -40px; }
  .q-card { padding: 24px 20px; }
  .art-detail { padding: 26px 22px; }
  .auth-card { padding: 30px 24px; }
  .score-hero { padding: 28px 20px; }
  .score-hero .big { font-size: 44px; }
  .stat-card .num { font-size: 28px; }
  .play-top { flex-wrap: wrap; }
  .mistake-item { gap: 12px; }
  .art-video { align-items: flex-start; }
}

/* ---------- ≤560px：手机 ---------- */
@media (max-width: 560px) {
  .topbar-inner { height: 56px; padding: 0 12px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand-badge { width: 30px; height: 30px; font-size: 15px; }
  .container { padding: 18px 12px 44px; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 21px; }
  .page-head p { font-size: 13.5px; }
  .hero { padding: 26px 18px; border-radius: 20px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13.8px; line-height: 1.65; }
  .hero::after { font-size: 110px; }
  .hero-actions { gap: 10px; }
  .btn { padding: 10px 18px; font-size: 14px; }
  .btn-sm { padding: 6px 12px; font-size: 12.5px; }
  .q-card { padding: 18px 14px; }
  .q-head { gap: 8px; }
  .q-stem { font-size: 15.5px; line-height: 1.75; }
  .opt-item { padding: 12px 12px; font-size: 14.5px; gap: 10px; }
  .opt-item .key { width: 24px; height: 24px; font-size: 12.5px; }
  /* 输入框字号 ≥16px，防止 iOS 聚焦时自动放大页面 */
  .input, .select, .textarea { font-size: 16px; }
  .textarea { min-height: 100px; }
  .timer { font-size: 15.5px; padding: 5px 12px; }
  .qnav { gap: 7px; }
  .qnav button { width: 34px; height: 34px; font-size: 13px; }
  .feedback { padding: 15px 14px; }
  .score-hero { padding: 24px 16px; }
  .score-hero .big { font-size: 40px; }
  .stat-card .num { font-size: 26px; }
  .stat-card .ico { width: 36px; height: 36px; font-size: 17px; right: 12px; top: 12px; }
  .bar-chart { height: 110px; }
  .art-card { padding: 16px 16px; }
  .art-detail { padding: 18px 14px; }
  .art-detail-head h1 { font-size: 21px; }
  .art-body { font-size: 15px; line-height: 1.85; }
  .art-table th, .art-table td { padding: 10px 12px; }
  .auth-card { padding: 24px 18px; }
  .auth-title { font-size: 20px; }
  .mistake-item { padding: 14px 12px; gap: 10px; }
  .mistake-item .m-stem { font-size: 14px; }
  .ch-card { padding: 18px 16px; }
  .ch-card h3 { font-size: 16px; }
  .group-tab { padding: 7px 13px; font-size: 13px; }
  .pagination a, .pagination span { padding: 6px 11px; font-size: 13px; }
  .tbl .stem-cell { max-width: 180px; }
  .tbl th, .tbl td { padding: 10px 10px; font-size: 13px; }
  .art-video { flex-direction: column; align-items: stretch; gap: 12px; }
  .art-video-info { width: 100%; }
  .mathkey-field { flex-direction: column; }
  .mathkey-toggle { width: 100%; text-align: center; padding: 10px 12px; }
}

/* ---------- 数学键盘 · 手机优化 ---------- */
@media (max-width: 560px) {
  .mathkey-panel { width: calc(100vw - 16px); bottom: 8px; padding: 8px 8px 10px; }
  .mathkey-grid { max-height: 172px; gap: 5px; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
  .mathkey-btn { min-height: 42px; font-size: 16px; }
  .mathkey-preview { min-height: 40px; font-size: 15px; }
}

/* ===== 身份体系 ===== */
.role-tag { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; line-height:1.5; margin-left:6px; vertical-align:middle; }
.role-admin { background:#ffe9e9; color:#c03a3a; border:1px solid #ffd0d0; }
.role-teacher { background:#e9f2ff; color:#2f6fd0; border:1px solid #d2e3ff; }
.role-student { background:#eaf7f0; color:#1c8a55; border:1px solid #d3efe0; }
.role-pick { display:grid; gap:10px; }
.role-opt { position:relative; display:flex; align-items:center; border:1.5px solid var(--line); border-radius:12px; padding:10px 14px; cursor:pointer; transition:border-color .15s; }
.role-opt:hover { border-color:#9ec5ff; }
.role-opt input { margin-right:10px; accent-color:#2f8f6b; }
.role-opt b { display:block; font-size:14px; color:#1a2a4a; }
.role-opt i { display:block; font-style:normal; font-size:12px; color:#8a93a6; margin-top:2px; }
.role-opt:has(input:checked) { border-color:#2f8f6b; background:#f0faf5; }
