/* ═══════════════════════════════════════════════════════════
   lesson.css —— 课程学习页设计系统（文章式滚动布局）
   参考 xueai.app 的课页骨架，配色用出海号品牌（海青 + 珊瑚）。
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --text: #1c1c1e;
  --sub: #6b7280;
  --accent: #0e7489;
  --accent-soft: rgba(14, 116, 137, 0.08);
  --coral: #e85d4c;
  --coral-soft: rgba(232, 93, 76, 0.08);
  --danger: #dc2626;
  --amber: #d97706;
  --success: #16a34a;
  --border: rgba(0, 0, 0, 0.07);

  --content-w: 860px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.1);

  --sidebar-w: 300px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

button {
  font-family: inherit;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 120;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--text);
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(14, 116, 137, 0.38);
  outline-offset: 3px;
}

/* ══════════ 布局：侧栏 + 内容 ══════════ */
.learn-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
}

/* ── 侧栏 ── */
.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-head .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #123a46);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-head .brand b {
  font-size: 14.5px;
  display: block;
  line-height: 1.3;
}

.sidebar-head .brand span {
  font-size: 11.5px;
  color: var(--sub);
}

.sidebar-progress {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--sub);
}

.sidebar-progress .bar {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.sidebar-progress .bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--coral));
  transition: width 0.4s ease;
}

.toc-tools {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.38);
}

.toc-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--sub);
}

.toc-search:focus-within {
  border-color: rgba(14, 116, 137, 0.5);
  box-shadow: 0 0 0 3px rgba(14, 116, 137, 0.08);
}

.toc-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
}

.toc-search input::placeholder {
  color: #9ca3af;
}

.toc-part-filter {
  width: 100%;
  margin-top: 7px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.toc-path-filter {
  border-color: rgba(14, 116, 137, 0.24);
  background: linear-gradient(135deg, rgba(14, 116, 137, 0.08), rgba(255, 255, 255, 0.9));
  color: var(--accent);
  font-weight: 750;
}

.toc-path-summary {
  margin-top: 7px;
  padding: 8px 9px;
  border: 1px solid rgba(14, 116, 137, 0.16);
  border-radius: 8px;
  background: var(--accent-soft);
}

.toc-path-summary[hidden] {
  display: none;
}

.toc-path-summary b,
.toc-path-summary span {
  display: block;
}

.toc-path-summary b {
  color: var(--accent);
  font-size: 11.5px;
}

.toc-path-summary span {
  margin-top: 1px;
  color: var(--sub);
  font-size: 10px;
}

.toc-filter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 7px;
}

.toc-filter-row button {
  border: 0;
  border-radius: 7px;
  padding: 5px 2px;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.toc-filter-row button:hover,
.toc-filter-row button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.continue-card {
  display: block;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(14, 116, 137, 0.2);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(14, 116, 137, 0.09), rgba(232, 93, 76, 0.05));
  color: var(--text);
  text-decoration: none;
}

.continue-card[hidden] {
  display: none;
}

.continue-card > span {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.continue-card b,
.continue-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-card b {
  margin-top: 2px;
  font-size: 12px;
}

.continue-card small {
  color: var(--sub);
  font-size: 10.5px;
}

.toc-result {
  margin: 7px 2px 0;
  color: var(--sub);
  font-size: 10.5px;
}

.toc {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 20px;
}

.toc-part {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--sub);
  text-transform: uppercase;
  margin: 16px 8px 6px;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  transition: background 0.12s;
}

.toc-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.toc-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.toc-item .st {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  color: transparent;
}

