/* ========================================
   初中生表达与演讲学习教程 - 样式表
   ======================================== */

:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1e40af;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --success-light: #d1fae5;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --max-width: 800px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
}

/* ---- 导航栏 ---- */
.topnav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topnav .logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.topnav .logo::before { content: "🎤 "; }
.topnav .breadcrumb {
  color: var(--text-light);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topnav .breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}
.topnav .breadcrumb a:hover { text-decoration: underline; }

/* ---- 主容器 ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ---- 首页头部 ---- */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.hero h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}
.hero .subtitle {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 24px;
}
.hero .badge {
  display: inline-block;
  background: var(--accent-light);
  color: #92400e;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

/* ---- 章节目录 ---- */
.toc {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-top: 20px;
}
.toc h2 {
  font-size: 22px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
}
.toc ol {
  list-style: none;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 4px;
}
.toc li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: background 0.2s;
}
.toc li a:hover { background: var(--primary-light); }
.toc li a::before {
  content: "第" counter(toc, cjk-ideographic) "章";
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ---- 章节页 ---- */
.chapter-header {
  text-align: center;
  padding: 40px 0 30px;
}
.chapter-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.chapter-header h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
}
.chapter-header .chapter-desc {
  color: var(--text-light);
  margin-top: 8px;
  font-size: 16px;
}

/* ---- 内容卡片 ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.card h2 {
  font-size: 22px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.card h3 {
  font-size: 18px;
  margin: 20px 0 10px;
  color: var(--primary-dark);
}

/* ---- 提示框 ---- */
.tip {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
}
.tip::before {
  content: "💡 小提示：";
  font-weight: 700;
  color: var(--primary-dark);
}
.tip p { display: inline; }

.important {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
}
.important::before {
  content: "⭐ 重点：";
  font-weight: 700;
  color: #92400e;
}
.important p { display: inline; }

/* ---- 练习区 ---- */
.practice {
  background: var(--success-light);
  border: 2px dashed var(--success);
  padding: 24px 28px;
  border-radius: var(--radius);
  margin: 24px 0;
}
.practice h4 {
  color: #065f46;
  font-size: 17px;
  margin-bottom: 10px;
}
.practice h4::before { content: "✏️ "; }
.practice ul {
  padding-left: 20px;
}
.practice li {
  margin-bottom: 6px;
}

/* ---- 表格 ---- */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  white-space: nowrap;
}
tr:hover td { background: #f1f5f9; }

/* ---- 框架框 ---- */
.framework {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 16px 0;
}
.framework h4 {
  color: #0369a1;
  margin-bottom: 8px;
  font-size: 16px;
}

/* ---- 步骤列表 ---- */
.steps {
  list-style: none;
  padding: 0;
}
.steps li {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.steps .step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}
.steps .step-content { flex: 1; }
.steps .step-content strong { display: block; margin-bottom: 4px; font-size: 16px; }
.steps .step-content p { color: var(--text-light); font-size: 15px; margin: 0; }

/* ---- 引用 ---- */
blockquote {
  background: #fefce8;
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #713f12;
  text-align: center;
}

/* ---- 范文 ---- */
.model {
  background: #fdf2f8;
  border: 2px solid #ec4899;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 20px 0;
}
.model h4 {
  color: #be185d;
  margin-bottom: 12px;
  font-size: 17px;
}
.model h4::before { content: "📄 范文："; }
.model .model-content {
  background: #fff;
  border-radius: 6px;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 2;
  color: #831843;
}
.model .model-content p { margin-bottom: 10px; }
.model .model-content p:last-child { margin-bottom: 0; }
.model .model-note {
  margin-top: 12px;
  font-size: 13px;
  color: #9d174d;
  background: #fce7f3;
  padding: 10px 14px;
  border-radius: 6px;
}
.model .model-note::before { content: "💡 "; }

/* ---- FAQ ---- */
.faq-item {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-q {
  background: var(--card);
  padding: 16px 20px;
  font-weight: 700;
  cursor: default;
  color: var(--primary-dark);
}
.faq-q::before { content: "Q："; color: var(--primary); }
.faq-a {
  padding: 16px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}
.faq-a::before { content: "A："; color: var(--success); font-weight: 700; }

/* ---- 底部导航 ---- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.chapter-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s;
}
.chapter-nav a:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.chapter-nav .prev::before { content: "← "; }
.chapter-nav .next::after { content: " →"; }
.chapter-nav .toc-link { margin: 0 auto; }

/* ---- 进度条 ---- */
.progress-bar {
  background: var(--border);
  height: 4px;
  border-radius: 2px;
  margin: 20px 0;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s;
}

/* ---- 页脚 ---- */
.footer {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* ---- 响应式 ---- */
@media (max-width: 600px) {
  .container { padding: 20px 16px 60px; }
  .hero h1 { font-size: 26px; }
  .hero { padding: 30px 10px 20px; }
  .card { padding: 20px 18px; }
  .chapter-header h1 { font-size: 24px; }
  table { font-size: 13px; }
  th, td { padding: 8px 10px; }
  .chapter-nav { flex-direction: column; align-items: stretch; }
  .chapter-nav a { justify-content: center; }
}

/* ---- 打印样式 ---- */
@media print {
  .topnav, .chapter-nav, .progress-bar { display: none; }
  body { font-size: 14px; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
