/* No external fonts — system fonts only for speed */

:root {
  --bg: #faf8f5;
  --bg-alt: #f5f1ec;
  --surface: #ffffff;
  --surface-soft: #faf8f5;
  --surface-strong: #f0ebe4;
  --line: #e8e0d6;
  --text: #2c2418;
  --muted: #8c7e6e;
  --accent: #c47d3c;
  --accent-soft: #d4924f;
  --danger: #c45544;
  --shadow: 0 1px 3px rgba(44, 36, 24, 0.05), 0 1px 2px rgba(44, 36, 24, 0.03);
  --header-bg: rgba(250, 248, 245, 0.9);
  --hero-gradient: linear-gradient(150deg, #fef4e8 0%, #fde8d8 30%, #faf0e6 70%, #faf8f5 100%);
  --logo-from: #f8c678;
  --logo-to: #e8a040;
  --accent-faint: rgba(196, 125, 60, 0.1);
  --accent-shadow: rgba(196, 125, 60, 0.25);
  --code-bg: #f5f1ec;
  --code-border: #e8e0d6;
  --code-color: #9a4b2c;
}

/* ---- Theme: 薄荷清新 ---- */
html[data-theme="mint"] {
  --bg: #f2faf5;
  --bg-alt: #e5f5eb;
  --surface: #ffffff;
  --surface-soft: #f2faf5;
  --surface-strong: #daf0e2;
  --line: #c8e4d2;
  --text: #1a2e20;
  --muted: #5e8c6a;
  --accent: #2e9960;
  --accent-soft: #3dab70;
  --danger: #c45544;
  --shadow: 0 1px 3px rgba(26, 46, 32, 0.05), 0 1px 2px rgba(26, 46, 32, 0.03);
  --header-bg: rgba(242, 250, 245, 0.9);
  --hero-gradient: linear-gradient(150deg, #e0fae8 0%, #ccf5d8 30%, #e6faf0 70%, #f2faf5 100%);
  --logo-from: #6dd4a0;
  --logo-to: #2e9960;
  --accent-faint: rgba(46, 153, 96, 0.1);
  --accent-shadow: rgba(46, 153, 96, 0.25);
  --code-bg: #e5f5eb;
  --code-border: #c8e4d2;
  --code-color: #1e6b42;
}

/* ---- Theme: 奶油蓝 ---- */
html[data-theme="blue"] {
  --bg: #f2f7fa;
  --bg-alt: #e5eff5;
  --surface: #ffffff;
  --surface-soft: #f2f7fa;
  --surface-strong: #dae8f0;
  --line: #c8d8e4;
  --text: #1a2430;
  --muted: #5e7a8c;
  --accent: #3b7cc8;
  --accent-soft: #4f8ed4;
  --danger: #c45544;
  --shadow: 0 1px 3px rgba(26, 36, 48, 0.05), 0 1px 2px rgba(26, 36, 48, 0.03);
  --header-bg: rgba(242, 247, 250, 0.9);
  --hero-gradient: linear-gradient(150deg, #deeefa 0%, #cce2f5 30%, #e2eefa 70%, #f2f7fa 100%);
  --logo-from: #6daae0;
  --logo-to: #3b7cc8;
  --accent-faint: rgba(59, 124, 200, 0.1);
  --accent-shadow: rgba(59, 124, 200, 0.25);
  --code-bg: #e5eff5;
  --code-border: #c8d8e4;
  --code-color: #2a5a90;
}

/* ---- Theme: 桃气粉紫 ---- */
html[data-theme="pink"] {
  --bg: #faf2f6;
  --bg-alt: #f5e5ee;
  --surface: #ffffff;
  --surface-soft: #faf2f6;
  --surface-strong: #f0dae6;
  --line: #e4c8d8;
  --text: #301828;
  --muted: #8c5e7a;
  --accent: #d04880;
  --accent-soft: #dc5c90;
  --danger: #c45544;
  --shadow: 0 1px 3px rgba(48, 24, 40, 0.05), 0 1px 2px rgba(48, 24, 40, 0.03);
  --header-bg: rgba(250, 242, 246, 0.9);
  --hero-gradient: linear-gradient(150deg, #fae0ee 0%, #f5ccdf 30%, #fae6f0 70%, #faf2f6 100%);
  --logo-from: #e88ab0;
  --logo-to: #d04880;
  --accent-faint: rgba(208, 72, 128, 0.1);
  --accent-shadow: rgba(208, 72, 128, 0.25);
  --code-bg: #f5e5ee;
  --code-border: #e4c8d8;
  --code-color: #901a50;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-soft);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

code,
pre {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

.page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---- Header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.site-header .page {
  padding-top: 18px;
  padding-bottom: 16px;
}

.site-kicker {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-title {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1.25;
}

.site-sub {
  margin: 8px 0 0;
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.site-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.course-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.course-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 3px;
  flex-shrink: 0;
}

.course-lang-btn {
  min-height: 30px;
  border: none;
  border-radius: 999px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.course-lang-btn:hover {
  color: var(--text);
}

.course-lang-btn.is-active {
  background: var(--text);
  color: #ffffff;
}

main.page {
  padding-top: 22px;
  padding-bottom: 42px;
}

/* ---- Section ---- */

.section {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 2.3vw, 1.7rem);
  line-height: 1.25;
}

.empty {
  margin: 0;
  color: var(--muted);
}

/* ---- Roadmap ---- */

.roadmap-figure {
  margin: 0;
}

.roadmap-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ---- Schedule ---- */

.schedule-grid {
  display: grid;
  gap: 12px;
}

.schedule-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 14px;
}

.schedule-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.week-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.schedule-head h3 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}

.schedule-body {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(250px, 1fr);
  gap: 16px;
}

.schedule-block h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.link-list {
  margin: 0 0 12px;
  padding-left: 22px;
}

.link-list li {
  margin-bottom: 6px;
  color: var(--muted);
}

.link-list a {
  color: var(--accent);
  font-weight: 500;
}

.link-list a:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

.session-list {
  display: grid;
  gap: 10px;
}

.session-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.session-date {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.session-title {
  font-size: 1.02rem;
}

.session-links {
  margin-top: 6px;
  font-size: 0.9rem;
}

.session-links a {
  color: var(--accent);
}

/* ---- Grading ---- */

.grading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.grade-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
}

.grade-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.grade-percent {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ---- Week Cards ---- */

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.week-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
}

.week-phase {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.week-card h3 {
  margin: 0 0 8px;
}

.week-card-title,
.week-card-meta,
.week-card-topic {
  margin: 0 0 8px;
  color: var(--muted);
}

.week-card-link {
  color: var(--accent);
  font-weight: 600;
}

.week-card-link:hover {
  text-decoration: underline;
}

.week-card[data-phase="build"] .week-phase {
  color: #b07832;
  border-color: rgba(176, 120, 50, 0.3);
}

.week-card[data-phase="verify"] .week-phase {
  color: #8b6e3e;
  border-color: rgba(139, 110, 62, 0.3);
}

.week-card[data-phase="deploy"] .week-phase {
  color: #6a8a5c;
  border-color: rgba(106, 138, 92, 0.3);
}

.week-card[data-phase="operate"] .week-phase {
  color: #8a6d8a;
  border-color: rgba(138, 109, 138, 0.3);
}

.week-card[data-phase="future"] .week-phase {
  color: #b06054;
  border-color: rgba(176, 96, 84, 0.3);
}

/* ---- Home Page ---- */

.home-header {
  border-bottom: 1px solid var(--line);
}

.home-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
}

.home-brand:hover {
  color: var(--text);
}

.home-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--logo-from), var(--logo-to));
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px var(--accent-shadow);
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 600;
  transition: color 140ms ease;
}

.home-nav-link:hover {
  color: var(--text);
}

.home-nav-link.is-active {
  color: var(--text);
  font-weight: 700;
}

.home-main {
  padding-top: 20px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  padding: 48px 18px 40px;
  border-radius: 20px;
  background: var(--hero-gradient);
}

.home-kicker {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-faint);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.home-hero-title {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.25;
  font-weight: 800;
}

.home-hero-subtitle {
  margin: 16px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.7;
}

.home-cta {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 16px;
  border: none;
  padding: 0 28px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--accent-shadow);
}

.home-cta:hover {
  color: #ffffff;
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-shadow);
}

