/* ==========================================================
   引路 · 样式
   纯静态项目，无框架、无构建步骤
   ========================================================== */

:root {
  --bg: #f6f7fc;
  --card: #ffffff;
  --surface-2: #f2f4fa;
  --line-2: #c9d0e3;
  --nav-bg: rgba(246, 247, 252, .82);
  --glow-1: #eef2ff;
  --glow-2: #eafaf1;
  --inline-code: #35406b;
  --hero-bg: linear-gradient(160deg, #ffffff, #fbfcff);
  --tip-bg: #fff8ea;
  --tip-line: #ffe2b0;
  --tip-text: #6a4d10;
  --code-bg: #1b2033;
  --code-text: #e6e9f5;
  --text: #161922;
  --text-2: #4b5166;
  --text-3: #8b91a7;
  --brand: #4f6ef7;
  --brand-soft: #eef1fe;
  --brand-deep: #3f5ad8;
  --ok: #18a058;
  --ok-soft: #e9f7ef;
  --bad: #e5484d;
  --bad-soft: #fdeef0;
  --gold: #f0a02a;
  --line: #e7e9f2;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 25, 34, .05);
  --shadow: 0 6px 24px rgba(30, 38, 80, .07);
  --shadow-lg: 0 14px 40px rgba(30, 38, 80, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -8%, var(--glow-1) 0%, rgba(238, 242, 255, 0) 60%),
    radial-gradient(700px 420px at 92% 4%, var(--glow-2) 0%, rgba(234, 250, 241, 0) 55%),
    var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--text-3); font-size: 14px; }

.view { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; }
.view[hidden] { display: none; }
#main { flex: 1; }

