/* =========================================================
   智能体学习台 — 样式
   ========================================================= */

:root {
  --paper: #f6f4ef;
  --card: #ffffff;
  --ink: #191b1f;
  --ink2: #3f454d;
  --muted: #7d838c;
  --line: #e8e3d9;
  --line2: #f1ede6;
  --accent: #b8452f;
  --accent-ink: #8e3221;
  --accent-soft: #fbece7;
  --teal: #2f6f5e;
  --teal-soft: #e9f1ee;
  --gold: #a97c25;
  --radius: 14px;
  --shadow-s: 0 1px 2px rgba(25, 27, 31, .05);
  --shadow-m: 0 2px 6px rgba(25, 27, 31, .05), 0 12px 32px -12px rgba(25, 27, 31, .16);
  --sidebar-w: 272px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: #f4d9cf; }

/* ---------- 侧边栏 ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #fffdfa;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line2);
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -.01em;
}
.brand-dot {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(145deg, #c34f36, #8e3221);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.brand-sub {
  margin: 6px 0 0 36px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .04em;
}

.side-search {
  padding: 14px 14px 6px;
}
.side-search form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f2ec;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 10px;
  transition: border-color .18s, background .18s;
}
.side-search form:focus-within {
  background: #fff;
  border-color: #dfd7c9;
}
.side-search svg { flex: none; color: var(--muted); }
.side-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  padding: 9px 0;
  font-size: 13.5px;
  min-width: 0;
}

.side-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 20px;
  overscroll-behavior: contain;
}
.side-scroll::-webkit-scrollbar { width: 8px; }
.side-scroll::-webkit-scrollbar-thumb { background: #e2dcd1; border-radius: 8px; border: 2px solid #fffdfa; }

.side-group-title {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a8a49c;
  padding: 16px 10px 7px;
  font-weight: 600;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink2);
  font-size: 14px;
  transition: background .15s, color .15s;
}
.side-link svg { color: #9a968e; flex: none; }
.side-link:hover { background: #f5f2ec; color: var(--ink); }
.side-link.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-link.is-active svg { color: var(--accent); }
.side-link .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.side-course {
  display: block;
  padding: 10px 10px 11px;
  border-radius: 10px;
  margin-bottom: 2px;
  transition: background .15s;
}
.side-course:hover { background: #f5f2ec; }
.side-course.is-active { background: #f7f4ee; box-shadow: inset 0 0 0 1px #ece6db; }
.side-course-top {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.side-course-idx {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  color: #b3aa9a;
  font-variant-numeric: tabular-nums;
}
.side-course-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.005em;
}
.side-course-meta {
  margin-top: 5px;
  margin-left: 20px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-mini-bar {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: #ece7dd;
  overflow: hidden;
}
.side-mini-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.side-foot {
  border-top: 1px solid var(--line2);
  padding: 12px 18px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side-foot b { color: var(--ink2); font-weight: 600; }

/* ---------- 手机顶栏 / 底部导航 ---------- */

.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  height: 54px;
  padding: 0 8px 0 4px;
  align-items: center;
  gap: 4px;
  background: rgba(246, 244, 239, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(232, 227, 217, .8);
}
.topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--ink2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: rgba(0,0,0,.06); }

.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: rgba(255, 253, 250, .94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0 7px;
  font-size: 10.5px;
  color: #96928a;
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--accent); font-weight: 600; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(25, 20, 16, .34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
  z-index: 55;
}

/* ---------- 主区域 ---------- */

.shell { margin-left: var(--sidebar-w); min-height: 100vh; }

.content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 46px 40px 110px;
}
.content.wide { max-width: 1320px; }

