/* ══════════════════════════════════════════════════════════════════
   Earth & Tea Theme — Unified Color Scheme for WeChat Article Portal
   ══════════════════════════════════════════════════════════════════ */

/* ── Light Mode (default) ──────────────────────────────────────── */
:root {
  --primary: #5B8469;
  --primary-dark: #4A6F56;
  --primary-light: #7A9E86;
  --accent: #C8854A;
  --accent-light: #DBA070;
  --gold: #E8C87A;
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --text: #2C2C2C;
  --text-secondary: #6B6B6B;
  --text-muted: #999;
  --text-footer: #bbb;
  --border: #E8E4DC;
  --tab-hover: #5B8469;
  --tab-active: #5B8469;
  --tab-active-border: #5B8469;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --container-width: 780px;
}

/* ── Dark Mode ───────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #1A1A1A;
  --surface: #222;
  --text: #E0E0E0;
  --text-secondary: #999;
  --text-muted: #777;
  --text-footer: #555;
  --border: #333;
  --tab-hover: #7A9E86;
  --tab-active: #7A9E86;
  --tab-active-border: #7A9E86;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1A1A1A;
    --surface: #222;
    --text: #E0E0E0;
    --text-secondary: #999;
    --text-muted: #777;
    --text-footer: #555;
    --border: #333;
    --tab-hover: #7A9E86;
    --tab-active: #7A9E86;
    --tab-active-border: #7A9E86;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
  }
}

/* ── Reset & Base ────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0;
}

/* ── Article Header (Classic Gradient) ───────────────────────── */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px 24px 30px;
  text-align: center;
  position: relative;
}
.header h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.header .meta { font-size: 14px; opacity: 0.9; margin-bottom: 4px; }
.header .meta a { color: rgba(255,255,255,0.85); text-decoration: underline; }

.back-home {
  position: absolute; top: 12px; left: 16px; font-size: 13px;
}
.back-home a { color: rgba(255,255,255,0.7); text-decoration: none; }
.back-home a:hover { color: #fff; }

/* ── Tab Navigation ──────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  flex: 1;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  user-select: none;
}
.tab:hover { color: var(--tab-hover); }
.tab.active { color: var(--tab-active); border-bottom-color: var(--tab-active-border); }

/* ── Content Sections ────────────────────────────────────────── */
.section { display: none; padding: 16px; }
.section.active { display: block; }

/* ── Article Body ────────────────────────────────────────────── */
.article-section {
  background: var(--surface);
  padding: 20px 16px;
  border-radius: 0 0 8px 8px;
}
.article-section section { margin-bottom: 16px; }
.article-section p {
  margin-bottom: 12px;
  text-align: justify;
  font-size: 15px;
  line-height: 1.8;
}
.article-section img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  border-radius: 4px;
}

/* ── Video Grid ──────────────────────────────────────────────── */
.video-grid { display: grid; gap: 16px; }
.video-card {
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.video-card video { width: 100%; display: block; background: #000; }
.video-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.video-card-desc {
  padding: 0 14px 12px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-footer);
}
.footer a { color: var(--primary); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Summary Section ─────────────────────────────────────────────────── */
.summary-block {
  background: var(--surface);
  padding: 20px;
  font-size: 15px;
  line-height: 1.7;
}
.summary-intro {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.summary-list {
  list-style: none;
  padding-left: 0;
}
.summary-list li {
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
}
.summary-list li::before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--primary);
}

/* ── 相关阅读 cross-links ── */
.related {
  max-width: 700px;
  margin: 0 auto 30px;
  padding: 14px 18px;
  background: var(--surface, #f7f5f0);
  border: 1px solid var(--border, #e0dcd2);
  border-radius: 8px;
}
.related-title {
  font-size: 14px;
  color: var(--primary, #4a7c59);
  margin-bottom: 8px;
}
.related-link {
  display: block;
  color: var(--text, #333);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
}
.related-link:hover { color: var(--primary, #4a7c59); }
