/* ====================================================================
   原力创业 · 四大通关 · Design System
   东方奢侈品级美学 — 墨色为底，鎏金为脉，四色为关
   ==================================================================== */

:root {
  /* ——— Ink palette (bg, surfaces) ——— */
  --ink-void: #08070a;
  --ink-paper: #0d0c10;
  --ink-surface: #15131a;
  --ink-elevated: #1c1922;
  --ink-deeper: #100e14;
  --ink-border: #2a2532;
  --ink-line: #1f1c26;
  --ink-hairline: rgba(201, 169, 97, 0.12);

  /* ——— Gold palette ——— */
  --gold: #c9a961;
  --gold-bright: #e8c77a;
  --gold-muted: #8a7546;
  --gold-deep: #4a3f26;
  --gold-faint: rgba(201, 169, 97, 0.08);
  --gold-glow: rgba(232, 199, 122, 0.35);

  /* ——— Four-gate elemental colors ——— */
  --cinnabar: #d04943;        /* 关一·觉醒 — 朱砂 */
  --cinnabar-dim: #7a2c2a;
  --cinnabar-glow: rgba(208, 73, 67, 0.18);

  --azurite: #4d83c1;         /* 关二·独创 — 石青 */
  --azurite-dim: #2c4d72;
  --azurite-glow: rgba(77, 131, 193, 0.18);

  --malachite: #6ea679;       /* 关三·升维 — 松石 */
  --malachite-dim: #3d6044;
  --malachite-glow: rgba(110, 166, 121, 0.18);

  --obsidian: #b08c4f;        /* 关四·锁定 — 玄金 */
  --obsidian-dim: #5e4926;
  --obsidian-glow: rgba(176, 140, 79, 0.22);

  /* ——— Text ——— */
  --text-primary: #ede4cf;
  --text-body: #c5bca5;
  --text-mute: #8a8170;
  --text-soft: #5f5849;
  --text-dim: #45403a;

  /* ——— Typography ——— */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STZhongsong", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", -apple-system, sans-serif;
  --font-en-serif: "Cormorant Garamond", "Cormorant", "EB Garamond", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Roboto Mono", ui-monospace, monospace;

  /* ——— Rhythm ——— */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --shadow-deep: 0 24px 64px -16px rgba(0, 0, 0, 0.6), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 0 rgba(201, 169, 97, 0.04) inset, 0 16px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-glow-gold: 0 0 28px -6px rgba(232, 199, 122, 0.35);

  --max-w: 1320px;
  --content-w: 1080px;
}

/* ====================================================================
   Reset
   ==================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink-paper);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
  /* paper-grain noise */
  background-image:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(201, 169, 97, 0.08), transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(208, 73, 67, 0.04), transparent 60%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.78 0 0 0 0 0.66 0 0 0 0 0.38 0 0 0 0.025 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
  opacity: 0.5;
}

::selection { background: var(--gold); color: var(--ink-void); }

/* ====================================================================
   Typography utilities
   ==================================================================== */
.t-display {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text-primary);
}
.t-serif { font-family: var(--font-serif); font-weight: 500; letter-spacing: 0.02em; }
.t-en { font-family: var(--font-en-serif); font-style: italic; letter-spacing: 0.01em; }
.t-mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; letter-spacing: 0.02em; }
.t-label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--gold-muted);
}
.t-eyebrow {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.t-num {
  font-family: var(--font-en-serif);
  font-weight: 500;
  font-style: italic;
  font-feature-settings: "tnum" 1;
}

/* ====================================================================
   Decorative atoms
   ==================================================================== */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  opacity: 0.4;
}
.hairline-v {
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 25%, var(--gold) 75%, transparent);
  opacity: 0.3;
}
.gold-rule {
  display: flex; align-items: center; gap: 12px;
  color: var(--gold);
}
.gold-rule::before, .gold-rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: 0.4;
}

.diamond {
  width: 6px; height: 6px;
  background: var(--gold); transform: rotate(45deg);
  box-shadow: 0 0 12px var(--gold-glow);
  display: inline-block;
}

.corner-brackets {
  position: relative;
}
.corner-brackets::before,
.corner-brackets::after {
  content: ""; position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--gold);
  opacity: 0.6;
}
.corner-brackets::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.corner-brackets::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ====================================================================
   Layout primitives
   ==================================================================== */
.page-shell {
  position: relative;
  z-index: 2;
}
.section {
  padding: 120px 48px;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.section-tight { padding: 80px 48px; }
.content { max-width: var(--content-w); margin: 0 auto; }
.narrow { max-width: 780px; margin: 0 auto; }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--ink-surface), var(--ink-deeper));
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-md);
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.card-tight { padding: 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.18em;
  font-weight: 500;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  opacity: 0; transition: opacity 240ms ease;
  z-index: 0;
}
.btn > * { position: relative; z-index: 1; }
.btn:hover { color: var(--ink-void); box-shadow: var(--shadow-glow-gold); }
.btn:hover::before { opacity: 1; }
.btn-ghost {
  border-color: var(--ink-border);
  color: var(--text-body);
}
.btn-ghost:hover { color: var(--gold-bright); border-color: var(--gold-muted); box-shadow: none; }
.btn-ghost:hover::before { opacity: 0; }

