/* 语料星座图谱 · seed ad6c4c93 — 深墨星野 + 琥珀金 + 米纸索引卡 */

:root {
  --ink-0: #050d1c;
  --ink-1: #0a1424;
  --ink-2: #101d33;
  --line-ink: rgba(233, 200, 138, 0.16);
  --line-ink-soft: rgba(233, 200, 138, 0.09);
  --amber: #d09b43;
  --amber-bright: #e8b96a;
  --amber-soft: rgba(208, 155, 67, 0.16);
  --cream: #eddfc5;
  --cream-2: #f3e9d6;
  --ink-on-cream: #071322;
  --ink-on-cream-2: #3d4a5c;
  --text-1: #eddfc5;
  --text-2: #cbb391;
  --ok: #7fae6e;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --serif-latin: "Spectral", "Noto Serif SC", serif;
  --sans: "Noto Sans SC", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text-1);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--amber); color: var(--ink-0); }

a { color: inherit; }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--amber-bright);
  background: var(--amber-soft);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line-ink-soft);
  background: var(--ink-0);
  position: sticky;
  top: 0;
  z-index: 20;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.mark {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.4;
}
.mark circle { fill: var(--amber); stroke: none; }

.topnav { display: flex; gap: 26px; }
.topnav a {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.topnav a:hover { color: var(--amber-bright); }
.topnav a.gh {
  color: var(--amber-bright);
  border: 1px solid var(--line-ink);
  padding: 4px 14px;
  border-radius: 999px;
}
.topnav a.gh:hover { background: var(--amber-soft); }

/* ---------- hero split ---------- */

.hero {
  display: grid;
  grid-template-columns: 58fr 42fr;
  min-height: 560px;
  height: calc(100vh - 331px);
  max-height: 800px;
  border-bottom: 1px solid var(--line-ink);
  padding: 0;
}

.sky {
  position: relative;
  background: radial-gradient(120% 90% at 68% 30%, var(--ink-2) 0%, var(--ink-1) 48%, var(--ink-0) 100%);
  overflow: hidden;
}

#constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#constellation .drift { animation: drift 90s linear infinite alternate; }
@keyframes drift {
  from { transform: translate(-4px, 2px); }
  to { transform: translate(5px, -4px); }
}

#constellation .node { animation: nodeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes nodeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.sky-head {
  position: absolute;
  top: 26px;
  left: 30px;
  z-index: 5;
  max-width: 420px;
}

.sky-sub {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.sky-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(5, 13, 28, 0.72);
  border: 1px solid var(--line-ink);
  border-radius: 8px;
  padding: 11px 16px;
  backdrop-filter: blur(6px);
}
.sky-search:focus-within { border-color: var(--amber); }
.sky-search svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.6;
  flex: none;
}
.sky-search input {
  width: 100%;
  background: none;
  border: 0;
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 14px;
  caret-color: var(--amber);
}
.sky-search input::placeholder { color: rgba(203, 179, 145, 0.55); }
.sky-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.sky-hint {
  margin: 12px 2px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.03em;
}

.sky-legend {
  position: absolute;
  right: 26px;
  bottom: 20px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.sky-legend .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 12px;
}
.d-domain { background: var(--amber); }
.d-cmd { background: var(--amber-bright); box-shadow: 0 0 6px rgba(232, 185, 106, 0.8); }
.d-bp { background: none; border: 1px dashed var(--amber); }

/* ---------- folio card ---------- */

.folio {
  background:
    radial-gradient(140% 100% at 100% 0%, var(--cream-2) 0%, var(--cream) 60%, #e6d5b8 100%);
  color: var(--ink-on-cream);
  padding: 34px 40px 28px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-ink);
  position: relative;
}

.folio::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: rgba(7, 19, 34, 0.14);
}
.folio::after {
  content: "";
  position: absolute;
  top: 34px;
  bottom: 34px;
  left: 9px;
  width: 11px;
  border: 1px solid rgba(7, 19, 34, 0.2);
  border-radius: 6px;
  background: var(--ink-0);
  opacity: 0.85;
}

