* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --accent: #3182ce;
  --bg: #f7fafc;
  --card-bg: #fff;
  --text: #2d3748;
  --text-light: #718096;
  --border: #e2e8f0;
  --success: #38a169;
  --warning: #d69e2e;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 2rem;
  text-align: center;
}
.header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.header p { opacity: 0.9; }
.header .logo { font-size: 0.9rem; margin-top: 1rem; opacity: 0.7; }

.search-bar {
  background: var(--card-bg);
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.search-bar input {
  width: 100%;
  max-width: 600px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 25px;
  font-size: 1rem;
  display: block;
  margin: 0 auto;
  transition: border-color 0.2s;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.channel-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.channel-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  background: var(--bg);
}
.channel-item:hover {
  background: #edf2f7;
}
.channel-item.active {
  background: var(--accent);
  color: #fff;
}
.channel-item .icon {
  font-size: 1.1rem;
}

.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.page-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 200px);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}
.sidebar {
  width: 260px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar h4 { color: var(--primary); margin-bottom: 1rem; font-size: 0.9rem; }
.sidebar ul { list-style: none; }
.sidebar li { margin-bottom: 0.5rem; }
.sidebar a { display: block; padding: 0.5rem 0.75rem; border-radius: 6px; color: var(--text); font-size: 0.9rem; transition: background 0.2s; }
.sidebar a:hover, .sidebar a.active { background: #edf2f7; text-decoration: none; color: var(--accent); }
.sidebar .back-link { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; color: var(--accent); font-weight: 500; }
.main-content {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 900px;
}
.main-content h1 { color: var(--primary); border-bottom: 2px solid var(--accent); padding-bottom: 0.5rem; margin-bottom: 2rem; }
.section { margin-bottom: 2rem; }
.nav-footer { display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.nav-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 500; transition: background 0.2s; }
.nav-btn:hover { background: var(--primary); text-decoration: none; }
.flow-chart { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.flow-item { background: var(--accent); color: #fff; padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.9rem; }
.flow-arrow { color: var(--accent); font-size: 1.2rem; }
.keyword { color: var(--accent); font-weight: 600; }

@media (max-width: 768px) {
  .page-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-content { padding: 1.5rem; }
}

.channel-content {
  display: none;
}
.channel-content.active {
  display: block;
}

.welcome-section {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 12px;
  margin-bottom: 2rem;
}
.welcome-section h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }

.learning-path {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.learning-path h3 { margin-bottom: 1.5rem; color: var(--primary); }
.path-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.path-step {
  background: var(--bg);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  min-width: 160px;
}
.path-step .step-num {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.path-step .step-title { font-weight: 600; color: var(--primary); }
.path-step .step-desc { font-size: 0.85rem; color: var(--text-light); }
.path-arrow { font-size: 1.5rem; color: var(--accent); }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.chapter-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--accent);
}
.chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}
.chapter-card .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: bold;
  margin-bottom: 1rem;
}
.chapter-card h3 { margin-bottom: 0.5rem; color: var(--primary); }
.chapter-card p { font-size: 0.9rem; color: var(--text-light); }
.chapter-card .topics { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chapter-card .tag {
  background: #edf2f7;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-light);
}

.channel-content h2 {
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.accordion { margin: 1rem 0; }
.accordion-item { 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  margin-bottom: 0.75rem; 
  overflow: hidden;
  background: var(--card-bg);
}
.accordion-header {
  background: #f7fafc;
  padding: 1rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--primary);
  transition: background 0.2s;
}
.accordion-header:hover { background: #edf2f7; }
.accordion-header::after { content: '+'; font-size: 1.4rem; color: var(--accent); font-weight: bold; }
.accordion-item.open .accordion-header { background: var(--accent); color: #fff; }
.accordion-item.open .accordion-header::after { content: '−'; color: #fff; }
.accordion-content {
  display: none;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}
.accordion-item.open .accordion-content { display: block; }

.accordion-content h4 {
  color: var(--primary-light);
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
}
.accordion-content h4:first-child { margin-top: 0; }

ul.content-list, ol.content-list {
  margin: 0.75rem 0 0.75rem 1.5rem;
}
ul.content-list li, ol.content-list li { margin-bottom: 0.5rem; }

.card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 1rem 0;
}
.card.highlight { 
  border-left: 4px solid var(--accent); 
  background: #ebf8ff;
}
.card.tip { 
  border-left: 4px solid var(--success); 
  background: #f0fff4; 
}
.card.warning { 
  border-left: 4px solid var(--warning); 
  background: #fffff0; 
}
.card strong { display: block; margin-bottom: 0.5rem; }

.script-text {
  background: #fffbeb;
  border: 1px dashed var(--warning);
  padding: 0.75rem;
  border-radius: 4px;
  font-style: italic;
  line-height: 1.8;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
th, td { padding: 0.75rem; border: 1px solid var(--border); text-align: left; }
th { background: #f7fafc; font-weight: 600; color: var(--primary); }
tr:hover { background: #f7fafc; }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s;
}

.back-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  font-size: 1.5rem;
}
.back-top.show { display: flex; }
.back-top:hover { background: var(--primary); }

.footer {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .header h1 { font-size: 1.5rem; }
  .channel-nav { gap: 0.25rem; padding: 0.5rem; }
  .channel-item { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .container { padding: 1rem; }
  .chapter-grid { grid-template-columns: 1fr; }
  .path-flow { flex-direction: column; }
  .path-arrow { transform: rotate(90deg); }
  .accordion-header { padding: 0.75rem 1rem; }
  .accordion-content { padding: 1rem; }
}
