/* ===== classio.cn 课程站 · 浅色主题（参照 pdai.tech / VuePress 1 默认主题实测参数） ===== */
/* 用手机浏览器打开时也像 App：不许双指缩放、不许双击放大，正常滑动不受影响 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  touch-action: pan-x pan-y;
}
:root {
  --c-text: #2c3e50;
  --c-text-soft: #4a5b6d;
  --c-text-light: #6b7a8c;
  --c-accent: #3eaf7c;
  --c-accent-dark: #2f8f65;
  --c-border: #eaecef;
  --c-border-soft: #f0f2f5;
  --c-bg: #ffffff;
  --c-bg-soft: #f3f4f5;
  --navbar-h: 58px;
  --sidebar-w: 288px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--navbar-h);
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.navbar-inner {
  display: flex; align-items: center; height: 100%; min-width: 0;
  padding: 0 20px; gap: 4px;
}
.site-title {
  font-size: 17px; font-weight: 700; color: var(--c-text);
  text-decoration: none; white-space: nowrap; margin-right: 26px;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.site-title:hover { color: var(--c-accent); }
.navbar-links { display: flex; align-items: center; overflow: hidden; min-width: 0; }
.navbar-links a {
  font-size: 14.9px; color: var(--c-text); text-decoration: none;
  margin-right: 22px; white-space: nowrap;
}
.navbar-links a:hover { color: var(--c-accent); }
.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 32px; height: 32px; margin-right: 8px; padding: 0;
  background: none; border: 0; border-radius: 8px;
  color: var(--c-text); font-size: 18px; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-toggle:hover { background: rgba(44, 62, 80, .07); }
.sidebar-toggle:active { background: rgba(44, 62, 80, .12); }

/* ---------- 布局 ---------- */
.layout { padding-top: var(--navbar-h); }

/* ---------- 左侧目录树 ---------- */
.sidebar {
  position: fixed; top: var(--navbar-h); bottom: 0; left: 0;
  width: var(--sidebar-w); overflow-y: auto; overflow-x: hidden;
  background: #fff; border-right: 1px solid var(--c-border-soft);
  padding: 14px 0 60px; z-index: 90;
  transition: transform .18s ease, visibility .18s;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #dfe3e8; border-radius: 3px; }
.nav-group-title {
  margin: 0; padding: 6px 24px 6px 20px; font-size: 16px; font-weight: 700;
  color: var(--c-text); border-left: 4px solid transparent;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-item.nav-current > a { color: var(--c-accent); background: #eef7f2; font-weight: 600; }
.sec-hidden { display: none !important; }
.nav-item > a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 16px 6px 32px;
  font-size: 14.4px; line-height: 1.4; color: var(--c-text);
  text-decoration: none; word-break: break-word;
  border-left: 4px solid transparent;
}
.nav-item > a:hover { color: var(--c-accent); }
.nav-item.active > a {
  color: var(--c-accent); background: #dbf0e5;
  font-weight: 600; border-left-color: var(--c-accent);
}
.nav-item.has-children > a { padding-right: 12px; }
.nav-item .caret {
  margin-left: auto; flex: none;
  font-size: 10px; color: #9aa7b4; cursor: pointer; padding: 2px 4px;
  transition: transform .15s ease; user-select: none;
}
.nav-item.open > a > .caret { transform: rotate(90deg); }
.nav-item > .nav-list { display: none; }
.nav-item.open > .nav-list { display: block; }
.nav-item .nav-list .nav-item > a {
  font-size: 14px; padding: 6px 16px 6px 44px; line-height: 1.4; color: var(--c-text-soft);
}
.nav-item .nav-list .nav-list .nav-item > a {
  font-size: 13.4px; padding: 5px 14px 5px 58px; line-height: 1.45; color: var(--c-text-light);
}
.nav-item .nav-list .nav-list .nav-item > a:hover { color: var(--c-accent); }
.sidebar-mask {
  display: none; position: fixed; inset: var(--navbar-h) 0 0 0;
  background: rgba(0, 0, 0, .35); z-index: 80;
}

/* ---------- 正文 ---------- */
.page {
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--navbar-h));
  transition: margin-left .18s ease;
}
/* 宽屏收起左侧目录（☰ 或 Ctrl/⌘+B）：正文吃掉整行 */
body.sidebar-closed .sidebar { transform: translateX(-100%); visibility: hidden; }
body.sidebar-closed .page { margin-left: 0; }
.content {
  padding: 32px 40px 100px; margin: 0;
  font-size: 15px; line-height: 1.75; word-wrap: break-word;
}
.loading { color: var(--c-text-light); }