.toc-item.done .st {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.toc-item .lk {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.toc-item .toc-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-item .toc-star {
  margin-left: auto;
  color: #d4a017;
  font-size: 12px;
  line-height: 1;
}

.toc-item .toc-lab-mark {
  margin-left: auto;
  color: var(--coral);
  font-size: 9px;
  line-height: 1;
}

.toc-item .toc-lab-mark + .toc-star,
.toc-item .toc-lab-mark + .lk,
.toc-item .toc-star + .lk {
  margin-left: 0;
}

.toc-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 42px 12px;
  color: var(--sub);
  text-align: center;
}

.toc-empty b {
  color: var(--text);
  font-size: 13px;
}

.toc-empty span {
  font-size: 11px;
}

.toc-empty button {
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.lk.free {
  background: var(--accent-soft);
  color: var(--accent);
}

.lk.paid {
  background: var(--coral-soft);
  color: var(--coral);
}

.lk.open {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.lk.required {
  background: var(--accent-soft);
  color: var(--accent);
}

.lk.optional {
  background: rgba(217, 119, 6, 0.09);
  color: var(--amber);
}

.toc-part.path-stage-title {
  color: var(--accent);
  text-transform: none;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
}

/* ── 内容区 ── */
.content {
  overflow-y: auto;
  position: relative;
  scroll-behavior: smooth;
}

/* 顶部条（移动端展示汉堡） */
.content-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(247, 245, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.hamburger {
  display: none;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
}

.content-top .crumb {
  font-size: 12.5px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-top .spacer {
  flex: 1;
}

/* ══════════ 文章 ══════════ */
.lesson {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 48px 28px 140px;
}

.lesson-header {
  margin-bottom: 34px;
}

.lesson-header .kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lesson-header h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.35;
}

.lesson-header .subtitle {
  font-size: 15px;
  color: var(--sub);
  margin-top: 10px;
  line-height: 1.7;
}

.lesson-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.lesson-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--sub);
  cursor: pointer;
  font-size: 12px;
}

.lesson-tool:hover,
.lesson-tool.active,
.lesson-tool.has-note {
  border-color: rgba(14, 116, 137, 0.25);
  background: var(--accent-soft);
  color: var(--accent);
}

.lesson-tool.active span {
  color: #d4a017;
}

.lesson-tool b {
  color: inherit;
  font-size: inherit;
}

.lesson-section-summary {
  margin-left: auto;
  color: var(--sub);
  font-size: 11.5px;
  font-weight: 700;
}

.lesson-note-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(14, 116, 137, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.lesson-note-panel[hidden] {
  display: none;
}

.lesson-note-panel label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.lesson-note-panel textarea {
  display: block;
  width: 100%;
  min-height: 128px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.7;
}

.lesson-note-panel textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 116, 137, 0.08);
}

.lesson-note-panel > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--sub);
  font-size: 10.5px;
}

.access-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: 2px 10px;
  border-radius: 99px;
}

.access-pill.free {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.access-pill.preview {
  background: var(--coral-soft);
  color: var(--coral);
}

.access-pill.route-required {
  background: var(--accent-soft);
  color: var(--accent);
}

.access-pill.route-optional {
  background: rgba(217, 119, 6, 0.09);
  color: var(--amber);
}

.access-pill.interactive {
  background: var(--coral-soft);
  color: var(--coral);
}

/* 分节标题 */
.sec-label {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #121314;
  margin: 40px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sec-label .sec-num {
  color: var(--accent);
  font-weight: 800;
}

.sec-label .sec-title {
  min-width: 0;
}

.lesson-section {
  scroll-margin-top: 72px;
}

.lesson-section.completed .sec-num {
  color: var(--success);
}

.section-done-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 22px 0 4px auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--sub);
  cursor: pointer;
  font-size: 11.5px;
}

.section-done-btn:hover {
  border-color: rgba(14, 116, 137, 0.32);
  color: var(--accent);
}

.section-done-btn.done {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.section-done-btn b {
  color: inherit;
  font-size: inherit;
}

/* 正文块 */
.lesson p.body-p {
  font-size: 15.5px;
  line-height: 1.85;
  margin: 14px 0;
}

.lesson h3.body-h3 {
  font-size: 17.5px;
  font-weight: 800;
  margin: 28px 0 10px;
}

.lesson h3.body-h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  background: var(--coral);
  border-radius: 2px;
  margin-right: 9px;
  vertical-align: -1px;
}

.lesson code {
  font-family: "SF Mono", "Fira Code", Menlo, monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
}

.lesson b {
  color: var(--text);
}

/* 正文、表格、卡片与工具包外链 */
.external-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(14, 116, 137, 0.34);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.external-link::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.18em;
  font-size: 0.78em;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-0.08em);
}

.external-link:hover {
  color: var(--coral);
  text-decoration-color: currentColor;
}

.external-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(14, 116, 137, 0.3);
  outline-offset: 2px;
}

/* 卡片 / callout */
.l-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  margin: 16px 0;
}

