/* yt.nbuild.cn — site.css
   Theme: 暗色 + 莫兰迪蓝,严老师教学站
*/
:root {
  --bg: #0f1419;
  --bg-elev: #1a2028;
  --bg-card: #232b36;
  --border: #2d3744;
  --text: #e6edf3;
  --muted: #8b98a8;
  --accent: #6cb6ff;
  --accent-hover: #9ecbff;
  --warn: #ffb454;
  --error: #ff7b72;
  --success: #7ee787;
  --code-bg: #161b22;
  --code-border: #30363d;
  --link: #79c0ff;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans CN", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.55;
}
pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: 0.85em;
}
/* hljs atom-one-dark theme already colors tokens; only adjust line padding */
pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 0;
  background: transparent;
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,20,25,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-emoji { font-size: 22px; }
.topnav { display: flex; gap: 18px; }
.topnav a { color: var(--muted); font-size: 14px; }
.topnav a:hover { color: var(--text); text-decoration: none; }

/* Layout */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 24px;
}

/* Sidebar */
.sidebar { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 8px; }
.sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  margin-bottom: 16px;
}
.sidebar-search input:focus { outline: none; border-color: var(--accent); }
.phase-nav details {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--bg-elev);
}
.phase-nav summary {
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.phase-nav summary:hover { color: var(--accent); }
.phase-count { color: var(--muted); font-weight: 400; font-size: 12px; }
.day-list {
  list-style: none; margin: 0; padding: 0 0 8px;
  border-top: 1px solid var(--border);
}
.day-list li { border-bottom: 1px solid var(--border); }
.day-list li:last-child { border-bottom: 0; }
.day-link {
  display: grid;
  grid-template-columns: 60px 60px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--muted);
  border-left: 2px solid transparent;
}
.day-link:hover {
  background: var(--bg-card);
  text-decoration: none;
  color: var(--text);
}
.day-link.active {
  background: var(--bg-card);
  border-left-color: var(--accent);
  color: var(--text);
}
.day-link.hidden { display: none; }
.day-num { color: var(--accent); font-weight: 600; font-family: var(--font-mono); font-size: 12px; }
.day-date { font-family: var(--font-mono); font-size: 11.5px; }
.day-subject {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
}

/* Main column */
.main { min-width: 0; }
.lesson { max-width: 920px; }

.hero { padding: 32px 0 48px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.hero h1 { font-size: 36px; margin: 0 0 12px; }
.hero-sub { color: var(--muted); font-size: 16px; max-width: 720px; }
.hero-stats { display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.phases-grid { display: grid; gap: 24px; }
.phase-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}
.phase-card-title { margin: 0 0 14px; color: var(--accent); font-size: 18px; }
.phase-day-list { list-style: none; margin: 0; padding: 0; }
.phase-day-list li a {
  display: grid;
  grid-template-columns: 60px 100px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}
.phase-day-list li:last-child a { border-bottom: 0; }
.phase-day-list li a:hover { color: var(--accent); text-decoration: none; }
.phase-day-list .day-num { font-family: var(--font-mono); }

/* Lesson page */
.lesson-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 28px;
}
.lesson-meta { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.back-link { font-size: 13px; color: var(--muted); }
.back-link:hover { color: var(--accent); text-decoration: none; }
.lesson-day {
  font-family: var(--font-mono);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--accent);
}
.lesson-phase {
  background: rgba(108,182,255,0.12);
  border: 1px solid rgba(108,182,255,0.3);
  color: var(--accent);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
}
.lesson-title { margin: 8px 0 0; font-size: 28px; line-height: 1.35; }
.lesson-nav {
  display: flex; justify-content: space-between;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.lesson-nav .prev, .lesson-nav .next { color: var(--muted); }
.lesson-nav .next { margin-left: auto; }

.lesson-section {
  margin-bottom: 36px;
}
.lesson-section h2 {
  font-size: 18px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
/* markdown-rendered headings inside .lesson-content */
.lesson-content h1 {
  font-size: 28px;
  margin: 28px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}
.lesson-content h2 {
  font-size: 22px;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.lesson-content h3 {
  font-size: 17px;
  margin: 20px 0 8px;
  color: var(--accent);
}
.lesson-content h4 {
  font-size: 15px;
  margin: 16px 0 6px;
  color: var(--text);
  font-weight: 600;
}

.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--text); }
.prose hr { border: 0; border-top: 1px dashed var(--border); margin: 24px 0; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--bg-elev);
  color: var(--muted);
}

.question-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.question-title {
  margin: 0 0 12px;
  font-size: 16px;
  display: flex; align-items: center; gap: 10px;
}
.question-tag {
  background: rgba(108,182,255,0.15);
  border: 1px solid rgba(108,182,255,0.3);
  color: var(--accent);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 400;
}

.callout {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  background: var(--bg-elev);
}
.callout.warning { border-left: 3px solid var(--warn); }
.callout.warning strong { color: var(--warn); }

.meta-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  margin: 0;
}
.meta-list dt { color: var(--muted); font-size: 13px; }
.meta-list dd { margin: 0; font-size: 14px; }

.page-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .phase-nav { margin-bottom: 24px; }
  .hero h1 { font-size: 28px; }
  .lesson-title { font-size: 22px; }
}