.page-head { margin-bottom: 26px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
h1.page-title {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.025em;
  margin: 0 0 8px;
  font-weight: 750;
}
.page-desc {
  color: var(--ink2);
  font-size: 14.5px;
  max-width: 66ch;
  margin: 0;
}

/* ---------- 首页 ---------- */

.hero {
  position: relative;
  padding: 34px 34px 30px;
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, #fdf6f1 0%, rgba(253, 246, 241, 0) 55%),
    #fffdfa;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -70px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 69, 47, .09), rgba(184, 69, 47, 0) 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 34px;
  line-height: 1.3;
  letter-spacing: -.03em;
  margin: 0 0 12px;
  font-weight: 780;
  max-width: 24ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  background: linear-gradient(180deg, transparent 62%, #f7dcd2 62%);
  padding: 0 2px;
}
.hero p.lead {
  margin: 0 0 22px;
  color: var(--ink2);
  max-width: 52ch;
  font-size: 14.5px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line2);
  position: relative;
  z-index: 1;
}
.hs { display: flex; align-items: baseline; gap: 7px; }
.hs b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.hs span { font-size: 12px; color: var(--muted); }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:hover { border-color: #d9d2c5; box-shadow: var(--shadow-s); }
.btn:active { transform: scale(.985); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(142, 50, 33, .24), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover { background: #ad3f2a; border-color: #ad3f2a; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .04); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.section {
  margin-top: 40px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 17px;
  margin: 0;
  letter-spacing: -.01em;
  font-weight: 700;
}
.section-head .more {
  font-size: 12.5px;
  color: var(--muted);
}
.section-head .more:hover { color: var(--accent); }

/* 课程卡 */

.course-grid { display: grid; gap: 14px; }

.course-card {
  position: relative;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-s);
  transition: transform .16s, box-shadow .2s, border-color .2s;
  overflow: hidden;
}
.course-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cc, var(--accent));
  opacity: .85;
}
.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-m);
  border-color: #ddd5c7;
}
.cc-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.cc-num {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  color: #b3aa9a;
  padding-top: 3px;
  letter-spacing: .04em;
}
.cc-body { flex: 1; min-width: 0; }
.cc-stage {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .05em;
  margin-bottom: 3px;
}
.cc-title {
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 3px;
}
.cc-sub { font-size: 12.5px; color: var(--muted); }
.cc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cc-meta .pct { color: var(--ink2); font-weight: 600; }
.bar {
  height: 4px;
  border-radius: 4px;
  background: #efeae1;
  overflow: hidden;
  margin-top: 9px;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--cc, var(--accent));
  transition: width .4s ease;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 11px;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: #f5f2ec;
  color: #6d6a63;
  white-space: nowrap;
}

/* 继续学习 */
.resume {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: #fffdfa;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
}
.resume-thumb {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.resume-body { flex: 1; min-width: 0; }
.resume-label { font-size: 11px; color: var(--muted); letter-spacing: .06em; margin-bottom: 2px; }
.resume-title {
  font-size: 14.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resume-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 路线 */
.route { position: relative; padding-left: 4px; }
.route-item {
  display: flex;
  gap: 16px;
  padding-bottom: 22px;
  position: relative;
}
.route-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px; top: 30px; bottom: 6px;
  width: 1px;
  background: var(--line);
}
.route-dot {
  flex: none;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  z-index: 1;
  font-family: Georgia, serif;
}
.route-item.done .route-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.route-item.active .route-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.route-body { padding-top: 2px; }
.route-stage { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.route-title { font-size: 15px; font-weight: 650; margin: 1px 0 2px; }
.route-desc { font-size: 13px; color: var(--ink2); line-height: 1.6; }

/* 最近笔记 */
.note-grid { display: grid; gap: 10px; }
.note-card {
  display: block;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-s);
  transition: border-color .16s, box-shadow .18s;
}
.note-card:hover { border-color: #dcd5c7; box-shadow: var(--shadow-m); }
.note-card .nc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.note-card .nc-title { font-size: 13.5px; font-weight: 600; }
.note-card .nc-body {
  font-size: 13px;
  color: var(--ink2);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

/* ---------- 课程详情 ---------- */

.course-hero {
  padding: 30px 32px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffdfa;
  box-shadow: var(--shadow-s);
  display: flex;
  gap: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.course-hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--cc, var(--accent));
}
.ch-hero-main { flex: 1; min-width: 0; }
.ch-hero-main h1 {
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -.025em;
  font-weight: 750;
}
.ch-hero-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.ch-hero-desc { font-size: 13.5px; color: var(--ink2); max-width: 62ch; margin: 0 0 14px; }
.ring-wrap { flex: none; display: grid; place-items: center; position: relative; }
.ring-text {
  position: absolute;
  text-align: center;
  line-height: 1.1;
}
.ring-text b { font-size: 20px; font-family: Georgia, serif; font-weight: 600; }
.ring-text span { display: block; font-size: 10px; color: var(--muted); letter-spacing: .08em; }

.chapter {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-s);
  margin-bottom: 12px;
}
.chapter-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: #fdfbf7;
  border-bottom: 1px solid var(--line2);
  font-size: 13.5px;
  font-weight: 650;
  cursor: default;
}
.chapter-head .ch-idx {
  font-family: Georgia, serif;
  font-size: 12px;
  color: #b3aa9a;
  font-variant-numeric: tabular-nums;
}
.chapter-head .ch-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line2);
  transition: background .14s;
  -webkit-tap-highlight-color: transparent;
}
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: #fbf8f2; }
.lesson-row.is-current { background: var(--accent-soft); }
.lesson-row.is-current .lr-title { color: var(--accent-ink); font-weight: 650; }

