:root {
  --ink: #070b0a;
  --paper: #f4f0e4;
  --jade: #5dd89b;
  --jade-soft: #a8f0c9;
  --gold: #e5bc67;
  --red: #e24f3c;
  --line: rgba(238, 237, 220, 0.15);
  --muted: rgba(238, 237, 220, 0.62);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: #eeeddc;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 999; top: 12px; left: 12px; padding: 10px 14px; background: var(--paper); color: var(--ink); }

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 18% 22%, rgba(93,216,155,.2), transparent 24%), radial-gradient(circle at 82% 14%, rgba(229,188,103,.12), transparent 20%), radial-gradient(circle at 74% 82%, rgba(226,79,60,.1), transparent 26%), radial-gradient(rgba(255,255,255,.24) .65px, transparent .65px);
  background-size: auto, auto, auto, 29px 29px; opacity: .65;
}
.ambient i { position: absolute; width: 42vw; aspect-ratio: 1; border: 1px solid rgba(93,216,155,.09); border-radius: 50%; animation: orbit 24s linear infinite; }
.ambient i:nth-child(1) { left: -20vw; top: 6vh; }
.ambient i:nth-child(2) { right: -19vw; top: 38vh; animation-duration: 34s; animation-direction: reverse; }
.ambient i:nth-child(3) { left: 30vw; bottom: -35vw; width: 65vw; animation-duration: 48s; }
@keyframes orbit { to { transform: rotate(360deg); } }

