/* ===== classio.cn 课程站 · 浅色主题（参照 pdai.tech / VuePress 1 默认主题实测参数） ===== */
: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;
  --toc-w: 230px;
  --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%;
  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;
}
.site-title:hover { color: var(--c-accent); }
.navbar-links { display: flex; align-items: center; overflow: hidden; }
.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: none; background: none; border: 0; font-size: 18px;
  color: var(--c-text); cursor: pointer; margin-right: 10px; padding: 4px 6px;
}

/* ---------- 布局 ---------- */
.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;
}
.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 > a {
  display: block; 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: 34px; position: relative; }
.nav-item .caret {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: #9aa7b4; cursor: pointer; padding: 4px;
  transition: transform .15s ease; user-select: none;
}
.nav-item.open > .caret { transform: translateY(-50%) 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);
}
.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);
  margin-right: calc(var(--toc-w) + 42px);
  min-height: calc(100vh - var(--navbar-h));
}
.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;
}
.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);
}

/* ---------- 右侧文章目录 ---------- */
.toc {
  position: fixed; top: calc(var(--navbar-h) + 24px); right: 22px;
  width: var(--toc-w); max-height: calc(100vh - var(--navbar-h) - 48px);
  overflow-y: auto; font-size: 13px; line-height: 1.6;
}
.toc-title {
  margin: 0 0 8px; padding-bottom: 8px; font-size: 13px; font-weight: 600;
  color: var(--c-text); border-bottom: 1px solid var(--c-border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list a {
  display: block; padding: 3px 0 3px 10px; color: var(--c-text-soft);
  text-decoration: none; border-left: 2px solid transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toc-list a:hover { color: var(--c-accent); }
.toc-list a.active { color: var(--c-accent); border-left-color: var(--c-accent); }
.toc-list .toc-h3 a { padding-left: 24px; font-size: 12.5px; }
.toc-empty { color: var(--c-text-light); font-size: 12.5px; }

/* ---------- 顶栏右侧 / 课程切换 ---------- */
.navbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.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;
}
.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,
body.course-list .toc { 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: 1350px) {
  .toc { display: none; }
  .page { margin-right: 0; }
}
@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; }
}
