/* ============================================================
 * app.css — 学习工作台（细边框 / 编辑式 / 少装饰）
 * ============================================================ */

.ic-s { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic-s svg { width: 100%; height: 100%; }

/* ---------------- 骨架 ---------------- */
.app-shell {
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: 100vh; height: 100dvh; overflow: hidden; background: var(--paper-2);
}

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px 12px;
  overflow-y: auto; z-index: 60; min-height: 0;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.sb-logo {
  width: 32px; height: 32px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
}
.sb-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.sb-en { font-family: var(--mono); font-size: 8.5px; letter-spacing: 1.2px; color: var(--faint); }

.sb-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-sm); background: var(--paper-2);
  border: 1px solid var(--line); color: var(--faint); font-size: 12.5px;
  margin-bottom: 14px; transition: border-color .15s, background .15s; width: 100%; text-align: left;
}
.sb-search:hover { border-color: var(--line-2); background: var(--paper); }
.sb-search .k { margin-left: auto; font-family: var(--mono); font-size: 10px; border: 1px solid var(--line-2); border-radius: var(--r-xs); padding: 0 4px; }

.sb-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); transition: background .14s, color .14s; position: relative;
  border-left: 2px solid transparent;
}
.sb-link:hover { background: var(--paper-2); color: var(--ink); }
.sb-link.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; border-left-color: var(--brand); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.sb-link .sb-ic { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.sb-link.active .sb-ic { opacity: 1; }
.sb-link .sb-badge { margin-left: auto; font-family: var(--mono); font-size: 10px; padding: 0 6px; border-radius: var(--r-xs); background: var(--paper-3); color: var(--muted); }
.sb-link .sb-badge.hot { background: var(--err-soft); color: var(--err); }

.sb-foot { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 10px; }
.sb-level { padding: 2px 8px 4px; }
.sb-level .lv-ring { font-family: var(--mono); font-weight: 600; color: var(--brand); }
.sb-level .lv-t { font-size: 12.5px; font-weight: 700; }
.sb-level .lv-s { font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.sb-reset { width: 100%; margin-top: 6px; font-size: 11.5px; color: var(--faint); padding: 7px; border-radius: var(--r-sm); transition: background .15s, color .15s; }
.sb-reset:hover { background: var(--paper-2); color: var(--err); }

.side-scrim { display: none; }

/* ---------------- 主区 ---------------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
  background: var(--paper); border-bottom: 1px solid var(--line); z-index: 30;
}
.menu-btn { display: none; width: 34px; height: 34px; border-radius: var(--r-sm); align-items: center; justify-content: center; color: var(--ink-2); }
.menu-btn:hover { background: var(--paper-2); }
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--paper-2); color: var(--faint); font-size: 12.5px; min-width: 180px;
}
.search-trigger:hover { border-color: var(--line-2); color: var(--muted); }
.search-trigger .k { margin-left: auto; font-family: var(--mono); font-size: 10px; border: 1px solid var(--line-2); border-radius: var(--r-xs); padding: 0 4px; }
.streak-chip { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--warn); }
.back-home { display: inline-flex; }

.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 24px 26px 64px; }
.content-inner { max-width: 1080px; margin: 0 auto; }

/* ---------------- 页头 ---------------- */
.page-head { margin-bottom: 22px; }
.ph-title { font-size: 23px; font-weight: 700; letter-spacing: -.2px; line-height: 1.45; }
.ph-sub { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 700px; line-height: 1.85; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------------- 区块 ---------------- */
.block { margin-top: 26px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.block-head h2 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi-top .l { font-size: 12px; color: var(--muted); }
.kpi-v { font-family: var(--mono); font-size: 25px; font-weight: 600; letter-spacing: -.5px; margin-top: 6px; line-height: 1.25; }
.kpi-v small { font-family: inherit; font-size: 12px; font-weight: 400; color: var(--faint); margin-left: 4px; }
.kpi-s { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ---------------- 继续学习 ---------------- */
.cont-card {
  padding: 20px 22px 18px; border-radius: var(--r);
  background: var(--paper); border: 1px solid var(--line);
}
.cont-card .ct-info { }
.cont-card .ct-k { font-family: var(--mono); font-size: 11px; color: var(--brand); letter-spacing: .3px; }
.cont-card .ct-t { font-size: 17px; font-weight: 700; margin-top: 4px; }
.cont-card .ct-s { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.8; max-width: 720px; }
.cont-card .cont-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.cont-card .cont-foot .progress { flex: 1; }
.cont-card .cont-note { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }

/* ---------------- 分类瓦片 ---------------- */
.cat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cat-tile {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s;
}
.cat-tile:hover { border-color: var(--brand); }
.cat-tile .no { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 1px; }
.cat-tile .ct-main { flex: 1; min-width: 0; }
.cat-tile .t { font-size: 13.5px; font-weight: 600; }
.cat-tile .d { font-size: 11.5px; color: var(--faint); line-height: 1.6; margin-top: 2px; }
.cat-tile .arrow { color: var(--faint); font-family: var(--mono); margin-top: 1px; }
.cat-tile:hover .arrow { color: var(--brand); }

/* ---------------- 课程卡 ---------------- */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.course-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; padding: 16px 18px 14px;
  border-top: 2px solid var(--line-2); transition: border-color .16s;
}
.course-card:hover { border-color: var(--brand); border-top-color: var(--brand); }
.cc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.cc-top .no { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.cc-top .cat { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.cc-top .lvl { margin-left: auto; font-size: 11px; color: var(--faint); }
.cc-body { display: flex; flex-direction: column; flex: 1; }
.cc-body h3 { font-size: 15.5px; font-weight: 700; line-height: 1.5; }
.cc-body .sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.8; flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cc-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 11px; color: var(--faint); font-family: var(--mono); }
.cc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.cc-prog { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--paper-2); }
.cc-prog .pl { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-bottom: 6px; }
.cc-prog .pl b { font-family: var(--mono); font-weight: 500; color: var(--muted); }

/* ---------------- 筛选栏 ---------------- */
.filter-bar { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row .fl { font-size: 11.5px; font-weight: 600; color: var(--faint); min-width: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.sm { padding: 4px 10px; font-size: 12px; }
.search-inline { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--paper); flex: 1; min-width: 180px; }
.search-inline:focus-within { border-color: var(--brand); }
.search-inline input { border: none; outline: none; width: 100%; font-size: 13px; background: transparent; }
.search-inline input:focus-visible { outline: none; }
.result-count { font-size: 12px; color: var(--faint); }

/* ---------------- 课程详情 ---------------- */
.course-hero { border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--r); padding: 24px 26px; background: var(--paper); }
.course-hero .ch-cat { font-family: var(--mono); font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.course-hero h1 { font-size: 24px; font-weight: 700; margin: 10px 0 8px; line-height: 1.4; }
.course-hero p { font-size: 13.5px; color: var(--muted); max-width: 660px; line-height: 1.85; }
.course-hero .ch-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.course-hero .ch-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-hero .ch-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.chapter { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.ch-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.ch-head .no { font-family: var(--mono); font-size: 11px; color: var(--faint); flex-shrink: 0; }
.ch-head .t { font-size: 13.5px; font-weight: 700; }
.ch-head .s { font-size: 11px; color: var(--faint); margin-left: auto; white-space: nowrap; font-family: var(--mono); }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--paper-2); transition: background .14s; }
.lrow:last-child { border-bottom: none; }
.lrow:hover { background: var(--paper-2); }
.lrow .lr-ic { width: 24px; height: 24px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--paper-3); color: var(--muted); font-family: var(--mono); font-size: 11px; }
.lrow.done .lr-ic { background: var(--ok-soft); color: var(--ok); }
.lrow .lr-main { flex: 1; min-width: 0; }
.lrow .lr-t { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow.done .lr-t { color: var(--muted); }
.lrow .lr-s { font-size: 11.5px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lr-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.lrow .lr-dur { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.lrow .lr-go { font-size: 12px; font-weight: 600; color: var(--brand); }

.aside-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; }
.aside-card h4 { font-size: 12.5px; font-weight: 700; margin-bottom: 12px; }
.aside-card .ol { display: flex; flex-direction: column; gap: 10px; }
.aside-card .ol li { display: flex; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.aside-card .ol li .n { font-family: var(--mono); font-size: 10.5px; color: var(--faint); flex-shrink: 0; margin-top: 3px; }
.aside-card .kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--paper-2); }
.aside-card .kv:last-child { border-bottom: none; }
.aside-card .kv .k { color: var(--faint); }
.aside-card .kv .v { font-weight: 600; }
.ring-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 8px; }

/* ---------------- 课时页 ---------------- */
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--faint); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { opacity: .5; font-family: var(--mono); }
.lesson-layout { display: grid; grid-template-columns: 1fr 250px; gap: 28px; align-items: start; }
.lesson-layout > *, .detail-grid > *, .two-col > *, .practice-setup > * { min-width: 0; }
.lesson-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.lesson-head h1 { font-size: 24px; font-weight: 700; line-height: 1.45; letter-spacing: -.2px; }
.lesson-head .lesson-meta { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.lesson-head .lesson-meta span { display: inline-flex; align-items: center; gap: 5px; }

.sec { margin-bottom: 22px; }
.sec h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.sec p { font-size: 14.5px; color: var(--ink-2); line-height: 2; }
.sec p + p { margin-top: 10px; }
.sec ul { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.sec ul li { position: relative; padding-left: 16px; font-size: 14px; color: var(--ink-2); line-height: 1.9; }
.sec ul li::before { content: ''; position: absolute; left: 3px; top: 11px; width: 4px; height: 4px; border-radius: 1px; background: var(--faint); }
.sec pre { margin-top: 12px; background: #1b1e24; color: #dde3ea; border-radius: var(--r-sm); padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.8; font-family: var(--mono); }
.sec pre code { font-family: inherit; white-space: pre; }
.sec .formula { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--paper-2); border-left: 2px solid var(--brand); font-size: 13.5px; color: var(--ink-2); line-height: 1.85; }
.callout { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--info-soft); border-left: 2px solid var(--info); font-size: 13px; color: #274d70; line-height: 1.85; }
.callout.warn { background: var(--warn-soft); border-left-color: var(--warn); color: #6d4511; }
.callout b { font-weight: 700; }
.lesson-fig { margin: 14px 0 6px; }
.lesson-fig img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.lesson-fig figcaption { margin-top: 7px; font-size: 11.5px; color: var(--faint); line-height: 1.7; text-align: center; }

.points { border-left: 2px solid var(--brand); background: var(--paper-2); padding: 14px 18px; margin: 4px 0 24px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.points h4 { font-size: 12px; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.points li { display: flex; gap: 9px; font-size: 13px; color: var(--ink-2); padding: 4px 0; line-height: 1.8; }
.points li svg { flex-shrink: 0; margin-top: 5px; color: var(--ok); }

.lesson-nav { display: flex; gap: 12px; margin-top: 24px; }
.lesson-nav a { flex: 1; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s; }
.lesson-nav a:hover { border-color: var(--brand); }
.lesson-nav .d { font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 4px; }
.lesson-nav .t { font-size: 13px; font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-nav a.next { text-align: right; }
.lesson-nav a.next .d { justify-content: flex-end; }

.toc { position: sticky; top: 0; }
.toc-list { display: flex; flex-direction: column; gap: 1px; max-height: 320px; overflow-y: auto; }
.toc-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-xs); font-size: 12px; color: var(--muted); }
.toc-item:hover { background: var(--paper-2); color: var(--ink); }
.toc-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.toc-item .ti-dot { width: 4px; height: 4px; border-radius: 1px; background: currentColor; opacity: .45; flex-shrink: 0; }
.toc-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.notes-area { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 11px; font-size: 12.5px; line-height: 1.8; resize: vertical; min-height: 84px; outline: none; background: var(--paper-2); }
.notes-area:focus { border-color: var(--brand); background: var(--paper); }
.notes-saved { font-size: 11px; color: var(--ok); margin-top: 5px; height: 14px; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--paper); color: var(--muted); transition: all .15s; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn.on { background: var(--warn-soft); border-color: #e3d3b8; color: var(--warn); }

/* ---------------- 测验 ---------------- */
.quiz { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-top: 26px; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.quiz-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.quiz-head .qn { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--paper-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: var(--r-xs); }
.quiz-sub { font-size: 12px; color: var(--faint); margin-bottom: 14px; }
.q-text { font-size: 15px; font-weight: 600; line-height: 1.8; margin: 6px 0 14px; }
.q-opts { display: flex; flex-direction: column; gap: 8px; }
.q-opt { display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.75; transition: border-color .14s, background .14s; color: var(--ink-2); background: var(--paper); }
.q-opt .key { width: 20px; height: 20px; border-radius: var(--r-xs); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--faint); flex-shrink: 0; margin-top: 1px; }
.q-opt:hover { border-color: var(--brand); }
.q-opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.q-opt.selected .key { border-color: var(--brand); color: var(--brand); }
.q-opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.q-opt.correct .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.q-opt.wrong { border-color: var(--err); background: var(--err-soft); }
.q-opt.wrong .key { background: var(--err); border-color: var(--err); color: #fff; }
.q-opt:disabled { cursor: default; }
.q-explain { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--paper-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }
.q-explain b { color: var(--brand-deep); }
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.q-hint { font-size: 11.5px; color: var(--faint); }
.quiz-done { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r-sm); background: var(--paper-2); border: 1px solid var(--line); }
.quiz-done .sc { font-family: var(--mono); font-size: 30px; font-weight: 600; line-height: 1; color: var(--brand); }
.quiz-done .sc small { font-size: 14px; color: var(--faint); font-weight: 400; }
.quiz-done .txt { font-size: 12.5px; color: var(--muted); }
.quiz-done .txt b { color: var(--ink); font-size: 13.5px; }

/* ---------------- 练习中心 ---------------- */
.practice-setup { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.setup-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.setup-card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.setup-card .s { font-size: 12px; color: var(--faint); margin-bottom: 14px; }
.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.opt-btn { text-align: left; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color .14s, background .14s; background: var(--paper); }
.opt-btn:hover { border-color: var(--brand); }
.opt-btn.active { border-color: var(--brand); background: var(--brand-soft); }
.opt-btn.wide { grid-column: 1 / -1; }
.opt-btn .t { font-size: 13px; font-weight: 600; }
.opt-btn .d { font-size: 11px; color: var(--faint); margin-top: 2px; font-family: var(--mono); }

.mistake-list { display: flex; flex-direction: column; gap: 10px; }
.mistake-item { display: flex; gap: 13px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-left: 2px solid var(--err); border-radius: var(--r); }
.mistake-item.resolved { border-left-color: var(--ok); opacity: .75; }
.mistake-item .mi-main { flex: 1; min-width: 0; }
.mistake-item .mi-t { font-size: 13.5px; font-weight: 600; line-height: 1.75; }
.mistake-item .mi-s { font-size: 11px; color: var(--faint); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.mistake-item .mi-ans { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.8; }

/* ---------------- 学习进度 ---------------- */
.progress-hero { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; padding: 22px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.ring-stack { display: flex; align-items: center; gap: 16px; }
.heatmap-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.hm-scroll { overflow-x: auto; padding-bottom: 4px; }
.hm-inner { width: 100%; }
.hm-months { display: grid; gap: 5px; height: 15px; font-family: var(--mono); font-size: 10px; color: var(--faint); width: 100%; margin-bottom: 5px; }
.hm-months span { white-space: nowrap; }
.hm-grid { display: grid; grid-template-rows: repeat(7, 1fr); gap: 5px; width: 100%; }
.hm-cell { border-radius: 3px; background: var(--paper-3); }
.hm-cell.l1 { background: #d9e6e3; }
.hm-cell.l2 { background: #a9c8c2; }
.hm-cell.l3 { background: #5f948c; }
.hm-cell.l4 { background: var(--brand); }
.hm-cell.today { box-shadow: 0 0 0 1.5px var(--ink); }
.hm-cell.future { opacity: .4; }
.hm-legend { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); margin-top: 12px; justify-content: flex-end; }
.hm-legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.cat-bars { display: flex; flex-direction: column; gap: 14px; }
.cat-bar .cb-top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 500; margin-bottom: 6px; }
.cat-bar .cb-top b { font-family: var(--mono); font-weight: 600; }
.radar-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; text-align: center; }
.radar-wrap h3 { font-size: 13.5px; font-weight: 700; text-align: left; margin-bottom: 4px; }
.radar-wrap canvas { max-width: 100%; height: auto; margin: 6px auto 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------------- 学习路径 ---------------- */
.path-list { display: flex; flex-direction: column; gap: 14px; }
.path-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.path-item.current { border-color: var(--brand); border-left-width: 3px; }
.pi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pi-top h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pi-desc { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.85; max-width: 640px; }
.pi-pills { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--faint); }
.pi-pills span { display: inline-flex; align-items: center; gap: 5px; }
.pi-steps { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pi-step { flex: 1; min-width: 150px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper-2); transition: border-color .15s; }
.pi-step:hover { border-color: var(--brand); }
.pi-step .n { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .5px; }
.pi-step .t { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.pi-step .s { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.pi-step.done { background: var(--ok-soft); border-color: #cfe0d5; }
.pi-prog { margin-top: 14px; display: flex; align-items: center; gap: 12px; }
.pi-prog .progress { flex: 1; }
.pi-prog b { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--brand); }

/* ---------------- 测评 ---------------- */
.assess-card { max-width: 680px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; }
.assess-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 12px; color: var(--faint); gap: 12px; }
.assess-prog { display: flex; gap: 4px; margin-bottom: 18px; }
.assess-prog i { flex: 1; height: 3px; border-radius: 2px; background: var(--paper-3); }
.assess-prog i.on { background: var(--brand); }
.assess-q { font-size: 17px; font-weight: 700; line-height: 1.7; margin-bottom: 6px; }
.assess-note { font-size: 12px; color: var(--faint); margin-bottom: 16px; }
.assess-result { text-align: center; }
.assess-result .ar-lv { font-family: var(--mono); font-size: 46px; font-weight: 600; color: var(--brand); line-height: 1.1; }
.assess-result .ar-nm { font-size: 16px; font-weight: 700; margin-top: 4px; }
.assess-result .ar-res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.assess-result .ar-res > div { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px; }
.assess-result .ar-res .v { font-size: 18px; font-weight: 700; }
.assess-result .ar-res .k { font-size: 11px; color: var(--faint); margin-top: 2px; }
.next-action { background: var(--paper-2); border-left: 2px solid var(--brand); padding: 13px 15px; font-size: 13px; line-height: 1.85; color: var(--ink-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.next-action b { color: var(--brand-deep); }

/* ---------------- 搜索浮层 ---------------- */
.search-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(24, 27, 32, .32); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 18px 18px; animation: fadeIn .14s ease; }
.search-panel { width: 100%; max-width: 600px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-field input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; }
.search-field input:focus-visible { outline: none; }
.search-field .esc { font-family: var(--mono); font-size: 10px; color: var(--faint); border: 1px solid var(--line-2); border-radius: var(--r-xs); padding: 1px 5px; }
.search-body { max-height: 52vh; overflow-y: auto; padding: 6px; }
.sr-group { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--faint); padding: 10px 10px 5px; }
.sr-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; }
.sr-item:hover, .sr-item.sel { background: var(--paper-2); }
.sr-item .ic { width: 26px; height: 26px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--paper-3); color: var(--muted); }
.sr-item .t { font-size: 13.5px; font-weight: 500; }
.sr-item .t mark { background: #f2e3c2; color: #6d4511; border-radius: 2px; padding: 0 1px; }
.sr-item .s { font-size: 11.5px; color: var(--faint); }
.sr-empty { padding: 36px 20px; text-align: center; color: var(--faint); font-size: 13px; }
.search-foot { border-top: 1px solid var(--line); padding: 8px 14px; display: flex; gap: 14px; font-size: 11px; color: var(--faint); }
.search-foot span { display: inline-flex; align-items: center; gap: 4px; }
.search-foot b { border: 1px solid var(--line-2); border-radius: var(--r-xs); padding: 0 4px; font-weight: 500; font-family: var(--mono); }

/* ---------------- 弹窗 ---------------- */
.modal-mask { position: fixed; inset: 0; z-index: 80; background: rgba(24, 27, 32, .4); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .14s ease; }
.modal { background: var(--paper); border-radius: var(--r-lg); width: 100%; max-width: 540px; max-height: 86vh; overflow-y: auto; padding: 24px 26px; box-shadow: var(--shadow-pop); animation: fadeUp .18s ease; }
.modal h3 { font-size: 18px; font-weight: 700; }
.modal .m-sub { font-size: 13px; color: var(--muted); margin: 5px 0 16px; line-height: 1.75; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------------- 结业证书 ---------------- */
.certificate { background: var(--paper); border: 1px solid #dcc99a; border-radius: var(--r); padding: 32px; text-align: center; position: relative; }
.certificate .c-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: #a8873f; }
.certificate .c-title { font-size: 24px; font-weight: 700; letter-spacing: 5px; color: #7d6224; margin: 8px 0 14px; }
.certificate .c-name { font-size: 16px; font-weight: 700; }
.certificate .c-line { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 8px; }
.certificate .c-date { font-size: 11.5px; color: var(--faint); margin-top: 16px; font-family: var(--mono); }
.certificate .c-seal { position: absolute; right: 30px; bottom: 24px; width: 66px; height: 66px; opacity: .85; }

/* ---------------- 收藏笔记网格 ---------------- */
.notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.note-card { padding: 18px; display: block; transition: border-color .15s, background .15s; }
.note-card:hover { border-color: var(--brand); background: #fdfdfd; }
.note-title { font-size: 14.5px; font-weight: 700; margin: 6px 0 8px; }
.note-body { font-size: 12.5px; color: var(--muted); line-height: 1.8; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.note-date { font-size: 11px; color: var(--faint); margin-top: 10px; font-family: var(--mono); }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .e-ic { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: var(--r); border: 1px solid var(--line-2); color: var(--faint); display: flex; align-items: center; justify-content: center; }
.empty h3 { font-size: 15px; font-weight: 700; color: var(--ink); }
.empty p { font-size: 12.5px; margin-top: 4px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .toc { position: static; }
  .two-col, .practice-setup { grid-template-columns: 1fr; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow-pop); }
  .app-shell.nav-open .sidebar { transform: none; }
  .app-shell.nav-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(24, 27, 32, .36); z-index: 50; animation: fadeIn .18s; }
  .menu-btn { display: flex; }
  .search-trigger { min-width: 0; padding: 7px 9px; }
  .search-trigger span.lbl, .search-trigger .k { display: none; }
  .back-home { display: flex; }
  .content { padding: 18px 16px 56px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .progress-hero { grid-template-columns: 1fr; }
  .ring-stack { justify-content: center; }
  .notes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi-v { font-size: 22px; }
  .course-grid, .cat-tiles, .two-col { grid-template-columns: 1fr; }
  .ph-title { font-size: 20px; }
  .lesson-head h1 { font-size: 20px; }
  .course-hero { padding: 20px; }
  .course-hero h1 { font-size: 20px; }
  .lesson-aside { grid-template-columns: 1fr; }
  .assess-card { padding: 20px 18px; }
  .assess-result .ar-res { grid-template-columns: 1fr; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav a.next { text-align: left; }
  .lesson-nav a.next .d { justify-content: flex-start; }
  .quiz { padding: 16px; }
  .path-item { padding: 16px; }
  .streak-chip { display: none; }
  .tb-title { font-size: 13px; }
  .cont-card { padding: 16px; }
  .certificate .c-seal { display: none; }
  .hm-months { gap: 3px; font-size: 9px; height: 13px; }
  .hm-grid { gap: 3px; }
}