.l-callout {
  background: var(--accent-soft);
  border: 1.5px solid rgba(14, 116, 137, 0.22);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14.5px;
  line-height: 1.8;
}

.l-callout b {
  color: var(--accent);
}

/* 案例框 */
.l-case {
  background: var(--coral-soft);
  border: 1.5px solid rgba(232, 93, 76, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14.5px;
  line-height: 1.8;
}

.l-case .case-tag {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.l-case .case-source-note {
  margin: -1px 0 9px;
  color: var(--sub);
  font-size: 11.5px;
  line-height: 1.55;
}

.l-case.case-public {
  background: #eef8f4;
  border-color: rgba(22, 128, 93, 0.24);
}

.l-case.case-public .case-tag {
  background: #167f5d;
}

.l-case.case-author .case-tag {
  background: #315f8f;
}

.l-case.case-authorized .case-tag {
  background: #7952a8;
}

.l-case.case-composite {
  background: #fff8ef;
  border-color: rgba(181, 111, 27, 0.24);
}

.l-case.case-composite .case-tag {
  background: #a86617;
}

/* 列表 */
.l-list {
  margin: 14px 0;
  padding-left: 4px;
  list-style: none;
}

.l-list li {
  position: relative;
  padding-left: 22px;
  margin: 9px 0;
  font-size: 15px;
  line-height: 1.8;
}

.l-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

/* 本章要点 */
.takeaway-box {
  background: linear-gradient(145deg, #ffffff, #f4faf9);
  border: 1.5px solid rgba(14, 116, 137, 0.25);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 16px 0;
}

.takeaway-box .tw-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.takeaway-box ol {
  padding-left: 20px;
}

.takeaway-box li {
  margin: 8px 0;
  font-size: 14.5px;
  line-height: 1.75;
}

/* 立刻就做（互动清单） */
.todo-box {
  background: var(--card);
  border: 1.5px solid rgba(232, 93, 76, 0.3);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 16px 0;
}

.todo-box .todo-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--coral);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.todo-box .todo-hint {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 12px;
}

.todo-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 14.5px;
  line-height: 1.7;
  user-select: none;
}

.todo-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.todo-item .cb {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  margin-top: 3px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.15s;
}

.todo-item.checked .cb {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.todo-item.checked span.txt {
  color: var(--sub);
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.25);
}

.seo-paywall {
  margin: 36px 0 60px;
  padding: 24px;
  border: 1.5px solid rgba(232, 93, 76, 0.24);
  border-radius: var(--radius);
  background: var(--coral-soft);
}

.seo-paywall h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.seo-paywall p,
.seo-paywall li {
  color: var(--sub);
  font-size: 14px;
}

.seo-paywall ul {
  padding-left: 20px;
  margin-top: 10px;
}

/* 表格 */
.tbl-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin: 16px 0;
}

.tbl-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 480px;
}

.tbl-wrap th {
  text-align: left;
  padding: 11px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.tbl-wrap td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.7;
}

/* 代码 / ASCII 图 */
.lesson pre {
  font-family: "SF Mono", "Fira Code", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  background: #10262d;
  color: #cdeef4;
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 16px 0;
}

/* 配图占位 */
.figure-ph {
  border: 1.5px dashed rgba(14, 116, 137, 0.35);
  background: rgba(14, 116, 137, 0.03);
  border-radius: var(--radius);
  padding: 26px 20px;
  margin: 16px 0;
  text-align: center;
  color: var(--sub);
  font-size: 13px;
}

.figure-ph b {
  color: var(--accent);
}

/* 重点章节原创信息图 */
.course-figure {
  margin: 24px 0;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(14, 116, 137, 0.16);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(28, 28, 30, 0.07);
}

.course-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--bg);
}

.case-breakdown-figure {
  margin-top: -2px;
  border-color: rgba(14, 116, 137, 0.16);
  background: rgba(255, 255, 255, 0.78);
}

.case-illustration,
.case-screenshot {
  margin-top: 14px;
}

.case-illustration img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.course-figure figcaption {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px 5px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.65;
}

.course-figure figcaption span {
  flex-shrink: 0;
  border-radius: 99px;
  padding: 1px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
}

.course-figure figcaption a {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}

.course-figure figcaption a:hover {
  text-decoration: underline;
}