.cosmos-header {
  position: fixed; z-index: 50; top: 0; left: 0; width: 100%; min-height: 78px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px clamp(18px, 3vw, 50px); border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(7,11,10,.94), rgba(7,11,10,.72)); backdrop-filter: blur(22px);
}
.cosmos-brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.cosmos-brand img { width: 43px; height: 43px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(226,79,60,.3)); }
.cosmos-brand span, .cosmos-brand strong, .cosmos-brand small { display: block; }
.cosmos-brand strong { font: 800 15px/1.1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .08em; }
.cosmos-brand small { margin-top: 5px; color: var(--muted); font: 650 8px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .18em; }
.cosmos-actions { display: flex; align-items: center; gap: 10px; }
.life-pill { display: flex; gap: 9px; align-items: center; min-height: 42px; padding: 7px 13px; border: 1px solid rgba(93,216,155,.28); border-radius: 999px; background: rgba(93,216,155,.07); }
.life-pill span:last-child, .life-pill small, .life-pill strong { display: block; }
.life-pill small { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.life-pill strong { margin-top: 2px; color: var(--jade-soft); font-size: 12px; letter-spacing: .08em; }
.life-beat { position: relative; width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 16px var(--jade); }
.life-beat::after { content: ""; position: absolute; inset: -5px; border: 1px solid var(--jade); border-radius: inherit; animation: beat 1.8s ease-out infinite; }
@keyframes beat { 0% { transform: scale(.4); opacity: 1; } 80%,100% { transform: scale(1.35); opacity: 0; } }
.contribute-button, .submit-contribution, .life-actions a, .life-actions button {
  min-height: 42px; border: 0; border-radius: 999px; padding: 0 18px; background: var(--paper); color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 850; text-decoration: none;
}
.contribute-button:hover, .contribute-button:focus-visible, .submit-contribution:hover, .submit-contribution:focus-visible { background: var(--jade-soft); }
.cosmos-header .jic-account-button { min-height: 42px; border-color: var(--line); background: rgba(255,255,255,.04); color: #eeeddc; }

.cosmos-shell { width: min(1540px, 100%); margin: 0 auto; padding: 126px clamp(14px, 3vw, 48px) 100px; }
.manifesto { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); column-gap: 7vw; align-items: end; min-height: 34vh; padding: 4vh 0 34px; }
.manifesto-kicker { grid-column: 1 / -1; margin: 0 0 18px; color: var(--jade); font: 750 10px/1.5 ui-monospace, SFMono-Regular, monospace; letter-spacing: .19em; }
.manifesto h1 { margin: 0; max-width: 950px; font-family: "Songti SC", "STSong", serif; font-size: clamp(44px, 6.8vw, 108px); font-weight: 500; line-height: .95; letter-spacing: -.06em; }
.manifesto h1 em { display: inline-block; margin-top: .14em; color: var(--jade-soft); font-size: .72em; font-style: normal; letter-spacing: -.045em; white-space: nowrap; }
.manifesto-copy { align-self: center; margin: 0; max-width: 560px; color: var(--muted); font-family: "Songti SC", "STSong", serif; font-size: clamp(15px, 1.25vw, 20px); line-height: 1.8; }
.manifesto-stats { grid-column: 1 / -1; display: flex; gap: clamp(24px, 5vw, 76px); padding-top: 36px; }
.manifesto-stats div { display: grid; gap: 6px; }
.manifesto-stats strong { font: 800 clamp(20px, 2.5vw, 38px)/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: -.05em; }
.manifesto-stats span { color: var(--muted); font-size: 10px; letter-spacing: .08em; }

.graph-stage { position: relative; height: min(76vh, 860px); min-height: 620px; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: radial-gradient(circle at 50% 48%, rgba(36,78,59,.25), transparent 40%), rgba(2,5,4,.86); box-shadow: 0 30px 100px rgba(0,0,0,.38); }
.graph-toolbar { position: absolute; z-index: 8; top: 18px; left: 18px; right: 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; pointer-events: none; }
.graph-toolbar > * { pointer-events: auto; }
.graph-search { width: min(380px, 42vw); display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 0 13px 0 17px; background: rgba(8,13,11,.78); backdrop-filter: blur(16px); }
.graph-search input { width: 100%; height: 43px; border: 0; outline: 0; background: transparent; color: #fff; font-size: 12px; }
.graph-search input::placeholder { color: rgba(255,255,255,.42); }
.graph-search kbd { color: rgba(255,255,255,.38); font: 10px ui-monospace, monospace; }
.filter-list { display: flex; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(8,13,11,.78); backdrop-filter: blur(16px); }
.filter-list button { min-width: 45px; height: 33px; border: 0; border-radius: 999px; padding: 0 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.filter-list button:hover, .filter-list button:focus-visible, .filter-list button.is-active { background: #ecebdc; color: #0b100e; }
.graph-canvas { position: absolute; inset: 0; }
.graph-canvas canvas { display: block; }
.graph-loading { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; justify-items: center; gap: 15px; pointer-events: none; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.graph-loading span { width: 40px; height: 40px; border: 1px solid rgba(93,216,155,.22); border-top-color: var(--jade); border-radius: 50%; animation: spin 1s linear infinite; }
.graph-loading.is-hidden { opacity: 0; transition: opacity .5s; }
@keyframes spin { to { transform: rotate(360deg); } }
.node-panel { position: absolute; z-index: 10; right: 18px; top: 82px; width: min(320px, calc(100% - 36px)); border: 1px solid var(--line); border-radius: 19px; padding: 22px; background: rgba(9,14,12,.84); backdrop-filter: blur(22px); box-shadow: 0 24px 80px rgba(0,0,0,.35); transform: translateX(calc(100% + 40px)); opacity: 0; transition: .35s ease; }
.node-panel.is-open { transform: translateX(0); opacity: 1; }
.node-panel-close { position: absolute; top: 11px; right: 11px; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.node-type { margin: 0 34px 12px 0; color: var(--jade); font: 750 9px/1.4 ui-monospace, monospace; letter-spacing: .15em; text-transform: uppercase; }
.node-panel h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 30px; font-weight: 500; }
.node-description { margin: 15px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.node-panel dl { margin: 18px 0 0; border-top: 1px solid var(--line); }
.node-panel dl div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.node-panel dt, .node-panel dd { margin: 0; font-size: 10px; }
.node-panel dt { color: var(--muted); }
.node-link { display: inline-flex; margin-top: 16px; color: var(--jade-soft); font-size: 11px; text-decoration: none; }
.node-link:hover { text-decoration: underline; }
.graph-legend { position: absolute; z-index: 7; left: 18px; bottom: 42px; display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 9px; pointer-events: none; }
.graph-legend span { display: flex; gap: 5px; align-items: center; }
.graph-legend i { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 9px currentColor; }
.legend-dao { color: #5dd89b; background: currentColor; }.legend-fo { color: #d99bff; background: currentColor; }.legend-cn { color: #e5bc67; background: currentColor; }.legend-tcm { color: #55a7ff; background: currentColor; }.legend-love { color: #ff6f73; background: currentColor; }
.graph-hint { position: absolute; z-index: 7; left: 18px; bottom: 15px; margin: 0; color: rgba(255,255,255,.36); font-size: 9px; pointer-events: none; }
.scene-tooltip { padding: 7px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(4,8,7,.92); color: #f6f2e8; font-size: 11px; }

.life-section { display: grid; grid-template-columns: minmax(230px,.6fr) minmax(300px,1fr) minmax(280px,.85fr); gap: clamp(30px,5vw,80px); align-items: center; padding: clamp(90px,12vw,180px) 2vw 30px; }
.life-section h2 { margin: 0 0 22px; font-family: "Songti SC", "STSong", serif; font-size: clamp(40px,5vw,78px); font-weight: 500; line-height: 1.05; letter-spacing: -.04em; }
.life-section > div:nth-child(2) > p:not(.manifesto-kicker) { max-width: 680px; color: var(--muted); font-size: 15px; line-height: 1.9; }
.life-orbit { position: relative; display: grid; width: min(28vw,360px); min-width: 230px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(93,216,155,.2); border-radius: 50%; }
.life-orbit::before, .life-orbit::after { content: ""; position: absolute; inset: 13%; border: 1px solid rgba(229,188,103,.17); border-radius: 50%; }
.life-orbit::after { inset: 30%; border-color: rgba(226,79,60,.23); }
.life-orbit span { position: relative; z-index: 2; color: var(--jade-soft); font-family: "Songti SC", serif; font-size: clamp(70px,10vw,140px); text-shadow: 0 0 45px rgba(93,216,155,.28); }
.life-orbit i { position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; margin: -4px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 18px var(--jade); animation: life-orbit 8s linear infinite; }
.life-orbit i:nth-of-type(2) { animation-duration: 13s; animation-direction: reverse; background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.life-orbit i:nth-of-type(3) { animation-duration: 20s; }
@keyframes life-orbit { from { transform: rotate(0deg) translateX(150px) rotate(0deg); } to { transform: rotate(360deg) translateX(150px) rotate(-360deg); } }
.life-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 22px; }
.life-actions a { display: inline-flex; align-items: center; background: var(--jade-soft); }
.life-actions button { border: 1px solid var(--line); background: transparent; color: #fff; }
.life-principles { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.life-principles li { display: grid; grid-template-columns: 38px 1fr; gap: 15px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.life-principles li > span { color: var(--jade); font: 700 9px ui-monospace, monospace; }
.life-principles strong { font-size: 13px; }
.life-principles p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.contribution-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; border: 1px solid rgba(255,255,255,.18); border-radius: 24px; padding: 0; background: #101613; color: #eeeddc; box-shadow: 0 40px 140px rgba(0,0,0,.7); }
.contribution-dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(8px); }
.dialog-close-form { position: sticky; z-index: 3; top: 0; height: 0; text-align: right; }
.dialog-close-form button { width: 38px; height: 38px; margin: 14px 14px 0 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(0,0,0,.3); color: #fff; cursor: pointer; }
.dialog-heading { padding: 34px 34px 25px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 10% 0, rgba(93,216,155,.14), transparent 45%); }
.dialog-heading span { color: var(--jade); font: 700 9px ui-monospace, monospace; letter-spacing: .15em; }
.dialog-heading h2 { margin: 13px 45px 10px 0; font-family: "Songti SC", serif; font-size: 32px; font-weight: 500; }
.dialog-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.contribution-form { display: grid; gap: 16px; padding: 28px 34px 34px; }
.contribution-form label { display: grid; gap: 7px; }
.contribution-form label > span:first-child { color: rgba(255,255,255,.68); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.relation-grid { grid-template-columns: 1fr .8fr 1fr; gap: 10px; }
.relation-grid:not([hidden]) { display: grid; }
.contribution-form input:not([type="checkbox"]), .contribution-form textarea, .contribution-form select { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; padding: 12px 13px; background: rgba(255,255,255,.045); color: #fff; font-size: 12px; }
.contribution-form textarea { resize: vertical; line-height: 1.6; }
.contribution-form select { color-scheme: dark; }
.contribution-form input:focus, .contribution-form textarea:focus, .contribution-form select:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(93,216,155,.1); }
.consent-row { display: grid !important; grid-template-columns: 18px 1fr; gap: 9px !important; align-items: start; color: var(--muted); font-size: 10px; line-height: 1.6; }
.consent-row input { margin: 2px 0 0; accent-color: var(--jade); }
.love-disclosure { display: flex; gap: 12px; align-items: flex-start; padding: 13px; border: 1px solid rgba(93,216,155,.19); border-radius: 12px; background: rgba(93,216,155,.06); }
.love-disclosure .life-beat { margin-top: 4px; }
.love-disclosure p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.love-disclosure strong { color: var(--jade-soft); }
.submit-contribution { min-height: 48px; border-radius: 12px; }
.form-status { min-height: 0; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.form-status.is-error { color: #ff9990; }
.form-status.is-success { color: var(--jade-soft); }

@media (max-width: 980px) {
  .manifesto { grid-template-columns: 1fr; row-gap: 25px; }
  .manifesto-copy, .manifesto-stats { grid-column: 1; }
  .life-section { grid-template-columns: .7fr 1fr; }
  .life-principles { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .life-principles li { padding-right: 24px; }
}
@media (max-width: 760px) {
  .cosmos-header { min-height: 66px; padding: 10px 13px; }
  .cosmos-brand img { width: 36px; height: 36px; }
  .cosmos-brand small, .life-pill { display: none; }
  .contribute-button { min-height: 38px; padding: 0 13px; font-size: 10px; }
  .cosmos-header .jic-account-button { min-height: 38px; }
  .cosmos-shell { padding: 91px 10px 65px; }
  .manifesto { min-height: auto; padding: 5vh 5px 26px; }
  .manifesto h1 { font-size: clamp(44px, 13vw, 70px); line-height: .98; }
  .manifesto h1 em { font-size: .7em; white-space: normal; }
  .manifesto-copy { font-size: 14px; }
  .manifesto-stats { gap: 19px; overflow-x: auto; }
  .manifesto-stats div { min-width: 93px; }
  .graph-stage { height: 72vh; min-height: 560px; border-radius: 19px; }
  .graph-toolbar { align-items: stretch; flex-direction: column; }
  .graph-search { width: 100%; }
  .filter-list { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .filter-list button { flex: 0 0 auto; }
  .node-panel { top: auto; bottom: 42px; max-height: 45%; overflow: auto; }
  .graph-legend { bottom: 17px; }
  .graph-hint { display: none; }
  .life-section { grid-template-columns: 1fr; padding: 100px 5px 30px; }
  .life-orbit { margin: 0 auto; }
  .life-principles { grid-column: 1; grid-template-columns: 1fr; }
  .dialog-heading, .contribution-form { padding-left: 19px; padding-right: 19px; }
  .form-grid, .relation-grid:not([hidden]) { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ambient i, .life-beat::after, .life-orbit i, .graph-loading span { animation: none; }
}