.home-modules h2 {
  margin-bottom: 12px;
}

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-card {
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.home-card:nth-child(1) {
  background: linear-gradient(145deg, #eaf4fc, #ddeefb);
  border-color: rgba(147, 197, 243, 0.3);
}

.home-card:nth-child(2) {
  background: linear-gradient(145deg, #fef5e7, #fdecd0);
  border-color: rgba(240, 200, 140, 0.3);
}

.home-card:nth-child(3) {
  background: linear-gradient(145deg, #f3eafc, #ebdcf9);
  border-color: rgba(195, 165, 230, 0.3);
}

.home-card:nth-child(4) {
  background: linear-gradient(145deg, #e8faf0, #d8f5e6);
  border-color: rgba(140, 215, 170, 0.3);
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(44, 36, 24, 0.08);
}

.home-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.home-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.home-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
}

.home-card:nth-child(1) .home-card-icon {
  background: rgba(100, 160, 230, 0.15);
  color: #3b82c8;
}

.home-card:nth-child(2) .home-card-icon {
  background: rgba(220, 160, 60, 0.15);
  color: #c4890a;
}

.home-card:nth-child(3) .home-card-icon {
  background: rgba(160, 110, 210, 0.15);
  color: #8b5cc8;
}

.home-card:nth-child(4) .home-card-icon {
  background: rgba(80, 180, 120, 0.15);
  color: #2e9960;
}

.home-card-head h3 {
  margin: 0;
  font-size: 1.25rem;
}

.home-card-desc {
  margin: 8px 0 14px;
  color: var(--muted);
}

.home-card-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.home-card-list li {
  margin-bottom: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text);
  font-weight: 500;
}

.home-card-list li::before {
  content: '•';
  margin-right: 8px;
  font-weight: 700;
}

.home-card:nth-child(1) .home-card-list li::before { color: #5ba0e0; }
.home-card:nth-child(2) .home-card-list li::before { color: #d4a040; }
.home-card:nth-child(3) .home-card-list li::before { color: #a070d0; }
.home-card:nth-child(4) .home-card-list li::before { color: #50b878; }

.home-card-list li:last-child {
  border-bottom: none;
}

.home-card-item-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.home-card-item-link:hover {
  text-decoration-color: var(--accent);
}

.home-card-item-prefix {
  color: var(--text);
}

.home-community-qrcode {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 14px;
}

.home-community-qrcode-img {
  width: 128px;
  height: 128px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  object-fit: cover;
  background: #ffffff;
}

.home-community-qrcode-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.home-more-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: none;
  border-radius: 999px;
  padding: 0;
  color: var(--accent);
  font-weight: 700;
}

.home-more-link:hover {
  text-decoration: underline;
}

.home-card.skeleton {
  pointer-events: none;
  background: var(--surface-soft);
  border-color: var(--line);
}

.skeleton-line {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-strong) 0%, var(--line) 50%, var(--surface-strong) 100%);
  background-size: 180% 100%;
  animation: skeleton-pulse 1.2s linear infinite;
}

.line-title {
  height: 22px;
  width: 56%;
  margin-bottom: 14px;
}

.line-text {
  height: 14px;
  width: 100%;
  margin-bottom: 9px;
}

.line-link {
  height: 16px;
  width: 32%;
  margin-top: 14px;
}

.home-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
}

.home-footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.home-footer-inner h2 {
  margin: 0;
  font-size: 1.2rem;
}

.home-footer-inner p {
  margin: 8px 0 0;
  color: var(--muted);
}

.home-footer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.home-qrcode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-qrcode-img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
}

.home-filing {
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* ---- Note Page ---- */

.note-page {
  padding-bottom: 48px;
}

.note-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.note-sidebar {
  position: sticky;
  top: 108px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
}

.note-sidebar h2 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.note-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-toc-item {
  margin-bottom: 8px;
}

.note-toc-item.level-2 {
  padding-left: 12px;
}

.note-toc-item.level-3 {
  padding-left: 24px;
}

.note-toc a {
  color: var(--muted);
  line-height: 1.45;
}

.note-toc a:hover {
  color: var(--accent);
}

.note-main {
  min-height: 420px;
}

.note-error {
  border: 1px solid rgba(196, 85, 68, 0.25);
  border-radius: 12px;
  background: rgba(196, 85, 68, 0.04);
  color: #8b3a2e;
  padding: 14px;
}

.note-error h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.note-error p {
  margin: 0 0 8px;
}

.note-error a {
  color: var(--accent);
  text-decoration: underline;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.note-pager-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
}

.note-pager-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.back-top {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--accent);
  font-weight: 600;
}

.back-top:hover {
  background: var(--accent-faint);
}

/* ---- All Notes ---- */

.all-notes-toc {
  margin-bottom: 0;
}

.all-notes-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.all-notes-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
}

.all-notes-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.all-week-section {
  margin-bottom: 16px;
}

.note-detail {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  overflow: hidden;
}

.note-detail summary {
  cursor: pointer;
  list-style: none;
  padding: 12px;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}

.note-detail summary::-webkit-details-marker {
  display: none;
}

.note-detail .markdown-body {
  padding: 2px 12px 10px;
}

/* ---- Markdown Body ---- */

.markdown-body {
  line-height: 1.85;
  color: var(--text);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.markdown-body h1 {
  font-size: clamp(1.55rem, 2.2vw, 1.95rem);
}

.markdown-body h2 {
  font-size: clamp(1.32rem, 1.9vw, 1.55rem);
}

.markdown-body h3 {
  font-size: clamp(1.15rem, 1.7vw, 1.3rem);
}

.markdown-body p {
  margin: 0 0 0.95rem;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.markdown-body li {
  margin-bottom: 0.3rem;
}

.markdown-body blockquote {
  margin: 0 0 1rem;
  padding: 0.4rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  color: var(--muted);
}

.markdown-body code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--code-color);
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}

.markdown-body pre {
  margin: 0 0 1rem;
  padding: 12px;
  border: 1px solid var(--code-border);
  border-radius: 10px;
  background: var(--bg);
  overflow-x: auto;
}

.markdown-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.markdown-body a:hover {
  color: var(--accent-soft);
}

.markdown-body table {
  width: 100%;
  margin: 0 0 1rem;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.markdown-body th {
  background: var(--surface-soft);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* ---- Mermaid ---- */

.mermaid-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
  overflow-x: auto;
}

/* ---- Interview Filter Bar ---- */

.itv-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 24px;
}

.itv-filter-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.itv-filter-btn:hover {
  background: var(--line);
  color: var(--text);
}

.itv-filter-btn.is-active {
  background: var(--text);
  color: #ffffff;
}

/* ---- Interview Cards (Vertical Grid) ---- */

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

.itv-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.itv-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(44, 36, 24, 0.10);
}