/* ====================================================================
   Sidebar nav (left ribbon)
   ==================================================================== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 88px;
  background: linear-gradient(180deg, rgba(13, 12, 16, 0.95), rgba(8, 7, 10, 0.92));
  border-right: 1px solid var(--ink-border);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 28px 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.sidebar-mark {
  width: 44px; height: 44px;
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--gold-bright);
  font-size: 20px;
  position: relative;
}
.sidebar-mark::before {
  content: ""; position: absolute; inset: -4px;
  border: 1px solid var(--gold-deep);
}
.sidebar-rail {
  flex: 1; width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-deep) 10%, var(--gold-deep) 90%, transparent);
  margin: 28px 0;
}
.sidebar-nav {
  display: flex; flex-direction: column; gap: 14px;
  width: 100%; align-items: center;
}
.sidebar-link {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--text-soft);
  padding: 14px 0;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color 240ms ease, border-color 240ms ease;
  user-select: none;
}
.sidebar-link.active {
  color: var(--gold-bright);
  border-left-color: var(--gold);
}
.sidebar-link:hover { color: var(--gold); }

/* ====================================================================
   Hero
   ==================================================================== */
.hero {
  min-height: 100vh;
  padding: 80px 80px 60px 168px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero-meta {
  position: absolute;
  top: 40px; right: 80px;
  display: flex; gap: 32px;
  align-items: center;
}
.hero-version {
  font-family: var(--font-en-serif);
  font-style: italic;
  color: var(--gold-muted);
  font-size: 14px;
}
.hero-mark {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  border: 1px solid var(--ink-border);
  background: rgba(21, 19, 26, 0.5);
}

.hero-eyebrow {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 32px;
}
.hero-eyebrow .diamond { box-shadow: 0 0 16px var(--gold-glow); }

.hero-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
  position: relative;
}
.hero-title .accent { color: var(--gold); }
.hero-title .stroke {
  -webkit-text-stroke: 1px var(--gold-muted);
  color: transparent;
  font-style: italic;
  font-family: var(--font-en-serif);
  font-weight: 500;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.3em;
  color: var(--gold-bright);
  margin: 36px 0 24px;
  font-weight: 500;
}

.hero-quote {
  max-width: 620px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-body);
  line-height: 1.7;
  margin: 40px 0 64px;
  padding-left: 24px;
  border-left: 1px solid var(--gold-muted);
}
.hero-quote em {
  color: var(--gold-bright);
  font-style: normal;
  font-weight: 500;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 64px;
  border-top: 1px solid var(--ink-border);
  border-bottom: 1px solid var(--ink-border);
}
.hero-grid-cell {
  padding: 28px 22px;
  border-right: 1px solid var(--ink-line);
  position: relative;
}
.hero-grid-cell:last-child { border-right: none; }
.hero-grid-num {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: 36px;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}
.hero-grid-label {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 6px;
}
.hero-grid-sub {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}

/* hero background ornament — large rotating sigil */
.hero-sigil {
  position: absolute;
  right: -120px; top: 50%;
  transform: translateY(-50%);
  width: 720px; height: 720px;
  opacity: 0.18;
  pointer-events: none;
  animation: sigil-rotate 240s linear infinite;
}
@keyframes sigil-rotate { to { transform: translateY(-50%) rotate(360deg); } }

/* ====================================================================
   Section header
   ==================================================================== */
.section-header {
  margin-bottom: 72px;
}
.section-header .t-eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.015em;
}
.section-header h2 em {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  font-size: 0.85em;
}
.section-header .dek {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--text-body);
  max-width: 720px;
  line-height: 1.6;
}

/* ====================================================================
   Gate marker (chapter)
   ==================================================================== */
.gate-marker {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 40px 0;
  border-top: 1px solid var(--ink-border);
  border-bottom: 1px solid var(--ink-border);
  margin-bottom: 72px;
}
.gate-marker-numeral {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: 96px;
  line-height: 0.9;
  color: var(--gate-color, var(--gold));
  font-weight: 500;
}
.gate-marker-title {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}
.gate-marker-cn {
  display: block;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--gate-color, var(--gold));
  font-weight: 400;
  margin-bottom: 10px;
}
.gate-marker-claim {
  color: var(--text-body);
  font-size: 16px;
  margin-top: 12px;
  font-family: var(--font-serif);
  max-width: 560px;
}
.gate-marker-meta {
  text-align: right;
  font-family: var(--font-en-serif);
  font-style: italic;
  color: var(--gate-color, var(--gold));
}
.gate-marker-meta .big {
  font-size: 48px;
  line-height: 1;
  display: block;
}
.gate-marker-meta .small {
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.15em;
  font-style: normal;
  font-family: var(--font-sans);
  margin-top: 6px;
}