/* ---------- 加载中的骨架屏 ---------- */
.skeleton { animation: sk-fade .25s ease-out both; }
.sk-line, .sk-block {
  border-radius: 6px;
  background: linear-gradient(90deg, #e9ebef 25%, #f5f6f8 37%, #e9ebef 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
.sk-line { height: 14px; margin: 0 0 13px; }
.sk-line.sk-title { height: 26px; width: 42%; margin: 4px 0 26px; border-radius: 8px; }
.sk-line.sk-short { width: 58%; }
.sk-line.sk-mid { width: 78%; }
.sk-block { height: 132px; margin: 24px 0; border-radius: 10px; }

.skeleton-nav { padding: 22px 20px; }
.skeleton-nav .sk-line { height: 12px; margin-bottom: 15px; }

@keyframes sk-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@keyframes sk-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-line, .sk-block { animation: none; }
}

.content h1 {
  font-size: 27.2px; font-weight: 600; line-height: 1.4;
  padding-bottom: 16px; border-bottom: 1px solid var(--c-border);
  margin: 0 0 28px;
}
.content h2 { font-size: 22.4px; font-weight: 600; margin: 44px 0 18px; }
.content h3 { font-size: 20px; font-weight: 600; margin: 36px 0 14px; }
.content h4 { font-size: 18px; font-weight: 600; margin: 28px 0 12px; }
.content h5, .content h6 { font-size: 16px; font-weight: 600; margin: 24px 0 10px; }
.content p { margin: 15px 0; }
.content a { color: var(--c-accent); text-decoration: none; }
.content a:hover { color: var(--c-accent-dark); text-decoration: underline; }
.content ul, .content ol { padding-left: 1.5em; margin: 15px 0; }
.content li { margin: 4px 0; }
.content li > ul, .content li > ol { margin: 4px 0; }
.content strong { font-weight: 600; }
.content hr { border: 0; border-top: 1px solid var(--c-border); margin: 30px 0; }
.content img { max-width: 100%; border-radius: 3px; }

.content blockquote {
  margin: 16px 0; padding: 16px;
  border-left: 8px solid #42b983; background: var(--c-bg-soft);
  color: var(--c-text);
}
.content blockquote > p { margin: 6px 0; }
.content blockquote > p:first-child { margin-top: 0; }
.content blockquote > p:last-child { margin-bottom: 0; }

/* 折叠块：完整代码 / 扩展阅读 */
.content details {
  margin: 18px 0;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fbfcfd;
}
.content details summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--c-text);
  background: #f6f8fa;
  border-radius: 6px;
  list-style: none;
  user-select: none;
}
.content details summary::-webkit-details-marker { display: none; }
.content details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--c-accent);
  transition: transform .15s ease;
}
.content details[open] summary::before { transform: rotate(90deg); }
.content details[open] summary {
  border-bottom: 1px solid var(--c-border);
  border-radius: 6px 6px 0 0;
}
.content details > *:not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}
.content details > pre {
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
}

.content code {
  font-family: var(--font-mono); font-size: .9em;
  color: #476582; background: rgba(27, 31, 35, .05);
  padding: .25rem .5rem; border-radius: 3px;
}
.content pre {
  background: #282c34; border-radius: 6px; padding: 20px 24px;
  overflow-x: auto; line-height: 1.6; margin: 18px 0;
}
.content pre code {
  background: transparent; padding: 0; color: #abb2bf;
  font-size: 14px; display: block;
}
.content pre.mermaid {
  background: transparent; text-align: center; padding: 8px 0;
}
.content pre.mermaid svg { max-width: 100%; height: auto; }