.itv-thumb {
  position: relative;
  overflow: hidden;
  background: var(--surface-strong);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  margin: 8px 8px 0;
}

.itv-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  transition: transform 300ms ease;
}

.itv-card:hover .itv-thumb img {
  transform: scale(1.03);
}

.itv-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 36, 24, 0.2);
  opacity: 0;
  transition: opacity 200ms ease;
  border-radius: 14px;
}

.itv-card:hover .itv-thumb-overlay {
  opacity: 1;
}

.itv-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.itv-play-btn::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--accent);
}

.itv-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.itv-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.itv-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.itv-card-title::before {
  content: '\1F50A\00a0\00a0';
  font-size: 0.85em;
}

.itv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.itv-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.itv-card-guest {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.itv-thumb-placeholder {
  background: var(--surface-strong);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  margin: 8px 8px 0;
}

.itv-card.skeleton {
  pointer-events: none;
}

.itv-card.skeleton .itv-card-body .skeleton-line {
  margin-bottom: 10px;
}

/* ---- Theme Picker ---- */

.theme-picker {
  position: absolute;
  top: 18px;
  right: 18px;
}

.theme-picker-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.theme-picker-toggle:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.theme-picker-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  min-width: 152px;
}

.theme-picker.is-open .theme-picker-panel {
  display: flex;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  transition: background 140ms ease;
}

.theme-option:hover {
  background: var(--surface-strong);
}

.theme-option.is-active {
  font-weight: 700;
}

.theme-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
}

.theme-option.is-active .theme-swatch {
  border-width: 3px;
  border-color: currentColor;
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
  .home-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .note-layout {
    grid-template-columns: 1fr;
  }

  .note-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .page {
    width: min(1160px, calc(100% - 20px));
  }

  .course-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .course-lang-switch {
    align-self: flex-start;
  }

  .section {
    padding: 14px;
    border-radius: 12px;
  }

  .schedule-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .itv-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-footer-side {
    align-items: flex-start;
  }

  .note-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  .home-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .itv-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-nav a,
  .note-pager-link,
  .back-top {
    width: 100%;
    justify-content: center;
  }

  .all-notes-links a {
    width: calc(50% - 4px);
    justify-content: center;
  }

  .home-nav-link,
  .home-more-link,
  .home-cta {
    width: 100%;
    justify-content: center;
  }
}