/* gate-specific tinting */
.gate-1 { --gate-color: var(--cinnabar); --gate-glow: var(--cinnabar-glow); --gate-dim: var(--cinnabar-dim); }
.gate-2 { --gate-color: var(--azurite); --gate-glow: var(--azurite-glow); --gate-dim: var(--azurite-dim); }
.gate-3 { --gate-color: var(--malachite); --gate-glow: var(--malachite-glow); --gate-dim: var(--malachite-dim); }
.gate-4 { --gate-color: var(--obsidian); --gate-glow: var(--obsidian-glow); --gate-dim: var(--obsidian-dim); }

/* ====================================================================
   Grid systems
   ==================================================================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

/* ====================================================================
   Pill, chip, badge
   ==================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--ink-border);
  background: var(--ink-deeper);
  color: var(--text-body);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  border-radius: 999px;
}
.chip-gold { border-color: var(--gold-muted); color: var(--gold-bright); }
.chip-gate { border-color: var(--gate-color); color: var(--gate-color); }

/* ====================================================================
   Checkbox / checkpoint
   ==================================================================== */
.cp {
  display: flex; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--ink-border);
  background: var(--ink-deeper);
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
}
.cp:hover {
  border-color: var(--gold-muted);
  background: var(--ink-surface);
}
.cp.done {
  border-color: var(--gate-color, var(--gold));
  background: linear-gradient(135deg, var(--ink-surface), color-mix(in srgb, var(--gate-color, var(--gold)) 8%, transparent));
}
.cp-box {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 1px solid var(--text-soft);
  position: relative;
  margin-top: 2px;
}
.cp.done .cp-box {
  border-color: var(--gate-color, var(--gold));
  background: var(--gate-color, var(--gold));
}
.cp.done .cp-box::after {
  content: "✓"; position: absolute;
  inset: 0; display: grid; place-items: center;
  color: var(--ink-void);
  font-weight: 700;
  font-size: 13px;
}
.cp-label {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
}
.cp-hint {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  font-family: var(--font-sans);
}

/* ====================================================================
   Tabular data table
   ==================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 14px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-line);
  vertical-align: top;
}
.data-table thead th {
  font-family: var(--font-serif);
  color: var(--gold);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom-color: var(--gold-muted);
}
.data-table tbody tr:hover { background: rgba(201, 169, 97, 0.03); }
.data-table .col-num {
  font-family: var(--font-en-serif);
  font-style: italic;
  color: var(--gate-color, var(--gold));
  font-size: 18px;
  width: 40px;
}

/* ====================================================================
   Quote callout
   ==================================================================== */
.quote {
  padding: 32px 36px;
  border-left: 2px solid var(--gate-color, var(--gold));
  background: linear-gradient(90deg, color-mix(in srgb, var(--gate-color, var(--gold)) 5%, transparent), transparent);
  position: relative;
}
.quote::before {
  content: "「"; position: absolute;
  top: -12px; left: 16px;
  font-family: var(--font-serif);
  font-size: 64px;
  color: var(--gate-color, var(--gold));
  opacity: 0.4;
  line-height: 1;
}
.quote-body {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-primary);
  font-weight: 500;
}
.quote-body em {
  color: var(--gate-color, var(--gold));
  font-style: normal;
}
.quote-attr {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-family: var(--font-sans);
}

/* ====================================================================
   Progress dashboard pill
   ==================================================================== */
.progress-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(180deg, var(--ink-surface), var(--ink-deeper));
  border: 1px solid var(--gold-muted);
  padding: 14px 22px;
  display: flex; align-items: center; gap: 18px;
  z-index: 60;
  box-shadow: var(--shadow-deep);
  font-family: var(--font-serif);
  cursor: pointer;
  transition: all 240ms ease;
}
.progress-pill:hover { border-color: var(--gold); box-shadow: var(--shadow-deep), 0 0 32px -8px var(--gold-glow); }
.progress-pill-num {
  font-family: var(--font-en-serif);
  font-style: italic;
  font-size: 28px;
  color: var(--gold-bright);
  line-height: 1;
}
.progress-pill-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-family: var(--font-sans);
}
.progress-pill-dots {
  display: flex; gap: 4px;
}
.progress-pill-dot {
  width: 6px; height: 6px;
  border: 1px solid var(--text-soft);
  transform: rotate(45deg);
}
.progress-pill-dot.lit {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 6px var(--gold-glow);
}

/* ====================================================================
   Misc utilities
   ==================================================================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-10 { gap: 40px; } .gap-12 { gap: 48px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; } .mt-12 { margin-top: 48px; } .mt-16 { margin-top: 64px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; } .mb-12 { margin-bottom: 48px; } .mb-16 { margin-bottom: 64px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