.folio-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(7, 19, 34, 0.28);
}

.folio-no {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-on-cream-2);
  letter-spacing: 0.14em;
}

.folio-title {
  margin: 0;
  margin-left: auto;
  font-family: var(--serif-latin);
  font-weight: 600;
  font-size: clamp(28px, 2.6vw, 40px);
  letter-spacing: 0.01em;
}

.folio-row {
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(7, 19, 34, 0.12);
  flex: 1;
  align-items: center;
}

.folio-row h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.folio-row p { margin: 0; font-size: 14.5px; color: var(--ink-on-cream-2); }

.stamp {
  flex: none;
  width: 52px;
  height: 52px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
  color: #a2591f;
  margin-top: 2px;
}
.stamp svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.stamp-s2 { color: #8a6d1f; transform: rotate(6deg); }
.stamp-s3 { color: #96402c; transform: rotate(-5deg); }

.lvl {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 7px;
  border: 1px solid currentColor;
  border-radius: 3px;
  letter-spacing: 0.08em;
}
.lvl-mid { color: #a2681c; }

.folio-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-on-cream-2);
}
.folio-foot a {
  color: #8a5a16;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(138, 90, 22, 0.4);
}
.folio-foot a:hover { text-decoration-color: currentColor; }

.folio-note {
  margin: auto 0 0;
  padding-top: 18px;
  font-size: 12.5px;
  color: rgba(61, 74, 92, 0.75);
}

.folio-open {
  text-align: center;
  padding-bottom: 14px;
}
.folio-lede {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(19px, 1.5vw, 25px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-on-cream);
}
.folio-rule { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.folio-rule::before, .folio-rule::after { content: ""; flex: 1; height: 1px; background: rgba(7, 19, 34, 0.3); }
.folio-rule svg { width: 9px; height: 9px; fill: #a2591f; flex: none; }
.folio-clip {
  position: absolute;
  top: 14px;
  right: 26px;
  width: 17px;
  height: 30px;
  fill: none;
  stroke: #96402c;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.85;
  transform: rotate(24deg);
}

/* ---------- pipeline band ---------- */

.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vw, 56px);
  padding: 34px 28px 30px;
  background: var(--ink-0);
  border-bottom: 1px solid var(--line-ink);
  position: relative;
}

.pipe-step {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pipe-step svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.3;
}
.pipe-step b {
  font-family: var(--serif-latin);
  font-weight: 600;
  font-size: 20px;
  display: block;
  line-height: 1.2;
}
.pipe-step span {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.06em;
}
.pipe-step b + span { margin-top: 2px; }
.pipe-step svg + div b, .pipe-step svg + div span { display: block; }

.pipe-arrow {
  width: 36px;
  height: 12px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
  opacity: 0.8;
}

.pipe-note {
  position: absolute;
  right: 30px;
  bottom: 8px;
  margin: 0;
  font-size: 12px;
  color: rgba(203, 179, 145, 0.55);
  letter-spacing: 0.04em;
}

/* ---------- stats + actions strip ---------- */

.footbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 40px 40px 44px;
  background: var(--ink-0);
  border-bottom: 1px solid var(--line-ink);
}

.stats { display: flex; }
.stat { padding-right: clamp(30px, 4.5vw, 72px); }
.stat + .stat { border-left: 1px solid var(--line-ink); padding-left: clamp(30px, 4.5vw, 72px); }
.stat b {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(38px, 4vw, 56px);
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
  letter-spacing: 0.14em;
}

.actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 28px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s, box-shadow 0.25s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn-primary {
  background: var(--amber);
  color: var(--ink-0);
  font-weight: 500;
  box-shadow: 0 6px 24px -8px rgba(208, 155, 67, 0.55);
}
.btn-primary:hover { background: var(--amber-bright); transform: translateY(-1px); }
.btn-primary svg { fill: currentColor; stroke: none; }
.btn-ghost {
  border: 1px solid var(--line-ink);
  color: var(--text-1);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-bright); }

/* ---------- shared sections ---------- */

section { padding: 72px 40px; }
section + section { border-top: 1px solid var(--line-ink-soft); }

.sec-head { max-width: 720px; margin-bottom: 44px; }
.sec-head h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: 0.04em;
}
.sec-head p { margin: 0; color: var(--text-2); font-size: 15.5px; }

/* ---------- domains index ---------- */

.dom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 48px;
}

.dom-cat h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.12em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-ink);
}
.dom-cat ul { list-style: none; margin: 0; padding: 0; }
.dom-cat li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4.5px 0;
  border-bottom: 1px solid rgba(233, 200, 138, 0.06);
}
.dom-cat a {
  text-decoration: none;
  font-size: 14.5px;
  color: var(--text-1);
}
.dom-cat a:hover { color: var(--amber-bright); }
.dom-cat .n {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.dom-cat .n b { color: var(--amber); font-weight: 500; }
.dom-cat .n i { font-style: normal; opacity: 0.75; }

/* ---------- terminal ---------- */

.term {
  max-width: 880px;
  background: var(--ink-1);
  border: 1px solid var(--line-ink);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.8);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-ink-soft);
}
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-ink); }
.term-bar b {
  margin-left: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.1em;
}

.term pre {
  margin: 0;
  padding: 22px 24px 26px;
  overflow-x: auto;
}
.term code {
  background: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-1);
  white-space: pre;
}
.term code a { color: var(--amber-bright); text-decoration: none; }
.term code a:hover { text-decoration: underline; text-underline-offset: 3px; }
.t-p { color: var(--amber); }
.t-c { color: var(--text-2); }
.t-k { color: var(--amber); }
.t-h { color: rgba(203, 179, 145, 0.5); user-select: none; }
.t-dim { color: rgba(203, 179, 145, 0.55); }
.t-mid { color: #e0a348; }
.t-low { color: var(--ok); }
.t-ok { color: var(--ok); }

.term-note {
  margin: 0;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--line-ink-soft);
  font-size: 12.5px;
  color: rgba(203, 179, 145, 0.6);
}

/* ---------- source ---------- */

.src-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 44px;
  align-items: start;
}

.yaml, .yaml pre { border-radius: 10px; }
.yaml {
  border: 1px solid var(--line-ink);
  background: var(--ink-1);
  overflow: hidden;
}
.code-bar {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.06em;
}
.yaml pre { margin: 0; padding: 20px 22px; overflow-x: auto; }
.yaml code {
  background: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-1);
  white-space: pre;
}
.y-k { color: var(--amber-bright); }
.y-s { color: #b9c7a6; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 52px;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  border: 1px solid var(--line-ink);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 42px;
  bottom: 6px;
  width: 1px;
  background: var(--line-ink-soft);
}
.steps b {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.steps span { display: block; font-size: 14px; color: var(--text-2); margin: 4px 0 8px; }
.steps code { display: inline-block; font-size: 12.5px; }

/* ---------- audiences ledger ---------- */

.ledger { margin: 0; border-top: 1px solid var(--line-ink); }
.ledger-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line-ink-soft);
}
.ledger-row dt {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--amber-bright);
}
.ledger-row dd { margin: 0; font-size: 14.5px; color: var(--text-2); }
.ledger-row a {
  font-size: 13.5px;
  color: var(--text-1);
  text-decoration: none;
  border: 1px solid var(--line-ink);
  border-radius: 999px;
  padding: 6px 16px;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.ledger-row a:hover { border-color: var(--amber); color: var(--amber-bright); }

/* ---------- footer ---------- */

.foot {
  padding: 30px 40px 38px;
  border-top: 1px solid var(--line-ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 13px;
}
.foot p { margin: 0; }
.foot a { color: var(--text-2); text-underline-offset: 3px; }
.foot a:hover { color: var(--amber-bright); }

/* ---------- constellation svg classes ---------- */

.node-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 1.5px;
  fill: var(--text-2);
}
.cat-label {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 3px;
  fill: var(--amber);
  font-weight: 600;
}
.cmd-label {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--amber-bright);
  letter-spacing: 0.5px;
}
.hub-ring { fill: var(--amber); }
.hub-label {
  font-family: var(--serif);
  font-size: 14px;
  fill: var(--amber-bright);
  letter-spacing: 3px;
  text-anchor: middle;
}
.cmd-box rect { fill: rgba(5, 13, 28, 0.92); stroke: var(--amber); stroke-width: 1; }
.cmd-box text { font-family: var(--mono); font-size: 12px; fill: var(--amber-bright); letter-spacing: 0.5px; }
.bp-box rect { fill: rgba(5, 13, 28, 0.88); stroke: var(--amber); stroke-width: 0.9; stroke-dasharray: 3 2.4; }
.bp-box text { font-family: var(--mono); font-size: 11px; fill: var(--amber); letter-spacing: 0.5px; }

