/* ===== 基础重置与变量 ===== */
:root {
  --primary: #2c3e50;
  --accent: #3498db;
  --accent-light: #ebf5fb;
  --bg: #fafbfc;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #5a6c7d;
  --border: #e1e8ed;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

/* ===== 导航栏 ===== */
.navbar {
  background: var(--primary);
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-lg);
}
.navbar .nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; height: 56px;
}
.navbar .logo {
  font-size: 1.2rem; font-weight: 700; color: #fff;
  text-decoration: none;
}
.navbar .logo span { color: var(--accent); }
.navbar .nav-links { display: flex; gap: 0.15rem; margin-left: auto; align-items: center; }
.navbar .nav-links > a {
  color: rgba(255,255,255,0.75); text-decoration: none;
  padding: 0.35rem 0.6rem; border-radius: 6px;
  font-size: 0.85rem; transition: all 0.2s; white-space: nowrap;
}
.navbar .nav-links > a:hover, .navbar .nav-links > a.active {
  color: #fff; background: rgba(255,255,255,0.12);
}

/* ===== 下拉菜单 ===== */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: block; color: rgba(255,255,255,0.8); text-decoration: none;
  padding: 0.35rem 0.6rem; border-radius: 6px;
  font-size: 0.85rem; cursor: pointer; transition: all 0.2s; white-space: nowrap;
  user-select: none;
}
.nav-dropdown-trigger:hover, .nav-dropdown-trigger.active-part {
  color: #fff; background: rgba(255,255,255,0.12);
}
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 0; min-width: 210px;
  background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all 0.2s ease; z-index: 200; padding: 0.4rem 0;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(4px);
}
.nav-dropdown-menu a {
  display: block; color: var(--text) !important; text-decoration: none;
  padding: 0.45rem 1rem; font-size: 0.85rem; transition: all 0.15s;
  border-radius: 0 !important; white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  background: var(--accent-light); color: var(--accent) !important;
}
.nav-dropdown-menu a.active {
  background: var(--accent-light); color: var(--accent) !important;
  font-weight: 600;
}

/* ===== 主容器 ===== */
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== Hero 区域 ===== */
.hero {
  text-align: center; padding: 3rem 1.5rem 2rem;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  color: #fff;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.hero p { font-size: 1.1rem; opacity: 0.85; max-width: 600px; margin: 0 auto; }

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg); border-radius: 10px;
  padding: 1.5rem 2rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card h2 { font-size: 1.3rem; margin-bottom: 0.6rem; color: var(--primary); }
.card p { color: var(--text-light); }

/* ===== 章节卡片（首页） ===== */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}
.chapter-card {
  background: var(--card-bg); border-radius: 10px;
  padding: 1.5rem; box-shadow: var(--shadow);
  border: 2px solid transparent; text-decoration: none;
  color: var(--text); transition: all 0.2s;
}
.chapter-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.chapter-card .ch-num {
  font-size: 2.5rem; font-weight: 800; color: var(--accent);
  opacity: 0.3; line-height: 1;
}
.chapter-card h3 { margin: 0.3rem 0 0.5rem; font-size: 1.15rem; }
.chapter-card p { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; }

/* ===== 内容排版 ===== */
.content h1 {
  font-size: 1.8rem; border-left: 4px solid var(--accent);
  padding-left: 1rem; margin: 1.5rem 0 1rem;
}
.content h2 {
  font-size: 1.3rem; margin: 2rem 0 0.8rem;
  color: var(--primary);
}
.content h3 {
  font-size: 1.1rem; margin: 1.5rem 0 0.5rem;
  color: var(--text);
}
.content p { margin-bottom: 0.8rem; color: var(--text-light); }
.content ul, .content ol { margin: 0.5rem 0 1rem 1.5rem; color: var(--text-light); }
.content li { margin-bottom: 0.4rem; }

/* 原理卡片 */
.principle {
  background: linear-gradient(135deg, var(--accent-light), #f0f7ff);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.5rem; margin: 1rem 0;
}
.principle .principle-title {
  font-weight: 700; color: var(--primary); font-size: 1.05rem;
}
.principle .principle-en {
  font-size: 0.8rem; color: var(--accent); margin-bottom: 0.3rem;
}

/* 例子框 */
.example {
  background: #fef9e7;
  border: 1px solid #f9e79f;
  border-radius: 8px;
  padding: 1rem 1.5rem; margin: 1rem 0;
}
.example::before {
  content: "💡 身边的例子";
  display: block;
  font-weight: 700; font-size: 0.85rem;
  color: #b7950b; margin-bottom: 0.4rem;
}
.example p { color: #7d6608; margin-bottom: 0.3rem; }

/* 思考框 */
.think {
  background: #eaf7ea;
  border: 1px solid #a9dfbf;
  border-radius: 8px;
  padding: 1rem 1.5rem; margin: 1rem 0;
}
.think::before {
  content: "🧠 培养经济思维";
  display: block;
  font-weight: 700; font-size: 0.85rem;
  color: #1e8449; margin-bottom: 0.4rem;
}

/* 小结 */
.summary {
  background: var(--primary); color: #fff;
  border-radius: 10px; padding: 1.5rem 2rem; margin: 2rem 0;
}
.summary h2 { color: #fff; }
.summary ul { color: rgba(255,255,255,0.85); }

/* 术语表 */
.glossary { margin: 1.5rem 0; }
.glossary dt {
  font-weight: 700; color: var(--primary);
  margin-top: 0.6rem;
}
.glossary dd { margin-left: 1.5rem; color: var(--text-light); }

/* ===== 进度条 ===== */
.progress-section { margin: 1.5rem 0; }
.progress-section h2 { margin-bottom: 0.8rem; }
.progress-bar {
  background: #e1e8ed; border-radius: 10px;
  height: 8px; margin-bottom: 0.3rem;
}
.progress-bar .fill {
  background: var(--accent); border-radius: 10px;
  height: 100%; transition: width 0.5s;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center; padding: 1.5rem;
  color: var(--text-light); font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .navbar { padding: 0 0.8rem; }
  .container { padding: 1rem; }
  .card { padding: 1rem; }
}