.lr-status {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid #ddd6c9;
  display: grid; place-items: center;
  color: transparent;
  font-size: 10px;
  background: #fff;
}
.lesson-row.is-done .lr-status {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.lesson-row.is-started .lr-status {
  border-color: var(--accent);
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
}
.lr-main { flex: 1; min-width: 0; }
.lr-title {
  font-size: 13.8px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lr-title .lab {
  font-size: 10.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-weight: 600;
  vertical-align: 1px;
}
.lr-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
  display: flex;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.lr-dur {
  flex: none;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  letter-spacing: -.02em;
}
.lr-note-badge {
  flex: none;
  font-size: 10.5px;
  color: var(--gold);
  background: #fbf3e2;
  border-radius: 5px;
  padding: 1px 6px;
}

/* ---------- 播放页 ---------- */

.lesson-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 26px;
  align-items: start;
}

.player-card {
  background: #0d0e10;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .4);
  position: relative;
}
.player-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  outline: none;
}
.video-shell { position: relative; }

.player-meta { margin-top: 18px; }
.pm-crumb {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pm-crumb a:hover { color: var(--accent); }
.lesson-title {
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -.02em;
  margin: 6px 0 8px;
  font-weight: 720;
}
.pm-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  align-items: center;
}
.pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0ece4;
  color: #6d6a63;
  font-weight: 600;
}
.pill.done { background: var(--teal-soft); color: var(--teal); }
.pill.doing { background: var(--accent-soft); color: var(--accent-ink); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffdfa;
  border: 1px solid var(--line);
}
.toolbar .spacer { flex: 1; }
.speed-group {
  display: inline-flex;
  background: #f3efe7;
  border-radius: 9px;
  padding: 2px;
  gap: 1px;
}
.speed-group button {
  border: 0;
  background: transparent;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--ink2);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.speed-group button.is-on { background: #fff; color: var(--accent); font-weight: 700; box-shadow: var(--shadow-s); }

/* 笔记 */
.notes-block { margin-top: 30px; }
.notes-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.notes-head h2 { font-size: 16px; margin: 0; font-weight: 700; }
.notes-head .n { font-size: 12px; color: var(--muted); }

.composer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.composer:focus-within { border-color: #d8cfbe; box-shadow: var(--shadow-m); }
.composer textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  padding: 13px 15px;
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  min-height: 78px;
  background: transparent;
  color: var(--ink);
}
.composer textarea::placeholder { color: #b0aca4; }
.composer-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-top: 1px solid var(--line2);
  background: #fdfbf7;
}
.composer-foot .hint { font-size: 11px; color: #a8a49c; }
.composer-foot .spacer { flex: 1; }
.ts-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ts-btn:hover { border-color: #d8cfbe; color: var(--accent); }

.note-list { margin-top: 16px; display: grid; gap: 10px; }
.note-item {
  position: relative;
  padding: 13px 15px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-s);
}
.note-item .ni-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ts-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 0;
  cursor: pointer;
  letter-spacing: -.02em;
}
.ts-chip:hover { background: #f7ddd4; }
.ni-time { font-size: 11px; color: #a8a49c; }
.ni-actions { margin-left: auto; display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.note-item:hover .ni-actions { opacity: 1; }
.ni-body {
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink2);
}
.ni-edit { display: none; }
.note-item.editing .ni-body { display: none; }
.note-item.editing .ni-edit { display: block; }
.ni-edit textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  min-height: 90px;
  resize: vertical;
  outline: none;
}
.empty {
  padding: 26px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: #fdfbf7;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* 章节侧栏 */
.outline {
  position: sticky;
  top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.outline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
  font-size: 12.5px;
  font-weight: 650;
}
.outline-head .count { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.outline-body { max-height: calc(100vh - 190px); overflow-y: auto; padding: 6px 8px 12px; }
.outline-body::-webkit-scrollbar { width: 7px; }
.outline-body::-webkit-scrollbar-thumb { background: #e2dcd1; border-radius: 8px; }
.ol-ch {
  font-size: 11px;
  color: #a19c93;
  padding: 10px 8px 4px;
  letter-spacing: .04em;
  font-weight: 650;
}
.ol-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6.5px 8px;
  border-radius: 8px;
  font-size: 12.8px;
  color: var(--ink2);
  line-height: 1.45;
}
.ol-item:hover { background: #f5f2ec; }
.ol-item.is-current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.ol-dot {
  flex: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.2px solid #ddd6c9;
  display: grid; place-items: center;
  font-size: 9px;
  color: transparent;
}
.ol-item.is-done .ol-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.ol-item.is-current .ol-dot { border-color: var(--accent); }
.ol-t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 笔记页 ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}
.filter-chip {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  cursor: pointer;
}
.filter-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  margin-left: auto;
  min-width: 200px;
}
.search-inline input {
  border: 0; outline: none; padding: 7px 0; font-size: 13px;
  background: transparent; width: 100%; min-width: 0;
}

.group-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: .04em;
  margin: 22px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 讲义 ---------- */

.doc-grid { display: grid; gap: 10px; }
.doc-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-s);
  transition: border-color .16s, transform .16s, box-shadow .18s;
}
.doc-card:hover { border-color: #dcd5c7; transform: translateY(-1px); box-shadow: var(--shadow-m); }
.doc-ico {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: #f4f1ea;
  color: #8d887e;
  display: grid; place-items: center;
}
.doc-t { font-size: 14px; font-weight: 620; line-height: 1.5; }
.doc-m { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

.reader {
  max-width: 760px;
  margin: 0 auto;
}
.reader-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.reader-head h1 {
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: -.02em;
  margin: 4px 0 8px;
  font-weight: 740;
}
.reader-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.article {
  font-size: 15.5px;
  line-height: 1.95;
  color: #2b2f34;
}
.article p { margin: 0 0 1.05em; }
.article h3 {
  font-size: 17.5px;
  margin: 1.9em 0 .7em;
  letter-spacing: -.01em;
  font-weight: 720;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  line-height: 1.4;
}
.article h4 {
  font-size: 15.5px;
  margin: 1.5em 0 .5em;
  font-weight: 700;
  color: var(--ink);
}
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1em 0 1.4em;
  font-size: 13.5px;
  line-height: 1.7;
  display: block;
  overflow-x: auto;
}
.article th, .article td {
  border: 1px solid var(--line);
  padding: 8px 11px;
  text-align: left;
  vertical-align: top;
}
.article th { background: #faf7f1; font-weight: 650; }
.article ul, .article ol { padding-left: 1.4em; margin: 0 0 1em; }
.article li { margin-bottom: .35em; }
.article strong { color: #14171a; font-weight: 700; }
.article blockquote {
  margin: 1.2em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--ink2);
}
.read-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  width: 0;
  z-index: 70;
  transition: width .1s linear;
}

/* ---------- 统计 ---------- */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-s);
}
.stat-card .k { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.stat-card .v {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-top: 2px;
  line-height: 1.2;
}
.stat-card .v small { font-size: 12px; color: var(--muted); font-family: var(--font); margin-left: 3px; font-weight: 500; }

.heat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13px, 1fr));
  gap: 3px;
  margin-top: 4px;
}
.heat i {
  aspect-ratio: 1;
  border-radius: 3px;
  background: #eee9e1;
  display: block;
  min-height: 11px;
}
.heat i.l1 { background: #f2d8ce; }
.heat i.l2 { background: #e5ac9c; }
.heat i.l3 { background: #cf7a63; }
.heat i.l4 { background: var(--accent); }

.prog-list { display: grid; gap: 14px; margin-top: 4px; }
.prog-row .pr-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  gap: 10px;
}
.prog-row .pr-top b { font-weight: 650; }
.prog-row .pr-top span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 搜索 ---------- */

.search-hero {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 6px 4px 16px;
  box-shadow: var(--shadow-s);
  margin-bottom: 26px;
}
.search-hero input {
  flex: 1;
  border: 0; outline: none; background: transparent;
  font-size: 15px; padding: 10px 0; min-width: 0;
}

/* ---------- 登录 ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% 0%, #fdf7f2, rgba(253, 247, 242, 0) 70%),
    var(--paper);
}
.login-box {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: var(--shadow-m);
}
.login-box h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: -.02em; }
.login-box p { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.login-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  margin-bottom: 10px;
}
.login-box input:focus { border-color: #d8cfbe; }
.login-box .btn { width: 100%; justify-content: center; }
.login-err { color: var(--accent); font-size: 12px; margin-bottom: 8px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 12px);
  background: #23262b;
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  max-width: 84vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .lesson-grid { grid-template-columns: 1fr; }
  .outline { position: static; }
  .outline-body { max-height: 320px; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.12); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .shell { margin-left: 0; }
  .topbar { display: flex; }
  .tabbar { display: grid; }
  .content { padding: 20px 16px 96px; }
  .content.wide { padding: 0 0 96px; }
  .hero { padding: 24px 20px 22px; border-radius: 16px; }
  .hero h1 { font-size: 25px; }
  .course-hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 20px; }
  .ring-wrap { align-self: flex-end; margin-top: -46px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  h1.page-title { font-size: 23px; }
}

@media (max-width: 900px) {
  /* 播放页在手机上全宽 */
  .lesson-grid { gap: 18px; }
  .player-card { border-radius: 0; margin: 0 -16px; }
  .content.wide .player-card { margin: 0; }
  .player-meta { padding: 0 16px; }
  .toolbar { margin: 14px 16px 0; }
  .notes-block { padding: 0 16px; }
  .outline { margin: 0 16px; }
  .lesson-title { font-size: 18.5px; }
  .content.wide { padding-bottom: 96px; }
  .lesson-grid .aside-wrap { padding: 0; }
  .resume { padding: 14px 16px; }
  .chapter { border-radius: 12px; }
  .lesson-row { padding: 12px 14px; }
  .filter-bar .search-inline { margin-left: 0; width: 100%; }
}

@media (max-width: 420px) {
  .hero-stats { gap: 8px 18px; }
  .hs b { font-size: 18px; }
  .cc-meta { gap: 10px; font-size: 11.5px; }
  .stat-cards { gap: 8px; }
  .stat-card { padding: 13px 14px; }
  .stat-card .v { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 打印 */
@media print {
  .sidebar, .tabbar, .topbar, .reader-tools, .scrim { display: none !important; }
  .shell { margin: 0; }
  .content { padding: 0; max-width: none; }
  .article { font-size: 12pt; }
}

/* ---------- 补充：笔记全文 / 目录 / 讲义导航 / 热力图 ---------- */

.note-card.full .nc-body {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
  white-space: pre-wrap;
}

.toc {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdfa;
  padding: 0 14px;
  font-size: 13px;
}
.toc summary {
  cursor: pointer;
  padding: 9px 0;
  font-weight: 600;
  color: var(--ink2);
  list-style: none;
  font-size: 12.5px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: "▸ "; color: var(--muted); }
.toc[open] summary::before { content: "▾ "; }
.toc ol {
  margin: 0 0 10px;
  padding-left: 1.3em;
  color: var(--ink2);
  line-height: 1.9;
  max-height: 320px;
  overflow-y: auto;
}
.toc li.sub { margin-left: 14px; font-size: 12.5px; color: var(--muted); }
.toc a:hover { color: var(--accent); }

.doc-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.doc-nav .spacer { flex: 1; }

.heat.cal {
  grid-template-columns: none;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  max-width: 100%;
}
.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
}
.heat-legend i {
  width: 10px; height: 10px;
  border-radius: 2px;
  background: #eee9e1;
  display: block;
}
.heat-legend i.l1 { background: #f2d8ce; }
.heat-legend i.l2 { background: #e5ac9c; }
.heat-legend i.l3 { background: #cf7a63; }
.heat-legend i.l4 { background: var(--accent); }

.article[style] { }

@media (max-width: 900px) {
  .reader { padding: 0 16px; }
  .article { font-size: 15px; line-height: 1.9; }
  .reader-head h1 { font-size: 21px; }
  .heat.cal { gap: 3px; }
}

/* ---------- 移动端微调 ---------- */
.hero h1 em { white-space: nowrap; }

@media (max-width: 900px) {
  .toolbar { gap: 10px; }
  .speed-group { width: 100%; order: 9; justify-content: space-between; }
  .speed-group button { flex: 1; padding: 6px 0; }
  .btn { padding: 10px 16px; }
}

/* =========================================================
   观看历史（B 站式）
   ========================================================= */

.wh-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; margin: 6px 0 18px; flex-wrap: wrap; }
.wh-title { font-size: 26px; margin: 2px 0 4px; letter-spacing: -.4px; }
.wh-sub { margin: 0; color: var(--muted); font-size: 13px; }
.wh-sub b { color: var(--ink2); font-weight: 600; }

.wh-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.wh-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink2); font-size: 13px; text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.chip b { color: var(--muted); font-weight: 600; font-size: 12px; }
.chip:hover { border-color: #d8d1c3; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-on b { color: rgba(255, 255, 255, .62); }

.wh-day { display: flex; align-items: center; gap: 12px; margin: 24px 0 10px; }
.wh-day span { font-size: 12.5px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.wh-day i { flex: 1; height: 1px; background: var(--line); }

.wh-list { display: flex; flex-direction: column; gap: 8px; }

.wh-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px; border-radius: 12px; background: #fff;
  border: 1px solid transparent; transition: border-color .15s, box-shadow .15s;
}
.wh-row:hover { border-color: var(--line); box-shadow: var(--shadow-s); }

.wh-cover {
  position: relative; flex: 0 0 184px; width: 184px; aspect-ratio: 16 / 9;
  border-radius: 9px; overflow: hidden; display: block;
  background: #23211f;
  background: radial-gradient(130% 150% at 82% 8%, #3a2c26 0%, #23211f 62%);
}
.wh-cover { --cc: #b8452f; }
.wh-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wh-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .34)); }
.wh-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9);
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .9);
  color: var(--accent-ink); display: grid; place-items: center;
  opacity: 0; transition: opacity .15s, transform .15s;
}
.wh-row:hover .wh-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wh-dur {
  position: absolute; right: 6px; bottom: 8px; font-size: 11px; color: #fff;
  background: rgba(0, 0, 0, .55); padding: 1px 5px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.wh-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .3); }
