:root {
  --bg: #070912;
  --surface: #0f1320;
  --surface-2: #161b2d;
  --line: #232a42;
  --line-soft: #181d2e;
  --text: #e8edf5;
  --muted: #8c92ab;
  --dim: #555b73;

  --tribe: #5fdcff;
  --tribe-glow: rgba(95, 220, 255, 0.32);
  --aesthetic: #a87aff;
  --ideology: #ff7b9d;
  --subculture: #ffb04d;
  --ecosystem: #5fe3a1;
  --signal: #ff5fbf;
  --archive: #f5d76e;

  --primary: var(--tribe);
  --primary-glow: var(--tribe-glow);

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --cjk-display: 'Noto Sans SC', sans-serif;
  --cjk-body: 'Noto Sans SC', sans-serif;
}

[data-theme="light"] {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #ebedf2;
  --line: #d4d7e0;
  --line-soft: #e3e6ec;
  --text: #131625;
  --muted: #5a5f76;
  --dim: #8e93a8;

  --tribe: #1f8aa8;
  --tribe-glow: rgba(31, 138, 168, 0.16);
  --aesthetic: #6b3fcc;
  --ideology: #c14872;
  --subculture: #b86f1c;
  --ecosystem: #2c8a6a;
  --signal: #c4267e;
  --archive: #b8862a;

  --primary: var(--tribe);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; line-height: 1.55; overflow-x: hidden; }

html[data-lang="en"] [lang="zh"] { display: none; }
html[data-lang="zh"] [lang="en"] { display: none; }
html[data-lang="zh"] body { font-family: var(--cjk-body); }
html[data-lang="zh"] h1, html[data-lang="zh"] h2, html[data-lang="zh"] h3, html[data-lang="zh"] .display { font-family: var(--cjk-display); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--tribe); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); }
.nav-inner { display: flex; align-items: center; gap: 28px; padding: 14px 24px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; position: relative; background: linear-gradient(135deg, var(--tribe), var(--signal)); display: grid; place-items: center; box-shadow: 0 0 16px var(--tribe-glow); }
.brand-mark::after { content: ''; width: 14px; height: 14px; background: var(--bg); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.brand-name { font-size: 17px; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 18px; margin-left: auto; font-size: 13px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-ctrl { display: flex; gap: 6px; }
.btn { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; padding: 7px 12px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; transition: all 0.15s; }
.btn:hover { color: var(--text); border-color: var(--tribe); }

.hero { position: relative; padding: 100px 0 80px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(50% 35% at 25% 35%, var(--tribe-glow), transparent 70%), radial-gradient(45% 30% at 80% 60%, rgba(255, 95, 191, 0.22), transparent 70%); opacity: 0.6; filter: blur(50px); pointer-events: none; }
[data-theme="light"] .hero::before { opacity: 0.22; }

.hero-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; margin-bottom: 22px; }
h1.display { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 5.2vw, 64px); line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 22px; }
h1.display em { font-style: normal; color: var(--tribe); }
.lede { font-size: 17px; color: var(--muted); max-width: 56ch; margin: 0 0 28px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--line); padding: 5px 10px; border-radius: 100px; }

.tribe-viz { position: relative; aspect-ratio: 1 / 1; max-width: 520px; margin: 0 auto; }
.tribe-viz svg { width: 100%; height: 100%; }

section { padding: 80px 0; border-top: 1px solid var(--line-soft); }
.sec-head { margin-bottom: 44px; }
.sec-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--tribe); text-transform: uppercase; margin-bottom: 14px; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; letter-spacing: -0.018em; margin: 0 0 14px; max-width: 22ch; }
h2 em { font-style: normal; color: var(--tribe); }
.sec-lede { color: var(--muted); max-width: 66ch; font-size: 16px; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; transition: all 0.2s; }
.card:hover { border-color: var(--tribe); transform: translateY(-2px); }
.card.glow-aesthetic { border-left: 3px solid var(--aesthetic); }
.card.glow-ideology { border-left: 3px solid var(--ideology); }
.card.glow-subculture { border-left: 3px solid var(--subculture); }
.card.glow-ecosystem { border-left: 3px solid var(--ecosystem); }
.card.glow-signal { border-left: 3px solid var(--signal); }
.card.glow-archive { border-left: 3px solid var(--archive); }
.card.glow-tribe { border-left: 3px solid var(--tribe); }
.card-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 0 0 10px; line-height: 1.25; }
.card p { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }
.card .meta { font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }

