:root {
  --bg: #f3f6f7;
  --ink: #161714;
  --muted: #62645f;
  --line: rgba(22, 23, 20, 0.14);
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: #ffffff;
  --accent: #0e7c7b;
  --accent-dark: #075b5b;
  --warm: #d88a32;
  --blue: #315fd8;
  --rose: #b5446e;
  --shadow: 0 24px 70px rgba(36, 32, 24, 0.16);
  font-family: Inter, "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

[hidden] { display: none !important; }
#learning { max-width: none; }
#learning .network-heading { max-width: 760px; margin: 0 auto; }
#learning > .node-path, #learning > .node-detail, #learning > .branch-choices, #learning > .eyebrow, #learning > .insight-panel { max-width: 760px; margin-left: auto; margin-right: auto; }
.network-scene { position: relative; height: 62vh; min-height: 420px; max-height: 720px; width: 100%; background: #0d1118; margin: 24px 0; overflow: hidden; }
#network-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#scene-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene-node-label { position: absolute; top: 0; left: 0; width: 116px; padding: 6px; border: 1px solid transparent; background: rgba(13,17,24,.8); border-radius: 4px; color: #d4e0ed; font-size: 12px; line-height: 1.4; pointer-events: auto; cursor: pointer; text-align: center; }
.scene-node-label[aria-pressed="true"] { border-color: #8ce7cd; color: white; background: #15544d; }
.scene-toolbar { position: absolute; bottom: 16px; right: 16px; display: flex; align-items: center; gap: 8px; color: white; padding: 8px; background: rgba(13,17,24,.9); border: 1px solid #44505e; border-radius: 6px; }
.scene-toolbar button { width: 34px; height: 34px; border: 1px solid #536575; background: #1a2532; border-radius: 4px; color: white; font-size: 20px; padding: 0; }
.scene-toolbar label { color: #d4e0ed; font-size: 12px; }
#scene-status { position: absolute; bottom: 12px; left: 16px; color: #d4e0ed; font-size: 12px; max-width: 50%; }
.network-list { max-width: 760px; margin: 12px auto; font-size: 14px; color: var(--muted); }
.network-list summary { cursor: pointer; padding: 12px 0; }
.network-list #knowledge-network { margin: 16px 0; }
@media (max-width: 560px) { .network-scene { height: 56vh; min-height: 380px; } .scene-node-label { width: 94px; font-size: 11px; } #scene-status { bottom: 64px; max-width: 80%; } }
.living-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0; }
.profile-signals { border-top: 1px solid var(--line); padding-top: 12px; }
.profile-signals div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.profile-signals dt { color: var(--muted); font-size: 14px; }
.profile-signals dd { margin: 0; line-height: 1.7; font-size: 14px; overflow-wrap: anywhere; }
.living-metrics div { padding: 18px 12px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.living-metrics span, .living-metrics small { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }
.living-metrics strong { display: block; font-size: 30px; margin: 12px 0; }
.profile-history { padding-left: 20px; color: var(--muted); line-height: 2; }
#clear-progress { margin-left: 24px; color: var(--muted); }
#live-description { line-height: 1.8; overflow-wrap: anywhere; }
#open-profile { padding: 6px; white-space: nowrap; margin-left: auto; font-size: 13px; }
@media (max-width: 560px) { .topbar { gap: 6px; } .living-metrics { gap: 6px; } .living-metrics span, .living-metrics small { font-size: 11px; } }
.language-switch { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.language-switch button { background: transparent; border: 0; border-radius: 3px; color: var(--muted); padding: 7px 10px; font: inherit; font-size: 13px; }
.language-switch button[aria-pressed="true"] { background: var(--ink); color: white; }
.journey-screen button { overflow-wrap: anywhere; }
.network-heading p { line-height: 1.8; color: var(--muted); }
.knowledge-disclaimer { max-width: 760px; margin-left: auto; margin-right: auto; }
#node-actions { max-width: 760px; margin-left: auto; margin-right: auto; flex-wrap: wrap; }
.network-navigation { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.network-navigation span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
#learning > .knowledge-content, #learning > #knowledge-pool, #learning > .knowledge-notes { max-width: 760px; margin: 32px auto; }
.pool-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.pool-heading h2 { margin: 0; font-size: 22px; }
.pool-filters { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.pool-filters button { border: 0; border-radius: 4px; padding: 8px 14px; background: transparent; }
.pool-filters button[aria-selected="true"] { background: var(--ink); color: white; }
.pool-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.pool-kind { grid-row: span 2; color: var(--muted); font-size: 12px; padding-top: 5px; }
.pool-choice { background: transparent; border: 0; color: var(--ink); text-align: left; padding: 0; font-weight: 700; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.pool-choice:hover { color: var(--accent-dark); }
.pool-item p { grid-column: 2; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.pool-source { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-size: 12px; white-space: nowrap; }
.pool-loading { height: 20px; }
.pool-loading::after { content: ''; display: block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent-dark); border-radius: 50%; animation: busy-spin 0.8s linear infinite; }
.knowledge-notes summary { cursor: pointer; margin-bottom: 16px; }
@media (max-width: 560px) { .pool-item { grid-template-columns: 38px minmax(0, 1fr); gap: 8px; } .pool-source { grid-column: 2; grid-row: auto; } }
.network-tool { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; overflow: auto; max-height: 450px; }
#knowledge-network { position: relative; display: grid; gap: 36px; }
#network-edges { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.network-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; position: relative; z-index: 1; }
.knowledge-point { max-width: 200px; min-height: 50px; padding: 12px; background: #fff; border: 1px solid #bacace; border-radius: 6px; color: var(--ink); font: inherit; font-size: 14px; overflow-wrap: anywhere; }
.knowledge-point[aria-pressed="true"] { background: var(--accent-dark); color: white; border-color: var(--accent-dark); }
.knowledge-point small { display: block; font-size: 11px; margin-top: 4px; opacity: .8; }
.node-path { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.node-path button { border: 0; background: none; color: var(--accent-dark); font: inherit; font-size: 13px; text-align: left; padding: 4px; }
.node-detail p { line-height: 1.85; color: var(--muted); white-space: pre-line; }
.branch-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.branch-choices h3 { grid-column: 1 / -1; margin: 0; font-size: 18px; }
.branch-choice { border: 1px solid #bacace; background: white; border-radius: 6px; padding: 16px; text-align: left; font: inherit; color: var(--accent-dark); line-height: 1.6; }
.branch-choice:hover { border-color: var(--accent); background: #e5f3f0; }
@media (max-width: 560px) { .branch-choices { grid-template-columns: 1fr; } }
#extend-node { margin-bottom: 30px; }
.journey-progress { display: flex; justify-content: space-between; gap: 12px; list-style: none; padding: 0; max-width: 760px; margin: 36px auto; color: var(--muted); font-size: 14px; }
.journey-progress li { flex: 1; border-top: 3px solid #dce1e3; padding-top: 12px; }
.journey-progress li[aria-current] { color: var(--accent-dark); border-color: var(--accent); font-weight: 700; }
.journey-screen { max-width: 760px; margin: 0 auto; padding: 16px 0 64px; }
.journey-screen h1 { font-size: 36px; line-height: 1.35; margin: 16px 0; overflow-wrap: anywhere; }
.guide-copy { color: var(--muted); font-size: 18px; line-height: 1.9; }
.description-label { display: block; color: var(--ink); margin: 28px 0 12px; font-weight: 600; }
textarea { display: block; width: 100%; resize: vertical; padding: 18px; border: 1px solid #bfcacc; border-radius: 8px; font: inherit; line-height: 1.8; background: white; }
textarea:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #315fd8; outline-offset: 3px; }
.form-error { color: #a32742; min-height: 20px; font-size: 14px; }
.brand-promise { margin-top: 42px; font-size: 14px; line-height: 1.9; color: var(--muted); }
.journey-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.journey-actions button { flex: 1; padding: 12px 16px; }
.journey-label { font-size: 13px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#question-options { border: 0; padding: 0; background: none; gap: 12px; }
#question-options label { padding: 18px; border: 1px solid #cbd5d7; border-radius: 8px; background: white; cursor: pointer; color: var(--ink); line-height: 1.7; }
#question-options label:has(input:checked) { border-color: var(--accent); background: #e5f3f0; }
.result-note { color: var(--muted); font-size: 13px; line-height: 1.8; }
.results-screen .knowledge-map { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; border: 0; padding: 16px 0; background: none; overflow: visible; }
.results-screen .map-node { position: static; width: 100%; box-shadow: none; }
.next-route { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 24px; }
.next-route p { color: var(--muted); line-height: 1.8; }
.text-button { border: 0; background: none; color: var(--accent-dark); padding: 16px 0; font: inherit; }
.insight-panel { box-shadow: none; background: white; }
.profile-card { box-shadow: none; background: white; }
.metric-list strong { font-size: 16px; }
@media (max-width: 560px) {
  .journey-screen h1 { font-size: 27px; }
  .guide-copy { font-size: 16px; }
  .journey-progress { font-size: 12px; gap: 8px; margin: 24px auto; }
  .journey-actions { flex-direction: column; }
  .insight-panel, .profile-card { padding: 18px; }
  .metric-list div { flex-wrap: wrap; }
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  margin: 14px 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(28, 28, 24, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: linear-gradient(135deg, var(--ink), var(--accent));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: 48px;
  min-height: calc(100vh - 120px);
  padding: 28px 0 72px;
}

.eyebrow,
.card-label {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(54px, 9vw, 116px);
  line-height: 0.88;
  letter-spacing: 0;
}

.tagline {
  margin: 0;
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.04;
}

.tagline.zh {
  margin-top: 12px;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 700;
}

.hero-body {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: var(--ink);
  box-shadow: 0 14px 30px rgba(22, 23, 20, 0.18);
}

.primary-button:hover {
  background: var(--accent-dark);
}

button[aria-busy="true"] {
  position: relative;
  color: transparent;
  cursor: wait;
}

button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  left: calc(50% - 9px);
  top: calc(50% - 9px);
  width: 14px;
  height: 14px;
  border: 2px solid #56dcb5;
  border-top-color: transparent;
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}

@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  button[aria-busy="true"]::after { animation: none; }
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.full {
  width: 100%;
}

.orbit {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}

.orbit-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(250px, 62vw);
  aspect-ratio: 1;
  place-items: center;
  padding: 32px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(235, 242, 239, 0.7)),
    linear-gradient(135deg, rgba(14, 124, 123, 0.22), rgba(216, 138, 50, 0.2));
  box-shadow: var(--shadow);
}

.orbit-core span {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

.orbit-core strong {
  display: block;
  max-width: 180px;
  font-size: 26px;
  line-height: 1.05;
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(22, 23, 20, 0.16);
  border-radius: 50%;
}

.ring-one {
  width: 76%;
  aspect-ratio: 1;
}

.ring-two {
  width: 98%;
  aspect-ratio: 1;
  border-style: dashed;
}

.orbit-node {
  position: absolute;
  z-index: 3;
  max-width: 160px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 34px rgba(22, 23, 20, 0.12);
  font-weight: 800;
}

.orbit-node:hover,
.map-node:hover,
.map-node.active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.node-a { top: 68px; right: 58px; }
.node-b { left: 18px; top: 176px; }
.node-c { right: 12px; bottom: 142px; }
.node-d { left: 112px; bottom: 56px; }

.scan-section,
.map-section {
  padding: 70px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-heading.compact {
  max-width: 680px;
}

.section-heading h2 {
  margin: 8px 0 10px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.scan-grid,
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: 22px;
}

.scan-panel,
.profile-card,
.insight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(44, 38, 28, 0.11);
  backdrop-filter: blur(16px);
}

.scan-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
}

fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

legend {
  padding: 0 8px;
  font-weight: 800;
}

label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  line-height: 1.35;
}

input {
  accent-color: var(--accent);
}

.scan-panel .primary-button {
  grid-column: 1 / -1;
}

.profile-card,
.insight-panel {
  padding: 24px;
}

.profile-card h3,
.insight-panel h3 {
  margin: 12px 0 10px;
  font-size: 30px;
  line-height: 1.06;
}

.profile-card p,
.insight-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.metric-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.metric-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.metric-list span {
  color: var(--muted);
}

.metric-list strong {
  font-size: 20px;
}

.knowledge-map {
  position: relative;
  display: grid;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(rgba(22, 23, 20, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 23, 20, 0.055) 1px, transparent 1px),
    rgba(255, 255, 255, 0.48);
  background-size: 44px 44px;
}

.map-node {
  position: absolute;
  z-index: 2;
  width: 210px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: 0 18px 42px rgba(31, 29, 22, 0.12);
  font-weight: 800;
}

.map-node span {
  display: block;
  margin-bottom: 8px;
  color: currentColor;
  opacity: 0.72;
  font-size: 12px;
  text-transform: uppercase;
}

.map-node:nth-of-type(1) { left: 12%; top: 14%; }
.map-node:nth-of-type(2) { right: 13%; top: 25%; }
.map-node:nth-of-type(3) { left: 20%; bottom: 18%; }
.map-node:nth-of-type(4) { right: 10%; bottom: 13%; }

.map-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, rgba(14, 124, 123, 0.1), rgba(14, 124, 123, 0.56));
  transform-origin: left center;
}

.line-a { left: 34%; top: 29%; width: 28%; transform: rotate(12deg); }
.line-b { left: 31%; top: 45%; width: 28%; transform: rotate(105deg); }
.line-c { left: 42%; bottom: 26%; width: 28%; transform: rotate(-8deg); }

.panel-topline,
.confidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.confidence {
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.boundary-box,
.mode-output {
  margin: 22px 0;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.boundary-box span {
  color: var(--rose);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boundary-box p,
.mode-output p {
  margin-bottom: 0;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mode-tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.mode-tab.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.mode-output h4 {
  margin: 0 0 8px;
  font-size: 21px;
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
  }

  .nav-links {
    display: none;
  }

  .hero,
  .scan-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .orbit {
    min-height: 440px;
  }

  .scan-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    top: 8px;
  }

  .brand {
    font-size: 14px;
  }

  .ghost-button {
    min-height: 38px;
    padding: 0 12px;
  }

  .hero {
    gap: 24px;
    padding-bottom: 36px;
  }

  .hero-actions {
    display: grid;
  }

  .orbit {
    min-height: 360px;
  }

  .orbit-core {
    width: 190px;
  }

  .orbit-core strong {
    font-size: 20px;
  }

  .orbit-node {
    max-width: 128px;
    font-size: 13px;
  }

  .node-a { top: 24px; right: 16px; }
  .node-b { left: 4px; top: 126px; }
  .node-c { right: 2px; bottom: 104px; }
  .node-d { left: 64px; bottom: 24px; }

  .knowledge-map {
    min-height: 500px;
  }

  .map-node {
    width: min(184px, 48vw);
    min-height: 80px;
    padding: 12px;
    font-size: 13px;
  }

  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.pool-choice { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .pool-loading::after { animation: none; } }
