:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --primary-light: #eef1ff;
  --text: #1a1a2e;
  --text-muted: #5c5c7a;
  --bg: #f7f8fc;
  --card: #ffffff;
  --border: #e4e7f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(102, 126, 234, 0.08);
  --max: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { font-size: 1.25rem; font-weight: 700; color: #fff; }
.brand span { opacity: .85; font-weight: 400; font-size: .85rem; display: block; }

.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  color: rgba(255,255,255,.9);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: .9rem;
}
.nav a:hover, .nav a.active {
  background: rgba(255,255,255,.2);
  text-decoration: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 56px 0 64px;
  text-align: center;
}

.hero h1 { font-size: 2rem; margin-bottom: 12px; }
.hero p { opacity: .9; max-width: 560px; margin: 0 auto 28px; font-size: 1.05rem; }

.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.6); }

/* Cards */
.section { padding: 48px 0; }
.section-title { font-size: 1.5rem; margin-bottom: 8px; }
.section-desc { color: var(--text-muted); margin-bottom: 28px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .15s;
}

.card:hover { transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: 10px; }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: .9rem; }
.card-meta { margin-top: 12px; font-size: .85rem; color: var(--primary); font-weight: 600; }

/* Path steps */
.path-steps { display: flex; flex-direction: column; gap: 16px; }
.path-step {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}
.path-step h4 { margin-bottom: 8px; }
.path-step ul { margin-left: 20px; color: var(--text-muted); font-size: .95rem; }

/* Learn layout */
.learn-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 32px 0 48px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 80px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-head {
  padding: 16px;
  background: var(--primary-light);
  font-weight: 700;
  font-size: .9rem;
}

.cat-block { border-bottom: 1px solid var(--border); }
.cat-block:last-child { border-bottom: none; }

.cat-toggle {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-toggle:hover { background: var(--bg); }
.cat-toggle.open { color: var(--primary); }

.lesson-list { display: none; padding: 0 8px 8px; }
.lesson-list.open { display: block; }

.lesson-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .85rem;
  color: var(--text-muted);
}
.lesson-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.lesson-link.active { background: var(--primary); color: #fff; }

/* Article body */
.lesson-main { min-width: 0; }

.lesson-header {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.lesson-header .badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .8rem;
  margin-bottom: 10px;
}

.lesson-header h1 { font-size: 1.6rem; margin-bottom: 10px; }
.lesson-header .summary { color: var(--text-muted); }

.section-block {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.section-block h2 { font-size: 1.15rem; margin-bottom: 12px; color: var(--primary-dark); }
.section-block p { margin-bottom: 10px; color: var(--text); }
.section-block ul { margin: 10px 0 0 20px; color: var(--text-muted); }
.section-block li { margin-bottom: 6px; }

.cta-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  text-align: center;
}
.cta-box h3 { margin-bottom: 8px; }
.cta-box p { opacity: .9; font-size: .9rem; margin-bottom: 16px; }
.cta-box .btn-primary { margin-top: 4px; }

.inapp-hint {
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
  font-size: .9rem;
  color: #8a6d00;
}

/* Articles */
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 22px;
  border: 1px solid var(--border);
  display: block;
  color: inherit;
}
.article-item:hover { border-color: var(--primary); text-decoration: none; }
.article-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.article-item .meta { font-size: .85rem; color: var(--text-muted); }

.article-body .section-block h2 { font-size: 1.05rem; }

/* Footer */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.7);
  padding: 32px 0;
  margin-top: 48px;
  font-size: .9rem;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .learn-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero h1 { font-size: 1.5rem; }
  .nav { display: none; }
}