.wh-prog i { display: block; height: 100%; background: var(--accent); }

.wh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: inherit; }
.wh-t {
  font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wh-t .lab { font-size: 11px; font-weight: 600; color: var(--teal); background: var(--teal-soft); padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.wh-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-meta .dot { margin: 0 6px; color: #cfc8ba; }
.wh-foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.wh-pos b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.wh-ago { margin-left: auto; color: #9aa0a8; font-size: 12px; }

.wh-act { display: flex; align-items: center; gap: 4px; padding-left: 4px; }
.wh-resume {
  display: inline-flex; align-items: center; gap: 1px; font-size: 12.5px; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 5px 11px;
  text-decoration: none; white-space: nowrap;
}
.wh-resume:hover { background: #f7ded5; }
.wh-del {
  width: 26px; height: 26px; border: 0; background: transparent; color: #c6c0b3;
  border-radius: 50%; cursor: pointer; display: grid; place-items: center;
}
.wh-del:hover { background: #f2eee6; color: var(--accent-ink); }
.wh-row.is-done .wh-t { color: var(--ink2); }

.empty-card {
  padding: 48px 24px; text-align: center; background: #fff; border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--muted);
}
.empty-card svg { color: #cbc4b6; }
.empty-card h3 { margin: 10px 0 4px; font-size: 16px; color: var(--ink2); }
.empty-card p { margin: 0 0 16px; font-size: 13px; }

/* ---------- 首页「接着看」 ---------- */

.watch-hero {
  display: flex; align-items: center; gap: 18px; padding: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-s); text-decoration: none; color: inherit;
  transition: box-shadow .18s, border-color .18s;
}
.watch-hero:hover { border-color: #ddd5c6; box-shadow: var(--shadow-m); }

.watch-cover {
  position: relative; flex: 0 0 264px; width: 264px; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden;
  background: #23211f;
  background: radial-gradient(130% 150% at 82% 8%, #3a2c26 0%, #23211f 62%);
}
.watch-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.watch-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .02), rgba(0, 0, 0, .3)); }
.watch-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .9);
  color: var(--accent-ink); display: grid; place-items: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .26);
}
.watch-dur {
  position: absolute; right: 8px; bottom: 10px; font-size: 11.5px; color: #fff;
  background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.watch-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .3); }
.watch-prog i { display: block; height: 100%; background: #e35a3d; }

.watch-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.watch-label { font-size: 12px; color: var(--accent-ink); }
.watch-title {
  font-size: 18px; font-weight: 600; line-height: 1.42; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.watch-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-meta .dot { margin: 0 6px; color: #cfc8ba; }
.watch-nums { font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.watch-nums b { color: var(--accent-ink); }
.watch-left { color: var(--muted); margin-left: 8px; }
.watch-cta {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.watch-hero:hover .watch-cta { background: var(--accent-ink); }

.watch-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(148px, 1fr);
  gap: 12px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px;
}
.wcard { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: inherit; min-width: 0; }
.wcard-cover {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: #23211f;
  background: radial-gradient(130% 150% at 82% 8%, #3a2c26 0%, #23211f 62%);
}
.wcard-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .3); }
.wcard-prog i { display: block; height: 100%; background: #e35a3d; }
.wcard-dur {
  position: absolute; right: 5px; bottom: 6px; font-size: 10.5px; color: #fff;
  background: rgba(0, 0, 0, .5); padding: 0 4px; border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.wcard-t {
  font-size: 12.5px; line-height: 1.45; color: var(--ink2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wcard-m { font-size: 11.5px; color: var(--muted); }
.wcard:hover .wcard-t { color: var(--accent-ink); }

/* ---------- 播放页「接着上次看」提示条 ---------- */

.resume-bar {
  display: none; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 8px 12px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent-ink); font-size: 13px;
}
.resume-bar.is-on { display: flex; }
.resume-bar .rb-txt { flex: 1; min-width: 0; }
.resume-bar b { font-variant-numeric: tabular-nums; }
.resume-bar .rb-btn {
  border: 1px solid rgba(142, 50, 33, .22); background: rgba(255, 255, 255, .7);
  color: var(--accent-ink); border-radius: 999px; padding: 3px 10px;
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.resume-bar .rb-x { border: 0; background: transparent; color: #b9806f; cursor: pointer; padding: 2px; }

/* ---------- 移动端 ---------- */

@media (max-width: 900px) {
  .wh-head { margin-bottom: 14px; }
  .wh-title { font-size: 21px; }
  .wh-filters { gap: 6px; margin-bottom: 14px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .wh-filters .wh-sep { display: none; }
  .chip { flex: 0 0 auto; font-size: 12.5px; padding: 5px 10px; }

  .wh-row { gap: 10px; padding: 8px; align-items: flex-start; }
  .wh-cover { flex: 0 0 132px; width: 132px; border-radius: 8px; }
  .wh-t { font-size: 13.5px; -webkit-line-clamp: 2; }
  .wh-meta { font-size: 11.5px; }
  .wh-foot { font-size: 11.5px; gap: 8px; }
  .wh-ago { margin-left: 0; width: 100%; }
  .wh-act { position: static; padding: 0; }
  .wh-resume { display: none; }
  .wh-del { width: 24px; height: 24px; }

  .watch-hero { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; }
  .watch-cover { flex: none; width: 100%; }
  .watch-title { font-size: 16px; }
  .watch-cta { justify-content: center; padding: 11px 16px; }
  .watch-strip { grid-auto-columns: 138px; }

  .resume-bar { font-size: 12.5px; padding: 7px 10px; }
}

/* ---------- 历史条目：课程维度的补充信息 ---------- */
.wh-course {
  color: #8c8578;
  background: #f6f3ec;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .wh-course { font-size: 11px; padding: 0 5px; }
  .wh-meta { white-space: normal; line-height: 1.5; }
}

/* ---------- 历史条目：看完后给「下一节」 ---------- */
.wh-act { flex-wrap: wrap; justify-content: flex-end; max-width: 190px; }
.wh-next {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--accent); color: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.wh-next:hover { background: var(--accent-ink); color: #fff; }
.wh-replay {
  font-size: 12px; color: var(--muted); text-decoration: none;
  padding: 3px 4px; white-space: nowrap;
}
.wh-replay:hover { color: var(--accent-ink); }

@media (max-width: 900px) {
  .wh-act { flex-direction: column; align-items: flex-end; gap: 4px; max-width: none; }
  .wh-next { padding: 5px 10px; font-size: 11.5px; }
  .wh-replay { display: none; }
}

/* =========================================================
   用手机观看：右上角按钮 + 二维码弹窗
   ========================================================= */

.top-qr { display: none; }

@media (min-width: 901px) {
  .top-qr {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 45;
    height: 34px;
    padding: 0 13px 0 11px;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink2);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-s);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s, border-color .15s, box-shadow .15s, transform .15s;
  }
  .top-qr:hover {
    color: var(--accent-ink);
    border-color: #ddc9c0;
    box-shadow: var(--shadow-m);
    transform: translateY(-1px);
  }
  .top-qr svg { color: var(--accent); }
  .top-qr:active { transform: none; }
}

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-scrim {
  position: absolute; inset: 0;
  background: rgba(26, 22, 18, .44);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: qrFade .16s ease;
}

.qr-card {
  position: relative;
  width: min(342px, 100%);
  padding: 22px 22px 18px;
  background: #fff;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 26px 64px -22px rgba(22, 17, 12, .5), 0 2px 8px rgba(22, 17, 12, .08);
  animation: qrPop .2s cubic-bezier(.2, .9, .3, 1);
}
.qr-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: #f5f2eb; color: var(--muted);
  cursor: pointer;
}
.qr-close:hover { background: #efe9df; color: var(--ink2); }

.qr-head { margin-bottom: 16px; }
.qr-eyebrow {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; letter-spacing: .06em;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px;
}
.qr-head h3 { margin: 10px 0 0; font-size: 18px; letter-spacing: -.2px; }

.qr-box {
  width: 214px; height: 214px;
  margin: 0 auto; padding: 10px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box.is-empty { font-size: 12px; color: var(--muted); }

.qr-hint { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.qr-url {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 7px 7px 7px 12px;
  background: #f7f5f0; border-radius: 10px;
}
.qr-url code {
  flex: 1; min-width: 0; text-align: left;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qr-copy {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; font-family: inherit; font-size: 12px;
  color: var(--ink2); background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; white-space: nowrap;
}
.qr-copy:hover { color: var(--accent-ink); border-color: #ddc9c0; }

.qr-foot { margin: 12px 0 0; font-size: 11.5px; color: #9aa0a8; line-height: 1.6; }

@keyframes qrPop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes qrFade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .qr-card, .modal-scrim { animation: none; }
}

/* 播放页/讲义页右侧有悬浮目录：给按钮留出空间 */
@media (min-width: 901px) {
  .v-lesson .aside-wrap { padding-top: 42px; }
}

/* ---------- 手机端：横屏播放 ---------- */

.rot-btn { display: none; }

@media (max-width: 900px) {
  .rot-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 12, 14, .58);
    color: #fff;
    font-family: inherit;
    font-size: 11.5px;
    line-height: 1;
    letter-spacing: .02em;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background .16s, transform .12s;
  }
  .rot-btn:active { transform: scale(.95); }
  .rot-btn.is-on { background: rgba(184, 69, 47, .82); }
  .rot-btn svg { opacity: .92; }

  /* 进入横屏：锁滚动，压黑背景 */
  html.rot-lock,
  body.rot-lock { overflow: hidden !important; }
  body.rot-lock::after {
    content: '';
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9400;
  }

  /* 伪横屏：把播放卡整体旋转 90°，铺满视口 */
  .player-card.is-rot {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vh;
    height: 100vw;
    width: 100dvh;
    height: 100dvw;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: #000;
    z-index: 9600;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .player-card.is-rot .video-shell { position: absolute; inset: 0; }
  .player-card.is-rot video {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
  }
  /* 旋转后卡片左上角正好落在视觉右上角，按钮不会被系统手势/控件压住 */
  .player-card.is-rot .rot-btn { left: 8px; right: auto; }

  /* 原生全屏（真实横屏）时让视频铺满 */
  .player-card:fullscreen { background: #000; }
  .player-card:fullscreen video {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
  }
  .player-card:-webkit-full-screen video {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
  }
}

/* ---------- 视频节点（时间轴要点） ---------- */

.nodes-block {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  padding: 14px 16px 10px;
}
.nodes-head {
  display: flex;
  align-items: center;
  gap: 7px;
}
.nodes-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-ink, #7a3a28);
}
.nodes-head .n { font-size: 11.5px; color: var(--muted); }

/* 时间轴横条 + 圆点 */
.node-rail {
  position: relative;
  height: 8px;
  margin: 12px 2px 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #efe9df, #e9e2d5);
}
.node-dot {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  background: var(--accent, #b8452f);
  transform: translate(-50%, -50%);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .12s;
}
.node-dot:hover { transform: translate(-50%, -50%) scale(1.35); }

.node-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 560px;
  overflow: auto;
}
.node-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.node-item:hover { background: #f6f1e7; }
.node-item.is-now { background: var(--accent-soft, #f7e8e2); }
.node-item.is-now .nd-title::after {
  content: '播放中';
  font-size: 10px;
  font-weight: 600;
  color: var(--accent, #b8452f);
  margin-left: 6px;
}
.nd-t {
  flex: none;
  font-family: var(--mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f0ece2;
  color: #6d6a63;
  margin-top: 1px;
}
.node-item.is-now .nd-t { background: var(--accent, #b8452f); color: #fff; }
.nd-body { min-width: 0; }
.nd-title {
  display: block;
  font-size: 13.5px;
  font-weight: 680;
  color: var(--ink, #2c2a26);
  line-height: 1.35;
}
.nd-sum {
  display: block;
  font-size: 12px;
  color: var(--muted, #8a867d);
  line-height: 1.55;
  margin-top: 3px;
}
.nd-tags { display: block; margin-top: 5px; }
.nd-tags i {
  font-style: normal;
  font-size: 10.5px;
  color: #6d6a63;
  border: 1px solid var(--line, #e7e1d5);
  border-radius: 999px;
  padding: 1.5px 8px;
  margin-right: 5px;
  background: #fff;
}

@media (max-width: 900px) {
  .nodes-block { border-radius: 12px; margin: 14px 16px 0; }
  .node-list { max-height: none; }
}

/* 节点待生成占位 */
.nodes-empty { background: #fbf9f4; }
.nodes-empty .ne-text {
  margin: 2px 0 6px;
  color: #8a8578;
  font-size: 13px;
  line-height: 1.7;
}