.lesson-map-figure {
  margin-top: 10px;
  margin-bottom: 34px;
}

.official-screenshot {
  border-color: rgba(28, 28, 30, 0.14);
  background: #fff;
}

.official-screenshot img {
  border: 1px solid rgba(28, 28, 30, 0.07);
}

/* ══════════ 模块：术语卡片网格 ══════════ */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.term-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, border-color 0.15s;
}

.term-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 116, 137, 0.35);
}

.term-card .tc-t {
  font-size: 14.5px;
  font-weight: 800;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.term-card .tc-t::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}

.term-card:nth-child(4n + 2) .tc-t::before {
  background: var(--coral);
}

.term-card:nth-child(4n + 3) .tc-t::before {
  background: var(--amber);
}

.term-card:nth-child(4n + 4) .tc-t::before {
  background: #7c3aed;
}

.term-card .tc-d {
  font-size: 13.5px;
  color: var(--sub);
  line-height: 1.75;
}

/* ══════════ 模块：编号步骤清单 ══════════ */
.steps-list {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 22px;
  margin: 16px 0;
  box-shadow: var(--shadow-card);
}

.steps-list .step-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.75;
}

.steps-list .step-item:last-child {
  border-bottom: none;
}

.steps-list .step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

/* ══════════ 模块：四类读者标签页 ══════════ */
.tabs-box {
  background: var(--card);
  border: 1.5px solid rgba(14, 116, 137, 0.22);
  border-radius: var(--radius);
  padding: 16px 20px 18px;
  margin: 16px 0;
  box-shadow: var(--shadow-card);
}

.tabs-box .tabs-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tabs-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tabs-nav .tab-btn {
  border: 1.5px solid var(--border);
  background: var(--bg);
  border-radius: 99px;
  padding: 6px 15px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s;
}

.tabs-nav .tab-btn:hover {
  border-color: rgba(14, 116, 137, 0.4);
}

.tabs-nav .tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab-panel {
  font-size: 14.5px;
  line-height: 1.85;
  animation: tabIn 0.25s ease;
  min-height: 52px;
}

@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ══════════ 模块：警告条 ══════════ */
.warn-inline {
  background: rgba(217, 119, 6, 0.05);
  border: 1.5px solid rgba(217, 119, 6, 0.22);
  border-radius: var(--radius);
  padding: 15px 19px;
  margin: 16px 0;
  font-size: 14.5px;
  line-height: 1.8;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.warn-inline .w-ic {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 2px;
}

.warn-inline b {
  color: var(--amber);
}

/* ══════════ 模块：小测 ══════════ */
.quiz-box {
  background: var(--card);
  border: 1.5px solid rgba(124, 58, 237, 0.28);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 26px 0 10px;
  box-shadow: var(--shadow-card);
}

.quiz-box .quiz-tag {
  display: inline-block;
  background: #7c3aed;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 99px;
  margin-bottom: 6px;
}

.quiz-box .quiz-title {
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 2px;
}

.quiz-box .quiz-sub {
  font-size: 12.5px;
  color: var(--sub);
  margin-bottom: 14px;
}

.q-item {
  padding: 14px 0 6px;
  border-top: 1px solid var(--border);
}

.q-item .q-text {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.7;
}

.q-item .q-text .q-no {
  color: #7c3aed;
  margin-right: 6px;
}

.q-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 10px 14px;
  margin: 7px 0;
  font-size: 13.5px;
  line-height: 1.65;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
  user-select: none;
}

.q-opt:hover {
  border-color: rgba(124, 58, 237, 0.45);
}

.q-opt .q-key {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  font-size: 11.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.q-item.answered .q-opt {
  cursor: default;
  opacity: 0.65;
}

.q-item.answered .q-opt.correct {
  opacity: 1;
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.06);
}

.q-item.answered .q-opt.correct .q-key {
  background: var(--success);
  color: #fff;
}

.q-item.answered .q-opt.wrong {
  opacity: 1;
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
}

.q-item.answered .q-opt.wrong .q-key {
  background: var(--danger);
  color: #fff;
}

.q-exp {
  display: none;
  margin: 10px 0 8px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.06);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}

.q-exp b {
  color: #7c3aed;
}

.q-item.answered .q-exp {
  display: block;
}