.locator { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.locator .q { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.locator .q:last-of-type { border-bottom: 0; }
.locator .q-text { font-family: var(--display); font-weight: 500; font-size: 17px; margin-bottom: 12px; }
.locator .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.locator .opt { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 10px 14px; border-radius: 6px; font-family: var(--body); font-size: 13px; cursor: pointer; transition: all 0.15s; text-align: left; }
.locator .opt:hover { border-color: var(--tribe); }
.locator .opt.on { background: var(--tribe-glow); border-color: var(--tribe); color: var(--text); }
.locator button.go { background: var(--tribe); color: #07091a; border: 0; padding: 12px 26px; border-radius: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; cursor: pointer; font-weight: 700; }
.locator-out { margin-top: 24px; padding: 22px 24px; background: var(--surface-2); border-left: 3px solid var(--tribe); border-radius: 6px; line-height: 1.65; min-height: 80px; }
.locator-out:empty::before { content: 'Pick one option per question. Press locate.'; color: var(--dim); font-style: italic; }
html[data-lang="zh"] .locator-out:empty::before { content: '每题选一项。按定位。'; }
.locator-out h4 { font-family: var(--display); font-size: 19px; margin: 0 0 8px; color: var(--tribe); font-weight: 600; }
.locator-out .conf { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 10px; }

.network-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.network-wrap svg { width: 100%; max-width: 720px; height: auto; display: block; margin: 0 auto; }

.vibes-track { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; overflow-x: auto; }
.vibes-track table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vibes-track th, .vibes-track td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.vibes-track th { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.vibes-track td:first-child { font-family: var(--mono); font-size: 12px; color: var(--tribe); width: 12%; }
.vibes-track td:nth-child(2) { font-family: var(--display); font-weight: 600; font-size: 15px; width: 22%; }

.mirror-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.prompt-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-align: left; padding: 14px 16px; border-radius: 10px; cursor: pointer; font-family: var(--body); font-size: 13px; transition: all 0.18s; }
.prompt-btn:hover { border-color: var(--tribe); transform: translateY(-1px); }
.prompt-btn .pt-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--tribe); text-transform: uppercase; display: block; margin-bottom: 6px; }
.prompt-btn strong { font-family: var(--display); font-size: 15px; font-weight: 600; }
.mirror-input { display: flex; gap: 10px; margin-bottom: 16px; }
.mirror-input textarea { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: var(--body); font-size: 14px; color: var(--text); resize: vertical; min-height: 70px; }
.mirror-input textarea:focus { outline: none; border-color: var(--tribe); }
.mirror-input button { background: var(--tribe); color: #07091a; border: 0; border-radius: 8px; padding: 0 26px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; cursor: pointer; font-weight: 700; }
.mirror-out { background: var(--surface-2); border-left: 3px solid var(--tribe); border-radius: 6px; padding: 22px 24px; font-size: 15px; line-height: 1.7; white-space: pre-wrap; min-height: 80px; color: var(--text); }
.mirror-out:empty::before { content: 'Pick a probe above or describe a tribe-shaped question.'; color: var(--dim); font-style: italic; }
html[data-lang="zh"] .mirror-out:empty::before { content: '从上方选择一个探针，或描述一个部落形状的问题。'; }

.rails { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ideology); border-radius: 14px; padding: 26px 28px; }
.rails h3 { font-family: var(--display); margin: 0 0 14px; font-size: 20px; color: var(--ideology); font-weight: 600; }
.rails ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.rails li { margin-bottom: 10px; }

footer { border-top: 1px solid var(--line-soft); padding: 40px 24px; color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: var(--muted); border-bottom: 1px dotted var(--line); }
footer a:hover { color: var(--tribe); }
