* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --primary:#4f6ef7;
  --primary-dark:#3a56d8;
  --bg:#f0f2f7;
  --card:#ffffff;
  --text:#1f2430;
  --muted:#8a90a3;
  --border:#e6e9f2;
  --success:#2fb46c;
  --warn:#f5a623;
  --error:#f0564a;
  --shadow:rgba(0,0,0,.06);
}
/* 夜间模式 */
body.dark-mode {
  --bg:#12141c;
  --card:#1d2030;
  --text:#e4e6f0;
  --muted:#7a8099;
  --border:#2d3045;
  --shadow:rgba(0,0,0,.3);
}
body.dark-mode .topbar { background:linear-gradient(135deg,#3a56d8 0%,#4f6ef7 100%); }
body.dark-mode .note-editor { background:var(--card); color:var(--text); }
body.dark-mode .tabbar { background:rgba(29,32,48,.96); border-top-color:var(--border); }
body.dark-mode .more-grid button { background:var(--border); }
body.dark-mode .fc-back { background:var(--border); color:var(--muted); }
body.dark-mode .question-card .q-opts { color:var(--muted); }
body.dark-mode .question-card .q-answer { background:var(--border); }
body.dark-mode .ai-box { color:var(--muted); }
body.dark-mode .tabs .tab { background:var(--card); }
body.dark-mode .exam-card-panel { box-shadow:0 2px 8px var(--shadow); }
body.dark-mode .exam-bar { box-shadow:0 2px 8px var(--shadow); }
body.dark-mode .stat-card { box-shadow:0 2px 8px var(--shadow); }
body.dark-mode .card { box-shadow:0 2px 8px var(--shadow); }
body.dark-mode .quiz-option.sel { background:rgba(79,110,247,.15); color:var(--primary); }
body.dark-mode .note-card .n-content { color:var(--muted); }
body.dark-mode input, body.dark-mode textarea, body.dark-mode select { background:var(--border); color:var(--text); border-color:transparent; }
body.dark-mode input:focus, body.dark-mode textarea:focus { background:var(--card); border-color:var(--primary); }
body.dark-mode .sheet { background:var(--card); }
body { font-family:"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif; background:var(--bg); color:var(--text); -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; }

/* 顶部 */
.topbar { background:var(--primary); color:#fff; padding:16px 20px; display:flex; justify-content:space-between; align-items:center; position:sticky; top:0; z-index:10; }
.topbar h1 { font-size:18px; font-weight:600; }
.topbar .user { display:flex; align-items:center; gap:10px; font-size:14px; }
.topbar .user .logout { background:rgba(255,255,255,.18); border:none; color:#fff; padding:5px 12px; border-radius:14px; cursor:pointer; font-size:13px; }
.topbar .user .logout:hover { background:rgba(255,255,255,.3); }

/* 导航 */
.nav { background:#fff; border-bottom:1px solid var(--border); display:flex; padding:0 20px; }
.nav button { flex:1; padding:14px 0; background:none; border:none; cursor:pointer; color:var(--muted); font-size:15px; position:relative; }
.nav button.active { color:var(--primary); font-weight:600; }
.nav button.active::after { content:""; position:absolute; left:20%; right:20%; bottom:0; height:3px; background:var(--primary); border-radius:2px; }

/* 内容区 */
.container { max-width:760px; margin:0 auto; padding:20px; }
.page { display:none; }
.page.active { display:block; }

/* 卡片 */
.card { background:var(--card); border-radius:12px; padding:20px; margin-bottom:16px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.card-title { font-size:16px; font-weight:600; margin-bottom:14px; color:var(--text); display:flex; justify-content:space-between; align-items:center; }
.card-title .link { color:var(--primary); font-size:13px; cursor:pointer; font-weight:400; }

/* 统计卡片 */
.stat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:16px; }
.stat-card { background:var(--card); border-radius:12px; padding:18px 14px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.stat-card .num { font-size:28px; font-weight:700; color:var(--primary); }
.stat-card .label { font-size:12px; color:var(--muted); margin-top:4px; }
.stat-card.green .num { color:var(--success); }
.stat-card.orange .num { color:var(--warn); }

/* 进度条 */
.progress-wrap { display:flex; align-items:center; gap:12px; }
.progress { flex:1; height:8px; background:#edf0f7; border-radius:4px; overflow:hidden; }
.progress .bar { height:100%; background:var(--primary); border-radius:4px; transition:width .3s; }
.progress-text { font-size:13px; color:var(--muted); min-width:40px; text-align:right; }

/* 列表项 */
.list-item { display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--border); }
.list-item:last-child { border-bottom:none; }
.list-item .info { flex:1; min-width:0; }
.list-item .title { font-size:15px; font-weight:500; }
.list-item .sub { font-size:12px; color:var(--muted); margin-top:3px; }
.list-item .title.done { text-decoration:line-through; color:var(--muted); }
.empty { text-align:center; color:var(--muted); padding:40px 0; font-size:14px; }

/* 标签 */
.tag { display:inline-block; padding:2px 9px; border-radius:10px; font-size:11px; margin-right:6px; }
.tag.high { background:#fde8e7; color:#d1483c; }
.tag.mid { background:#fff3dd; color:#d8900a; }
.tag.low { background:#e7f2ff; color:#3a76c9; }
.tag.done { background:#e5f7ed; color:#1f9d5d; }
.tag.status0 { background:#eef0f5; color:#6b7280; }
.tag.status1 { background:#e7f2ff; color:#3a76c9; }
.tag.status2 { background:#e5f7ed; color:#1f9d5d; }
.tag.status3 { background:#f3f3f4; color:#9a9ea8; }
.tag.note { background:#e7f2ff; color:#3a76c9; }
.tag.warn { background:#fff3dd; color:#d8900a; }
.tag.danger { background:#fde8e7; color:#d1483c; }
.tag.error { background:#fde8e7; color:#d1483c; }

/* 按钮 */
.btn { display:inline-block; border:none; border-radius:8px; padding:10px 18px; font-size:14px; cursor:pointer; }
.btn.primary { background:var(--primary); color:#fff; }
.btn.primary:hover { background:var(--primary-dark); }
.btn.block { width:100%; }
.btn.ghost { background:#fff; color:var(--primary); border:1px solid var(--primary); }
.btn.ghost:hover { background:#f0f3ff; }
.btn.danger-ghost { background:#fff; color:var(--error); border:1px solid var(--error); }
.btn.sm { padding:5px 11px; font-size:12px; border-radius:6px; }

/* 表单 */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; color:var(--muted); margin-bottom:6px; }
.form-group input, .form-group textarea, .form-group select {
  width:100%; padding:11px 13px; border:1px solid var(--border); border-radius:8px;
  font-size:14px; outline:none; transition:border-color .2s; background:#fff; color:var(--text);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color:var(--primary); }
.form-group textarea { min-height:80px; resize:vertical; }
.form-row { display:flex; gap:12px; }
.form-row .form-group { flex:1; }
.form-inline { display:flex; gap:16px; align-items:center; }
.radio { display:flex; gap:6px; align-items:center; font-size:14px; cursor:pointer; }

/* 弹窗 */
.mask { position:fixed; inset:0; background:rgba(0,0,0,.4); display:none; align-items:flex-end; justify-content:center; z-index:50; }
.mask.show { display:flex; }
.sheet { background:#fff; border-radius:16px 16px 0 0; width:100%; max-width:760px; max-height:85vh; overflow-y:auto; padding:22px 20px 28px; animation:slideUp .25s ease; }
@keyframes slideUp { from { transform:translateY(40px); opacity:0; } to { transform:translateY(0); opacity:1; } }
.sheet h3 { font-size:17px; margin-bottom:18px; }
.sheet .close { float:right; font-size:22px; color:var(--muted); cursor:pointer; line-height:1; }

/* 整屏弹窗（做题页）：铺满屏幕，头尾固定，中间滚动 */
.mask.mask-full { align-items:stretch; }
.sheet.sheet-full { background:var(--card); width:100%; max-width:none; height:100%; max-height:none; border-radius:0; padding:0; display:flex; flex-direction:column; overflow:hidden; animation:none; }
.sheet-full .quiz-head { flex:none; display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--border); }
.sheet-full .quiz-head h3 { font-size:17px; margin:0; }
.sheet-full .quiz-head .close { float:none; }
.sheet-full .quiz-body { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:16px 18px 24px; }
.sheet-full .quiz-foot { flex:none; padding:12px 18px calc(12px + env(safe-area-inset-bottom)); border-top:1px solid var(--border); background:var(--card); }
@media (min-width:768px) {
  .sheet-full .quiz-head, .sheet-full .quiz-body, .sheet-full .quiz-foot { width:100%; max-width:900px; margin:0 auto; }
}

/* 计划卡片 */
.plan-card { background:var(--card); border-radius:12px; padding:18px; margin-bottom:14px; box-shadow:0 1px 3px rgba(0,0,0,.05); cursor:pointer; transition:box-shadow .2s; }
.plan-card:hover { box-shadow:0 4px 14px rgba(0,0,0,.08); }
.plan-card .top { display:flex; justify-content:space-between; align-items:center; }
.plan-card .p-title { font-size:16px; font-weight:600; }
.plan-card .desc { font-size:13px; color:var(--muted); margin:8px 0 12px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.plan-card .meta { display:flex; align-items:center; gap:10px; font-size:12px; color:var(--muted); }
.plan-card .ops { display:flex; gap:6px; }
.plan-card .ops .btn { cursor:pointer; }
.plan-card .ops .btn:hover { opacity:.85; }
.plan-card .ops .btn.delete { color:var(--error); }

/* 任务行 */
.task-row { display:flex; align-items:flex-start; gap:12px; padding:13px 0; border-bottom:1px solid var(--border); }
.task-row:last-child { border-bottom:none; }
.task-check { width:22px; height:22px; border:2px solid var(--border); border-radius:50%; cursor:pointer; flex-shrink:0; margin-top:2px; transition:all .15s; }
.task-check.checked { background:var(--success); border-color:var(--success); position:relative; }
.task-check.checked::after { content:"✓"; color:#fff; font-size:14px; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); }
.task-main { flex:1; min-width:0; }
.task-main .t-title { font-size:15px; }
.task-main .t-title.done { text-decoration:line-through; color:var(--muted); }
.task-main .t-meta { font-size:12px; color:var(--muted); margin-top:4px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.task-ops { display:flex; gap:6px; flex-shrink:0; }

/* 笔记卡 */
.note-card { background:var(--card); border-radius:12px; padding:16px; margin-bottom:12px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.note-card .n-title { font-size:15px; font-weight:600; margin-bottom:6px; display:flex; align-items:center; gap:8px; }
.note-card .n-content { font-size:14px; color:#4a4f5e; white-space:pre-wrap; margin-bottom:8px; }
.note-card .n-meta { font-size:12px; color:var(--muted); }
.note-card .n-meta .btn { margin-left:8px; }

/* 笔记富文本编辑器 */
.note-toolbar { display:flex; gap:4px; align-items:center; margin-bottom:6px; padding:6px 8px; background:var(--bg); border-radius:8px; }
.note-tool { background:none; border:none; cursor:pointer; padding:5px 8px; font-size:13px; border-radius:4px; color:var(--text); transition:background .15s; }
.note-tool:hover { background:var(--border); }
.note-sep { width:1px; height:18px; background:var(--border); margin:0 4px; }
.note-editor {
  min-height:120px; padding:10px; border:1px solid var(--border); border-radius:8px;
  font-size:14px; line-height:1.8; background:#fff; outline:none;
}
.note-editor:focus { border-color:var(--primary); }
.note-editor:empty::before { content:attr(placeholder); color:var(--muted); pointer-events:none; }

/* 筛选 tab */
.tabs { display:flex; gap:8px; margin-bottom:16px; }
.tabs .tab { padding:7px 16px; border-radius:16px; font-size:13px; cursor:pointer; background:#fff; border:1px solid var(--border); color:var(--muted); }
.tabs .tab.active { background:var(--primary); color:#fff; border-color:var(--primary); }

/* 周打卡图 */
.week-chart { display:flex; align-items:flex-end; gap:10px; height:120px; padding-top:8px; }
.week-bar { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; }
.week-bar .bar { width:100%; max-width:34px; background:var(--primary); border-radius:4px 4px 0 0; transition:height .3s; }
.week-bar .val { font-size:11px; color:var(--muted); margin-top:5px; }
.week-bar .day { font-size:11px; color:var(--muted); margin-top:3px; }
.chart-title { font-size:14px; color:var(--muted); margin-bottom:10px; }

@media (max-width:600px) {
  .stat-grid { grid-template-columns:repeat(3,1fr); gap:8px; }
  .stat-card .num { font-size:22px; }
  .container { padding:14px; }
}

/* 番茄钟 */
.pomo-circle {
  width:210px; height:210px; border-radius:50%; margin:0 auto;
  background:conic-gradient(var(--primary) 0deg, #edf0f7 0deg);
  display:flex; align-items:center; justify-content:center; position:relative;
  transition:background .3s;
}
.pomo-circle::before {
  content:""; position:absolute; inset:12px; border-radius:50%; background:#fff;
}
.pomo-circle > div { position:relative; z-index:1; text-align:center; }
.pomo-circle.rest { background:conic-gradient(#2fb46c 0deg, #edf0f7 0deg); }
.pomo-circle.rest #pomo-time { color:#2fb46c; }

/* 多按钮行 */
.btn-row { display:flex; gap:10px; margin-bottom:16px; }
.btn-row .btn { flex:1; text-align:center; }

/* 题库 */
.question-card { background:var(--card); border-radius:12px; padding:16px; margin-bottom:12px; box-shadow:0 1px 3px rgba(0,0,0,.05); transition:opacity .3s ease, transform .3s ease; }
/* 「未做过」筛选下答完题的卡片淡出 */
.question-card.q-fading { opacity:0; transform:translateX(16px); pointer-events:none; }
.question-card .q-head { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.question-card .q-tags { font-size:12px; color:var(--muted); }
.question-card .q-fav { margin-left:auto; cursor:pointer; font-size:17px; color:#c4c9d4; line-height:1; user-select:none; transition:color .12s, transform .12s; padding:2px 4px; }
.question-card .q-fav:hover { color:#f5a623; }
.question-card .q-fav.faved { color:#f5a623; }
.question-card .q-fav:active { transform:scale(1.25); }
/* 作答状态角标：绿=上次答对，红=上次答错，灰点=未做过 */
.question-card .q-status { margin-left:auto; width:18px; text-align:center; font-size:13px; font-weight:700; line-height:1; user-select:none; }
.question-card .q-status.ok { color:#2fa44f; }
.question-card .q-status.bad { color:#e05252; }
.question-card .q-status.none { width:6px; height:6px; border-radius:50%; background:#c4c9d4; align-self:center; }
.question-card .q-status + .q-fav { margin-left:4px; }
.question-card .q-content { font-size:15px; line-height:1.7; white-space:pre-wrap; margin-bottom:10px; }
.question-card .q-opts { font-size:13px; color:#4a4f5e; line-height:1.9; margin-bottom:10px; }
.question-card .q-answer { font-size:13px; color:var(--muted); line-height:1.7; padding:10px 12px; background:#f7f9ff; border-radius:8px; margin-bottom:10px; white-space:pre-wrap; }

/* 题库逐级钻取 */
.q-crumb { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:13px; color:var(--muted); margin-bottom:14px; }
.q-crumb a { color:var(--primary); cursor:pointer; }
.q-crumb a:hover { text-decoration:underline; }
.q-crumb b { color:var(--text); font-weight:600; }
.q-crumb-sep { color:#c4c9d4; }
.q-drill { display:flex; flex-direction:column; gap:10px; }
.q-drill-group-title { font-size:12px; color:var(--muted); padding:2px 2px 0; }
.q-drill-subtitle { font-size:12px; color:var(--muted); padding:12px 2px 2px; }
.q-drill-item { display:flex; align-items:center; gap:12px; padding:14px 16px; background:var(--card); border:1px solid var(--border); border-radius:12px; cursor:pointer; transition:border-color .15s, box-shadow .15s, transform .15s; }
.q-drill-item:hover { border-color:var(--primary); box-shadow:0 4px 14px rgba(30,80,200,.08); transform:translateY(-1px); }
.q-drill-item:active { transform:scale(.995); }
.q-drill-item .di-main { flex:1; min-width:0; }
.q-drill-item .di-name { font-size:15px; font-weight:600; color:var(--text); line-height:1.4; word-break:break-all; }
.q-drill-item .di-meta { font-size:12px; color:var(--muted); margin-top:3px; }
.q-drill-item .di-arrow { color:#c4c9d4; font-size:18px; line-height:1; }
.q-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.question-card .q-ops { display:flex; gap:8px; flex-wrap:wrap; }

/* 答题选项 */
.quiz-option { border:1px solid var(--border); border-radius:8px; padding:11px 13px; margin-bottom:8px; font-size:14px; line-height:1.5; cursor:pointer; transition:all .15s; }
.quiz-option:hover { border-color:var(--primary); }
.quiz-option.sel { border-color:var(--primary); background:#f0f3ff; color:var(--primary-dark); font-weight:500; }

/* AI 总结 */
.ai-box { background:var(--card); border-radius:12px; padding:16px; margin-bottom:14px; box-shadow:0 1px 3px rgba(0,0,0,.05); font-size:14px; line-height:1.8; color:#4a4f5e; }
.ai-box .ai-meta { font-size:12px; color:var(--muted); padding-bottom:10px; margin-bottom:10px; border-bottom:1px solid var(--border); }

/* 闪卡 */
.fc-front { font-size:18px; font-weight:600; line-height:1.7; text-align:center; padding:26px 12px; white-space:pre-wrap; }
.fc-back { margin-top:12px; padding:14px; background:#f7f9ff; border-radius:10px; font-size:14px; line-height:1.8; color:#4a4f5e; white-space:pre-wrap; }
.fc-actions { margin-top:16px; }
.fc-rate { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:16px; }
.fc-rate .btn { padding:10px 4px; font-size:13px; line-height:1.4; }
.fc-tip { font-size:12px; color:var(--success); text-align:center; min-height:0; margin-bottom:8px; }
.fc-list-item { display:flex; align-items:flex-start; gap:12px; background:var(--card); border-radius:12px; padding:14px 16px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.fc-list-item .fc-list-main { flex:1; min-width:0; }
.fc-list-item .fc-list-front { font-size:14px; font-weight:500; white-space:pre-wrap; }
.fc-list-item .fc-list-meta { font-size:12px; color:var(--muted); margin-top:4px; }

/* 题库悬浮操作按钮（FAB） */
.q-fab {
  position:fixed; right:18px; bottom:90px; z-index:45;
}
.q-fab-btn {
  width:52px; height:52px; border-radius:50%;
  background:linear-gradient(135deg,#4f6ef7,#3a56d8);
  color:#fff; font-size:28px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; box-shadow:0 4px 14px rgba(79,110,247,.45);
  transition:transform .2s, box-shadow .2s;
  user-select:none;
}
.q-fab-btn:active { transform:scale(.92); }
.q-fab-menu {
  position:absolute; right:0; bottom:64px;
  background:var(--card); border-radius:12px;
  box-shadow:0 4px 18px rgba(0,0,0,.18);
  overflow:hidden; min-width:170px;
  animation:fabIn .15s ease-out;
}
@keyframes fabIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.q-fab-item {
  padding:12px 16px; font-size:14px; cursor:pointer;
  border-bottom:1px solid var(--border); white-space:nowrap;
  transition:background .12s;
}
.q-fab-item:last-child { border-bottom:none; }
.q-fab-item:hover { background:var(--bg); }
@media (min-width:601px) {
  /* 桌面端 FAB 离底部远一点 */
  .q-fab { bottom:28px; }
}

@media (max-width:600px) {
  .nav { display:none; }
  .fc-rate { grid-template-columns:repeat(2,1fr); }
  /* 闪卡手机端：更大卡片、提示手势 */
  .fc-front { min-height:160px; display:flex; align-items:center; justify-content:center; padding:32px 20px; font-size:19px; }
  .fc-back { min-height:120px; }
  .fc-tip { font-size:11px; color:var(--muted); }
  .fc-tip::after { content:'（点击卡片翻面 · 左右滑动切换）'; display:block; margin-top:4px; }
}

/* 移动端底部导航 */
.tabbar { display:none; }
@media (max-width:600px) {
  .tabbar {
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:40;
    background:rgba(255,255,255,.96); backdrop-filter:blur(12px);
    border-top:1px solid var(--border);
    padding-bottom:env(safe-area-inset-bottom);
    box-shadow:0 -2px 12px rgba(31,36,48,.06);
  }
  .tabbar button {
    flex:1; background:none; border:none; cursor:pointer;
    padding:7px 0 6px; color:var(--muted); font-size:11px;
    display:flex; flex-direction:column; align-items:center; gap:2px;
    transition:color .15s;
  }
  .tabbar button span { font-size:19px; line-height:1.2; }
  .tabbar button.active { color:var(--primary); font-weight:600; }
  .tabbar button.active span { transform:translateY(-1px); }
  body { padding-bottom:calc(62px + env(safe-area-inset-bottom)); }
  .more-sheet { max-width:520px; }
  .more-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:6px; }
  .more-grid button {
    background:var(--bg); border:none; border-radius:12px; padding:18px 10px;
    font-size:14px; color:var(--text); cursor:pointer;
    display:flex; flex-direction:column; align-items:center; gap:6px;
  }
  .more-grid button span { font-size:22px; }
}

/* 移动端整体风格 */
@media (max-width:600px) {
  :root { --radius:16px; }
  .topbar {
    padding:12px 16px;
    background:linear-gradient(135deg,#4f6ef7 0%,#6d8bff 100%);
    box-shadow:0 2px 10px rgba(79,110,247,.22);
  }
  .topbar h1 { font-size:17px; letter-spacing:.5px; }
  .topbar .user { gap:8px; font-size:13px; }
  .container { padding:12px; }
  .card { border-radius:16px; padding:16px; margin-bottom:12px; box-shadow:0 2px 8px rgba(31,36,48,.06); }
  .card-title { font-size:15px; margin-bottom:10px; }
  .stat-grid { gap:8px; margin-bottom:12px; }
  .stat-card { border-radius:14px; padding:14px 8px; }
  .stat-card .num { font-size:21px; }
  .stat-card .label { font-size:11px; }
  .list-item { padding:12px 0; }
  .filter-row, .btn-row { gap:8px; }
  .btn { padding:9px 14px; font-size:13px; }
  .sheet { border-radius:18px 18px 0 0; }
}

/* 逾期提醒条 */
.overdue-bar { background:#fde8e7; color:#d1483c; padding:12px 16px; border-radius:10px; margin-bottom:16px; font-size:13px; cursor:pointer; }
.overdue-bar:hover { background:#fbd9d7; }

/* 学习热力图 */
.hm-streak { font-size:13px; color:var(--muted); font-weight:400; }
.hm-streak b { color:var(--error); }
.heatmap { display:flex; gap:4px; overflow-x:auto; padding-bottom:4px; }
.hm-col { display:flex; flex-direction:column; gap:4px; }
.hm-cell { width:12px; height:12px; border-radius:3px; background:#ebedf0; }
.hm0 { background:#ebedf0; }
.hm1 { background:#cfe0ff; }
.hm2 { background:#9dbcff; }
.hm3 { background:#6d90f8; }
.hm4 { background:#3a56d8; }
.hm-legend { display:flex; align-items:center; gap:4px; margin-top:10px; font-size:11px; color:var(--muted); }
.hm-legend i { display:inline-block; }

/* 重复任务 / 子任务 */
.tag.repeat { background:#eef4ff; color:var(--primary-dark); }
.task-row.sub { padding-left:26px; }
.task-row.sub .t-title { font-size:14px; }

/* 计划模板 */
.template-card { display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--border); }
.template-card:last-child { border-bottom:none; }
.template-card .tc-main { flex:1; min-width:0; }
.template-card .tc-name { font-size:15px; font-weight:600; }
.template-card .tc-desc { font-size:13px; color:var(--muted); margin:5px 0; }
.template-card .tc-meta { font-size:12px; color:var(--muted); }

/* 学习统计 */
.trend-chart { display:flex; gap:4px; overflow-x:auto; padding-bottom:2px; }
.trend-col { flex:1; min-width:9px; display:flex; flex-direction:column; }
.trend-bar-area { height:120px; display:flex; align-items:flex-end; }
.trend-bar { width:100%; background:var(--primary); border-radius:3px 3px 0 0; transition:height .3s; }
.trend-bar:hover { background:var(--primary-dark); }
.trend-label { height:14px; margin-top:4px; font-size:10px; color:var(--muted); text-align:center; white-space:nowrap; }
.rp-metric { margin-bottom:14px; }
.rp-metric:last-of-type { margin-bottom:8px; }
.rp-metric-head { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:var(--muted); margin-bottom:7px; }
.rp-metric-head b { font-size:13px; color:var(--text); font-weight:500; }
.rp-extra { font-size:12px; color:var(--muted); line-height:1.8; padding-top:10px; border-top:1px solid var(--border); }
.rp-extra b { color:var(--primary); }
.rp-tag-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.rp-tag-row:last-child { margin-bottom:0; }
.rp-tag-name { width:80px; flex-shrink:0; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rp-tag-barwrap { flex:1; height:8px; background:#edf0f7; border-radius:4px; overflow:hidden; }
.rp-tag-bar { height:100%; background:var(--primary); border-radius:4px; transition:width .3s; }
.rp-tag-val { min-width:26px; text-align:right; font-size:12px; color:var(--muted); }
.rp-weak-name { flex:1; min-width:0; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rp-weak-barwrap { width:120px; flex-shrink:0; height:8px; background:#edf0f7; border-radius:4px; overflow:hidden; }
.rp-weak-rate { min-width:86px; text-align:right; font-size:12px; color:var(--muted); }
.ex-sec { margin-bottom:12px; }
.ex-sec b { display:block; font-size:12px; color:var(--primary); margin-bottom:4px; }
.ex-sec p { margin:0; font-size:13px; line-height:1.75; white-space:pre-wrap; }
.rp-table { width:100%; border-collapse:collapse; font-size:13px; }
.rp-table th, .rp-table td { padding:8px 6px; border-bottom:1px solid var(--border); text-align:right; }
.rp-table th:first-child, .rp-table td:first-child { text-align:left; }
.rp-table th { color:var(--muted); font-weight:500; }
.rp-table tbody tr:last-child td { border-bottom:none; }

@media (max-width:600px) {
  .rp-tag-name { width:64px; }
  .trend-label { font-size:9px; }
}

/* AI 进阶 */
.ai-tabs { overflow-x:auto; padding-bottom:2px; }
.ai-tabs .tab { flex:none; white-space:nowrap; }
/* 手机端 AI 子导航排两行（每行 3 个），避免横向滚动截断 */
@media (max-width:600px) {
  .ai-tabs { flex-wrap:wrap; overflow-x:visible; gap:8px; }
  .ai-tabs .tab { flex:1 1 calc(33.333% - 6px); text-align:center; padding:8px 4px; }
}
.ai-panel { display:none; }
.ai-panel.active { display:block; }
.ai-hint { font-size:13px; color:var(--muted); line-height:1.7; margin-bottom:14px; }
.paper-head .ai-meta { border-bottom:none; padding-bottom:0; margin-bottom:0; }
.paper-option { border:1px solid var(--border); border-radius:8px; padding:10px 12px; margin-bottom:8px; font-size:14px; line-height:1.5; cursor:pointer; transition:all .15s; }
.paper-option:hover { border-color:var(--primary); }
.paper-option.sel { border-color:var(--primary); background:#f0f3ff; color:var(--primary-dark); font-weight:500; }
.paper-option.locked { pointer-events:none; }
.paper-option.right { border-color:var(--success); background:#e5f7ed; color:#1f9d5d; }
.paper-option.wrong { border-color:var(--error); background:#fde8e7; color:#d1483c; }
.paper-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; }
.paper-res { display:none; flex:1; font-size:13px; color:var(--muted); line-height:1.6; }
.ai-score { font-size:38px; font-weight:700; line-height:1; }
.ai-score span { font-size:13px; font-weight:500; margin-left:2px; }
.ai-grade-head { display:flex; align-items:center; gap:16px; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid var(--border); }
.ai-verdict { font-size:16px; font-weight:600; }
.ai-missing { background:#fff7e6; border-radius:10px; padding:12px 14px; margin-bottom:12px; font-size:13px; line-height:1.7; }
.ai-missing ul { margin:6px 0 0 18px; }
.ai-ref { background:#f7f9ff; border-radius:10px; padding:12px 14px; font-size:13px; line-height:1.7; }
.ai-plan-day { display:flex; justify-content:space-between; align-items:center; font-size:14px; font-weight:600; margin:14px 0 4px; padding-top:8px; border-top:1px dashed var(--border); }
.ai-plan-day:first-of-type { margin-top:4px; border-top:none; }
.ai-plan-day .d { color:var(--primary); }
.brief-content { white-space:pre-wrap; line-height:1.9; }
.fc-tts { display:flex; gap:8px; justify-content:center; margin-top:10px; }

/* 计时模考 */
.exam-bar { position:sticky; top:0; z-index:20; display:flex; align-items:center; gap:12px; background:var(--card); border-radius:12px; padding:10px 14px; margin-bottom:12px; box-shadow:0 2px 8px rgba(0,0,0,.08); }
.exam-timer { font-size:22px; font-weight:700; color:var(--primary); font-variant-numeric:tabular-nums; }
.exam-timer.warn { color:var(--error); animation:exam-pulse 1s infinite; }
@keyframes exam-pulse { 0%,100% { opacity:1; } 50% { opacity:.55; } }
.exam-progress { flex:1; font-size:13px; color:var(--muted); }
.exam-q { margin-bottom:14px; }
.exam-result-item { border:1px solid var(--border); border-left:4px solid var(--success); border-radius:10px; padding:12px 14px; margin-bottom:10px; background:var(--card); }
.exam-result-item.bad { border-left-color:var(--error); }
.exam-answers { font-size:13px; color:var(--muted); margin-top:6px; }
.exam-history-item { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px dashed var(--border); }
.exam-history-item:last-child { border-bottom:none; }
.exam-history-item .e-main { flex:1; min-width:0; }
.exam-history-item .e-title { font-size:14px; font-weight:500; }
.exam-history-item .e-meta { font-size:12px; color:var(--muted); margin-top:3px; }
.exam-history-item .e-score { font-size:20px; font-weight:700; white-space:nowrap; }
.exam-history-item .e-score span { font-size:11px; font-weight:500; margin-left:1px; }

/* 答题卡（手机端逐题模式） */
.exam-card-panel {
  background:var(--card); border-radius:12px; padding:12px; margin-bottom:12px;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.exam-card-grid {
  display:grid; grid-template-columns:repeat(8,1fr); gap:8px;
}
.exam-card-item {
  width:100%; aspect-ratio:1; display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:500; border-radius:8px; cursor:pointer;
  background:var(--bg); color:var(--muted); transition:all .15s;
  user-select:none;
}
.exam-card-item:hover { background:var(--border); }
.exam-card-item.answered { background:var(--primary); color:#fff; }
.exam-card-item.current { box-shadow:0 0 0 2px var(--primary); }
@media (max-width:400px) { .exam-card-grid { grid-template-columns:repeat(6,1fr); } }

/* 文件导入说明 */
.import-help { font-size:12px; color:var(--muted); background:var(--bg); border-radius:8px; padding:10px 12px; line-height:1.9; margin-bottom:12px; }
.import-help code { background:var(--card); padding:1px 5px; border-radius:4px; color:var(--text); }

@media (max-width:600px) {
  .ai-grade-head { gap:12px; }
  .ai-score { font-size:32px; }
}


/* 禁用态按钮（已拉取完成的套卷等） */
.btn:disabled, .btn[disabled] { opacity:.45; cursor:not-allowed; box-shadow:none; }
.btn:disabled:hover, .btn[disabled]:hover { transform:none; }