.quiz-score {
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--sub);
  text-align: center;
}

/* ══════════ 渐入动画 ══════════ */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════ 互动实验（第 4 章：引擎权重） ══════════ */
.demo-box {
  background: var(--card);
  border: 1.5px solid rgba(14, 116, 137, 0.25);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0;
  box-shadow: var(--shadow-card);
}

.demo-box .demo-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.demo-box .demo-title {
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 4px;
}

.demo-box .demo-sub {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 14px;
}

.stage-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stage-tab {
  border: 1.5px solid var(--border);
  background: var(--bg);
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s;
}

.stage-tab:hover {
  border-color: rgba(14, 116, 137, 0.4);
}

.stage-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.engine-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.engine-row {
  display: grid;
  grid-template-columns: 108px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.engine-row .en {
  font-weight: 700;
  text-align: right;
  color: var(--text);
}

.engine-row .bar {
  height: 22px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 7px;
  overflow: hidden;
}

.engine-row .bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 7px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.engine-row .pv {
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.demo-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.7;
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 14px;
}

/* ══════════ 定制互动实验（第 9 / 12 / 26 章） ══════════ */
.lab-box {
  margin: 24px 0;
}

.lab-box button,
.lab-box input,
.lab-box select {
  font: inherit;
}

.lab-box button:focus-visible,
.lab-box input:focus-visible,
.lab-box select:focus-visible {
  outline: 3px solid rgba(14, 116, 137, 0.18);
  outline-offset: 2px;
}

.lab-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--sub);
  font-size: 12px;
  margin-bottom: 13px;
}

.lab-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lab-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.lab-legend .lg-p {
  background: var(--success);
}

.lab-legend .lg-i {
  background: var(--coral);
}

.lab-legend .lg-m {
  background: var(--amber);
}

.market-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.market-row {
  display: grid;
  grid-template-columns: 26px minmax(130px, 1fr) repeat(3, 67px) 30px;
  align-items: center;
  gap: 7px;
}

.market-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.market-row input,
.market-row select {
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
}

.market-row input:focus,
.market-row select:focus {
  border-color: var(--accent);
}

.market-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 800;
}

.market-row label select {
  flex: 1;
  padding: 7px 4px;
}

.market-remove {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--sub);
  font-size: 20px;
  cursor: pointer;
}

.market-remove:hover:not(:disabled) {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
}

.market-remove:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.lab-add {
  border: 1.5px dashed rgba(14, 116, 137, 0.35);
  background: transparent;
  color: var(--accent);
  border-radius: 9px;
  padding: 7px 13px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.lab-add:disabled {
  opacity: 0.5;
  cursor: default;
}

.market-output {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(250px, 0.95fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 18px;
}

.pim-matrix {
  position: relative;
  min-height: 290px;
  overflow: visible;
  border: 1px solid var(--border);
  border-left: 2px solid rgba(0, 0, 0, 0.25);
  border-bottom: 2px solid rgba(0, 0, 0, 0.25);
  border-radius: 8px 8px 3px 3px;
  background:
    linear-gradient(to right, transparent 49.8%, var(--border) 50%, transparent 50.2%),
    linear-gradient(to bottom, transparent 49.8%, var(--border) 50%, transparent 50.2%),
    linear-gradient(135deg, rgba(232, 93, 76, 0.035), rgba(14, 116, 137, 0.035));
}

.pim-matrix .axis {
  position: absolute;
  color: var(--sub);
  font-size: 10px;
  font-weight: 700;
}

.pim-matrix .axis-y {
  left: -34px;
  top: 47%;
  transform: rotate(-90deg);
}

.pim-matrix .axis-x {
  bottom: -22px;
  left: 46%;
}

.pim-matrix .quad {
  position: absolute;
  color: rgba(107, 114, 128, 0.62);
  font-size: 10px;
  font-weight: 700;
}

.pim-matrix .q1 {
  top: 8px;
  left: 10px;
}

.pim-matrix .q2 {
  top: 8px;
  right: 10px;
}

.pim-matrix .q3 {
  bottom: 8px;
  left: 10px;
}

.pim-matrix .q4 {
  bottom: 8px;
  right: 10px;
}

.matrix-dots {
  position: absolute;
  inset: 0;
}

.market-dot {
  position: absolute;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.18);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  color: #fff;
  z-index: 2;
}

.market-dot b {
  font-size: 10px;
  line-height: 1;
}

.market-ranking {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg);
}

