:root {
  --bg: #05060a;
  --bg-2: #0a0c14;
  --panel: #0f121c;
  --panel-2: #131827;
  --line: rgba(120, 140, 200, 0.12);
  --line-strong: rgba(120, 180, 255, 0.22);
  --text: #e6ecff;
  --text-dim: #8a94b8;
  --text-mute: #5b6586;
  --cyan: #49d6ff;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --green: #22d39e;
  --pink: #f472b6;
  --danger: #ff5c7c;
  --grad: linear-gradient(135deg, #49d6ff 0%, #3b82f6 50%, #8b5cf6 100%);
  --grad-soft: linear-gradient(135deg, rgba(73, 214, 255, 0.18), rgba(139, 92, 246, 0.18));
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 500px at 15% -10%, rgba(73, 214, 255, 0.08), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(139, 92, 246, 0.09), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(59, 130, 246, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 150, 220, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 150, 220, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  pointer-events: none;
  z-index: -1;
}

#particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

section, nav, footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(5, 6, 10, 0.6);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--text);
}
.logo-mark {
  display: inline-flex;
  color: var(--cyan);
  filter: drop-shadow(0 0 6px rgba(73, 214, 255, 0.5));
}
.logo-text .accent { color: var(--cyan); }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 28px 80px;
  position: relative;
}
.hero-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(73, 214, 255, 0.18), transparent 60%);
  pointer-events: none;
  filter: blur(20px);
  z-index: -1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(73, 214, 255, 0.06);
  border: 1px solid rgba(73, 214, 255, 0.2);
  border-radius: 999px;
  margin-bottom: 28px;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.hero-title {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.08;
  margin-bottom: 22px;
}
.title-line { display: block; color: var(--text); }
.title-gradient {
  display: block;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(73, 214, 255, 0.25));
}
.hero-subtitle {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}
.stat-num {
  font-size: 38px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad);
  color: #031020;
  box-shadow: 0 10px 30px rgba(73, 214, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(73, 214, 255, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: rgba(73, 214, 255, 0.06);
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn-large { padding: 16px 32px; font-size: 15px; }

.hero-terminal {
  margin-top: 60px;
  max-width: 620px;
  background: linear-gradient(180deg, #0a0e1a, #060912);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px rgba(73, 214, 255, 0.05) inset;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.tdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.tdot.red { background: #ff5f57; }
.tdot.yellow { background: #febc2e; }
.tdot.green { background: #28c840; }
.terminal-title {
  margin-left: 10px;
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.3px;
}
.terminal-body { padding: 20px 22px; line-height: 1.9; }
.t-line { color: var(--text); }
.t-prompt { color: var(--cyan); margin-right: 10px; }
.t-cmd { color: #d8e3ff; }
.t-out { color: var(--text-dim); padding-left: 2ch; }
.t-key { color: var(--violet); }
.t-val { color: var(--green); margin-left: 12px; }
.t-ok {
  color: var(--green);
  padding-top: 6px;
  border-top: 1px dashed rgba(34, 211, 158, 0.2);
  margin-top: 8px;
}

.scroll-hint {
  position: absolute;
  bottom: 20px;
  right: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 2px;
}
.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute;
  top: -20px;
  left: 0;
  width: 1px;
  height: 20px;
  background: var(--cyan);
  animation: scrolldown 2s infinite;
}
@keyframes scrolldown {
  0% { top: -20px; }
  100% { top: 100%; }
}

/* ---------- Section Head ---------- */
.section-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  text-align: center;
  margin-bottom: 50px;
}
.section-tag {
  display: inline-block;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.section-desc {
  color: var(--text-dim);
  font-size: 15px;
}
.section-desc .highlight {
  color: var(--cyan);
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

/* ---------- Features ---------- */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 28px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.feature-card {
  padding: 28px 24px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(73, 214, 255, 0.08);
  color: var(--cyan);
  margin-bottom: 18px;
  border: 1px solid rgba(73, 214, 255, 0.2);
  position: relative;
  z-index: 1;
}
.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.feature-card p {
  color: var(--text-dim);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

/* ---------- Projects ---------- */
.projects {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.35s, box-shadow 0.35s;
  display: flex;
  flex-direction: column;
}
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}
.project-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(73, 214, 255, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--cyan);
  box-shadow: 0 20px 50px rgba(73, 214, 255, 0.12);
}
.project-card:hover::before { transform: scaleX(1); }
.project-card:hover::after { opacity: 1; }

.p-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.p-emoji {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(73, 214, 255, 0.3));
}
.p-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
}
.tag-level.beginner { background: rgba(34, 211, 158, 0.12); color: #5de8b5; border: 1px solid rgba(34, 211, 158, 0.3); }
.tag-level.intermediate { background: rgba(250, 204, 21, 0.12); color: #ffd94a; border: 1px solid rgba(250, 204, 21, 0.3); }
.tag-level.advanced { background: rgba(244, 114, 182, 0.12); color: #ff9ec9; border: 1px solid rgba(244, 114, 182, 0.3); }
.tag-time { background: rgba(73, 214, 255, 0.08); color: var(--cyan); border: 1px solid rgba(73, 214, 255, 0.2); }

.project-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}
.p-desc {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 22px;
  flex: 1;
}
.p-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(120, 140, 200, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.p-meta svg { color: var(--cyan); flex-shrink: 0; }
.p-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(73, 214, 255, 0.06);
  border: 1px solid rgba(73, 214, 255, 0.25);
  border-radius: 10px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s;
}
.p-cta:hover {
  background: var(--cyan);
  color: #031020;
  border-color: var(--cyan);
}
.p-cta svg { transition: transform 0.25s; }
.p-cta:hover svg { transform: translateX(4px); }

/* ---------- CTA ---------- */
.cta {
  max-width: 1200px;
  margin: 40px auto 80px;
  padding: 0 28px;
}
.cta-inner {
  position: relative;
  padding: 80px 40px;
  text-align: center;
  background: linear-gradient(180deg, rgba(73, 214, 255, 0.06), rgba(139, 92, 246, 0.06));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  overflow: hidden;
}
.cta-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(73, 214, 255, 0.15), transparent 60%);
  pointer-events: none;
  filter: blur(30px);
}
.cta-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  position: relative;
}
.text-gradient {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cta-desc {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 30px;
  position: relative;
}
.cta .btn { position: relative; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 30px 28px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-tag { color: var(--text-mute); font-size: 13px; }
.footer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-mute);
  font-size: 13px;
}
.footer-meta .divider { opacity: 0.4; }

/* ---------- Project Detail Panel ---------- */
.project-detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.project-detail.open { opacity: 1; visibility: visible; }
.detail-overlay { position: absolute; inset: 0; cursor: pointer; }
.detail-panel {
  position: relative;
  flex: 1;
  margin: 20px;
  background: linear-gradient(180deg, #0d1222, #080b16);
  border: 1px solid rgba(120, 150, 220, 0.15);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}
.project-detail.open .detail-panel { transform: translateY(0); opacity: 1; }

.detail-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(120, 150, 220, 0.1);
  background: linear-gradient(90deg, rgba(73, 214, 255, 0.04), rgba(139, 92, 246, 0.04));
}
.detail-back {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(120, 150, 220, 0.2);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.detail-back:hover { color: var(--cyan); border-color: var(--cyan); }

.detail-title-wrap { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.detail-emoji { font-size: 26px; line-height: 1; }
.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 3px;
}
.detail-desc { color: var(--text-dim); font-size: 13px; }
.detail-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.detail-meta .tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11.5px;
  border-radius: 99px;
  border: 1px solid;
  font-family: "JetBrains Mono", monospace;
}
.detail-meta .tag-beginner { background: rgba(34, 211, 158, 0.12); color: #5de8b5; border-color: rgba(34, 211, 158, 0.3); }
.detail-meta .tag-intermediate { background: rgba(250, 204, 21, 0.12); color: #ffd94a; border-color: rgba(250, 204, 21, 0.3); }
.detail-meta .tag-advanced { background: rgba(244, 114, 182, 0.12); color: #ff9ec9; border-color: rgba(244, 114, 182, 0.3); }
.detail-meta .tag-time { background: rgba(120, 150, 220, 0.1); color: #a5b4d8; border-color: rgba(120, 150, 220, 0.2); }

.detail-body {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  overflow: hidden;
}

/* ---------- Lesson Pane (Left) ---------- */
.lesson-pane {
  border-right: 1px solid rgba(120, 150, 220, 0.08);
  background: linear-gradient(180deg, #0a0f1d, #080b14);
  padding: 22px 16px 22px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-project-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.lesson-project-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(120, 150, 220, 0.08);
}

.chapter {
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1, #3b82f6), var(--c2, #8b5cf6));
  padding: 1px;
  transition: transform 0.2s;
}
.chapter-inner {
  background: #0b1020;
  border-radius: 11px;
}
.chapter-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  cursor: pointer;
  background: linear-gradient(120deg, var(--c1, #3b82f6), var(--c2, #8b5cf6));
  color: white;
  font-weight: 700;
  font-size: 14.5px;
  transition: filter 0.2s;
}
.chapter-head:hover { filter: brightness(1.1); }
.chapter-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  font-size: 14px;
  flex-shrink: 0;
}
.chapter-title { flex: 1; letter-spacing: 0.2px; }
.chapter-toggle {
  font-size: 18px;
  opacity: 0.8;
  transition: transform 0.25s;
}
.chapter.open .chapter-toggle { transform: rotate(45deg); }

.chapter-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.chapter.open .chapter-body { max-height: 2000px; }

.section-card {
  padding: 14px 14px 16px;
  border-bottom: 1px dashed rgba(120, 150, 220, 0.08);
}
.section-card:last-child { border-bottom: 0; }

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(120, 150, 220, 0.05);
  border: 1px solid rgba(120, 150, 220, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.section-head:hover { background: rgba(120, 150, 220, 0.1); }
.section-head.active {
  background: linear-gradient(90deg, rgba(73, 214, 255, 0.18), rgba(139, 92, 246, 0.18));
  border-color: var(--cyan);
}
.section-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
}
.section-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.section-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; font-weight: 400; }
.section-plus {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: rgba(73, 214, 255, 0.2);
  color: var(--cyan);
  font-weight: 700;
  font-size: 16px;
}

.section-content {
  padding: 12px 10px 0;
  display: none;
}
.section-card.open .section-content { display: block; }

.section-content p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.section-content .concept {
  padding: 10px 12px;
  background: rgba(73, 214, 255, 0.06);
  border: 1px solid rgba(73, 214, 255, 0.15);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  font-size: 12.5px;
  color: #c7e8ff;
  line-height: 1.6;
  margin-bottom: 10px;
}
.section-content .btn-practice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  color: #031020;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 18px rgba(73, 214, 255, 0.25);
}
.section-content .btn-practice:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(73, 214, 255, 0.35); }

/* ---------- Code Pane (Right) ---------- */
.code-pane {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 22px 16px;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.editor-wrap {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(120, 150, 220, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: #0a0f1e;
  flex: 1;
  min-height: 0;
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #151a2e;
  border-bottom: 1px solid rgba(120, 150, 220, 0.1);
  gap: 12px;
}
.editor-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: "JetBrains Mono", monospace;
  background: #0a0f1e;
  color: #dce7ff;
  border: 1px solid rgba(120, 150, 220, 0.15);
  border-radius: 6px 6px 0 0;
}
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
}
.tbtn-run {
  background: linear-gradient(135deg, #3b82f6, #49d6ff);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}
.tbtn-run:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45); }
.tbtn-reset {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border-color: rgba(120, 150, 220, 0.2);
}
.tbtn-reset:hover { color: var(--cyan); border-color: var(--cyan); }
.tbtn-answer {
  background: rgba(244, 114, 182, 0.08);
  color: #ff9ec9;
  border-color: rgba(244, 114, 182, 0.25);
}
.tbtn-answer:hover { background: rgba(244, 114, 182, 0.15); border-color: #ff9ec9; }

.editor-body {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
}
.editor-lines {
  padding: 16px 10px 16px 16px;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: rgba(120, 150, 220, 0.35);
  text-align: right;
  line-height: 1.8;
  user-select: none;
  background: #060914;
  border-right: 1px solid rgba(120, 150, 220, 0.08);
  white-space: pre;
  overflow: hidden;
}
.code-editor {
  display: block;
  width: 100%;
  height: 100%;
  padding: 16px 18px;
  background: transparent;
  border: 0;
  resize: none;
  outline: none;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
  color: #dce7ff;
  tab-size: 2;
  white-space: pre;
  overflow-x: auto;
}
.code-editor::placeholder { color: rgba(120, 150, 220, 0.3); }

.output-wrap {
  border: 1px solid rgba(120, 150, 220, 0.12);
  border-radius: 12px;
  background: #060914;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  max-height: 300px;
  overflow: hidden;
}
.output-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(120, 150, 220, 0.05);
  border-bottom: 1px solid rgba(120, 150, 220, 0.1);
}
.output-header span:nth-child(2) { margin-right: auto; }
.out-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.output-clear {
  background: transparent;
  border: 1px solid rgba(120, 150, 220, 0.2);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.output-clear:hover { color: var(--cyan); border-color: var(--cyan); }
.output-body {
  padding: 16px 20px;
  margin: 0;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: #b8d0ff;
  white-space: pre;
  overflow-y: auto;
  flex: 1;
}
.output-body .output-line { display: block; }
.output-body .output-mute, .output-body .muted { color: #5d6a8a; }
.output-body .ok { color: #6bf0b5; }
.output-body .output-loading { color: var(--cyan); }

/* ---------- Section detail (concept + practice) ---------- */
.section-card {
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(120,150,220,0.08);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
  transition: background 0.2s;
}
.section-head:hover { background: rgba(120,150,220,0.05); }
.section-head.active {
  background: linear-gradient(90deg, rgba(73,214,255,0.18), rgba(139,92,246,0.18));
  border-bottom: 1px solid rgba(73,214,255,0.15);
}
.section-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; font-weight: 700;
  color: #49d6ff;
}
.section-title { font-size: 13.5px; font-weight: 700; color: #e7ecf7; line-height: 1.3; }
.section-sub { font-size: 11.5px; color: #9aa5bd; margin-top: 3px; font-weight: 400; line-height: 1.4;}
.section-plus {
  width: 22px; height: 22px; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: rgba(73,214,255,0.18);
  color: #49d6ff;
  font-weight: 700; font-size: 16px;
}

.section-content {
  padding: 14px 14px 16px;
  border-top: 1px solid rgba(120,150,220,0.08);
  display: none;
}
.section-card.open .section-content { display: block; }

.concept-card {
  background: rgba(73,214,255,0.05);
  border: 1px solid rgba(73,214,255,0.18);
  border-left: 3px solid #49d6ff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.concept-label {
  font-size: 11.5px;
  color: #49d6ff;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.concept-text {
  font-size: 12.5px;
  color: #c7d6ee;
  line-height: 1.7;
}

.btn-practice {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: linear-gradient(90deg, #49d6ff, #8b5cf6);
  color: #021221;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(73,214,255,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-practice:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(139,92,246,0.35); }

/* Small fixes for the file tag */
.detail-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.detail-meta .tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; font-size: 11px; font-weight: 600;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  border: 1px solid rgba(120,150,220,0.2);
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding-top: 70px; }
  .hero-stats { gap: 28px; }
  .stat-num { font-size: 30px; }
  .scroll-hint { display: none; }
  .cta-inner { padding: 50px 24px; }
  .detail-panel { margin: 0; border-radius: 0; }
  .detail-header { flex-wrap: wrap; }
  .detail-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .lesson-pane { max-height: 45vh; padding: 16px; border-right: 0; border-bottom: 1px solid rgba(120, 150, 220, 0.1); }
  .code-pane { padding: 14px; }
}