.content table {
  display: block; overflow-x: auto; border-collapse: collapse;
  margin: 18px 0; max-width: 100%;
}
.content th, .content td {
  border: 1px solid #dfe2e5; padding: .6em 1em; text-align: left;
}
.content th { background: #f6f8fa; font-weight: 600; }
.content tr:nth-child(2n) { background: #fafbfc; }

/* 提示块（::: tip / warning / info / note / danger） */
.block {
  margin: 16px 0; padding: 14px 20px; border-radius: 4px;
  border-left: .4rem solid #9aa7b4; background: #f8f8f8;
}

/* 本讲数据卡：分节显示时常驻，滚动时吸附在正文顶部 */
.content details.data-ref {
  position: sticky; top: 84px; z-index: 6;
  margin: 18px 0 22px; padding: 0;
  border: 1px solid #cfe3d6; border-radius: 8px; background: #f7fbf8;
  box-shadow: 0 4px 14px rgba(24, 60, 40, .07);
}
.content details.data-ref > summary {
  padding: 11px 18px; font-size: 14px;
  color: var(--c-accent); background: transparent;
  border-bottom: 1px solid #e2efe8;
}
.content details.data-ref > .data-body {
  max-height: 40vh; overflow: auto;
  margin: 0; padding: 4px 18px 10px;
}
.content details.data-ref table { font-size: 12.8px; margin: 6px 0 10px; }
.content details.data-ref th,
.content details.data-ref td { padding: 4px 9px; }
.content details.data-ref p { margin: 8px 0 6px; }

/* 查询结果：默认折叠，点开再看 */
.content details.result-block {
  margin: 10px 0 18px; padding: 0 14px;
  border: 1px dashed #cfe0d6; border-radius: 6px; background: #fbfdfc;
}
.content details.result-block > summary {
  padding: 8px 0; font-size: 13.5px; font-weight: 600;
  color: var(--c-accent); background: transparent; border: 0;
}
.content details.result-block[open] > summary { border-bottom: 1px solid #e6f0ea; }
.content details.result-block table { font-size: 13px; margin: 8px 0 12px; }
.content details.result-block > *:not(summary) { margin-left: 0; margin-right: 0; }

/* 讲到这里就练：内嵌小输入框 */
.content .practice-block {
  margin: 18px 0 22px; padding: 0 16px 14px;
  border: 1px solid #cfe3d6; border-left: 3px solid var(--c-accent);
  border-radius: 8px; background: #f8fbf9;
}
.content .practice-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 0 8px; font-weight: 700; font-size: 14.5px; color: #22503c;
}
.content .practice-tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: var(--c-accent); color: #fff; font-size: 11.5px; font-weight: 600;
}
.content .practice-tag--quiz { background: #b4762a; }
.content .practice-block--quiz { background: #fbf8f2; border-color: #e5d8c2; border-left-color: #b4762a; }
.content .practice-block--quiz .practice-head { color: #6b4a1c; }
.content .practice-block--quiz ol { padding-left: 1.4em; }
.content .practice-block--quiz li { margin: 6px 0; }
.content .practice-body > p:first-child { margin-top: 0; }
.content .practice-runner { margin-top: 8px; }
.content .practice-sql {
  width: 100%; box-sizing: border-box; display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.55; padding: 10px 12px;
  border: 1px solid #cfe0d6; border-radius: 6px; background: #fff;
  color: #1f2d27; resize: vertical; tab-size: 2;
}
.content .practice-sql:focus {
  outline: none; border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(63, 111, 168, .12);
}
.content .practice-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.content .practice-run {
  padding: 7px 16px; border: 0; border-radius: 6px;
  background: var(--c-accent); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.content .practice-run:disabled { opacity: .6; cursor: default; }
.content .practice-reset {
  padding: 7px 12px; border: 1px solid #cfe0d6; border-radius: 6px;
  background: #fff; color: #3a5648; font-size: 13px; cursor: pointer;
}
.content .practice-hint { font-size: 12.5px; color: #7d8f86; }
.content .practice-out { margin-top: 10px; }
.content .practice-out[hidden] { display: none; }
/* 登录态与判题 */
.classio-userbar{display:flex;align-items:center;gap:10px;font-size:13px;margin-left:auto;flex:none;position:relative}
.classio-userbar .ub-name{color:#3f574b;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.classio-userbar .ub-login,.classio-userbar .ub-link{color:#3f6fa8;text-decoration:none;padding:3px 9px;border:1px solid #cfdcd4;border-radius:6px;white-space:nowrap}
.classio-userbar .ub-warn{color:#a4620a;text-decoration:none;font-weight:600;white-space:nowrap}
.classio-userbar .ub-out{padding:3px 9px;border:1px solid #cfdcd4;border-radius:6px;background:#fff;color:#5b6f64;cursor:pointer;font-size:12.5px;white-space:nowrap}
/* 手机端账户菜单（桌面端用顶栏那排链接，头像与下拉都隐藏） */
.ub-me,.ub-menu{display:none}
.ub-menu-head{padding:8px 10px 10px;border-bottom:1px solid #eef1ef;margin-bottom:4px}
.ub-menu-name{display:block;font-size:14.5px;font-weight:700;color:#2c3e50}
.ub-menu-sub{display:block;margin-top:2px;font-size:12px;color:#7b8b82}
.ub-menu-item{display:flex;align-items:center;width:100%;padding:10px;border:0;border-radius:8px;background:none;color:#2c3e50;font-family:inherit;font-size:13.5px;text-align:left;text-decoration:none;cursor:pointer}
.ub-menu-item:hover{background:#f4f8f6}
.ub-menu-sep{height:1px;margin:4px 2px;background:#eef1ef}
.ub-menu-out{color:#b04a3a}
.ub-menu-out:hover{background:#fdf3f1}
.content .practice-submit{padding:7px 14px;border:1px solid #3eaf7c;border-radius:6px;background:#fff;color:#2b7d59;font-size:13.5px;font-weight:600;cursor:pointer}
.content .practice-submit.is-pass{background:#3eaf7c;color:#fff;border-color:#3eaf7c}
.content .practice-submit.is-locked{border-color:#c9d4cd;color:#6f8278}
.content .practice-submit:disabled{opacity:.65;cursor:default}
.content .practice-status{font-size:12.5px;color:#7d8f86}
.content .practice-verdict{margin-top:10px;padding:10px 12px;border-radius:7px;font-size:13.5px;line-height:1.6}
.content .practice-verdict.verdict-pass{background:#eaf7f0;color:#1f6b45;border-left:3px solid #3eaf7c}
.content .practice-verdict.verdict-fail{background:#fff6e8;color:#8a5a12;border-left:3px solid #d99a3a}
.content .practice-verdict.verdict-error{background:#fdecec;color:#a33;border-left:3px solid #d66}
.content .verdict-label{font-weight:700;margin-right:8px}
.content .verdict-badge{margin-left:8px;padding:1px 7px;border-radius:10px;background:#3eaf7c;color:#fff;font-size:11.5px}

/* 教师端表格 */
.dash-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0 18px}
.dash-toolbar select,.dash-toolbar button{padding:7px 11px;border:1px solid #cfdcd4;border-radius:7px;background:#fff;font-size:13.5px}
.dash-toolbar button{cursor:pointer}
.dash-stats{display:flex;gap:14px;flex-wrap:wrap;margin:0 0 18px}
.dash-stat{background:#f6faf8;border:1px solid #dde9e3;border-radius:10px;padding:12px 16px;min-width:130px}
.dash-stat b{display:block;font-size:22px;color:#22503c}
.dash-stat span{font-size:12.5px;color:#6b7d73}
.dash-table-wrap{overflow-x:auto;border:1px solid #e3e8e4;border-radius:10px}
.dash-table{border-collapse:collapse;font-size:12.5px;min-width:100%;background:#fff}
.dash-table th,.dash-table td{border-bottom:1px solid #eef2ef;padding:7px 9px;text-align:center;white-space:nowrap}
.dash-table th{background:#f4f8f6;position:sticky;top:0;font-weight:600;color:#3f574b}
.dash-table td.name,.dash-table th.name{text-align:left;position:sticky;left:0;background:#fff;z-index:1}
.dash-table th.name{background:#f4f8f6}
.dash-cell{display:inline-block;width:22px;height:22px;line-height:22px;border-radius:5px;font-size:11px}
.dash-cell.pass{background:#3eaf7c;color:#fff}
.dash-cell.fail{background:#f3d9a8;color:#7a5210}
.dash-cell.error{background:#f0b9b9;color:#7a1f1f}
.dash-cell.none{background:#eef2ef;color:#b6c3bb}
.dash-table tr.row-link{cursor:pointer}
.dash-table tr.row-link:hover td{background:#f7fbf9}
.dash-detail{margin-top:18px}
.dash-detail pre{background:#f7f9f8;border:1px solid #e3e8e4;border-radius:8px;padding:10px;font-size:12.5px;overflow-x:auto}

/* 单题看板：点小节看每个学生的通过情况和最近一次 SQL */
.dash-table th.ex-head{cursor:pointer;text-decoration:underline dotted;text-underline-offset:3px}
.dash-hint{margin-left:10px;font-size:12px;color:#6b7d73;font-weight:400}
.dash-ex{margin-top:22px;border:1px solid #dde9e3;border-radius:12px;padding:14px 16px;background:#fbfdfc}
.dash-ex-head{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-bottom:10px}
.dash-ex-title b{font-size:15px;color:#1f3a2d}
.dash-ex-sub{margin-left:10px;font-size:12.5px;color:#5a6f63}
.dash-ex-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.dash-ex-tools button{padding:5px 10px;border:1px solid #cfdcd4;border-radius:7px;background:#fff;font-size:12.5px;cursor:pointer;color:#3f574b}
.dash-ex-tools button:hover{background:#f2f8f5}
.dash-ex-tools .ex-filter.on{border-color:#3eaf7c;color:#22694a;background:#eaf6f0;font-weight:600}
.dash-ex-time{font-size:12px;color:#7b8b82}
.ex-pill{display:inline-block;padding:2px 9px;border-radius:20px;font-size:12px}
.ex-pill.pass{background:#e5f6ee;color:#1c7a51}
.ex-pill.fail{background:#fdf0d8;color:#8a5a10}
.ex-pill.none{background:#eef2ef;color:#8b9a92}
.dash-ex-table td.ex-sql{text-align:left;max-width:460px}
.dash-ex-table details summary{cursor:pointer;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;color:#2a5d48}
.dash-ex-table details pre{white-space:pre-wrap;background:#f7f9f8;border:1px solid #e3e8e4;border-radius:8px;padding:8px;margin:6px 0 0;font-size:12px}
.dash-ex-cap{caption-side:bottom;text-align:left;padding:8px 4px 0;font-size:12px;color:#7b8b82}

@media (max-width: 960px) {
  .content .practice-sql { font-size: 12.5px; }
  .content .practice-hint { display: none; }
  .classio-userbar{font-size:12.5px;gap:6px}
}


/* 练习框内的「展开本小节结果」按钮 */
.content .result-toggle-inline {
  margin-left: 8px; padding: 7px 12px; border: 1px solid #cfe0d6; border-radius: 6px;
  background: #fff; color: #2f6b4f; font-size: 13px; font-weight: 600; cursor: pointer;
}
.content .result-toggle-inline:hover { border-color: #8fc0a6; background: #f6fbf8; }

.block-title { margin: 0 0 6px; font-weight: 700; }
.block > p:last-child { margin-bottom: 0; }
.block-tip { border-color: #42b983; background: #f3f5f7; }
.block-tip .block-title { color: #42b983; }
.block-warning { border-color: #e7c000; background: rgba(255, 229, 100, .25); }
.block-warning .block-title { color: #b5a000; }
.block-info { border-color: #3e8ed0; background: #f0f7ff; }
.block-info .block-title { color: #3e8ed0; }
.block-note { border-color: #9aa7b4; background: #f6f7f8; }
.block-note .block-title { color: #6b7a8c; }
.block-danger { border-color: #c00; background: rgba(192, 0, 0, .08); }
.block-danger .block-title { color: #c00; }

/* ---------- 同学们（贡献者头像） ---------- */
.contrib {
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--c-border);
}
.contrib-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px;
}
.contrib-head h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--c-text); }
.content .contrib-all { color: var(--c-text-light); font-size: 13px; text-decoration: none; }
.content .contrib-all:hover { color: var(--c-accent); }
.contrib-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.content .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; line-height: 1; text-decoration: none;
  box-shadow: 0 0 0 1px rgba(44, 62, 80, .08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.content .avatar:hover {
  transform: translateY(-2px); text-decoration: none;
  box-shadow: 0 6px 14px rgba(44, 62, 80, .18);
}
.content .avatar-more {
  background: #f2f4f6; color: var(--c-text-soft);
  font-size: 12.5px; font-weight: 600;
  box-shadow: 0 0 0 1px var(--c-border);
}

/* ---------- 顶栏右侧 / 课程切换 ---------- */
.navbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.course-switch {
  font-size: 13.5px; font-family: inherit; color: var(--c-text);
  background: #fff; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 4px 8px; cursor: pointer; max-width: 190px; min-width: 0;
}
.course-switch:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* ---------- 课程列表页：终端清单 ---------- */
body.course-list .navbar { display: none; }
body.course-list .layout { padding-top: 0; }
body.course-list .sidebar { display: none; }
body.course-list .page {
  margin-left: 0; margin-right: 0; min-height: 100vh;
  height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
}
body.course-list .content {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  max-width: none; padding: 0;
}
.course-list { flex: 1; display: flex; flex-direction: column; width: 100%; }

.cl-term {
  background: #fbfaf7; color: #24292f;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px; line-height: 1.85; letter-spacing: .01em;
  min-height: 0; overflow: hidden;
}
/* tmux 分屏：左 shell / 右监视面板 */
.cl-main {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}
.cl-pane-shell { min-width: 0; min-height: 0; display: flex; }
.cl-pane-side {
  min-height: 0; overflow-y: auto;
  border-left: 1px solid rgba(36, 41, 47, .12);
  padding: 20px 26px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.cl-side-title { color: rgba(36, 41, 47, .45); font-size: 12px; }
.cl-clock { font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: .04em; color: #1f2328; }
.cl-side-date { color: rgba(36, 41, 47, .6); font-size: 12.5px; }
.cl-side-label {
  color: rgba(36, 41, 47, .42); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; margin-bottom: 8px;
}
.cl-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; line-height: 2; }
.cl-k { color: rgba(36, 41, 47, .5); }
.cl-v { color: #24292f; }
.cl-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.cl-cal-h { color: rgba(36, 41, 47, .38); }
.cl-cal-d { color: rgba(36, 41, 47, .75); }
.cl-cal-d.is-today {
  color: #2f8f63; font-weight: 700; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(62, 175, 124, .55);
}
/* 本机统计（点击排行） */
.cl-stats-sub { margin-top: 6px; }
.cl-stat-row { display: flex; align-items: baseline; gap: 10px; font-size: 12px; line-height: 2; }
.cl-stat-name {
  flex: 1 1 auto; min-width: 0; color: rgba(36, 41, 47, .62);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cl-bar { flex: none; letter-spacing: -1.5px; font-size: 11px; }
.cl-bar-on { color: #24292f; }
.cl-bar-off { color: rgba(36, 41, 47, .13); }
.cl-stat-pct { flex: 0 0 34px; text-align: right; color: rgba(36, 41, 47, .55); }
.cl-stat-empty { font-size: 11.5px; color: rgba(36, 41, 47, .38); }
/* 右栏底部：快捷命令（把监视面板底部也收住） */
.cl-side-foot {
  margin-top: auto; padding-top: 14px;
  border-top: 1px dashed rgba(36, 41, 47, .12);
}
.cl-cmds { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-chip {
  font: inherit; font-size: 11.5px; line-height: 1.5;
  color: #2f6fbf; background: rgba(47, 111, 191, .06);
  border: 1px solid rgba(47, 111, 191, .18); border-radius: 4px;
  padding: 3px 8px; cursor: pointer;
}
.cl-chip:hover {
  background: rgba(47, 111, 191, .12);
  border-color: rgba(47, 111, 191, .35);
}
.cl-side-note {
  display: flex; align-items: center; margin-top: 9px;
  font-size: 11px; color: rgba(36, 41, 47, .38);
}
/* Repo 链接（右栏） */
.content .cl-kv .cl-link {
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: inherit; text-decoration: underline;
  text-decoration-color: rgba(36, 41, 47, .3); text-underline-offset: 3px;
}
.content .cl-kv .cl-link:hover { text-decoration-color: currentColor; color: inherit; }
.cl-screen {
  flex: 1; min-height: 0; overflow-y: auto; padding: 22px 48px 18px; cursor: text;
  display: flex; flex-direction: column;
  background-color: #fbfaf7;
  background-image: radial-gradient(rgba(36, 41, 47, .05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.cl-out { flex: 1 0 auto; }
/* 底部提示条：收住终端底部，空白区域不再悬空 */
.cl-foot {
  flex: none; display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px 16px; margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed rgba(36, 41, 47, .12);
  font-size: 11.5px; color: rgba(36, 41, 47, .42);
}
.cl-foot-right { margin-left: auto; display: inline-flex; align-items: center; }
.cl-foot-dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%; background: #3eaf7c;
  box-shadow: 0 0 6px rgba(62, 175, 124, .55);
}
/* ASCII 字标（空心细线，按栏宽放大铺满，逐行黑白渐深） */
.cl-art { font-size: var(--art-f, 22px); line-height: 1.02; white-space: pre; letter-spacing: 0; }
/* 通栏细线（收住头部区域） */
.cl-rule { height: 0; border-top: 1px solid rgba(36, 41, 47, .14); margin: 14px 0 4px; }
.cl-art-1 { color: #17191c; }
.cl-art-2 { color: #2f343a; }
.cl-art-3 { color: #4a5057; }
.cl-art-4 { color: #666c74; }
.cl-art-5 { color: #838993; }
.cl-art-6 { color: #838993; }
/* tmux 式状态栏 */
.cl-statusbar {
  flex: none; display: flex; align-items: center; gap: 16px;
  height: 28px; padding: 0 14px;
  background: #24292f; color: #c9d1d9;
  font-size: 12px; letter-spacing: .03em;
}
.cl-sb-tag { background: #3eaf7c; color: #0f2419; font-weight: 700; padding: 2px 8px; border-radius: 2px; }
.cl-sb-seg { color: rgba(201, 209, 217, .6); }
.cl-sb-right { margin-left: auto; display: flex; gap: 18px; color: rgba(201, 209, 217, .75); }
.cl-line { white-space: pre-wrap; word-break: break-word; }
.cl-dim { color: rgba(36, 41, 47, .46); }
.cl-err { color: #b3261e; }
.cl-user { color: #2f8f63; font-weight: 600; }
.cl-sep { color: rgba(36, 41, 47, .6); }
.cl-path { color: #2f6fbf; }
.cl-dir { color: #2f6fbf; font-weight: 600; }
.cl-file { color: #24292f; }
.cl-cmdk { color: #2f6fbf; font-weight: 600; }
.cl-dirlink { cursor: pointer; }
.cl-dirlink:hover { text-decoration: underline; }
.cl-inputline { display: flex; align-items: baseline; flex: none; }
.cl-input {
  flex: 1; min-width: 0; border: 0; outline: 0; margin: 0 0 0 .6em; padding: 0;
  background: transparent; font: inherit; letter-spacing: inherit; color: inherit;
  caret-color: #2f8f63;
}
/* ls -l 输出行（点击 = cd） */
.content .cl-row {
  display: grid; align-items: baseline; width: 100%;
  grid-template-columns: 18px 92px 168px 176px 78px 100px minmax(0, 1fr);
  gap: 0 14px; padding: 4px 0; cursor: pointer;
}
.cl-desc { color: rgba(36, 41, 47, .38); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-perm { color: rgba(36, 41, 47, .36); }
.content .cl-row .cl-mark {
  color: #2f8f63; opacity: 0; transform: translateX(-5px);
  transition: opacity .15s ease, transform .15s ease;
}
.content .cl-row:hover .cl-mark { opacity: 1; transform: none; }
.content .cl-row .cl-name { font-weight: 600; color: #2f6fbf; }
.content .cl-row:hover .cl-name { text-decoration: underline; }
.cl-tags { color: rgba(36, 41, 47, .5); }
.cl-author { color: rgba(36, 41, 47, .5); }
.cl-status { color: rgba(36, 41, 47, .5); }
.cl-status.is-live { color: rgba(36, 41, 47, .85); }

@media (max-width: 1000px) {
  .cl-main { grid-template-columns: 1fr; }
  .cl-pane-side { display: none; }
}
@media (max-width: 900px) {
  .cl-screen { padding: 16px 20px 20px; }
  .cl-art { font-size: 9.5px; }
  .cl-sb-seg { display: none; }
  .cl-desc { display: none; }
  .cl-foot { gap: 4px 12px; font-size: 11px; }
  .cl-foot-right { display: none; }
  .content .cl-row {
    grid-template-columns: 16px minmax(0, 1fr) auto;
    grid-template-areas: "mark name status" "mark tags author";
    gap: 0 12px;
  }
  .cl-perm { display: none; }
  .cl-mark { grid-area: mark; } .cl-name { grid-area: name; }
  .cl-status { grid-area: status; text-align: right; }
  .cl-tags { grid-area: tags; } .cl-author { grid-area: author; text-align: right; }
}

/* ---------- 404 ---------- */
.notfound h1 { border: 0; margin-bottom: 8px; }
.notfound p { color: var(--c-text-light); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-mask { display: block; }
  .sidebar-toggle { display: inline-block; }
  .page { margin-left: 0; margin-right: 0; }
  .navbar-links { overflow-x: auto; }
  .content { padding: 24px 20px 80px; }
}

/* ---------- 手机 / 平板顶栏：☰ · 品牌 · 课程切换 · 账户，一行排开 ---------- */
@media (max-width: 960px) {
  .navbar-inner {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    gap: 2px;
  }
  .sidebar-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none; width: 38px; height: 38px; padding: 0; margin: 0 2px 0 0;
    border-radius: 10px; font-size: 20px; line-height: 1; color: var(--c-text);
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar-toggle:active { background: rgba(44, 62, 80, .08); }
  .site-title {
    font-size: 16px; margin-right: 0; margin-left: 2px;
    flex: none; overflow: visible; text-overflow: clip;
  }
  .site-title .st-sub { display: none; }
  /* 手机上没有整行宽度给这些入口：课程目录/直达链接都收进 ☰ 抽屉 */
  .navbar-links,
  .view-switch,
  .md-download,
  .teacher-toggle { display: none !important; }
  .navbar-right { flex: 1 1 auto; margin-left: 8px; gap: 6px; min-width: 0; }
  .course-switch {
    flex: 0 1 auto; width: auto; max-width: 200px; min-width: 0;
    height: 34px; padding: 0 4px 0 9px; font-size: 12.5px;
    border-radius: 9px; background: #f5f7f6; border-color: #e6ebe8;
    text-overflow: ellipsis;
  }
  .classio-userbar { margin-left: auto; gap: 8px; }
  .classio-userbar .ub-login {
    padding: 6px 13px; border-radius: 999px; font-weight: 600;
    border-color: #b3d8c4; background: #eef8f2; color: #24724c;
  }
  /* 已登录：桌面那排链接收进头像下拉 */
  .classio-userbar .ub-name,
  .classio-userbar .ub-link,
  .classio-userbar .ub-warn,
  .classio-userbar .ub-out { display: none; }
  .classio-userbar .ub-me {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
    flex: none; height: 32px; padding: 0 9px 0 3px;
    border: 1px solid #cfe3d8; border-radius: 999px;
    background: #eaf4ef; color: #2f7a58;
    font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .classio-userbar .ub-ini {
    display: grid; place-items: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff; font-size: 12.5px;
  }
  .classio-userbar .ub-caret { font-size: 9px; line-height: 1; color: #5f8a72; }
  .classio-userbar .ub-me[aria-expanded="true"] { background: #dcefe5; }
  .classio-userbar .ub-menu {
    display: block; position: absolute; top: calc(100% + 14px); right: 0; z-index: 130;
    width: 236px; max-width: calc(100vw - 20px); padding: 6px;
    background: #fff; border: 1px solid #e6ebe8; border-radius: 14px;
    box-shadow: 0 16px 40px rgba(24, 43, 33, .18);
  }
  .classio-userbar .ub-menu[hidden] { display: none; }
  /* 抽屉：讲义 ⇄ 看板 的快捷入口钉在顶部，目录滚到哪儿都够得着 */
  .sidebar .qn-side {
    position: sticky; top: 0; z-index: 3;
    margin: 0; padding: 10px 14px;
    background: #fff;
    box-shadow: 0 10px 14px -12px rgba(24, 43, 33, .4);
  }
  /* 补上抽屉顶部 14px 的内边距，滚动时不会露出被切一半的目录项 */
  .sidebar .qn-side::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
    height: 14px; background: #fff;
  }
  /* 分组的 ▶ 加大点击区，手机上不用瞄准 */
  .sidebar .nav-item .caret {
    padding: 11px 10px; margin: -11px -8px -11px auto;
    font-size: 11px; touch-action: manipulation;
  }
  /* 抽屉里的「文档 / 授课PPT」切换（顶栏放不下，见 presentation-mode.js） */
  .sidebar .side-view {
    position: sticky; top: 0; z-index: 3;
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 14px 2px; background: #fff;
  }
  .sidebar .side-view-btn {
    display: inline-block;
    flex: 0 0 auto; height: 26px; padding: 0 11px;
    border-radius: 999px; border: 1px solid #e0e8e3;
    background: #f5f7f6; color: #3f574b;
    font: inherit; font-size: 12.5px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar .qn-side .side-view-btn { height: 24px; font-size: 12px; padding: 0 9px; }
  .sidebar .side-view-btn.on { background: #eef8f2; border-color: #b3d8c4; color: #24724c; font-weight: 600; }
}

/* 参考答案改为教师接口按需加载 */
.content .answer-loading{color:#8b9b93;font-size:12.5px;margin:4px 0 0}
.content .answer-text{white-space:pre-wrap;font-size:13.5px;line-height:1.75;margin:6px 0 0}
.content .answer-block--remote pre{margin:6px 0 0}

/* 加载失败兜底 */
.notfound .retry-btn{padding:8px 18px;border:0;border-radius:7px;background:#3eaf7c;color:#fff;font-size:14px;cursor:pointer}
.notfound .retry-hint{margin-top:10px;font-size:13px;color:#7d8f86}

/* ---------- 跨页面直达入口（讲义页顶栏 + 目录顶部） ---------- */
.navbar-links a.qn-link {
  font-size: 14.4px; font-weight: 600; color: var(--c-accent);
  background: var(--c-accent-soft, #eaf5ef); border: 1px solid #d8e8df;
  border-radius: 999px; padding: 3px 12px; margin-right: 10px;
}
.navbar-links a.qn-link:hover { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.qn-side {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 14px 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border-soft);
}
/* 抽屉里的 文档/授课PPT 切换：只在手机上出现 */
.side-view { display: none; }
.side-view-btn { display: none; }
.qn-side-link {
  font-size: 13px; color: var(--c-accent); text-decoration: none;
  background: var(--c-accent-soft, #eaf5ef); border: 1px solid #d8e8df;
  border-radius: 999px; padding: 3px 10px;
}
.qn-side-link:hover { background: var(--c-accent); color: #fff; }
@media (max-width: 1100px) {
  .navbar-links a.qn-link { padding: 2px 9px; font-size: 13.5px; margin-right: 7px; }
}

/* ===== 每节末尾：上一节 / 下一节（到本讲头尾换成上一讲 / 下一讲） ===== */
.sec-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 40px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}
.pager-i {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  text-decoration: none;
  background: var(--c-bg);
  transition: border-color 0.15s, background 0.15s;
}
a.pager-i:hover {
  border-color: var(--c-accent);
  background: var(--c-bg-soft);
}
.pager-i.next {
  align-items: flex-end;
  text-align: right;
}
.pager-k {
  font-size: 12px;
  color: var(--c-text-light);
}
.pager-t {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--c-accent-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
@media (max-width: 560px) {
  .sec-pager {
    gap: 8px;
    margin-top: 28px;
  }
  .pager-i {
    padding: 10px 12px;
  }
  .pager-t {
    font-size: 13.5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
  }
}

/* ===== 分节阅读时，上级标题与它的导语压在正文前，弱化一档 ===== */
.sec-ctx {
  opacity: 0.86;
}

/* 一题多问：判完显示哪几问答对了 */
.content .verdict-parts{margin-left:10px;display:inline-flex;gap:6px;flex-wrap:wrap;vertical-align:middle}
.content .verdict-parts .vpart{padding:1px 7px;border-radius:10px;background:rgba(0,0,0,.06);font-size:11.5px;color:#6b7a8c;white-space:nowrap}
.content .verdict-parts .vpart.on{background:#3eaf7c;color:#fff}

/* 练习框：上次提交的提示（回到讲义接着做时显示） */
.content .practice-last{margin:8px 0 0;padding:7px 10px;border:1px dashed #d5e4da;border-radius:6px;background:#f7faf8;font-size:12.5px;color:#3f574b;display:flex;flex-wrap:wrap;gap:8px;align-items:baseline}
.content .practice-last .pl-st{font-weight:700}
.content .practice-last .pl-st.ok{color:#1f7a55}
.content .practice-last .pl-st.bad{color:#b45309}
.content .practice-last .pl-at{color:#8a9a91}
.content .practice-last .pl-hint{color:#8a9a91}

.cl-entries { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cl-entry {
  font-size: 11.5px; line-height: 1.5; text-decoration: none;
  color: #2f6fbf; background: rgba(47, 111, 191, .06);
  border: 1px solid rgba(47, 111, 191, .18); border-radius: 4px;
  padding: 3px 8px;
}
.cl-entry:hover { background: rgba(47, 111, 191, .12); }