.rank-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--sub);
  margin: 0 0 6px 3px;
}

.rank-item {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) 23px auto;
  align-items: center;
  gap: 7px;
  padding: 8px 3px;
  border-top: 1px solid var(--border);
}

.rank-no {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.rank-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-name small {
  display: block;
  color: var(--sub);
  font-size: 9.5px;
  font-weight: 500;
}

.rank-item > b {
  color: var(--accent);
  font-size: 13px;
}

.rank-item em {
  border-radius: 99px;
  padding: 2px 7px;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.rank-item em.go {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.rank-item em.hold,
.rank-item em.practice {
  background: rgba(217, 119, 6, 0.1);
  color: var(--amber);
}

.rank-item em.stop {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.rank-item em.watch {
  background: rgba(107, 114, 128, 0.1);
  color: var(--sub);
}

.lab-footnote {
  margin-top: 18px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(217, 119, 6, 0.06);
  color: var(--sub);
  font-size: 11.5px;
  line-height: 1.65;
}

.lab-completion-action {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(14, 116, 137, 0.14);
}

.lab-completion-action button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid rgba(14, 116, 137, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 9px 14px;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.lab-completion-action button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  font-weight: 900;
}

.lab-completion-action button.done {
  border-color: rgba(22, 127, 93, 0.28);
  background: #eef8f4;
  color: #167f5d;
}

/* ── 专家资源导航 ── */
.expert-navigation {
  margin: 4.5rem 0 2.5rem;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  border: 1px solid #d6d1c5;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 0%, rgba(205, 84, 66, 0.1), transparent 34%),
    #f3f0e8;
}

.expert-navigation-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.35rem;
}

.expert-navigation-head > div > span {
  display: block;
  margin-bottom: 0.5rem;
  color: #a74938;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.expert-navigation-head h2 {
  margin: 0;
  color: #171714;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.expert-navigation-head p {
  max-width: 680px;
  margin: 0.55rem 0 0;
  color: #656158;
  line-height: 1.75;
}

.expert-navigation-head > a {
  flex: 0 0 auto;
  padding: 0.7rem 0.9rem;
  border: 1px solid #c9c2b5;
  border-radius: 999px;
  color: #3b3a35;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  transition: 160ms ease;
}

.expert-navigation-head > a:hover {
  border-color: #ad4c3b;
  color: #a14030;
  transform: translateY(-1px);
}

.expert-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.expert-resource-card {
  display: block;
  padding: 1.1rem;
  border: 1px solid #d9d4ca;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(42, 37, 29, 0.04);
  transition: 180ms ease;
}

.expert-resource-card:hover {
  border-color: #bc7567;
  box-shadow: 0 14px 30px rgba(42, 37, 29, 0.08);
  transform: translateY(-2px);
}

.expert-resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.expert-resource-meta span {
  padding: 0.23rem 0.48rem;
  border-radius: 999px;
  background: #ede8df;
  color: #655e53;
  font-size: 0.68rem;
  font-weight: 750;
}

.expert-resource-meta span:first-child {
  background: #26231f;
  color: #fff;
}

.expert-resource-meta .resource-dynamic {
  background: #fff0d1;
  color: #805b13;
}

.expert-resource-meta .resource-stable {
  background: #e6f2eb;
  color: #2f6748;
}

.expert-resource-card h3 {
  margin: 0.75rem 0 0.25rem;
  color: #1d1b18;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.35;
}

.expert-resource-card h3 span {
  color: #bd5542;
  font-family: var(--font-sans);
}

.expert-resource-card p {
  margin: 0.55rem 0;
  color: #57544e;
  font-size: 0.9rem;
  line-height: 1.65;
}

.expert-resource-card .expert-resource-publisher {
  margin-top: 0;
  color: #8a8378;
  font-size: 0.76rem;
}

.expert-resource-use {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid #ece7df;
  color: #57544e;
  font-size: 0.82rem;
  line-height: 1.6;
}

.expert-resource-use b {
  display: block;
  margin-bottom: 0.15rem;
  color: #a34737;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.expert-resource-card blockquote {
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.8rem;
  border-left: 3px solid #c75b47;
  background: #f8f3ec;
  color: #45423c;
  font-size: 0.82rem;
  line-height: 1.6;
}

.expert-resource-card blockquote b {
  color: #292620;
}

.expert-navigation-foot {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #cfc8bb;
  color: #716b61;
  font-size: 0.82rem;
  line-height: 1.65;
}

.lab-question {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  margin: 17px 0 8px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice-grid button {
  min-height: 82px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 11px 12px;
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.choice-grid button b,
.choice-grid button span {
  display: block;
}

.choice-grid button b {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 2px;
}

.choice-grid button span {
  color: var(--sub);
  font-size: 11.5px;
  line-height: 1.5;
}

.choice-grid button:hover,
.choice-grid button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-grid button.active {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.business-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.business-tabs button {
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--bg);
  color: var(--sub);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.business-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.readiness-wrap {
  display: none;
}

.readiness-wrap.show {
  display: block;
  animation: tabIn 0.22s ease;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.check-grid label,
.geo-group label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.55;
  cursor: pointer;
}

.check-grid input,
.geo-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 5px;
  color: transparent;
  font-size: 10px;
  margin-top: 1px;
}

.check-grid input:checked + .check-mark,
.geo-group input:checked + .check-mark {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.check-grid label:has(input:checked),
.geo-group label:has(input:checked) {
  border-color: rgba(22, 163, 74, 0.3);
  background: rgba(22, 163, 74, 0.045);
}

.path-result {
  border: 1.5px solid rgba(14, 116, 137, 0.22);
  border-radius: 12px;
  padding: 15px 17px;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.6));
}

.result-kicker {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 5px;
}

.result-kicker.ready {
  background: var(--success);
}

.result-kicker.wait {
  background: var(--amber);
}

.path-result h4 {
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 6px;
}

.path-result ol {
  margin-left: 20px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.75;
}

.path-result p {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 8px;
}

.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.missing-list span {
  border-radius: 99px;
  padding: 3px 8px;
  background: rgba(217, 119, 6, 0.1);
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 700;
}

.geo-progress {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.geo-progress > div {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.06);
}

.geo-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.35s ease;
}

.geo-progress b {
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.geo-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.geo-group {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px;
  background: rgba(247, 245, 240, 0.65);
}

.geo-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 7px;
  font-size: 12px;
  font-weight: 800;
}

.geo-group header b {
  color: var(--accent);
  font-size: 10.5px;
}

.geo-group label {
  margin-top: 6px;
  padding: 7px 8px;
  font-size: 10.5px;
}

.geo-result {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  margin-top: 12px;
}

.geo-result > div {
  border-radius: 10px;
  padding: 11px 13px;
  background: var(--accent-soft);
}

.geo-result span {
  display: block;
  color: var(--sub);
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 3px;
}

.geo-result b {
  color: var(--accent);
  font-size: 14px;
}

.geo-result p,
.geo-result ol {
  color: var(--sub);
  font-size: 11px;
  line-height: 1.65;
}

.geo-result ol {
  margin-left: 17px;
}

/* ══════════ 付费墙 ══════════ */
.paywall {
  position: relative;
  margin: 26px 0 10px;
}

.paywall-fade {
  filter: blur(4px);
  opacity: 0.45;
  user-select: none;
  pointer-events: none;
  max-height: 220px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
}

.paywall-card {
  background: var(--card);
  border: 1.5px solid rgba(232, 93, 76, 0.35);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: var(--shadow-pop);
  text-align: center;
  margin-top: -60px;
  position: relative;
  z-index: 2;
}

.paywall-card h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
}

.paywall-card .pw-sub {
  color: var(--sub);
  font-size: 13.5px;
  margin-bottom: 14px;
}

.pw-locked-list {
  text-align: left;
  max-width: 460px;
  margin: 0 auto 18px;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 16px;
}

.pw-locked-list .li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  padding: 5px 0;
  color: var(--text);
}

.pw-locked-list .li::before {
  content: "🔒";
  font-size: 12px;
}

.pw-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════ 按钮 ══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(14, 116, 137, 0.3);
}

