:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --accent: #111827;
  --rose: #e11d48;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input { font: inherit; }

.site-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 16px auto 40px;
}

.hero-card,
.sidebar-card,
.content-card,
.footer-card,
.topic-detail-card,
.topic-box,
.milestone-card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 24px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 0.8fr;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--dark);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 {
  margin-top: 14px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
}
.subtitle, .muted { color: var(--muted); }
.hero-text {
  margin-top: 18px;
  max-width: 760px;
  color: #475569;
  line-height: 1.75;
}

.pill {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-actions,
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 18px;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn-primary {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}
.btn-primary:hover { background: var(--dark-soft); }
.btn-secondary {
  background: white;
  color: var(--text);
}
.btn-secondary:hover { background: #f8fafc; }

.milestone-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  height: 100%;
}

.milestones {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.milestone-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}

.milestone-num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--dark);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 18px 0 22px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { margin-top: 6px; color: var(--muted); font-size: 0.92rem; }

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
}

.sidebar-card {
  border-radius: var(--radius-xl);
  padding: 18px;
  position: sticky;
  top: 16px;
  height: fit-content;
}

.sidebar-head input {
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: white;
}

.topic-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}

.topic-pill {
  width: 100%;
  border: 1px solid var(--border);
  background: white;
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}
.topic-pill:hover { background: #f8fafc; }
.topic-pill.active {
  background: var(--dark);
  border-color: var(--dark);
  color: white;
}
.topic-pill.active .topic-short,
.topic-pill.active .topic-level,
.topic-pill.active .topic-progress-label { color: #cbd5e1; }

.topic-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.topic-title { font-weight: 700; }
.topic-short,
.topic-level,
.topic-progress-label {
  color: var(--muted);
  font-size: 0.82rem;
}
.topic-short { margin-top: 6px; line-height: 1.45; }
.topic-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.bar > div {
  height: 100%;
  background: var(--dark);
  border-radius: 999px;
}
.topic-pill.active .bar { background: rgba(255,255,255,0.18); }
.topic-pill.active .bar > div { background: white; }

.main-column {
  display: grid;
  gap: 22px;
}

.topic-detail-card {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.topic-detail-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.topic-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.topic-intro {
  margin-top: 18px;
  line-height: 1.75;
  color: #475569;
}
.topic-progress-wrap { margin-top: 18px; }
.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
}

.triple-grid,
.double-grid {
  display: grid;
  gap: 18px;
}
.triple-grid { grid-template-columns: repeat(3, 1fr); }
.double-grid { grid-template-columns: repeat(2, 1fr); }

.topic-box,
.content-card,
.footer-card {
  border-radius: var(--radius-xl);
  padding: 22px;
}
.topic-box h3,
.content-card h3 { margin-bottom: 6px; }

.simple-list,
.faq-answer,
.topic-box ul {
  margin: 0;
  padding-left: 18px;
}

.topic-box li,
.simple-list li {
  margin: 10px 0;
  color: #334155;
  line-height: 1.6;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: white;
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border: 0;
  background: white;
  font-weight: 600;
  cursor: pointer;
}
.faq-answer {
  padding: 0 18px 18px 34px;
  color: #475569;
  line-height: 1.7;
  display: none;
}
.faq-item.open .faq-answer { display: block; }

.footer-card {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .hero-card,
  .layout,
  .double-grid,
  .triple-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .sidebar-card { position: static; }
}

@media (max-width: 720px) {
  .site-shell { width: min(100% - 20px, 1320px); }
  .hero-card,
  .topic-detail-card,
  .topic-box,
  .content-card,
  .footer-card,
  .sidebar-card,
  .milestone-card { padding: 18px; }
  h2 { font-size: 2.2rem; }
}
