/* ===== Silicon Fire Era — shared stylesheet ===== */

:root {
  --bg: #07080d;
  --bg-deep: #030408;
  --ink: #dcd9d0;
  --ink-dim: #8d8a83;
  --ink-faint: #5a5850;
  --accent: #d4a257;
  --accent-glow: #f0c483;
  --hair: #1e2030;
  --panel: rgba(18, 20, 32, 0.7);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Cosmic background (fixed, same for all pages) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(212,162,87,0.10), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(80,110,200,0.10), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(120,60,180,0.05), transparent 60%),
    linear-gradient(180deg, #04050a 0%, #07080d 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 50% 40%, #fff, transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 85% 15%, #fff, transparent),
    radial-gradient(1px 1px at 90% 55%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 60% 30%, rgba(212,162,87,0.6), transparent),
    radial-gradient(2px 2px at 25% 45%, rgba(180,200,255,0.4), transparent);
  background-size: 200% 200%;
  opacity: 0.5;
  animation: drift 240s linear infinite;
}
@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 200% 200%; }
}

a { color: inherit; }

/* Progress bar */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  z-index: 100;
  transition: width .12s ease-out;
}

/* Topbar (all chapter pages) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  backdrop-filter: blur(14px);
  background: rgba(7, 8, 13, 0.65);
  border-bottom: 1px solid var(--hair);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 13px;
}
.topbar a.home-link {
  color: var(--ink-dim);
  text-decoration: none;
  letter-spacing: 0.15em;
  transition: color .2s;
}
.topbar a.home-link:hover { color: var(--accent-glow); }
.topbar .book-chapter-label {
  color: var(--ink-faint);
  letter-spacing: 0.2em;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Cascadia Mono", monospace;
  font-size: 11px;
}

/* Chapter page layout */
main.chapter {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 40px 60px;
  animation: fadeIn .7s ease-out both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.chapter-year {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Cascadia Mono", monospace;
  font-size: clamp(84px, 14vw, 140px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  opacity: 0.55;
  margin-bottom: -6px;
  user-select: none;
}
.chapter-meta {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin: 20px 0 10px;
}
.chapter-subtitle {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-size: 15px;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
  margin: 0 0 14px;
  font-weight: 400;
}
.chapter-title {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-weight: 700;
  font-size: clamp(32px, 5vw, 48px);
  color: var(--accent-glow);
  line-height: 1.25;
  margin: 0 0 50px;
  letter-spacing: 0.02em;
}

/* Chapter body typography */
.chapter-body p {
  margin: 0 0 1.4em;
  color: var(--ink);
}
.chapter-body p:first-of-type::first-letter {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-weight: 700;
  float: left;
  font-size: 3.4em;
  line-height: 0.9;
  margin: 0.08em 0.1em 0 -0.05em;
  color: var(--accent-glow);
}
.chapter-body strong {
  color: var(--accent-glow);
  font-weight: 700;
}
.chapter-body em {
  color: var(--ink-dim);
  font-style: italic;
}
.chapter-body ul, .chapter-body ol {
  padding-left: 1.3em;
  margin: 0 0 1.4em;
}
.chapter-body li { margin-bottom: 0.6em; }
.chapter-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 22px;
  margin: 1.6em 0;
  color: var(--ink-dim);
  font-style: italic;
}
.chapter-body hr {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 2.4em 0;
}
.chapter-body h2, .chapter-body h3 {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  color: var(--accent-glow);
  font-weight: 700;
  margin: 2em 0 0.6em;
  letter-spacing: 0.02em;
}
.chapter-body h2 { font-size: 22px; }
.chapter-body h3 { font-size: 18px; }

/* Chapter-to-chapter navigation */
.chapter-nav {
  max-width: 720px;
  margin: 60px auto 100px;
  padding: 40px 40px 0;
  border-top: 1px solid var(--hair);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: stretch;
}
.chapter-nav a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--hair);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink-dim);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  transition: all .2s;
  min-height: 80px;
}
.chapter-nav a:hover:not(.disabled) {
  border-color: var(--accent);
  color: var(--accent-glow);
  transform: translateY(-2px);
}
.chapter-nav a.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.chapter-nav a .nav-label {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 6px;
}
.chapter-nav a .nav-title {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.chapter-nav a .nav-year {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Cascadia Mono", monospace;
  font-size: 11px;
  color: var(--accent);
  margin-right: 8px;
}
.chapter-nav a.next { text-align: right; }
.chapter-nav a.toc-link {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 12px;
  min-width: 44px;
  font-size: 11px;
  letter-spacing: 0.4em;
}

/* ===== INDEX page ===== */
.cover {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 80px 40px 60px;
  max-width: 900px;
  margin: 0 auto;
}
.cover .eyebrow {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 11px;
  letter-spacing: 0.6em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 30px;
}
.cover h1 {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-weight: 900;
  font-size: clamp(54px, 9vw, 108px);
  line-height: 1.05;
  margin: 0 0 28px;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #f5efe0 0%, #d4a257 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cover .subtitle {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-size: 20px;
  color: var(--ink-dim);
  font-weight: 400;
  margin-bottom: 56px;
}
.cover .range {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  color: var(--ink-dim);
  letter-spacing: 0.25em;
  padding: 10px 22px;
  border: 1px solid var(--hair);
  border-radius: 2px;
}
.cover .preface {
  max-width: 600px;
  margin: 56px auto 0;
  font-size: 15.5px;
  color: var(--ink-dim);
  line-height: 2;
  text-align: left;
  padding: 30px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.cover .cta {
  margin-top: 50px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.cover .cta a {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid var(--accent);
  color: var(--accent-glow);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 13px;
  letter-spacing: 0.25em;
  border-radius: 2px;
  transition: all .2s;
}
.cover .cta a:hover {
  background: var(--accent);
  color: var(--bg-deep);
}
.cover .cta a.secondary {
  border-color: var(--hair);
  color: var(--ink-dim);
}
.cover .cta a.secondary:hover {
  border-color: var(--ink-dim);
  background: transparent;
  color: var(--ink);
}

/* Volume banner */
.volume-banner {
  max-width: 900px;
  margin: 100px auto 50px;
  padding: 0 40px;
  text-align: center;
}
.volume-banner .line {
  display: inline-block;
  width: 60px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  opacity: 0.5;
}
.volume-banner .label {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 11px;
  letter-spacing: 0.5em;
  color: var(--accent);
  text-transform: uppercase;
  padding: 0 24px;
  vertical-align: middle;
}
.volume-banner h2 {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--ink);
  margin: 24px 0 8px;
  letter-spacing: 0.08em;
}
.volume-banner .caption {
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: 0.25em;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Cascadia Mono", monospace;
}

/* Chapter grid */
.chapters-grid {
  max-width: 900px;
  margin: 30px auto 0;
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.chapters-grid a.chapter-card {
  display: block;
  padding: 20px 22px;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 4px;
  transition: all .2s;
  color: var(--ink);
  min-height: 108px;
}
.chapters-grid a.chapter-card:hover {
  border-color: var(--accent);
  background: rgba(30, 32, 48, 0.8);
  transform: translateY(-2px);
}
.chapter-card .year {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Cascadia Mono", monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.chapter-card .num {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.chapter-card .title {
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 4px;
}
.chapter-card .sub {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Colophon */
.colophon {
  max-width: 720px;
  margin: 100px auto 60px;
  padding: 40px 40px 0;
  border-top: 1px solid var(--hair);
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 2;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  letter-spacing: 0.08em;
}
.colophon .dedication {
  color: var(--ink-dim);
  font-size: 14px;
  margin-bottom: 20px;
  font-style: italic;
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  letter-spacing: 0.02em;
  line-height: 1.9;
}

/* Mobile */
@media (max-width: 680px) {
  body { font-size: 16px; line-height: 1.85; }
  main.chapter { padding: 60px 22px 40px; }
  .topbar { padding: 14px 18px; }
  .chapter-nav {
    grid-template-columns: 1fr 1fr;
    padding: 30px 22px 0;
    gap: 10px;
  }
  .chapter-nav a.toc-link {
    grid-column: span 2;
    writing-mode: horizontal-tb;
    min-width: 0;
    padding: 12px 20px;
  }
  .cover { padding: 60px 22px 40px; }
  .chapters-grid {
    padding: 0 22px;
    grid-template-columns: 1fr;
  }
  .volume-banner { padding: 0 22px; }
  .colophon { padding: 30px 22px 0; }
}