.btn-coral {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 18px rgba(232, 93, 76, 0.3);
}

.btn-ghost {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* ══════════ 底部操作条 ══════════ */
.lesson-bar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, rgba(247, 245, 240, 0));
  pointer-events: none;
}

.lesson-bar > * {
  pointer-events: auto;
}

.lesson-bar .nav-lbl {
  font-size: 12px;
  color: var(--sub);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-got {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 20px rgba(232, 93, 76, 0.35);
  padding: 13px 34px;
  font-size: 15px;
}

.btn-got.done {
  background: var(--success);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.3);
}

/* ══════════ 弹窗 / toast ══════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  place-items: center;
  z-index: 90;
  padding: 16px;
}

.modal-backdrop.show {
  display: grid;
}

.modal {
  width: min(460px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-pop);
}

.modal h2,
.modal h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal p {
  color: var(--sub);
  font-size: 13.5px;
  margin-bottom: 14px;
}

.modal .row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.modal input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  font: inherit;
  outline: none;
}

.modal input:focus {
  border-color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 99;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════ 课末导航 ══════════ */
.lesson-end {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.end-nav {
  flex: 1;
  min-width: 220px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.end-nav:hover {
  border-color: rgba(14, 116, 137, 0.4);
  transform: translateY(-2px);
}

.end-nav .dir {
  font-size: 11.5px;
  color: var(--sub);
  font-weight: 700;
  margin-bottom: 3px;
}

.end-nav .ttl {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.5;
}

.end-nav.next {
  text-align: right;
}

/* ══════════ 移动端 ══════════ */
.sidebar-mask {
  display: none;
}

@media (max-width: 960px) {
  .learn-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    background: var(--bg);
    box-shadow: var(--shadow-pop);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 55;
  }

  .sidebar-mask.show {
    display: block;
  }

  .hamburger {
    display: grid;
    place-items: center;
  }

  .lesson-bar {
    left: 0;
  }

  .lesson {
    padding: 32px 18px 150px;
  }

  .lesson-header h1 {
    font-size: 24px;
  }

  .lesson-bar .nav-lbl {
    display: none;
  }

  .engine-row {
    grid-template-columns: 88px 1fr 40px;
    font-size: 12.5px;
  }

  .market-row {
    grid-template-columns: 24px minmax(100px, 1fr) repeat(3, 58px) 26px;
    gap: 5px;
  }

  .market-output,
  .geo-result {
    grid-template-columns: 1fr;
  }

  .pim-matrix {
    min-height: 260px;
    margin-left: 12px;
  }

  .geo-groups {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .lesson-tools {
    align-items: stretch;
  }

  .lesson-section-summary {
    width: 100%;
    margin-left: 2px;
  }

  .lesson-bar {
    gap: 6px;
    padding-inline: 8px;
  }

  .lesson-bar .btn {
    padding-inline: 13px;
    font-size: 12px;
  }

  .lesson-bar .btn-got {
    padding-inline: 17px;
  }

  .lab-box {
    padding: 17px 14px;
  }

  .market-row {
    grid-template-columns: 24px 1fr 25px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
  }

  .market-row:first-child {
    border-top: 0;
  }

  .market-row label {
    grid-row: 2;
  }

  .market-row label:nth-of-type(1) {
    grid-column: 2;
    justify-self: start;
  }

  .market-row label:nth-of-type(2) {
    grid-column: 2;
    justify-self: center;
  }

  .market-row label:nth-of-type(3) {
    grid-column: 2;
    justify-self: end;
  }

  .market-row label select {
    width: 48px;
  }

  .market-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .choice-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid button {
    min-height: 0;
  }

  .pim-matrix {
    min-height: 235px;
  }

  .rank-item {
    grid-template-columns: 21px minmax(0, 1fr) 23px;
  }

  .rank-item em {
    grid-column: 2 / 4;
    justify-self: start;
  }

  .course-figure {
    margin: 20px -2px;
    padding: 5px;
    border-radius: 14px;
  }

  .course-figure img {
    border-radius: 10px;
  }

  .course-figure figcaption {
    display: block;
    padding: 9px 7px 6px;
  }

  .course-figure figcaption span {
    display: inline-block;
    margin: 0 5px 4px 0;
  }

  .course-figure figcaption a {
    display: block;
    margin: 4px 0 0;
  }
}

@media (max-width: 760px) {
  .expert-navigation-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .expert-resource-grid {
    grid-template-columns: 1fr;
  }
}