/* ---------------- 导航 ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  width: 100%;
  max-width: 1128px;
  box-sizing: border-box;
  margin: 0 auto;
  backdrop-filter: blur(12px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--surface-2);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #5b7cff, #7a5bf7);
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(79, 110, 247, .35);
}
.brand-name { font-size: 17px; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: var(--text-3); font-weight: 500; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  padding: 7px 12px; border-radius: 9px;
  font-size: 14px; color: var(--text-2); transition: .15s;
}
.nav-links a:hover { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* ---------------- 导航：三横杠菜单（手机竖屏） ---------------- */
.nav-menu { display: flex; align-items: center; flex: 1; min-width: 0; }
.nav-toggle {
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 42px; height: 42px; flex: 0 0 42px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: var(--text-2); transition: transform .2s ease, opacity .2s ease;
}
.nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 手机版：品牌 + 三横杠一行，其余收进下拉菜单 */
.nav.nav-mobile { flex-wrap: nowrap; gap: 10px; padding: 9px 14px; }
.nav.nav-mobile .brand { min-width: 0; }
.nav.nav-mobile .brand-sub { display: none; }
.nav.nav-mobile .nav-toggle { display: inline-flex; margin-left: auto; }
.nav.nav-mobile .nav-menu {
  position: absolute; top: 100%; left: 0; right: 0;
  display: none; flex-direction: column; align-items: stretch; gap: 12px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  max-height: calc(100vh - 60px); overflow-y: auto;
  background: var(--card); border-bottom: 1px solid var(--surface-2);
  box-shadow: 0 18px 40px rgba(16, 24, 48, .16);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.nav.nav-mobile.is-open .nav-menu { display: flex; }
.nav.nav-mobile .nav-links {
  order: 0; width: 100%; margin-left: 0; flex-direction: column; gap: 2px;
}
.nav.nav-mobile .nav-links a { padding: 11px 14px; border-radius: 10px; font-size: 15px; }
.nav.nav-mobile .nav-right {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  width: 100%; margin-left: 0;
}
.nav.nav-mobile .nav-right .nav-major { grid-column: 1 / -1; max-width: 100%; }
.nav.nav-mobile .nav-right #reselectBtn { grid-column: 1 / -1; }
.nav.nav-mobile .theme-btn,
.nav.nav-mobile .nav-me { width: 100%; min-height: 40px; justify-content: center; }
.nav.nav-mobile .nav-me { padding: 6px 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 11px;
  padding: 10px 18px; font-size: 15px; font-weight: 600;
  transition: transform .16s, box-shadow .16s, background .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(79, 110, 247, .28); }
.btn-primary:hover { background: var(--brand-deep); box-shadow: 0 8px 22px rgba(79, 110, 247, .34); }
.btn-ghost { background: var(--card); color: var(--text-2); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--line-2); color: var(--text); }
.btn-danger { background: var(--card); color: var(--bad); border-color: #f4d3d5; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; border-radius: 9px; }
.btn-lg { padding: 13px 24px; font-size: 16px; border-radius: 13px; }

/* ---------------- 首页 hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 24px;
}
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft);
  padding: 4px 11px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 { font-size: 46px; letter-spacing: -.5px; }
.lead { margin-top: 18px; font-size: 16.5px; color: var(--text-2); }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-points { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hero-points li { font-size: 14.5px; color: var(--text-2); padding-left: 24px; position: relative; }
.hero-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
  font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1;
}

/* hero 右侧路径预览卡 */
.hero-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 18px; transform: rotate(-1.2deg);
}
.hero-card-head { display: flex; align-items: center; gap: 6px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #dfe3ee; }
.dot:nth-child(1) { background: #ffb4b4; }
.dot:nth-child(2) { background: #ffdca8; }
.dot:nth-child(3) { background: #b6e8c8; }
.hero-card-title { margin-left: 8px; font-size: 12.5px; color: var(--text-3); }
.preview-stage { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--surface-2); }
.preview-tag {
  flex: 0 0 42px; height: 22px; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.preview-line b { display: block; font-size: 14px; }
.preview-line em { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.preview-foot { padding-top: 12px; font-size: 12.5px; color: var(--text-3); text-align: center; }

/* ---------------- 通用 section ---------------- */
.section { padding: 44px 0 8px; }
.section-title { font-size: 27px; letter-spacing: -.3px; }
.section-sub { margin-top: 8px; color: var(--text-2); font-size: 15px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); font-size: 20px; margin-bottom: 14px;
}
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--text-2); }

/* 学科门类网格 */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.cat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.cat-card:hover { transform: translateY(-3px); border-color: #cfd8ff; box-shadow: var(--shadow); }
.cat-emoji { font-size: 22px; }
.cat-name { font-weight: 700; font-size: 15.5px; margin-top: 4px; }
.cat-desc { font-size: 12.5px; color: var(--text-3); }
.cat-count { font-size: 12.5px; color: var(--brand); font-weight: 600; margin-top: 8px; }

/* 公共必修课（首页） */
.common-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; margin-top: 24px;
}
.common-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; box-shadow: var(--shadow-sm); text-decoration: none;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.common-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.common-tag {
  align-self: flex-start; font-size: 11.5px; font-weight: 700;
  color: var(--brand); background: var(--brand-soft);
  border-radius: 999px; padding: 3px 9px;
}
.common-name { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.5; margin-top: 6px; }
.common-desc { font-size: 12.5px; color: var(--text-3); }
.common-go { font-size: 12.5px; color: var(--brand); font-weight: 600; margin-top: 10px; }

/* 三步流程 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); position: relative;
}
.step-num {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #5b7cff, #7a5bf7); color: #fff;
  font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--text-2); }

/* 底部行动条 */
.cta-band {
  margin-top: 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(120deg, var(--surface-2), #f3eeff);
  border: 1px solid #e3e7ff; border-radius: 20px; padding: 28px 30px; flex-wrap: wrap;
}
.cta-band h3 { font-size: 19px; margin-bottom: 6px; }
.cta-band p { font-size: 14.5px; color: var(--text-2); }

/* ---------------- 专业库 ---------------- */
.page-head { padding: 18px 0 6px; }
.back { display: inline-block; font-size: 13.5px; color: var(--text-3); margin-bottom: 10px; }
.back:hover { color: var(--brand); }
.page-head h1 { font-size: 30px; letter-spacing: -.3px; }
.page-head p { margin-top: 8px; color: var(--text-2); font-size: 15px; max-width: 720px; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: 999px; padding: 7px 14px; font-size: 13.5px;
  transition: .15s; box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip-on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79, 110, 247, .25); }

.major-head { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 14px; flex-wrap: wrap; }
.major-head h2 { font-size: 20px; }

.major-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.major-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  padding: 18px; display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.major-card:hover { transform: translateY(-3px); border-color: #cfd8ff; box-shadow: var(--shadow); }
.major-card-emoji {
  flex: 0 0 38px; height: 38px; border-radius: 11px;
  background: var(--brand-soft); display: grid; place-items: center; font-size: 19px;
}
.major-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.major-card-name { font-weight: 700; font-size: 15.5px; }
.major-card-desc { font-size: 13px; color: var(--text-3); }
.major-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.badge {
  font-size: 11.5px; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid #eaedf6;
}
.badge-on { background: var(--ok-soft); color: var(--ok); border-color: #cdecdb; }
.badge-done { background: var(--brand-soft); color: var(--brand); border-color: #dbe2ff; }
.badge-ghost { background: transparent; color: var(--text-3); }

/* ---------------- 专业路径 ---------------- */
.major-title { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.major-emoji {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--surface-2), #f4eeff); font-size: 26px;
  border: 1px solid #e6e9ff;
}
.major-title h1 { font-size: 28px; }
.major-title p { font-size: 13.5px; margin-top: 2px; }

.progress-row { display: flex; align-items: center; gap: 14px; margin: 20px 0 26px; flex-wrap: wrap; }
.progress-bar { flex: 1; min-width: 180px; height: 8px; background: #e9ecf7; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #5b7cff, #7a5bf7); transition: width .35s; }

.stage-list { display: flex; flex-direction: column; gap: 18px; }
.stage {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.stage-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--surface-2); }
.stage-badge {
  flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px;
}
.stage-title-wrap { flex: 1; min-width: 0; }
.stage-title { font-size: 17.5px; }
.stage-goal { font-size: 13.5px; color: var(--text-3); margin-top: 2px; }
.stage-progress { font-size: 13px; color: var(--text-3); font-weight: 600; }

.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 16px; }
.module { background: var(--card); border: 1px solid var(--surface-2); border-radius: 13px; padding: 13px; }
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.module-name { font-weight: 700; font-size: 14px; }
.module-count { font-size: 12px; color: var(--text-3); }
.level-list { display: flex; flex-direction: column; gap: 6px; }
.level-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; font-size: 12.8px; color: var(--text-2);
  transition: .15s;
}
.level-item:hover { border-color: #cfd8ff; color: var(--text); box-shadow: var(--shadow-sm); }
.level-item.is-done { background: #f7fbf9; border-color: #d8efe4; }
.level-item.is-soon { opacity: .72; }
.level-dot {
  flex: 0 0 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 700;
}
.level-item.is-done .level-dot { background: var(--ok-soft); color: var(--ok); }
.level-item.is-soon .level-dot { background: var(--surface-2); color: var(--text-3); }
.level-name-txt { flex: 1; min-width: 0; }
.level-go { color: var(--brand); font-weight: 600; font-size: 12px; }
.level-soon { color: var(--text-3); font-size: 11.5px; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 12px; }

/* ---------------- 关卡 ---------------- */
.level-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.level-top .back { margin: 0; }
.crumb { font-size: 13.5px; color: var(--text-2); }
.level-top .muted { margin-left: auto; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 26px 28px;
}
.card-title { font-size: 16px; margin-bottom: 14px; }
.quiz-card { max-width: 760px; }
.level-name { font-size: 18px; }
.brief {
  margin-top: 10px; padding: 12px 14px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--surface-2);
  font-size: 13.5px; color: var(--text-2);
}
.brief b { color: var(--text); }
.stem { margin-top: 20px; font-size: 16.5px; font-weight: 600; white-space: pre-wrap; }

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.option {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; font-size: 14.5px; color: var(--text);
  transition: .15s;
}
.option:hover:not(:disabled) { border-color: #c3cdf8; background: var(--card); }
.option:disabled { cursor: default; }
.option-key {
  flex: 0 0 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700;
}
.option-txt { flex: 1; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.8px; }
.option.correct { border-color: #b9e4c9; background: var(--ok-soft); }
.option.correct .option-key { background: var(--ok); color: #fff; }
.option.wrong { border-color: #f5c6c9; background: var(--bad-soft); }
.option.wrong .option-key { background: var(--bad); color: #fff; }

/* ---- 代码任务：编辑器 + 运行 + 判题 ---- */
.code-card { max-width: 900px; margin-top: 18px; }
.code-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.code-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--brand); background: var(--brand-soft);
  padding: 4px 10px; border-radius: 999px;
}
.code-title { font-size: 17px; margin: 8px 0 0; }
.runner-status {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.runner-status.is-ready { color: var(--ok); background: var(--ok-soft); border-color: #bfe6cf; }
.runner-status.is-off { color: var(--bad); background: var(--bad-soft); border-color: #f3c9cb; }
.code-task { font-size: 14px; line-height: 1.75; color: var(--text-2); }
.code-task strong { color: var(--text); }
.code-hint { margin-top: 10px; }
.code-hint summary {
  cursor: pointer; font-size: 12.5px; color: var(--brand); font-weight: 600;
  list-style: none;
}
.code-hint summary::-webkit-details-marker { display: none; }
.code-hint summary::before { content: '💡 '; }
.code-hint p {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.7;
}

.code-shell {
  margin-top: 14px; border-radius: 14px; overflow: hidden;
  border: 1px solid #2a3145; background: var(--code-bg);
  box-shadow: 0 14px 30px rgba(20, 28, 52, .18);
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 14px; background: #1f263a;
  border-bottom: 1px solid #2a3145; flex-wrap: wrap;
}
.code-lang {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: #94a1c6; letter-spacing: .08em;
}
.code-lang i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #63d19a; margin-right: 7px; font-style: normal;
}
.code-btns { display: flex; gap: 7px; flex-wrap: wrap; }
.code-btn {
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid #39415a; background: #262e45; color: #c8d1ee;
  transition: .15s;
}
.code-btn:hover { background: #303a58; color: #fff; }
.code-btn.is-primary { background: #4f6ef7; border-color: #4f6ef7; color: #fff; }
.code-btn.is-primary:hover { background: #637ff8; }
.code-btn:disabled { opacity: .55; cursor: not-allowed; }
.code-editor {
  display: block; width: 100%; min-height: 250px; resize: vertical;
  border: 0; outline: none; padding: 14px 16px;
  background: var(--code-bg); color: var(--code-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.75; tab-size: 4;
}
.code-output {
  margin: 0; padding: 12px 16px; max-height: 220px; overflow: auto;
  background: #10141f; border-top: 1px solid #2a3145;
  color: #d8e2ff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.code-output.is-bad { color: #ff9fa2; }
.code-output.is-ok { color: #96e6b3; }
.code-tests { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.code-test {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
  background: var(--surface-2);
}
.code-test.is-pass { color: var(--ok); border-color: #bfe6cf; background: var(--ok-soft); }
.code-test.is-fail { color: var(--bad); border-color: #f3c9cb; background: var(--bad-soft); }
.code-foot { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.code-note { font-size: 12px; color: var(--text-3); line-height: 1.7; }

/* ---------- 代码任务：离线判定（骨架 / 填空 / 输出预测） ---------- */
.code-ref {
  margin: 0; padding: 14px 16px; max-height: 280px; overflow: auto;
  background: var(--code-bg); color: var(--code-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.75; white-space: pre-wrap;
}
.code-blanks { margin-top: 16px; display: grid; gap: 12px; }
.blank-item {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.blank-q { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.blank-input {
  width: 100%; box-sizing: border-box; outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.blank-input::placeholder { color: var(--text-3); }
.blank-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.code-predict { margin-top: 16px; }
.code-predict-q { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.code-predict-q code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--inline-code); color: var(--text);
  padding: 2px 7px; border-radius: 6px; font-size: 12.5px;
}
.code-predict-label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.code-predict-input {
  width: 100%; box-sizing: border-box; resize: vertical; outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.code-predict-input:focus {
  border-color: var(--brand); background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.code-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.code-actions .code-btn { font-size: 13.5px; padding: 10px 22px; border-radius: 11px; }

.feedback { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.feedback strong { display: block; font-size: 15px; margin-bottom: 6px; }
.fb-ok { color: var(--ok); }
.fb-bad { color: var(--bad); }
.feedback p { font-size: 14px; color: var(--text-2); margin-bottom: 14px; }

.empty-card { max-width: 760px; text-align: center; padding: 44px 28px; }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-card h2 { font-size: 19px; margin-bottom: 10px; }
.empty-card p { color: var(--text-2); font-size: 14.5px; max-width: 480px; margin: 0 auto 20px; }

/* ---------------- 报告 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 18px; box-shadow: var(--shadow-sm); }
.stat-num { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.stat-label { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.record-list { display: flex; flex-direction: column; }
.record { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--surface-2); font-size: 14px; }
.record:last-child { border-bottom: 0; }
.record-name { flex: 1; min-width: 0; }
.record-major { font-size: 12.5px; color: var(--text-3); }
.record-score { font-weight: 700; font-size: 13.5px; color: var(--text-2); }

.btn-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---------------- 页脚 / 提示 ---------------- */
.footer {
  max-width: 1080px; margin: 0 auto; padding: 32px 24px 48px;
  border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px;
}
.footer-sub { margin-top: 4px; font-size: 12px; color: #a6abbf; }
.footer-contact { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.footer-contact a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.footer-contact a:hover { color: var(--text-1); }

.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 14px);
  background: #161922; color: #fff; padding: 11px 20px; border-radius: 11px;
  font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 50;
  box-shadow: 0 12px 30px rgba(22, 25, 34, .28);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= v3：专业隔离 / 学习方式 / 闯关地图 / 讲解区 ================= */

/* hidden 属性必须压过 .lesson-video 之类的 display 规则 */
[hidden] { display: none !important; }

/* ---- 导航右侧：当前专业 + 重新选择 ---- */
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: 14px; }
.nav-major {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
  box-shadow: var(--shadow-sm); white-space: nowrap;
  max-width: 210px; overflow: hidden; text-overflow: ellipsis;
}

/* ---- 我的专业卡 ---- */
.my-major-card { max-width: 720px; }
.my-major-head { display: flex; align-items: center; gap: 16px; }
.my-major-emoji {
  flex: 0 0 58px; height: 58px; border-radius: 17px;
  display: grid; place-items: center; font-size: 28px;
  background: var(--brand-soft);
}
.my-major-head h2 { font-size: 23px; letter-spacing: -.2px; }

/* ---- 我的专业页：学习方式切换（显眼大按钮） ---- */
.learn-switch {
  margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line);
}
.learn-switch-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.learn-switch-head strong { font-size: 15px; }
.learn-switch-head .muted { font-size: 13px; }
.learn-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.learn-opt {
  position: relative; display: flex; align-items: center; gap: 12px;
  text-align: left; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 15px 16px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, transform .12s;
}
.learn-opt:hover { border-color: var(--line-2); transform: translateY(-1px); }
.learn-emoji {
  flex: 0 0 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; background: var(--brand-soft);
}
.learn-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.learn-text strong { font-size: 15px; font-weight: 700; }
.learn-text em { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.learn-check {
  margin-left: auto; flex: 0 0 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  color: #fff; background: var(--line); opacity: .45;
}
.learn-opt-on {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 6px 18px rgba(79, 110, 247, .16);
}
.learn-opt-on .learn-emoji { background: var(--card); }
.learn-opt-on .learn-check { background: var(--brand); opacity: 1; }
.learn-opt-on .learn-text strong { color: var(--brand); }

/* ---- 路径页上的紧凑切换 ---- */
.mode-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: -4px 0 18px;
}
.mode-row-label { font-size: 13px; color: var(--text-3); font-weight: 600; }
.mode-btn {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--text-2); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 7px 15px; transition: all .15s;
}
.mode-btn:hover { border-color: var(--line-2); color: var(--text); }
.mode-btn-on {
  color: var(--brand); background: var(--brand-soft);
  border-color: var(--brand); box-shadow: 0 3px 10px rgba(79, 110, 247, .14);
}
.mode-row-hint { font-size: 12.5px; color: var(--text-3); margin-left: 2px; }
.link { color: var(--brand); font-size: 13px; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---- 选学习方式 ---- */
.style-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 26px; max-width: 860px;
}
.style-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 28px 24px; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.style-card:hover { transform: translateY(-3px); border-color: #cfd8ff; box-shadow: var(--shadow); }
.style-card.style-on { border-color: var(--brand); box-shadow: 0 12px 30px rgba(79, 110, 247, .18); }
.style-emoji { font-size: 34px; }
.style-name { font-size: 19px; font-weight: 700; }
.style-desc { font-size: 14px; color: var(--text-2); }
.style-tag { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.style-check {
  position: absolute; top: 16px; right: 18px;
  font-size: 12px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 4px 10px; border-radius: 999px;
}
.style-note { margin-top: 18px; }

/* ---- 闯关地图：可拖动的横向旅程 ---- */
.map-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2); margin: 4px 0 18px;
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lg-done { background: #3f6b52; }
.lg-open { background: #e0b054; }
.lg-lock { background: #b3c0b8; }

.map-list { display: flex; flex-direction: column; gap: 26px; }

.journey {
  position: relative; overflow: hidden; border-radius: 26px;
  user-select: none; -webkit-user-select: none;
  border: 1px solid #cfe2e0;
  background-color: #d9eaea;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath d='M4 15 Q23 29 42 15' fill='none' stroke='%23ffffff' stroke-opacity='0.55' stroke-width='1.6'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath d='M4 15 Q23 29 42 15' fill='none' stroke='%2378a49e' stroke-opacity='0.16' stroke-width='1.4'/%3E%3C/svg%3E");
  background-size: 46px 38px;
  background-position: 0 0, 23px 19px;
  box-shadow: 0 18px 44px rgba(32, 76, 62, .08);
}
.journey-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 28px 0; position: relative; flex-wrap: wrap;
}
.journey-kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .22em; color: #6d8d7e;
}
.journey-kicker::after { content: ''; width: 46px; height: 1px; background: #a6c1b4; }
.journey-title { font-size: 28px; letter-spacing: .04em; margin: 6px 0 4px; color: #22382f; }
.journey-desc { margin: 0; font-size: 12.5px; line-height: 1.55; color: #5f7c6f; max-width: 520px; }
.journey-side {
  margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.journey-total { text-align: right; color: #2c463a; padding-top: 6px; }
.journey-total strong { display: block; font-size: 27px; line-height: 1; font-weight: 600; }
.journey-total span { display: block; margin-top: 4px; font-size: 11.5px; color: #708c7f; }
.journey-lit {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 249, 232, .82); border: 1px solid rgba(201, 165, 77, .35);
  font-size: 11.5px; color: #6f7d4f;
}
.journey-lit b { font-size: 13px; color: #4a7a5f; }
.journey-lit-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9a8, #e0b054);
  box-shadow: 0 0 6px rgba(224, 176, 84, .9);
}
.journey-heading { flex: 1 1 300px; min-width: 0; }
.journey-compass {
  flex: 0 0 auto; width: 46px; height: 46px; color: #587566;
}
.journey-compass svg { display: block; width: 100%; height: 100%; }
.journey-compass span,
.journey-compass i { display: none; }

.journey-stage { display: flex; align-items: center; gap: 6px; padding: 0 10px 2px; }
.journey-viewport {
  flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
  cursor: grab; touch-action: pan-y;
  scrollbar-width: none; -ms-overflow-style: none;
  user-select: none; -webkit-user-select: none;
}
.journey-viewport::-webkit-scrollbar { display: none; }
.journey-viewport.is-dragging { cursor: grabbing; }
.journey-viewport:focus-visible { outline: 2px solid rgba(79, 110, 247, .5); outline-offset: -2px; }
.journey-track {
  position: relative;
  user-select: none; -webkit-user-select: none;
}
.journey-head, .journey-foot { user-select: none; -webkit-user-select: none; }

.journey-arrow {
  flex: 0 0 34px; height: 54px; border-radius: 16px;
  border: 1px solid rgba(95, 130, 112, .26);
  background: rgba(255, 255, 255, .72);
  color: #4d6c5c; font-size: 22px; line-height: 1;
  cursor: pointer; transition: .15s; padding: 0;
}
.journey-arrow:hover { background: #fff; color: #2f5342; box-shadow: 0 6px 16px rgba(54, 88, 71, .14); }

.journey-land { position: absolute; left: 0; top: 0; display: block; }
.journey-path { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.jdeco { position: absolute; pointer-events: none; }

.jnode {
  position: absolute; transform: translate(-50%, -50%);
  width: 164px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.jnode:disabled { cursor: not-allowed; }
.jnode-badge {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14.5px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #f2ce74, #e0b054);
  border: 4px solid #fff9e8;
  box-shadow: 0 4px 0 rgba(122, 94, 39, .16), 0 9px 18px rgba(74, 66, 37, .2);
  transition: transform .18s, box-shadow .18s;
}
.jnode.is-done .jnode-badge {
  background: linear-gradient(180deg, #4a7a5f, #3a5f49); font-size: 18px;
  box-shadow: 0 4px 0 rgba(58, 95, 73, .22), 0 0 0 6px rgba(139, 205, 164, .2), 0 10px 24px rgba(58, 95, 73, .28);
}
.jnode.just-lit .jnode-badge { animation: jnodeLit 1s ease-out; }
@keyframes jnodeLit {
  0% { transform: scale(.65); box-shadow: 0 0 0 0 rgba(255, 222, 128, .95); }
  45% { transform: scale(1.18); box-shadow: 0 0 0 18px rgba(255, 222, 128, 0); }
  100% { transform: scale(1); }
}
.jnode.is-lock .jnode-badge { background: #b6c2ba; border-color: #eef3ef; box-shadow: 0 3px 0 rgba(90, 105, 97, .12); }
.jnode.is-current .jnode-badge { animation: jnodePulse 1.9s ease-in-out infinite; }
.jnode.is-open:hover .jnode-badge { transform: translateY(-3px) scale(1.06); }
@keyframes jnodePulse {
  0%, 100% { box-shadow: 0 4px 0 rgba(122, 94, 39, .16), 0 0 0 0 rgba(224, 176, 84, .5); }
  55% { box-shadow: 0 4px 0 rgba(122, 94, 39, .16), 0 0 0 12px rgba(224, 176, 84, 0); }
}
.jnode-title {
  max-width: 168px; padding: 0 4px;
  font-size: 12px; font-weight: 600; color: #2a4035;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .65);
}
.jnode-sub {
  padding: 0 4px;
  font-size: 10.5px; color: #647d70;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
.jnode.is-lock .jnode-title { color: #7f9086; }
.jnode.is-lock .jnode-sub { color: #8fa096; }

.journey-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 0 28px 12px; font-size: 11.5px; color: #7d978a;
}

html[data-theme="night"] .journey {
  background-color: #14201b;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath d='M4 15 Q23 29 42 15' fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='1.6'/%3E%3C/svg%3E"),
    radial-gradient(120% 80% at 10% 0%, rgba(60, 84, 74, .35), rgba(60, 84, 74, 0) 55%);
  background-size: 46px 38px, auto;
  border-color: #253a31;
}
html[data-theme="night"] .journey-title { color: #ddeade; }
html[data-theme="night"] .journey-desc,
html[data-theme="night"] .journey-kicker,
html[data-theme="night"] .journey-total span,
html[data-theme="night"] .journey-foot { color: #8fa89a; }
html[data-theme="night"] .journey-total { color: #d7e5da; }
html[data-theme="night"] .journey-lit {
  background: rgba(24, 38, 32, .85); border-color: #3a5142; color: #a9bda8;
}
html[data-theme="night"] .journey-lit b { color: #9fd2ad; }
html[data-theme="night"] .journey-arrow { background: rgba(30, 46, 39, .8); border-color: #2c4437; color: #a9c2b2; }
html[data-theme="night"] .journey-arrow:hover { background: #23382d; color: #dcebe0; }
html[data-theme="night"] .jnode-title { background: none; color: #dcebe2; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
html[data-theme="night"] .jnode-sub { background: none; color: #90a89b; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
html[data-theme="night"] .jnode.is-lock .jnode-title { color: #7f9488; }

@media (max-width: 720px) {
  .journey-head { padding: 20px 20px 4px; }
  .journey-title { font-size: 24px; }
  .journey-desc { font-size: 12.5px; }
  .journey-compass { width: 36px; height: 36px; opacity: .85; }
  .journey-total strong { font-size: 22px; }
  .journey-arrow { display: none; }
  .journey-foot { padding: 0 20px 14px; }
  .journey-foot span:first-child { display: none; }
  .jnode { width: 140px; }
  .jnode-title { max-width: 140px; font-size: 12px; }
}
.map-note { margin-top: 18px; }

/* ---- 文字说明：文档页（左目录 + 正文 + 右页内目录） ---- */
.view-doc { padding-top: 6px; }
.doc-wrap {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 200px;
  gap: 34px;
  max-width: 1240px;
  margin: 0 auto;
  align-items: start;
}

.doc-side {
  position: sticky; top: 84px;
  max-height: calc(100vh - 104px);
  display: flex; flex-direction: column;
}
.doc-side .back { font-size: 13px; color: var(--text-3); flex: none; }
.doc-side-kicker {
  margin-top: 14px; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  color: var(--text-3); flex: none;
}
.doc-side-title {
  margin-top: 6px; font-size: 14.5px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex: none;
}
.doc-side-sub { margin-top: 2px; font-size: 12.5px; color: var(--text-3); flex: none; }
.doc-nav, .video-nav {
  margin-top: 14px; display: flex; flex-direction: column; gap: 2px;
  border-left: 2px solid var(--line); padding-left: 0;
  overflow-y: auto; flex: 1; min-height: 0;
  scrollbar-width: thin;
}
.doc-nav::-webkit-scrollbar, .video-nav::-webkit-scrollbar { width: 6px; }
.doc-nav::-webkit-scrollbar-thumb, .video-nav::-webkit-scrollbar-thumb { background: #dfe3ef; border-radius: 999px; }
.doc-nav-stage {
  margin-top: 14px; font-size: 12px; font-weight: 800; color: var(--text);
  padding: 6px 0 4px 12px; letter-spacing: .02em;
  background: var(--surface-2); border-radius: 0 8px 8px 0; margin-left: -2px;
}
.doc-nav-stage:first-child { margin-top: 0; }
.doc-nav-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); padding: 8px 0 6px 12px;
}
.doc-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 12px; margin-left: -2px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  font-size: 13.5px; color: var(--text-2);
  transition: .15s;
}
.doc-nav-item:hover { background: var(--surface-2); color: var(--text); }
.doc-nav-item.is-on {
  border-left-color: var(--brand); background: var(--brand-soft);
  color: var(--brand); font-weight: 700;
}
.doc-nav-dot { width: 14px; text-align: center; font-size: 12px; color: var(--text-3); }
.doc-nav-item.is-on .doc-nav-dot { color: var(--brand); }
.doc-nav-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-nav-soon {
  font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 6px; white-space: nowrap; background: #fafbfe;
}

.doc-main {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 36px 26px; box-shadow: var(--shadow-sm);
  min-width: 0;
}
.doc-crumb { font-size: 12.5px; color: var(--text-3); letter-spacing: .02em; }
.doc-title { margin: 8px 0 10px; font-size: 26px; letter-spacing: -.4px; }
.doc-lead {
  margin: 0 0 6px; font-size: 15px; line-height: 1.8; color: var(--text-2);
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.doc-readbar {
  margin-top: 14px; display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--text-3); white-space: nowrap;
}
.doc-readtag {
  font-weight: 800; letter-spacing: .04em; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 3px 10px;
}
.doc-readbar-track { flex: 1; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.doc-readbar-track i {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transition: width .15s ease;
}
.doc-body h2 {
  font-size: 18.5px; margin: 28px 0 10px; letter-spacing: -.2px;
  scroll-margin-top: 84px;
}
.doc-body p { font-size: 14.8px; line-height: 1.9; color: var(--text-2); margin: 10px 0; }
.doc-body b, .doc-body strong { color: var(--text); }
.doc-body ul, .doc-body ol { margin: 10px 0 14px; padding-left: 22px; }
.doc-body li { font-size: 14.8px; line-height: 1.85; color: var(--text-2); margin: 5px 0; }
.doc-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; background: var(--surface-2); color: var(--inline-code);
  padding: 2px 5px; border-radius: 5px;
}
.doc-body pre {
  margin: 14px 0; padding: 14px 16px; border-radius: 12px;
  background: #1c2033; overflow-x: auto; border: 1px solid #262c45;
}
.doc-body pre code {
  background: none; color: #dfe4ff; padding: 0; font-size: 13px; line-height: 1.7;
}
.doc-tip {
  margin: 16px 0; padding: 12px 15px; border-radius: 10px;
  background: var(--tip-bg); border-left: 3px solid var(--gold);
  font-size: 14px; line-height: 1.8; color: var(--tip-text);
}
.doc-tip b { color: var(--tip-text); }

.doc-refs { margin-top: 30px; padding-top: 18px; border-top: 1px dashed var(--line); }
.doc-refs h3 { font-size: 14px; color: var(--text-3); font-weight: 700; }
.doc-ref-list { margin: 10px 0 8px; padding-left: 20px; }
.doc-ref-list li { font-size: 14px; line-height: 1.9; }
.doc-ref-list a { color: var(--brand); text-decoration: none; }
.doc-ref-list a:hover { text-decoration: underline; }
.doc-ref-note { font-size: 12.5px; color: var(--text-3); }
.doc-ref-note a { color: var(--text-3); }

.doc-foot {
  margin-top: 26px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

.doc-toc { position: sticky; top: 84px; border-left: 1px solid var(--line); padding-left: 16px; }
.doc-toc-title { font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: .05em; margin-bottom: 8px; }
.doc-toc-link {
  display: block; font-size: 13px; color: var(--text-3);
  padding: 5px 0; line-height: 1.5; border-left: 2px solid transparent;
  padding-left: 8px; margin-left: -10px;
}
.doc-toc-link:hover { color: var(--brand); border-left-color: var(--brand); }

/* ---- 视频讲解：课程播放页（右侧章节折叠目录） ---- */
.view-video { padding-top: 6px; }
.course-head { max-width: 1240px; margin: 0 auto 20px; }
.course-head-top { display: flex; align-items: center; gap: 12px; }
.course-head-top .back { font-size: 13px; color: var(--text-3); }
.course-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 3px 10px;
}
.course-title { margin: 12px 0 6px; font-size: 28px; letter-spacing: -.5px; }
.course-meta { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.course-dot { margin: 0 8px; color: var(--text-3); }

.course-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px; max-width: 1240px; margin: 0 auto; align-items: start;
}
.course-main {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 24px 24px; box-shadow: var(--shadow-sm); min-width: 0;
}
.player-box {
  margin-top: 0; width: 100%; aspect-ratio: 16 / 9;
  background: #0f1117; border-radius: 14px; overflow: hidden;
  border: 1px solid #1d2233;
}
.player-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-foot {
  margin-top: 10px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px;
}
.player-foot .link { color: var(--brand); text-decoration: none; }
.player-foot .link:hover { text-decoration: underline; }
.player-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--text-3); }

/* 右侧课程目录卡片 */
.course-side {
  position: sticky; top: 84px; max-height: calc(100vh - 104px);
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.course-side-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); flex: none; }
.course-side-kicker {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--text-3);
}
.course-side-title { margin-top: 6px; font-size: 14px; font-weight: 800; line-height: 1.4; color: var(--text); }
.course-side-sub { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.course-side-now { margin-top: 8px; font-size: 11.5px; font-weight: 700; line-height: 1.5; color: var(--brand); }
.course-side-now:empty { display: none; }

.video-nav {
  margin-top: 0; padding: 6px 8px 10px;
  border-left: 0; border-radius: 0;
  overflow-y: auto; flex: 1; min-height: 0;
}
.course-chapter { border-bottom: 1px solid var(--line); }
.course-chapter:last-child { border-bottom: 0; }
.course-chapter-head {
  width: 100%; display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 8px; border: 0; background: none; border-radius: 8px;
  font-family: inherit; text-align: left; color: var(--text-2); cursor: pointer;
}
.course-chapter-head:hover { background: var(--surface-2); }
.course-chapter-idx {
  flex: none; width: 24px; padding-top: 2px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--text-3);
}
.course-chapter-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.course-chapter-name { font-size: 12.8px; font-weight: 700; line-height: 1.45; color: var(--text); }
.course-chapter-range { font-size: 10.5px; color: var(--text-3); }
.course-chapter-arrow { flex: none; font-size: 11px; color: var(--text-3); transition: transform .18s; }
.course-chapter.is-open .course-chapter-arrow { transform: rotate(180deg); }
.course-chapter.is-mine .course-chapter-idx,
.course-chapter.is-mine .course-chapter-name { color: var(--brand); }
.course-chapter-body { display: none; padding: 0 0 8px 2px; }
.course-chapter.is-open .course-chapter-body { display: block; }

.ep-group-label {
  margin: 20px 0 8px; font-size: 12.5px; font-weight: 800;
  color: var(--text-3); letter-spacing: .04em;
}
.ep-list { margin-top: 4px; }
.ep-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 13.5px; color: var(--text-2);
  transition: .15s;
}
.ep-card:hover { border-color: #c3cdf8; background: var(--card); }
.ep-card.is-playing { border-color: #c3cdf8; background: var(--brand-soft); color: var(--brand); }
.ep-card .ep-no {
  flex: none; font-size: 11.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 6px; padding: 2px 7px;
}
.ep-card.is-playing .ep-no { background: var(--card); }
.ep-card .ep-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-card .ep-dur { flex: none; color: var(--text-3); font-size: 12px; }
.ep-card .ep-play { flex: none; font-size: 12px; color: var(--brand); }

.video-ep {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; margin: 2px 4px;
  border-radius: 8px;
  font-size: 12.5px; color: var(--text-2); transition: .15s;
}
.video-ep:hover { background: var(--surface-2); color: var(--text); }
.video-ep.is-mine { color: var(--text); font-weight: 600; }
.video-ep.is-mine .video-ep-no { color: var(--brand); }
.video-ep.is-extra { opacity: .72; }
.video-ep.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.video-ep-no { flex: none; width: 32px; font-size: 11px; color: var(--text-3); }
.video-ep-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-ep-dur { flex: none; font-size: 10.5px; color: var(--text-3); }

/* ---- 学习方式卡片：即将开放角标 ---- */
.style-badge {
  display: inline-block; margin-left: 8px; vertical-align: 2px;
  font-size: 10.5px; font-weight: 700; color: #a2650a;
  background: #fff4e0; border: 1px solid #ffe2b0;
  padding: 1px 7px; border-radius: 999px;
}

/* 首页四步 */
.steps { grid-template-columns: repeat(4, 1fr); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .doc-wrap { grid-template-columns: 210px minmax(0, 1fr); gap: 26px; }
  .doc-toc { display: none; }
  .course-stage { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 30px; }
  .hero h1 { font-size: 36px; }
  .hero-card { transform: none; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .major-grid { grid-template-columns: repeat(2, 1fr); }
  .modules { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-sub { display: none; }
}

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .quote-card { flex-wrap: wrap; }
  .checkin-week { gap: 5px; }
  .ck-day { padding: 6px 2px; }
  .ck-dow { font-size: 10px; }
  .ck-date { font-size: 9.5px; }
  .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view { padding: 18px 16px 48px; }
  .hero h1 { font-size: 29px; }
  .lead { font-size: 15px; }
  .section-title { font-size: 21px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .major-grid, .modules { grid-template-columns: 1fr; }
  .card { padding: 20px 18px; }
  .stem { font-size: 15.5px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-band { padding: 20px; }
  .cta-band h3 { font-size: 17px; }
  .doc-wrap { grid-template-columns: 1fr; gap: 18px; }
  .doc-side, .course-side { position: static; max-height: none; }
  .doc-nav {
    flex-direction: row; flex-wrap: wrap; border-left: 0;
    border-top: 1px solid var(--line); padding-top: 10px;
    max-height: 240px;
  }
  .doc-nav-label, .doc-nav-stage { display: none; }
  .doc-nav-item { margin-left: 0; border-left: 0; border-radius: 8px; }
  .doc-main, .course-main { padding: 22px 18px; }
  .doc-title { font-size: 22px; }
  .course-stage { grid-template-columns: 1fr; gap: 18px; }
  .course-title { font-size: 23px; }
  .course-meta { font-size: 12.5px; }
  .video-nav { max-height: 300px; }
  .course-chapter:first-child .course-chapter-body { display: block; }
}

/* ==========================================================
   主题：晨雀（默认，白）/ 夜猫（黑）
   切换方式：<html data-theme="night">，见 js/app.js 的 applyTheme()
   ========================================================== */
html[data-theme="night"] {
  color-scheme: dark;
  --bg: #0e1120;
  --card: #171b2c;
  --surface-2: #1f2438;
  --line: #2a3049;
  --line-2: #3a4262;
  --text: #e8ebf6;
  --text-2: #b3bbd3;
  --text-3: #7e88a4;
  --brand: #7d95ff;
  --brand-soft: #232c4f;
  --brand-deep: #a3b4ff;
  --ok: #3fca85;
  --ok-soft: #12301f;
  --bad: #ff7175;
  --bad-soft: #3a1c22;
  --gold: #f2b455;
  --nav-bg: rgba(14, 17, 32, .86);
  --glow-1: #1a2246;
  --glow-2: #102b23;
  --inline-code: #c3cbef;
  --tip-bg: #2c2413;
  --tip-line: #4a3a12;
  --tip-text: #f0d59a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .55);
}
html[data-theme="night"] .footer-sub { color: var(--text-3); }
html[data-theme="night"] .dot { background: #39405c; }
html[data-theme="night"] .toast { background: #e8ebf6; color: #14172a; }
html[data-theme="night"] .learn-check { color: #fff; }
html[data-theme="night"] .learn-opt-on .learn-emoji { background: #2b3560; }
html[data-theme="night"] .mode-btn { background: var(--card); }
html[data-theme="night"] .doc-body pre { background: #0b0e1a; border-color: #232a45; }
html[data-theme="night"] .doc-body pre code { color: #cfd6ff; }
html[data-theme="night"] .hero-card { transform: rotate(-1.2deg); }
html[data-theme="night"] .option.is-correct { background: rgba(63, 202, 133, .12); }
html[data-theme="night"] .option.is-wrong { background: rgba(255, 113, 117, .12); }
html[data-theme="night"] .video-player, 
html[data-theme="night"] .player-box { background: #05070f; }
html[data-theme="night"] img { opacity: .94; }

/* 主题切换按钮 */
.theme-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--text-2); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; transition: .15s; white-space: nowrap;
}
.theme-btn:hover { color: var(--text); border-color: var(--line-2); }
.theme-btn .theme-ico { font-size: 14px; }
/* ==========================================================
   首页改版：继续上次 / 鼓励语 / 公告轮播 / 数据条
   ========================================================== */
.hero-side { display: grid; gap: 14px; align-content: start; }

.resume-card { padding: 4px 2px 2px; }
.resume-major { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.resume-level { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.resume-meta { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }
.resume-empty { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 14px; }

.quote-card {
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.quote-text {
  margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.6;
  color: var(--brand-ink, var(--text));
}
.quote-next {
  flex: 0 0 auto; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  color: var(--text-3); background: transparent; border: 0; padding: 4px;
  border-radius: 8px; transition: .15s;
}
.quote-next:hover { color: var(--brand); background: var(--card); }
.quote-tools { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.checkin-btn {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--brand); background: var(--card); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px; transition: .15s; white-space: nowrap;
}
.checkin-btn:hover { border-color: var(--brand); }
.checkin-btn.is-done,
.checkin-btn:disabled {
  cursor: default; color: var(--ok); background: rgba(24, 160, 88, .08);
  border-color: rgba(24, 160, 88, .28);
}

/* 公告轮播 */
.caro-section { margin-top: 8px; }
.section-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.caro-ctrl { display: flex; gap: 8px; }
.caro-arrow {
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--text-2);
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; transition: .15s;
}
.caro-arrow:hover { color: var(--brand); border-color: var(--brand); }

.carousel { overflow: hidden; border-radius: 18px; }
.caro-track { display: flex; transition: transform .5s cubic-bezier(.4, .1, .2, 1); }
.caro-card {
  flex: 0 0 100%; min-width: 100%; box-sizing: border-box;
  display: flex; align-items: flex-start; gap: 16px;
  padding: 22px 24px; border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}
.caro-emoji {
  flex: 0 0 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  background: var(--surface-2);
}
.caro-body { min-width: 0; }
.caro-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 8px;
  background: var(--surface-2); color: var(--text-3);
}
.caro-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--text); }
.caro-desc { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }

.caro-card.tone-blue { background: linear-gradient(135deg, rgba(79,110,247,.10), var(--card)); }
.caro-card.tone-violet { background: linear-gradient(135deg, rgba(139,92,246,.10), var(--card)); }
.caro-card.tone-green { background: linear-gradient(135deg, rgba(24,160,88,.10), var(--card)); }
.caro-card.tone-amber { background: linear-gradient(135deg, rgba(240,160,42,.12), var(--card)); }
.caro-card.tone-pink { background: linear-gradient(135deg, rgba(236,72,153,.10), var(--card)); }
.caro-card.tone-slate { background: linear-gradient(135deg, rgba(100,116,139,.10), var(--card)); }

.caro-dots { display: flex; gap: 7px; justify-content: center; margin-top: 12px; }
.caro-dot {
  width: 7px; height: 7px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--line-2); transition: .2s;
}
.caro-dot.on { width: 20px; background: var(--brand); }

/* 数据条 */
.stat-band {
  margin-top: 34px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px 10px;
}
.stat-band-item { text-align: center; }
.stat-band-item b { display: block; font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: .01em; }
.stat-band-item span { font-size: 12.5px; color: var(--text-3); }

/* 导航右侧：个人入口 */
.nav-me {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 6px; transition: .15s;
}
.nav-me:hover { color: var(--text); border-color: var(--line-2); }
.nav-me .nav-avatar {
  width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
  font-size: 14px; background: var(--surface-2);
}
.nav-me-on { color: var(--text); }

/* ==========================================================
   个人中心
   ========================================================== */
.guest-card { max-width: 640px; }
.guest-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.guest-avatar {
  flex: 0 0 52px; height: 52px; border-radius: 999px; font-size: 24px;
  display: grid; place-items: center; background: var(--surface-2);
}
.guest-head h3 { margin: 0 0 4px; font-size: 17px; }
.guest-head p { margin: 0; font-size: 13px; line-height: 1.6; }

.guest-form { display: grid; gap: 16px; }
.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field-input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14.5px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px;
  transition: .15s;
}
.field-input:focus { outline: none; border-color: var(--brand); background: var(--card); }
.field-hint { margin: 0; font-size: 12.5px; color: var(--text-3); }

.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-opt {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  font-size: 20px; line-height: 1; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; transition: .15s;
}
.avatar-opt:hover { transform: translateY(-2px); border-color: var(--line-2); }
.avatar-opt.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(79,110,247,.16); }

.profile-card { padding-bottom: 18px; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
  flex: 0 0 64px; height: 64px; border-radius: 999px; font-size: 30px;
  display: grid; place-items: center; background: var(--brand-soft);
}
.profile-id { flex: 1; min-width: 0; }
.profile-id h2 { margin: 0 0 3px; font-size: 21px; }
.profile-tags { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-3);
}
.tag-ok { background: rgba(24,160,88,.12); color: var(--ok); }

.profile-stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--surface-2);
}
.pf-stat { text-align: center; }
.pf-stat b { display: block; font-size: 16px; font-weight: 700; color: var(--text); }
.pf-stat span { font-size: 12px; color: var(--text-3); }

/* 每日打卡 */
.checkin-card { margin-bottom: 18px; }
.checkin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.checkin-head .card-title { margin-bottom: 4px; }
.checkin-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--surface-2);
}
.ck-stat { text-align: center; }
.ck-stat b { display: block; font-size: 20px; font-weight: 700; color: var(--text); }
.ck-stat span { font-size: 12px; color: var(--text-3); }
.checkin-week { display: flex; gap: 8px; margin-top: 16px; }
.ck-day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid transparent;
}
.ck-day.is-on { background: rgba(224, 176, 84, .12); border-color: rgba(224, 176, 84, .4); }
.ck-day.is-today { border-color: var(--brand); }
.ck-dow { font-size: 11px; color: var(--text-3); }
.ck-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; color: var(--text-3); background: var(--card);
}
.ck-day.is-on .ck-dot {
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #e0b054);
  color: #5a4315; font-weight: 800;
  box-shadow: 0 0 10px rgba(224, 176, 84, .55);
}
.ck-date { font-size: 10.5px; color: var(--text-3); }

.study-bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar {
  width: 100%; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--brand), rgba(79,110,247,.45));
  min-height: 4px; transition: height .4s ease;
}
.bar-empty { background: var(--surface-2); }
.bar-label { font-size: 12px; color: var(--text-3); }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--surface-2);
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row b { font-size: 14.5px; color: var(--text); }
.setting-row p { margin: 4px 0 0; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; line-height: 1.6; }

@media (max-width: 900px) {
  .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .caro-card { padding: 18px; }
  .hero-side { grid-template-columns: 1fr; }
}

/* ===== 合并：账号 / 打卡 / 照明 / 版式（来自服务器版） ===== */


/* ==========================================================
   个人中心
   ========================================================== */
.guest-card { max-width: 640px; }
.guest-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.guest-avatar {
  flex: 0 0 52px; height: 52px; border-radius: 999px; font-size: 24px;
  display: grid; place-items: center; background: var(--surface-2);
}
.guest-head h3 { margin: 0 0 4px; font-size: 17px; }
.guest-head p { margin: 0; font-size: 13px; line-height: 1.6; }

.guest-form { display: grid; gap: 16px; }
.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field-input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14.5px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px;
  transition: .15s;
}
.field-input:focus { outline: none; border-color: var(--brand); background: var(--card); }
.field-hint { margin: 0; font-size: 12.5px; color: var(--text-3); }

.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-opt {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  font-size: 20px; line-height: 1; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; transition: .15s;
}
.avatar-opt:hover { transform: translateY(-2px); border-color: var(--line-2); }
.avatar-opt.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(79,110,247,.16); }

.profile-card { padding-bottom: 18px; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
  flex: 0 0 64px; height: 64px; border-radius: 999px; font-size: 30px;
  display: grid; place-items: center; background: var(--brand-soft);
}
.profile-id { flex: 1; min-width: 0; }
.profile-id h2 { margin: 0 0 3px; font-size: 21px; }
.profile-tags { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-3);
}
.tag-ok { background: rgba(24,160,88,.12); color: var(--ok); }

.profile-stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--surface-2);
}
.pf-stat { text-align: center; }
.pf-stat b { display: block; font-size: 16px; font-weight: 700; color: var(--text); }
.pf-stat span { font-size: 12px; color: var(--text-3); }

.study-bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar {
  width: 100%; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--brand), rgba(79,110,247,.45));
  min-height: 4px; transition: height .4s ease;
}
.bar-empty { background: var(--surface-2); }
.bar-label { font-size: 12px; color: var(--text-3); }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--surface-2);
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row b { font-size: 14.5px; color: var(--text); }
.setting-row p { margin: 4px 0 0; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; line-height: 1.6; }

@media (max-width: 900px) {
  .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .caro-card { padding: 18px; }
  .hero-side { grid-template-columns: 1fr; }
}
/* 学号输入：固定学校简称前缀 */
.sid-input-wrap {
  display: flex; align-items: stretch;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; overflow: hidden; transition: .15s;
}
.sid-input-wrap:focus-within { border-color: var(--brand); background: var(--card); }
.sid-prefix {
  display: flex; align-items: center; padding: 0 12px;
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-3); background: var(--card);
  border-right: 1px solid var(--line); user-select: none;
}
.sid-input {
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  padding-left: 12px;
}
.sid-input:focus { background: transparent !important; }

/* 学校搜索选择（替代原来的下拉框） */
.school-pick { position: relative; }
.school-search { width: 100%; }
.school-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  max-height: 268px; overflow-y: auto; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 32px rgba(16, 24, 40, .16);
}
.school-opt {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  text-align: left; cursor: pointer; font: inherit;
}
.school-opt b {
  flex: 0 0 auto; min-width: 66px;
  color: var(--brand); font-size: 12.5px; letter-spacing: .04em;
}
.school-opt span { font-size: 13.5px; color: var(--text-2); }
.school-opt:hover, .school-opt.is-active { background: var(--surface-2); }
.school-opt-custom b { color: var(--text-3); }
.school-empty { padding: 10px; font-size: 12.5px; line-height: 1.6; color: var(--text-3); }
.school-picked { margin: 6px 0 8px; font-size: 12.5px; color: var(--text-3); }
.school-picked.is-empty { visibility: hidden; }
.sid-standalone { width: 100%; }
/* ============================================================
 * 打卡 / 照明看板 · 云端账号 · 点亮动画
 * ============================================================ */
.cloud-only[hidden] { display: none !important; }

/* ---------- 首页看板 ---------- */
.pulse-section { margin-top: 6px; }

.pulse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pulse-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pulse-top { display: flex; align-items: center; justify-content: space-between; }
.pulse-label { font-size: 13px; color: var(--text-3); letter-spacing: .4px; }
.pulse-ico { font-size: 18px; line-height: 1; }
.pulse-value { display: flex; align-items: baseline; gap: 6px; color: var(--text-2); font-size: 15px; }
.pulse-value b {
  font-size: 42px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -1px;
}
.pulse-hint { margin: 0; font-size: 12.5px; color: var(--text-3); }
.pulse-btn { align-self: flex-start; margin-top: 2px; }

.pulse-card-glow {
  background: linear-gradient(160deg, #fff8e9 0%, var(--card) 62%);
  border-color: #f4e0b4;
}
.pulse-card-glow .pulse-value b { color: #b26a00; }
.pulse-card-glow .pulse-ico { animation: bulbGlow 3.2s ease-in-out infinite; }
@keyframes bulbGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,181,0,0)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 8px rgba(255,181,0,.55)); }
}

.pulse-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.pulse-bar i {
  display: block; height: 100%; width: 10%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffd166, #ff9f1c);
  transition: width .8s cubic-bezier(.2,.8,.2,1);
}

.pulse-flash .pulse-card-glow { animation: pulseFlash .9s ease; }
@keyframes pulseFlash {
  0% { box-shadow: 0 0 0 0 rgba(255,159,28,.5); }
  100% { box-shadow: 0 0 0 20px rgba(255,159,28,0); }
}

/* ==========================================================
   手机竖屏优化（≤640px 自动触发；点导航「版式」按钮可强制手机版）
   依据 2026 移动端通用规范：
   - 触控目标 ≥ 44px（Apple HIG）/ 48dp（Material），相邻间隔 ≥ 8px
   - 正文字号 ≥ 16px，输入框 ≥ 16px（防 iOS 聚焦自动放大）
   - 主按钮全宽，落在拇指可达区；表格/代码块横向滚动不撑破页面
   - 底部留出 iPhone 安全区（env(safe-area-inset-bottom)）
   ========================================================== */
@media (max-width: 640px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; }
  img, video, iframe { max-width: 100%; }

  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 38px; }

  .hero h1 { font-size: clamp(28px, 8.5vw, 34px); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }

  .view { padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }

  .level-list { gap: 8px; }
  .level-item { min-height: 48px; align-items: center; }
  .options { gap: 10px; }
  .option { min-height: 48px; align-items: center; padding: 13px 16px; }

  .doc-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .doc-body pre { overflow-x: auto; font-size: 13px; -webkit-overflow-scrolling: touch; }

  #caroPrev, #caroNext { min-width: 44px; min-height: 44px; }
  .quote-next { min-height: 40px; }
}

/* 强制手机版（桌面浏览器上把内容收窄成手机宽度，便于演示/调试） */
html[data-layout="mobile"] { background: #e8ecf7; }
html[data-layout="mobile"][data-theme="night"] { background: #0a0e1c; }
html[data-layout="mobile"] body {
  max-width: 480px; margin: 0 auto;
  box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(20, 28, 60, .14);
}
html[data-layout="mobile"] body { font-size: 16px; }
html[data-layout="mobile"] input,
html[data-layout="mobile"] select,
html[data-layout="mobile"] textarea { font-size: 16px; }
html[data-layout="mobile"] .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
html[data-layout="mobile"] .btn-sm { min-height: 38px; }
html[data-layout="mobile"] .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 30px; }
html[data-layout="mobile"] .hero h1 { font-size: clamp(28px, 8.5vw, 34px); }
html[data-layout="mobile"] .hero-card { transform: none; }
html[data-layout="mobile"] .hero-actions { flex-direction: column; align-items: stretch; }
html[data-layout="mobile"] .hero-actions .btn { width: 100%; }
html[data-layout="mobile"] .view { padding: 18px 16px calc(48px + env(safe-area-inset-bottom, 0px)); }
html[data-layout="mobile"] .brand-sub { display: none; }
html[data-layout="mobile"] .cat-grid { grid-template-columns: repeat(2, 1fr); }
html[data-layout="mobile"] .major-grid,
html[data-layout="mobile"] .modules { grid-template-columns: 1fr; }
html[data-layout="mobile"] .feature-grid,
html[data-layout="mobile"] .steps { grid-template-columns: 1fr; }
html[data-layout="mobile"] .stat-grid { grid-template-columns: repeat(2, 1fr); }
html[data-layout="mobile"] .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-layout="mobile"] .pulse-grid { grid-template-columns: 1fr; }
html[data-layout="mobile"] .doc-wrap { grid-template-columns: 1fr; gap: 18px; }
html[data-layout="mobile"] .doc-toc { display: none; }
html[data-layout="mobile"] .doc-side,
html[data-layout="mobile"] .video-side { position: static; max-height: none; }
html[data-layout="mobile"] .video-wrap { grid-template-columns: 1fr; gap: 18px; }
html[data-layout="mobile"] .level-list { gap: 8px; }
html[data-layout="mobile"] .level-item { min-height: 48px; align-items: center; }
html[data-layout="mobile"] .options { gap: 10px; }
html[data-layout="mobile"] .option { min-height: 48px; align-items: center; padding: 13px 16px; }
html[data-layout="mobile"] .doc-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
html[data-layout="mobile"] .doc-body pre { overflow-x: auto; font-size: 13px; -webkit-overflow-scrolling: touch; }
html[data-layout="mobile"] #caroPrev,
html[data-layout="mobile"] #caroNext { min-width: 44px; min-height: 44px; }

/* ---------- 账号切换 tab ---------- */
.auth-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  background: var(--surface-2);
  border-radius: 12px;
}
.auth-tab {
  padding: 7px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

/* ==========================================================
   触控手感修复（手机端审计后补）
   ========================================================== */
/* 1. iOS 点按灰闪换成品牌色淡闪；禁双击缩放（保留捏合缩放与平滑滚动） */
button, a, [role="button"] { -webkit-tap-highlight-color: rgba(79, 110, 247, .12); }
body { touch-action: manipulation; }

/* 2. 全局按压反馈：手机没有 hover，按下要"陷下去"才有手感 */
.theme-btn:active, .quote-next:active, .caro-arrow:active, .nav-me:active, .nav-toggle:active,
.cat-card:active, .major-card:active, .common-card:active,
.level-item:active, .option:active:not(:disabled) {
  transform: scale(.97);
}
.theme-btn, .quote-next, .caro-arrow, .nav-me, .nav-toggle,
.cat-card, .major-card, .common-card, .level-item, .option {
  transition: transform .12s ease, box-shadow .16s, border-color .16s, background .16s, color .15s;
}

/* 3. 轮播圆点视觉 7px 不变，点击热区扩到 ~25px（WCAG 最低 24px） */
.caro-dot { position: relative; }
.caro-dot::after { content: ''; position: absolute; inset: -9px; border-radius: 999px; }

/* 4. 竖屏下导航小按钮加高到 38px，更好点 */
@media (max-width: 640px) {
  .theme-btn, .nav-me { min-height: 38px; }
  .theme-btn { padding: 8px 14px; }
}
html[data-layout="mobile"] .theme-btn,
html[data-layout="mobile"] .nav-me { min-height: 38px; }
html[data-layout="mobile"] .theme-btn { padding: 8px 14px; }
.auth-tab:hover { color: var(--brand); }
.auth-tab.is-on {
  background: var(--card);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16,24,48,.1);
}

.pwd-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  max-width: 420px;
}

/* ---------- 点亮（照明）动画 ---------- */
.light-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 20, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .55s ease;
}
.light-overlay.is-on { opacity: 1; }
.light-halo {
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9a8 0%, rgba(255,214,102,.6) 36%, rgba(255,196,0,0) 70%);
  opacity: 0;
}
.light-overlay.is-on .light-halo { animation: halo 1.9s ease forwards; }
@keyframes halo {
  0% { transform: scale(.25); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: scale(5.5); opacity: 0; }
}
.light-text { position: relative; text-align: center; color: #fff; }
.light-emoji { margin: 0 0 8px; font-size: 42px; line-height: 1; }
.light-title { margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.light-sub { margin: 0; font-size: 14px; color: rgba(255,255,255,.82); }
.light-sub b { color: #ffd166; font-size: 17px; }

/* ---------- 夜猫模式 ---------- */
html[data-theme="night"] .pulse-card-glow {
  background: linear-gradient(160deg, #2b2214 0%, var(--card) 62%);
  border-color: #4a3a12;
}
html[data-theme="night"] .pulse-card-glow .pulse-value b { color: #ffcf6b; }
html[data-theme="night"] .auth-tab.is-on {
  background: rgba(125,149,255,.16);
  box-shadow: none;
}
html[data-theme="night"] .light-overlay { background: rgba(4,6,14,.72); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .pulse-grid { grid-template-columns: 1fr; }
}

/* ---- 本机旧记录提示（在线但未登录） ---- */
.stale-hint {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(224, 176, 84, .12);
  border: 1px solid rgba(224, 176, 84, .38);
  color: #7a5a12;
  font-size: 13px;
  line-height: 1.7;
}
.stale-hint b { color: #6b4d0a; }
html[data-theme="night"] .stale-hint {
  background: rgba(224, 176, 84, .1);
  border-color: rgba(224, 176, 84, .32);
  color: #e6c98a;
}
html[data-theme="night"] .stale-hint b { color: #f2d79b; }

/* ---- 题目页右上角：看这一关的讲解 ---- */
.level-top .level-explain {
  color: var(--brand);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-weight: 600;
}
.level-top .level-explain:hover { text-decoration: none; filter: brightness(1.04); }

/* ==========================================================
   公共必修课：文字说明（分章 + 思维导图）
   ----------------------------------------------------------
   结构：左栏章节目录 / 中栏「核心句 + 思维导图 + 必背要点 + 考法」
   / 右栏数字考点速记。每章用 --ch-accent 换主色，避免一页到底发灰。
   ========================================================== */
.common-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.common-card-in { border-color: color-mix(in srgb, var(--brand) 24%, var(--line)); }
.common-card-in .common-go { font-weight: 700; }

/* ---- 课程头部 ---- */
.course-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 2px; }
.cm-chip {
  font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px;
}

/* ---- 每一章 ---- */
.course-ch {
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.course-ch:first-of-type { margin-top: 22px; padding-top: 0; border-top: 0; }

/* 开篇的总览图 */
.course-map { margin: 10px 0 0; }
.course-map + .course-ch { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }

.ch-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ch-num {
  flex: none; font-size: 11.5px; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--ch-accent, var(--brand));
  border-radius: 7px; padding: 3px 9px;
}
.doc-body .ch-head h2 { margin: 0; font-size: 19px; letter-spacing: -.2px; line-height: 1.5; }

/* 一句话核心 */
.doc-body .ch-core {
  margin: 14px 0 16px; padding: 12px 16px;
  border-left: 3px solid var(--ch-accent, var(--brand));
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  background: color-mix(in srgb, var(--ch-accent, #4f6ef7) 8%, var(--card));
  font-size: 14.6px; line-height: 1.85; color: var(--text-2);
}

/* ---- 思维导图：根 → 分支（标签 + 叶子） ---- */
.mm {
  margin: 4px 0 20px; padding: 16px 18px 10px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ch-accent, #4f6ef7) 5%, var(--card)), var(--card));
}
.mm-root {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 800; color: #fff;
  background: var(--ch-accent, var(--brand));
  padding: 7px 15px; border-radius: 999px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ch-accent, #4f6ef7) 30%, transparent);
}
.mm-root::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .85);
}
.mm-body {
  position: relative;
  margin: 6px 0 0 16px; padding-left: 18px;
  border-left: 2px solid var(--line);
}
.mm-branch {
  position: relative; display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px; align-items: start;
  padding: 9px 0;
}
.mm-branch::before {
  content: ''; position: absolute; left: -18px; top: 21px;
  width: 14px; height: 2px; background: var(--line);
}
.mm-label {
  font-size: 12.5px; font-weight: 800; text-align: center;
  color: var(--ch-accent, var(--brand));
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ch-accent, #4f6ef7) 28%, var(--line));
  border-radius: 8px; padding: 5px 8px; line-height: 1.45;
}
.mm-leaves { display: flex; flex-wrap: wrap; gap: 7px; }
.mm-leaf {
  font-size: 12.8px; line-height: 1.5; color: var(--text-2);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px;
  transition: border-color .15s, color .15s, transform .15s;
}
.mm-leaf:hover {
  border-color: var(--ch-accent, var(--brand));
  color: var(--text); transform: translateY(-1px);
}

/* ---- 必背要点 ---- */
.doc-body .ch-h3 {
  margin: 22px 0 10px; font-size: 12.5px; font-weight: 800;
  letter-spacing: .1em; color: var(--text-3);
}
.doc-body .kp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-body .kp-list li {
  position: relative; margin: 0; padding-left: 20px;
  font-size: 14.4px; line-height: 1.85; color: var(--text-2);
}
.doc-body .kp-list li::before {
  content: ''; position: absolute; left: 3px; top: .74em;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--ch-accent, var(--brand)); opacity: .8;
  transform: rotate(45deg);
}

/* ---- 考法提示 ---- */
.course-tip {
  margin: 18px 0 2px; padding: 12px 15px; border-radius: 10px;
  background: var(--tip-bg); border-left: 3px solid var(--gold);
  font-size: 13.8px; line-height: 1.85; color: var(--tip-text);
}
.course-tip b { color: var(--tip-text); margin-right: 6px; }

/* ---- 右栏：数字考点速记 ---- */
.quick-item {
  display: flex; gap: 9px; padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.quick-item:last-child { border-bottom: 0; }
.quick-n {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800;
  color: var(--brand); background: var(--brand-soft);
}
.quick-body { min-width: 0; }
.quick-t { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.45; }
.quick-d { display: block; font-size: 11.5px; color: var(--text-3); line-height: 1.55; margin-top: 2px; }

/* ---- 手机 / 窄屏 ---- */
@media (max-width: 640px) {
  .mm { padding: 14px 12px 8px; }
  .mm-body { margin-left: 6px; padding-left: 12px; }
  .mm-branch { grid-template-columns: 1fr; gap: 6px; padding: 8px 0; }
  .mm-branch::before { display: none; }
  .mm-label { justify-self: start; }
  .doc-body .ch-head h2 { font-size: 17.5px; }
  .doc-body .kp-list li { font-size: 14px; }
}
html[data-layout="mobile"] .mm-branch { grid-template-columns: 1fr; gap: 6px; }
html[data-layout="mobile"] .mm-branch::before { display: none; }
html[data-layout="mobile"] .mm-label { justify-self: start; }
/* ---- 夜猫模式补丁：公共必修课 / 已通关节点 / 角标 / 建设中标签 ----
   （这几条曾被合并队友代码时误覆盖，重新补回，改动时请保留） */
html[data-theme="night"] .style-badge { background: #3a2f14; border-color: #4a3a12; color: #f0d59a; }
html[data-theme="night"] .common-card:hover { border-color: var(--brand); }
html[data-theme="night"] .level-item.is-done,
html[data-theme="night"] .map-node.is-done,
html[data-theme="night"] .jnode.is-done {
  background: #12301f;
  border-color: #2b6b48;
}
html[data-theme="night"] .doc-nav-soon { background: var(--surface-2); }
html[data-theme="night"] .jnode.is-done .jnode-badge { background: #1c5c3c; color: #d8f5e4; }

/* ==========================================================
   多级折叠：阶段 → 模块 → 关卡（路径页 / 文档页目录）
   桌面端保持原样全部展开，折叠只在手机版生效
   ========================================================== */
button.stage-head, button.module-head,
button.doc-nav-stage, button.doc-nav-label, button.side-fold-btn {
  font: inherit; color: inherit; background: none; border: 0;
  text-align: left; width: 100%; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
button.stage-head { align-items: center; }
/* 折叠头是 button，标题/说明改用 span，需要补回块级显示 */
.stage-title { display: block; }
.stage-goal { display: block; }
/* 桌面端保持原来的分隔线与阶段标签底色（button 的 border/background 重置后补回） */
@media (min-width: 641px) {
  html:not([data-layout="mobile"]) button.stage-head { border-bottom: 1px solid var(--surface-2); }
  html:not([data-layout="mobile"]) button.doc-nav-stage { background: var(--surface-2); }
}
button.doc-nav-stage { margin-left: -2px; }
button.doc-nav-label { display: flex; align-items: center; gap: 8px; }
.doc-nav-label-txt { flex: 1; min-width: 0; }
.doc-nav-stage-txt { flex: 1; min-width: 0; }
.stage-head .fold-arrow,
.module-head .fold-arrow { margin-left: 2px; }
.fold-arrow {
  display: none; flex: none; font-size: 11px; color: var(--text-3);
  transition: transform .18s ease;
}
.fold.is-open > * > .fold-arrow { transform: rotate(180deg); }

/* 桌面端：目录卡片的折叠按钮不显示 */
.doc-fold-btn { display: none; }
.side-fold-btn {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%; padding: 0; border: 0; background: none;
  font: inherit; text-align: left; cursor: pointer;
}

/* ---------- 手机竖屏：三级折叠 ---------- */
@media (max-width: 640px) {
  .fold-arrow { display: inline-block; }

  /* 路径页 */
  .stage { padding: 14px 14px 12px; border-radius: 14px; }
  .stage-list { gap: 12px; }
  .stage-head { min-height: 52px; padding-bottom: 0; border-bottom: 0; }
  .stage.is-open > .stage-head { padding-bottom: 12px; border-bottom: 1px solid var(--surface-2); }
  .stage-title { font-size: 16.5px; }
  .stage-goal { font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .stage-progress { font-size: 12px; }
  .stage:not(.is-open) > .stage-body { display: none !important; }
  .modules { grid-template-columns: 1fr; gap: 8px; padding-top: 12px; }
  .module { padding: 0 12px; }
  .module-head { min-height: 48px; margin-bottom: 0; }
  .module.is-open > .module-head { margin-bottom: 10px; }
  .module:not(.is-open) > .module-body { display: none !important; }
  .module-name { font-size: 14.5px; }

  /* 文档页：目录收成一张可展开的卡片 */
  .doc-fold-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; min-height: 44px; margin-top: 10px; padding: 0 13px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
    font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer;
  }
  .doc-side { position: static; max-height: none; }
  .doc-side > .doc-nav { display: none; margin-top: 10px; max-height: 56vh; }
  .doc-side.is-open > .doc-nav { display: flex; }
  .doc-nav {
    border-left: 0; padding-left: 0;
    flex-direction: column; flex-wrap: nowrap; gap: 4px; max-height: 56vh;
  }
  .doc-nav-item { white-space: normal; }
  .doc-nav-stage { margin-top: 0; border-radius: 8px; min-height: 44px; display: flex; align-items: center; gap: 8px; }
  .doc-nav-label { min-height: 40px; padding-left: 16px; }
  .doc-nav-group:not(.is-open) > .doc-nav-group-body { display: none; }
  .doc-nav-sub:not(.is-open) > .doc-nav-sub-body { display: none; }
  .doc-nav-sub-body { padding-left: 10px; }
  .doc-nav-item { min-height: 42px; }

  /* 视频页：播放器在上，目录收成可展开卡片 */
  .course-stage { grid-template-columns: 1fr; gap: 14px; }
  .course-head { margin-bottom: 12px; }
  .course-title { font-size: 21px; letter-spacing: -.3px; }
  .course-meta { font-size: 12.5px; }
  .course-main { padding: 12px 12px 14px; border-radius: 14px; }
  .player-box { border-radius: 10px; }
  .player-foot { font-size: 12px; gap: 8px; }
  .player-hint { font-size: 11.5px; line-height: 1.6; }
  .course-side { position: static; max-height: none; border-radius: 14px; }
  .course-side-head { padding: 12px 14px; }
  .course-side:not(.is-open) > .video-nav { display: none !important; }
  .video-nav { max-height: 56vh; }
  .video-ep { min-height: 42px; padding: 9px 10px; font-size: 13px; }
  .video-ep-dur { display: none; }
  .course-chapter-head { min-height: 48px; }
  .ep-group-label { margin: 16px 0 8px; }
  .ep-card { flex-wrap: wrap; gap: 6px 8px; padding: 11px 12px; }
  .ep-card .ep-name { flex: 1 1 100%; order: 3; white-space: normal; line-height: 1.5; }
  .ep-card .ep-dur { display: none; }
  .ep-card .ep-play { order: 1; margin-left: auto; }
  .doc-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .doc-foot .btn { width: 100%; }
}

/* ---------- 强制手机版（桌面演示）同样折叠 ---------- */
html[data-layout="mobile"] .fold-arrow { display: inline-block; }
html[data-layout="mobile"] .stage { padding: 14px 14px 12px; border-radius: 14px; }
html[data-layout="mobile"] .stage-list { gap: 12px; }
html[data-layout="mobile"] .stage-head { min-height: 52px; padding-bottom: 0; border-bottom: 0; }
html[data-layout="mobile"] .stage.is-open > .stage-head { padding-bottom: 12px; border-bottom: 1px solid var(--surface-2); }
html[data-layout="mobile"] .stage-title { font-size: 16.5px; }
html[data-layout="mobile"] .stage-goal { font-size: 12.5px; line-height: 1.5; }
html[data-layout="mobile"] .stage:not(.is-open) > .stage-body { display: none !important; }
html[data-layout="mobile"] .modules { grid-template-columns: 1fr; gap: 8px; padding-top: 12px; }
html[data-layout="mobile"] .module { padding: 0 12px; }
html[data-layout="mobile"] .module-name { font-size: 14.5px; }
html[data-layout="mobile"] .module-head { min-height: 48px; margin-bottom: 0; }
html[data-layout="mobile"] .module.is-open > .module-head { margin-bottom: 10px; }
html[data-layout="mobile"] .module:not(.is-open) > .module-body { display: none !important; }
html[data-layout="mobile"] .doc-fold-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 44px; margin-top: 10px; padding: 0 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer;
}
html[data-layout="mobile"] .doc-side > .doc-nav { display: none; margin-top: 10px; max-height: 56vh; }
html[data-layout="mobile"] .doc-side.is-open > .doc-nav { display: flex; }
html[data-layout="mobile"] .doc-nav {
  border-left: 0; padding-left: 0;
  flex-direction: column; flex-wrap: nowrap; gap: 4px; max-height: 56vh;
}
html[data-layout="mobile"] .doc-nav-item { white-space: normal; }
html[data-layout="mobile"] .doc-nav-stage { margin-top: 0; border-radius: 8px; min-height: 44px; display: flex; align-items: center; gap: 8px; }
html[data-layout="mobile"] .doc-nav-label { min-height: 40px; padding-left: 16px; }
html[data-layout="mobile"] .doc-nav-group:not(.is-open) > .doc-nav-group-body { display: none; }
html[data-layout="mobile"] .doc-nav-sub:not(.is-open) > .doc-nav-sub-body { display: none; }
html[data-layout="mobile"] .doc-nav-sub-body { padding-left: 10px; }
html[data-layout="mobile"] .doc-nav-item { min-height: 42px; }
html[data-layout="mobile"] .course-stage { grid-template-columns: 1fr; gap: 14px; }
html[data-layout="mobile"] .course-title { font-size: 21px; letter-spacing: -.3px; }
html[data-layout="mobile"] .course-main { padding: 12px 12px 14px; border-radius: 14px; }
html[data-layout="mobile"] .player-box { border-radius: 10px; }
html[data-layout="mobile"] .course-side { position: static; max-height: none; border-radius: 14px; }
html[data-layout="mobile"] .course-side-head { padding: 12px 14px; }
html[data-layout="mobile"] .course-side:not(.is-open) > .video-nav { display: none !important; }
html[data-layout="mobile"] .video-nav { max-height: 56vh; }
html[data-layout="mobile"] .video-ep { min-height: 42px; padding: 9px 10px; font-size: 13px; }
html[data-layout="mobile"] .video-ep-dur { display: none; }
html[data-layout="mobile"] .course-chapter-head { min-height: 48px; }
html[data-layout="mobile"] .ep-card { flex-wrap: wrap; gap: 6px 8px; padding: 11px 12px; }
html[data-layout="mobile"] .ep-card .ep-name { flex: 1 1 100%; order: 3; white-space: normal; line-height: 1.5; }
html[data-layout="mobile"] .ep-card .ep-dur { display: none; }
html[data-layout="mobile"] .ep-card .ep-play { order: 1; margin-left: auto; }
html[data-layout="mobile"] .doc-foot { flex-direction: column; align-items: stretch; gap: 8px; }
html[data-layout="mobile"] .doc-foot .btn { width: 100%; }

/* ==========================================================
   学习搭子「小引」· 桌面宠物挂件
   ========================================================== */
.pet {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 8600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.pet > * { pointer-events: auto; }

.pet-body {
  width: 100px;
  height: 100px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffffff, var(--brand-soft) 72%);
  box-shadow: var(--shadow-lg);
  font-size: 30px;
  line-height: 1;
  cursor: grab;
  display: grid;
  place-items: center;
  padding: 0;
  animation: petBob 3.4s ease-in-out infinite;
  transition: transform .18s ease, box-shadow .18s ease;
  touch-action: none;
  user-select: none;
}
.pet-body:hover { transform: translateY(-2px) scale(1.04); }
.pet-body.is-drag { cursor: grabbing; animation: none; transform: scale(.96); }
.pet-face { display: inline-block; animation: petBlink 5.6s ease-in-out infinite; }

.pet.is-thinking .pet-body { animation: petThink 1s ease-in-out infinite; }
.pet.is-offline .pet-body { filter: saturate(.65); }

/* 小引的可爱 SVG 形象 + 互动动画 */
.pet-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pet-body-shape { fill: #ffffff; stroke: #e4e9f2; stroke-width: 2; }
.pet-belly { fill: #eef4ff; }
.pet-foot { fill: #e7eef9; }
.pet-blush { fill: #ffb3c4; opacity: .85; }
.pet-eye-white { fill: #ffffff; stroke: #dfe5ee; stroke-width: 1.2; }
.pet-pupil { fill: #2b2f3a; }
.pet-shine { fill: #ffffff; }
.pet-mouth { fill: none; stroke: #2b2f3a; stroke-width: 2.4; stroke-linecap: round; }
.pet-sprout { fill: #7fd6a4; stroke: #5cbf8a; stroke-width: 1; }
.pet-sprout2 { opacity: .85; }
.pet-arm { fill: #ffffff; stroke: #e4e9f2; stroke-width: 2; }
.pet-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: petEyeBlink 5.6s ease-in-out infinite;
}
@keyframes petEyeBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.12); }
  97% { transform: scaleY(1); }
}
.pet-body.is-bounce { animation: petBob 3.4s ease-in-out infinite, petBounce .6s ease; }
@keyframes petBounce {
  0%   { transform: translateY(0) scale(1, 1); }
  28%  { transform: translateY(-12px) scale(.9, 1.12); }
  58%  { transform: translateY(0) scale(1.1, .9); }
  78%  { transform: translateY(0) scale(.98, 1.02); }
  100% { transform: translateY(0) scale(1, 1); }
}
.pet-particle {
  position: absolute; right: 24px; bottom: 86px;
  font-size: 17px; line-height: 1; pointer-events: none; z-index: 1;
  animation: petPop 1.5s ease-out forwards;
}
@keyframes petPop {
  0%   { opacity: 0; transform: translate(0, 0) scale(.5); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), -52px) scale(1.15); }
}
/* 夜猫模式：把小引的皮肤调暗一点，免得在深色背景上太刺眼 */
html[data-theme="night"] .pet-body-shape { fill: #2a3350; stroke: #3a4566; }
html[data-theme="night"] .pet-belly { fill: #313c5c; }
html[data-theme="night"] .pet-foot { fill: #2a3350; }
html[data-theme="night"] .pet-eye-white { fill: #c9d4ee; stroke: #3a4566; }

.pet-bubble {
  max-width: 240px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease;
  position: relative;
}
.pet-bubble.is-on { opacity: 1; transform: none; }
.pet-bubble::after {
  content: '';
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  background: var(--card);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.pet-panel {
  width: 332px;
  max-width: calc(100vw - 40px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pet-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.pet-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft);
  font-size: 17px;
}
.pet-title { font-size: 13px; font-weight: 600; line-height: 1.3; flex: 1; min-width: 0; }
.pet-sub { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); }
.pet-x {
  border: 0; background: transparent; color: var(--text-3);
  font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.pet-x:hover { background: var(--line); color: var(--text); }

.pet-log {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  min-height: 120px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.pet-msg {
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.pet-msg.ai { align-self: flex-start; background: var(--surface-2); color: var(--text); border-top-left-radius: 5px; }
.pet-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-top-right-radius: 5px; }
.pet-msg.is-typing { color: var(--text-3); }

.pet-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 12px 10px;
}
.pet-chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all .15s ease;
}
.pet-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.pet-inputrow {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}
.pet-inputrow input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  outline: none;
}
.pet-inputrow input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pet-inputrow button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 13px;
  cursor: pointer;
}
.pet-inputrow button:hover { background: var(--brand-deep); }

@keyframes petBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes petBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.72); }
}
@keyframes petThink {
  0%, 100% { transform: rotate(0) scale(1); }
  35% { transform: rotate(-5deg) scale(1.03); }
  70% { transform: rotate(5deg) scale(1.03); }
}

/* 夜猫模式 */
html[data-theme="night"] .pet-body {
  background: radial-gradient(circle at 35% 28%, #262c44, #1b2033 72%);
  border-color: var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
}
html[data-theme="night"] .pet-bubble::after { background: var(--card); }
html[data-theme="night"] .pet-head { background: var(--surface-2); }

/* 手机：贴底、别挡内容 */
html[data-layout="mobile"] .pet { right: 14px; bottom: 14px; }
html[data-layout="mobile"] .pet-body { width: 54px; height: 54px; font-size: 26px; }
html[data-layout="mobile"] .pet-panel { width: calc(100vw - 28px); }
html[data-layout="mobile"] .pet-log { max-height: 44vh; }

/* ==========================================================
   同步教材卡片（关卡页顶部：教材 / 章节 / 知识点 / 难度）
   ========================================================== */
.tb-sync {
  margin: 14px 0 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
  line-height: 1.65;
}
.tb-sync[hidden] { display: none; }
.tb-sync-wide { margin-bottom: 4px; }

.tb-sync-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tb-sync-kicker {
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-deep);
}
.tb-sync-chapter {
  font-size: 13px;
  color: var(--text-2, #5b6480);
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}
.tb-sync-diff {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
  color: #fff;
}
.tb-sync-diff.is-入门 { background: var(--ok); }
.tb-sync-diff.is-进阶 { background: var(--brand); }
.tb-sync-diff.is-综合 { background: var(--gold); }

.tb-sync-book { display: flex; flex-direction: column; gap: 2px; }
.tb-sync-book b { font-size: 15px; color: var(--text); }
.tb-sync-meta { font-size: 12.5px; color: var(--text-2, #6b748f); }
.tb-sync-chapline {
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-deep);
}

.tb-sync-points {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tb-points-label {
  font-size: 12px;
  color: var(--text-2, #6b748f);
  margin-right: 2px;
}
.tb-point {
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  color: var(--text);
}

.tb-sync-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-2, #6b748f);
}

/* 专业路径页：模块名下面挂一行教材名 */
.module-book {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2, #6b748f);
}

/* ==================== 科目选择页 ==================== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.subjects-stage-header {
  grid-column: 1 / -1;
  margin-top: 20px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line, #e5e7eb);
}

.subjects-stage-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #1f2937);
  margin: 0;
}

.subject-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--card, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.subject-card:hover {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.subject-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.subject-card-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft, #f3f4f6);
  border-radius: 10px;
}

.subject-card-info {
  flex: 1;
  min-width: 0;
}

.subject-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #1f2937);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subject-card-course {
  font-size: 13px;
  color: var(--text-2, #6b7280);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subject-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-soft, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.subject-card-progress span {
  font-size: 13px;
  color: var(--text-2, #6b7280);
  white-space: nowrap;
}

.subject-card-arrow {
  font-size: 20px;
  color: var(--text-2, #9ca3af);
  margin-left: 12px;
  transition: transform 0.2s ease;
}

.subject-card:hover .subject-card-arrow {
  transform: translateX(4px);
  color: var(--primary, #3b82f6);
}