/* ===== DataVis Portfolio - 暖色纸张杂志风 ===== */
:root {
  --paper: #f5f0e6;
  --paper-2: #fffdf8;
  --ink: #24332e;
  --ink-soft: #53615b;
  --ink-dim: #7b847e;
  --line: rgba(36, 51, 46, 0.14);
  --terracotta: #c76b4b;
  --gold: #d8a340;
  --forest: #2f6b5f;
  --plum: #7c5a7a;
  --blue: #4e7f8c;
  --sage: #8aa37c;
  --rose: #b85c6a;
  --shadow: 0 14px 30px rgba(54, 44, 30, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(199, 107, 75, 0.10), transparent 62%),
    radial-gradient(800px 420px at 5% 105%, rgba(47, 107, 95, 0.10), transparent 60%),
    repeating-linear-gradient(0deg, rgba(36, 51, 46, 0.018) 0 1px, transparent 1px 5px),
    var(--paper);
}

a { color: inherit; text-decoration: none; }

/* ===== 顶部导航 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 15px 40px;
  background: rgba(250, 247, 239, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fffdf8;
  display: grid;
  place-items: center;
  font-family: Georgia, "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 6px 14px rgba(199, 107, 75, 0.28);
}
.brand .name {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
}
.brand .sub { font-size: 9px; color: var(--ink-dim); letter-spacing: 3px; }
.nav-links { display: flex; gap: 28px; font-size: 13px; color: var(--ink-soft); }
.nav-links a { position: relative; padding: 4px 0; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav .badge {
  margin-left: auto;
  font-size: 12px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ===== Hero ===== */
.hero { max-width: 1180px; margin: 0 auto; padding: 68px 40px 26px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 18px; }
.hero h1 {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
}
.hero h1::before {
  content: "CHAPTER ARCHIVE · 2026";
  display: block;
  font-family: "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--terracotta);
  margin-bottom: 14px;
  font-weight: 700;
}
.hero .desc { margin-top: 16px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.hero .status-pill {
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(47, 107, 95, 0.08);
  border: 1px solid rgba(47, 107, 95, 0.28);
  color: var(--forest);
  white-space: nowrap;
}

/* ===== 章节网格 ===== */
.chapters {
  max-width: 1180px;
  margin: 0 auto 64px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 22px;
}
.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--terracotta);
  border-radius: 10px;
  padding: 24px;
  min-height: 300px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--card-top, var(--terracotta)), transparent);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 38px rgba(54, 44, 30, 0.14);
  border-color: rgba(199, 107, 75, 0.32);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.card .num {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  background: var(--num-color, linear-gradient(135deg, var(--terracotta), var(--gold)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card .icon { font-size: 24px; opacity: 0.8; }
.card .chapter-tag {
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--terracotta);
  font-weight: 700;
}
.card h2 {
  margin-top: 9px;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  line-height: 1.45;
}
.card p { margin-top: 11px; font-size: 13px; line-height: 1.85; color: var(--ink-soft); }
.tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(36, 51, 46, 0.2);
  background: rgba(245, 240, 230, 0.55);
  color: var(--ink-soft);
}
.card-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  border-top: 1px dashed var(--line);
}
.card-foot .state { color: var(--ink-dim); }
.card-foot .state.ok { color: var(--forest); }
.card-foot .state.ok::before { content: "● "; color: var(--sage); }
.card-foot .view { color: var(--terracotta); font-weight: 700; }
.card-foot .view:hover { text-decoration: underline; }

/* ===== 链接说明 ===== */
.links-note { max-width: 1180px; margin: 0 auto 64px; padding: 0 40px; }
.links-note .panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: 10px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 2;
  color: var(--ink-soft);
}
.links-note h3 {
  color: var(--ink);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 18px;
  margin-bottom: 10px;
}
.links-note code {
  background: rgba(199, 107, 75, 0.10);
  color: var(--terracotta);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
}

footer {
  text-align: center;
  padding: 26px 20px;
  font-size: 12px;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.55);
}

/* ===== 章节子页面 ===== */
.chapter-page { max-width: 900px; margin: 0 auto; padding: 54px 32px 20px; }
.chapter-page .back {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--forest);
  font-size: 13px;
  box-shadow: 0 5px 14px rgba(54, 44, 30, 0.06);
}
.chapter-page .back:hover { border-color: var(--forest); }
.chapter-page .num {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 72px;
  line-height: 1;
  font-weight: 700;
  margin-top: 28px;
  background: var(--num-color, linear-gradient(135deg, var(--terracotta), var(--gold)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chapter-page .chapter-tag {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--terracotta);
  font-weight: 700;
}
.chapter-page h1 {
  margin-top: 10px;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 36px;
  line-height: 1.3;
}
.chapter-page .desc { margin-top: 16px; line-height: 2; color: var(--ink-soft); font-size: 14px; }

/* ===== 章节内容区 ===== */
.content { max-width: 900px; margin: 0 auto; padding: 0 32px 30px; }
.kp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.kp-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--terracotta);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(54, 44, 30, 0.06);
}
.kp-card h3 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 15px;
  color: var(--forest);
  margin-bottom: 8px;
}
.kp-card p { font-size: 12px; line-height: 1.9; color: var(--ink-soft); }
.code-title {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--terracotta);
  font-weight: 700;
}
.code-box {
  background: #1f2c28;
  border: 1px solid #1f2c28;
  border-radius: 10px;
  padding: 20px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.8;
  color: #f2e9d8;
  overflow-x: auto;
  white-space: pre;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
  margin-top: 34px;
}
.demo {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--sage);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(54, 44, 30, 0.06);
}
.demo h4 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 14px;
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--terracotta);
}
.demo .chart { width: 100%; height: 300px; }
.pager {
  display: flex;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 60px;
  gap: 12px;
}
.pager a {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 13px;
  color: var(--ink-soft);
  box-shadow: 0 5px 14px rgba(54, 44, 30, 0.05);
}
.pager a:hover { color: var(--terracotta); border-color: var(--terracotta); }

@media (max-width: 640px) {
  .nav { padding: 12px 16px; gap: 14px; }
  .nav-links { display: none; }
  .nav .badge { font-size: 11px; padding: 6px 10px; }
  .hero, .chapters, .links-note { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 44px; }
  .hero h1 { font-size: 30px; }
  .chapters { grid-template-columns: 1fr; }
  .chapter-page { padding: 36px 16px 16px; }
  .content { padding: 0 16px 24px; }
  .pager { padding: 0 16px 44px; flex-direction: column; }
  .demo-grid { grid-template-columns: 1fr; }
}