.edge { stroke: var(--amber); stroke-width: 0.7; opacity: 0.14; }
.edge-x { stroke: var(--amber); stroke-width: 0.5; opacity: 0.06; }
.bg-star { fill: var(--amber); }

circle.dom { fill: var(--amber); opacity: 0.85; transition: opacity 0.4s, fill 0.4s; }
circle.cat { fill: var(--amber); }
circle.cmd { fill: var(--amber-bright); }

g.lit circle, g.lit text { fill: var(--amber-bright); }
g.lit text { filter: drop-shadow(0 0 4px rgba(232, 185, 106, 0.65)); }
g.lit rect { stroke: var(--amber-bright); fill: rgba(232, 185, 106, 0.14); filter: drop-shadow(0 0 7px rgba(232, 185, 106, 0.8)); }
g.lit .hub-ring { opacity: 0.32; }
g.lit circle.cmd, g.lit circle.dom { filter: drop-shadow(0 0 5px rgba(232, 185, 106, 0.9)); }
line.edge.lit { opacity: 0.85; stroke-width: 1.1; }
#constellation.searching g:not(.lit):not(.search-hit):not(.drift) { opacity: 0.16; transition: opacity 0.45s; }
#constellation g, #constellation line.edge { transition: opacity 0.45s; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; height: auto; max-height: none; }
  .sky { height: 520px; }
  .folio { border-left: 0; border-top: 1px solid var(--line-ink); }
  .dom-grid { grid-template-columns: repeat(2, 1fr); }
  .src-grid { grid-template-columns: 1fr; }
  .ledger-row { grid-template-columns: 150px 1fr; }
  .ledger-row a { grid-column: 2; justify-self: start; }
}

@media (max-width: 720px) {
  section { padding: 56px 22px; }
  .topbar { padding: 12px 18px; }
  .topnav { gap: 14px; }
  .topnav a:not(.gh) { display: none; }
  .sky { height: 440px; }
  .sky-head { left: 18px; right: 18px; top: 18px; max-width: none; }
  .sky-legend { right: 18px; }
  .folio { padding: 26px 22px 22px; }
  .pipeline { flex-wrap: wrap; gap: 18px 26px; padding: 26px 22px; }
  .pipe-arrow { display: none; }
  .footbar { padding: 32px 22px; }
  .dom-grid { grid-template-columns: 1fr; gap: 28px; }
  .ledger-row { grid-template-columns: 1fr; gap: 8px; }
  .ledger-row a { grid-column: 1; }
  .foot { padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #constellation .drift, #constellation .node { animation: none; }
  .btn { transition: none; }
}
