:root {
  --bg: #05090e;
  --bg-2: #08121b;
  --panel: rgba(7, 18, 27, 0.78);
  --panel-strong: rgba(7, 17, 26, 0.94);
  --text: #e9f4fb;
  --muted: #8da6b4;
  --faint: #587080;
  --line: rgba(104, 193, 228, 0.18);
  --line-strong: rgba(112, 217, 255, 0.42);
  --accent: #5ce8ff;
  --accent-rgb: 92, 232, 255;
  --blue: #4f8cff;
  --warm: #ffb25e;
  --green: #62e4b2;
  --shadow: rgba(0, 0, 0, 0.48);
  --dock: rgba(6, 17, 25, 0.86);
  --label-bg: rgba(6, 17, 26, 0.9);
  --label-text: #eefaff;
  --canvas-vignette: rgba(1, 5, 9, 0.9);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.theme-light {
  --bg: #e9edf0;
  --bg-2: #f7f9fa;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(252, 253, 254, 0.96);
  --text: #182630;
  --muted: #617480;
  --faint: #8a9aa4;
  --line: rgba(25, 65, 82, 0.14);
  --line-strong: rgba(18, 121, 148, 0.44);
  --accent: #0b8fab;
  --accent-rgb: 11, 143, 171;
  --blue: #2d6ecb;
  --warm: #c87b27;
  --green: #18805d;
  --shadow: rgba(45, 66, 77, 0.16);
  --dock: rgba(255, 255, 255, 0.84);
  --label-bg: rgba(255, 255, 255, 0.94);
  --label-text: #1c303b;
  --canvas-vignette: rgba(231, 236, 239, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
kbd { font-family: var(--font-mono); }

#app {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

#scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

.backdrop-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 58% at 50% 46%, rgba(18, 72, 95, 0.38) 0%, rgba(5, 14, 22, 0) 68%),
    radial-gradient(ellipse 32% 44% at 79% 19%, rgba(45, 111, 167, 0.18) 0%, rgba(5, 14, 22, 0) 70%),
    radial-gradient(ellipse 42% 40% at 13% 75%, rgba(31, 95, 104, 0.12) 0%, rgba(5, 14, 22, 0) 72%),
    linear-gradient(180deg, #060c12 0%, #05090e 44%, #04080d 100%);
  transition: background 0.7s var(--ease);
}
.backdrop-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91, 174, 204, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 174, 204, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 64% 58% at 50% 50%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 64% 58% at 50% 50%, #000 0%, transparent 80%);
  opacity: 0.8;
}
body.theme-light .backdrop-glow {
  background:
    radial-gradient(ellipse 76% 66% at 50% 43%, rgba(255, 255, 255, 0.92) 0%, rgba(238, 242, 245, 0.2) 64%),
    radial-gradient(ellipse 38% 44% at 76% 16%, rgba(159, 197, 212, 0.34) 0%, rgba(238, 242, 245, 0) 72%),
    radial-gradient(ellipse 34% 38% at 12% 76%, rgba(183, 207, 214, 0.3) 0%, rgba(238, 242, 245, 0) 72%),
    linear-gradient(180deg, #f0f4f6 0%, #e8edf0 50%, #dfe6ea 100%);
}
body.theme-light .backdrop-glow::before {
  background-image:
    linear-gradient(rgba(30, 82, 104, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 82, 104, 0.04) 1px, transparent 1px);
  opacity: 0.7;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.12;
  background: repeating-linear-gradient(0deg, rgba(166, 239, 255, 0.055) 0px, rgba(166, 239, 255, 0.055) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
}
body.theme-light .scan-overlay { opacity: 0; }

#leader-layer {
  position: absolute;
  inset: 0;
  z-index: 9;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
#leader-layer line { vector-effect: non-scaling-stroke; }
#leader-layer circle { vector-effect: non-scaling-stroke; }

#labels-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.part-label {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: stretch;
  min-width: 138px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid color-mix(in srgb, var(--part-color) 38%, transparent);
  border-left: 2px solid var(--part-color);
  border-radius: 4px;
  background: var(--label-bg);
  color: var(--label-text);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.26), inset 0 0 20px color-mix(in srgb, var(--part-color) 6%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.22s ease, transform 0.22s var(--ease), box-shadow 0.22s ease, border-color 0.22s ease;
  transform: translate3d(0, 0, 0);
  opacity: 0;
}
.part-label.is-positioned { opacity: 1; }
.part-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--part-color), transparent 75%);
  opacity: 0.8;
}
.part-label:hover,
.part-label.is-selected {
  border-color: var(--part-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32), 0 0 24px color-mix(in srgb, var(--part-color) 18%, transparent), inset 0 0 24px color-mix(in srgb, var(--part-color) 9%, transparent);
}
.part-label.is-hidden { opacity: 0 !important; pointer-events: none; }
.label-index {
  width: 28px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--part-color);
  border-right: 1px solid color-mix(in srgb, var(--part-color) 22%, transparent);
  background: color-mix(in srgb, var(--part-color) 7%, transparent);
}
.label-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0 10px;
  text-align: left;
}
.label-copy b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.label-copy em {
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: flex-start; gap: 15px; min-width: 0; }
.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  margin-top: 4px;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.15), inset 0 0 16px rgba(var(--accent-rgb), 0.12);
}
.mark-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 22px rgba(var(--accent-rgb), 0.6);
  transform: translate(-50%, -50%);
}
.mark-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.ring-a { width: 20px; height: 20px; border-right-color: transparent; animation: spin 8s linear infinite; }
.ring-b { width: 28px; height: 12px; transform: translate(-50%, -50%) rotate(-34deg); border-left-color: transparent; animation: spin-rev 11s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes spin-rev { from { transform: translate(-50%, -50%) rotate(-34deg); } to { transform: translate(-50%, -50%) rotate(-394deg); } }

.kicker, .eyebrow, .modal-kicker, .tour-step-label {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kicker span { color: var(--accent); }
.kicker i { width: 18px; height: 1px; background: var(--line-strong); }
.brand h1 {
  font-size: clamp(17px, 1.55vw, 24px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.055em;
}
.brand p {
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.brand p span { color: var(--faint); padding: 0 3px; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.project-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.project-chip:hover { border-color: var(--line-strong); }
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip-label { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; }
.chip-value { font-family: var(--font-mono); font-size: 11px; color: var(--text); letter-spacing: 0.03em; }
.chip-value small { margin-left: 3px; font-size: 8px; color: var(--muted); }

.theme-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.theme-switch button {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.theme-switch button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.theme-switch button.is-active { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.16); }

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.side-panel {
  position: absolute;
  z-index: 15;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
.side-panel::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 18px;
  height: 18px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.4);
  border-right: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 0 5px 0 0;
  pointer-events: none;
}
.components-panel {
  left: 30px;
  top: 132px;
  width: 302px;
  max-height: calc(100vh - 248px);
  padding: 18px 15px 15px;
}
.detail-panel {
  right: 30px;
  top: 132px;
  width: 334px;
  max-height: calc(100vh - 226px);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 5px; }
.panel-head h2 { margin-top: 4px; font-size: 18px; font-weight: 550; letter-spacing: 0.06em; }
.panel-head-right { display: flex; align-items: center; gap: 8px; }
.count-badge {
  display: grid;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
}
.panel-close {
  display: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.panel-close:hover { color: var(--text); border-color: var(--line-strong); }

.filter-row {
  display: flex;
  gap: 4px;
  margin: 17px 2px 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.filter-row button {
  flex: 1;
  height: 28px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  transition: background 0.2s ease, color 0.2s ease;
}
.filter-row button:hover { color: var(--text); background: rgba(var(--accent-rgb), 0.05); }
.filter-row button.is-active { color: var(--accent); background: rgba(var(--accent-rgb), 0.1); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.12); }

.component-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding: 1px 2px 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.26) transparent;
}
.component-list::-webkit-scrollbar, .detail-body::-webkit-scrollbar { width: 5px; }
.component-list::-webkit-scrollbar-thumb, .detail-body::-webkit-scrollbar-thumb { border-radius: 4px; background: rgba(var(--accent-rgb), 0.26); }
.part-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.part-row:hover { background: rgba(var(--accent-rgb), 0.045); border-color: rgba(var(--accent-rgb), 0.12); transform: translateX(2px); }
.part-row.is-active { background: linear-gradient(90deg, color-mix(in srgb, var(--part-color) 12%, transparent), transparent); border-color: color-mix(in srgb, var(--part-color) 32%, transparent); }
.part-row.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 3px;
  background: var(--part-color);
  box-shadow: 0 0 12px var(--part-color);
}
.part-row-index { font-family: var(--font-mono); font-size: 9px; color: var(--part-color); letter-spacing: 0.02em; }
.part-row-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.part-row-name { font-size: 11px; font-weight: 500; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part-row-spec { font-family: var(--font-mono); font-size: 8px; color: var(--muted); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part-row-arrow { width: 13px; height: 13px; color: var(--faint); transition: color 0.2s ease, transform 0.2s ease; }
.part-row-arrow svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; }
.part-row:hover .part-row-arrow, .part-row.is-active .part-row-arrow { color: var(--part-color); transform: translateX(2px); }

.source-note {
  position: relative;
  margin: 12px 6px 0;
  padding: 12px 0 0 13px;
  border-top: 1px solid var(--line);
}
.source-line { position: absolute; left: 0; top: 14px; width: 1px; height: 30px; background: linear-gradient(var(--accent), transparent); }
.source-note p { font-size: 8.5px; line-height: 1.7; color: var(--faint); letter-spacing: 0.025em; }

.detail-panel .panel-head { padding: 18px 18px 15px; border-bottom: 1px solid var(--line); }
.detail-body {
  overflow-y: auto;
  padding: 16px 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.26) transparent;
}
.detail-intro { animation: detail-in 0.38s var(--ease) both; }
@keyframes detail-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.detail-intro .lead { margin-top: 11px; color: var(--muted); font-size: 10px; line-height: 1.8; letter-spacing: 0.03em; }
.overview-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 17px; }
.overview-stat { padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: rgba(var(--accent-rgb), 0.025); }
.overview-stat strong { display: block; font-family: var(--font-mono); font-size: 17px; font-weight: 400; color: var(--text); letter-spacing: -0.02em; }
.overview-stat strong small { margin-left: 2px; font-size: 8px; color: var(--muted); }
.overview-stat span { display: block; margin-top: 5px; color: var(--muted); font-size: 8.5px; letter-spacing: 0.08em; }
.zone-overview { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.zone-overview h4 { margin-bottom: 11px; font-size: 9px; font-weight: 500; letter-spacing: 0.13em; color: var(--muted); }
.zone-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 9.5px; color: var(--text); }
.zone-line i { width: 5px; height: 5px; border-radius: 50%; background: var(--zone-color, var(--accent)); box-shadow: 0 0 8px var(--zone-color, var(--accent)); }
.zone-line em { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 8px; font-style: normal; }
.overview-note { margin-top: 19px; padding: 11px 12px; border-left: 2px solid var(--accent); background: rgba(var(--accent-rgb), 0.045); font-size: 9px; line-height: 1.7; color: var(--muted); }
.overview-tip { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--faint); font-size: 8.5px; letter-spacing: 0.04em; }
.overview-tip span { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: blink 2.2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.detail-category { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-tag { display: inline-flex; align-items: center; gap: 6px; height: 21px; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--part-color) 35%, transparent); border-radius: 3px; color: var(--part-color); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.06em; }
.detail-code { color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.1em; }
.detail-hero { margin-top: 13px; }
.detail-hero h3 { font-size: 22px; font-weight: 500; letter-spacing: 0.03em; }
.detail-hero .en { margin-top: 4px; color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.14em; }
.detail-hero .spec-big { margin-top: 13px; color: var(--part-color); font-family: var(--font-mono); font-size: 18px; letter-spacing: 0.01em; }
.detail-summary { margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.8; letter-spacing: 0.02em; }
.spec-list { margin-top: 18px; border-top: 1px solid var(--line); }
.spec-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.spec-key { color: var(--faint); font-size: 8.5px; letter-spacing: 0.04em; }
.spec-val { color: var(--text); font-size: 9.5px; line-height: 1.55; }
.doc-ref { margin-top: 16px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 4px; background: rgba(var(--accent-rgb), 0.025); }
.doc-ref span { display: block; color: var(--faint); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.12em; }
.doc-ref p { margin-top: 5px; color: var(--muted); font-size: 8.5px; line-height: 1.6; }
.detail-actions { display: flex; gap: 6px; margin-top: 15px; }
.detail-actions button {
  flex: 1;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.detail-actions button:hover { color: var(--text); border-color: var(--line-strong); background: rgba(var(--accent-rgb), 0.05); }
.detail-actions button.primary { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.08); }
.detail-actions button.primary:hover { background: rgba(var(--accent-rgb), 0.14); }

.viewport-meta {
  position: absolute;
  z-index: 11;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.meta-left { left: 32px; }
.meta-right { right: 32px; gap: 16px; }
.meta-key { color: var(--accent); }
.mouse-hint { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mouse-icon, .wheel-icon, .pan-icon { position: relative; display: inline-block; width: 10px; height: 13px; border: 1px solid currentColor; border-radius: 5px; opacity: 0.8; }
.mouse-icon::before { content: ""; position: absolute; left: 50%; top: 2px; width: 1px; height: 3px; background: currentColor; transform: translateX(-50%); }
.wheel-icon::before { content: ""; position: absolute; left: 50%; top: 3px; width: 2px; height: 4px; border-radius: 1px; background: currentColor; transform: translateX(-50%); }
.pan-icon { border-radius: 3px; }

.compass {
  position: absolute;
  z-index: 11;
  right: 34px;
  top: 104px;
  width: 63px;
  height: 63px;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
  opacity: 0.8;
}
.compass-ring { position: absolute; inset: 9px; border: 1px solid var(--line); border-radius: 50%; }
.compass-ring::before, .compass-ring::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--line-strong); transform: translate(-50%, -50%); }
.compass-ring::before { width: 1px; height: 100%; }
.compass-ring::after { width: 100%; height: 1px; }
.compass-ring i { position: absolute; left: 50%; top: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); transform: translateX(-50%); }
.compass-n { position: absolute; top: -2px; font-family: var(--font-mono); font-size: 7px; color: var(--accent); }
.compass-caption { position: absolute; bottom: -12px; font-size: 7px; letter-spacing: 0.12em; white-space: nowrap; opacity: 0.6; }

.scalebar { position: absolute; z-index: 11; left: 32px; bottom: 49px; display: flex; align-items: center; gap: 6px; color: var(--faint); font-family: var(--font-mono); font-size: 7px; pointer-events: none; }
.scale-track { display: flex; gap: 0; height: 5px; border-bottom: 1px solid var(--line-strong); }
.scale-track i { width: 22px; height: 5px; border-left: 1px solid var(--line-strong); }
.scale-track i:last-child { border-right: 1px solid var(--line-strong); }
.scale-label { opacity: 0.8; }

.control-dock {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--dock);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform: translateX(-50%);
}
.control-dock button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.07em;
  transition: color 0.2s ease, background 0.2s ease;
}
.control-dock button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.control-dock button:hover { color: var(--text); background: rgba(var(--accent-rgb), 0.06); }
.control-dock button.is-on { color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.control-dock button.is-on::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); transform: translateX(-50%); }
.dock-divider { width: 1px; height: 17px; margin: 0 4px; background: var(--line); }
.mobile-only { display: none !important; }

.hint-strip {
  position: absolute;
  left: 50%;
  bottom: 80px;
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.hint-strip.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 7px); }
.hint-pulse { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 2s ease-in-out infinite; }
.hint-strip button { display: grid; width: 17px; height: 17px; place-items: center; color: var(--faint); font-size: 13px; line-height: 1; }
.hint-strip button:hover { color: var(--text); }

.tooltip {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 0.14s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tooltip.is-visible { opacity: 1; }
.tooltip .tt-name { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; white-space: nowrap; }
.tooltip .tt-spec { color: var(--muted); font-family: var(--font-mono); font-size: 8px; white-space: nowrap; }

.tour-card {
  position: absolute;
  left: 30px;
  bottom: 82px;
  z-index: 26;
  width: 280px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-strong);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: tour-in 0.4s var(--ease) both;
}
@keyframes tour-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.tour-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-top button { color: var(--faint); font-size: 18px; line-height: 1; }
.tour-top button:hover { color: var(--text); }
.tour-card h3 { margin-top: 9px; font-size: 16px; font-weight: 550; letter-spacing: 0.05em; }
.tour-card p { margin-top: 7px; color: var(--muted); font-size: 9.5px; line-height: 1.75; letter-spacing: 0.02em; }
.tour-progress { height: 2px; margin-top: 14px; background: var(--line); overflow: hidden; }
.tour-progress i { display: block; width: 25%; height: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width 0.4s var(--ease); }
.tour-actions { display: flex; gap: 6px; margin-top: 11px; }
.tour-actions button { flex: 1; height: 28px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 8.5px; letter-spacing: 0.06em; }
.tour-actions button:hover { color: var(--text); border-color: var(--line-strong); }
.tour-actions button.primary { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.08); }

.toast {
  position: absolute;
  left: 50%;
  bottom: 132px;
  z-index: 60;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 9px;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal.is-open { visibility: visible; opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 7, 12, 0.58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body.theme-light .modal-backdrop { background: rgba(226, 233, 237, 0.58); }
.modal-card {
  position: relative;
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.4s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.3) transparent;
}
.modal.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--line-strong); }
.modal-card h2 { margin-top: 10px; max-width: 620px; font-size: 30px; line-height: 1.25; font-weight: 500; letter-spacing: 0.03em; }
.modal-card h2 span { color: var(--muted); font-weight: 300; }
.modal-lead { max-width: 660px; margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.8; letter-spacing: 0.03em; }
.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 26px; }
.guide-grid article { min-height: 160px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(var(--accent-rgb), 0.022); }
.guide-grid article b { font-family: var(--font-mono); font-size: 10px; font-weight: 400; color: var(--accent); }
.guide-grid article h4 { margin-top: 24px; font-size: 11px; font-weight: 550; letter-spacing: 0.06em; }
.guide-grid article p { margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.75; }
.shortcut-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 21px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8.5px; }
.shortcut-row kbd { display: inline-grid; min-width: 18px; height: 18px; margin-right: 5px; padding: 0 4px; place-items: center; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 25px; }
.modal-actions button { height: 36px; padding: 0 20px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; transition: all 0.2s ease; }
.modal-actions button:hover { color: var(--text); border-color: var(--line-strong); }
.modal-actions button.primary { color: #031219; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.2); }
.modal-actions button.primary:hover { filter: brightness(1.08); }
body.theme-light .modal-actions button.primary { color: #fff; }

.info-card { width: min(880px, 100%); }
.info-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.info-metrics > div { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(var(--accent-rgb), 0.025); }
.info-metrics strong { display: block; font-family: var(--font-mono); font-size: 28px; font-weight: 400; letter-spacing: -0.03em; }
.info-metrics strong small { margin-left: 4px; font-size: 9px; color: var(--muted); }
.info-metrics span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: 0.08em; }
.info-columns { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.info-columns h4 { font-size: 10px; font-weight: 550; letter-spacing: 0.12em; color: var(--accent); }
.info-columns p, .info-columns li { margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.info-columns ul { margin: 0; padding: 0; list-style: none; }
.info-columns li { position: relative; padding-left: 13px; }
.info-columns li::before { content: ""; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05090e;
  transition: opacity 0.8s var(--ease), visibility 0.8s ease;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { width: min(330px, calc(100vw - 64px)); text-align: center; }
.loader-mark { position: relative; width: 54px; height: 54px; margin: 0 auto 22px; border: 1px solid rgba(92, 232, 255, 0.42); border-radius: 50%; box-shadow: 0 0 40px rgba(92, 232, 255, 0.12); }
.loader-mark::before, .loader-mark::after { content: ""; position: absolute; border-radius: 50%; }
.loader-mark::before { inset: 8px; border: 1px solid rgba(92, 232, 255, 0.2); border-top-color: #5ce8ff; animation: spin 1.7s linear infinite; }
.loader-mark::after { left: 50%; top: 50%; width: 6px; height: 6px; background: #5ce8ff; box-shadow: 0 0 15px #5ce8ff; transform: translate(-50%, -50%); }
.loader-mark span { position: absolute; left: 50%; top: -2px; width: 4px; height: 4px; border-radius: 50%; background: #5ce8ff; box-shadow: 0 0 8px #5ce8ff; transform: translateX(-50%); }
.loader-kicker { color: #5ce8ff; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.22em; }
.loader h2 { margin-top: 10px; color: #e9f4fb; font-size: 19px; font-weight: 400; letter-spacing: 0.1em; }
.loader-track { height: 2px; margin-top: 24px; background: rgba(92, 232, 255, 0.12); overflow: hidden; }
.loader-track i { display: block; width: 32%; height: 100%; background: #5ce8ff; box-shadow: 0 0 14px #5ce8ff; animation: loader-run 1.5s ease-in-out infinite; }
@keyframes loader-run { 0% { transform: translateX(-110%); } 100% { transform: translateX(340%); } }
.loader p { margin-top: 12px; color: #607e8d; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.07em; }

@media (max-width: 1280px) {
  .components-panel { width: 280px; left: 20px; }
  .detail-panel { width: 312px; right: 20px; }
  .topbar { padding: 20px 20px 0; }
  .meta-left { left: 22px; }
  .meta-right { right: 22px; }
  .compass { right: 22px; }
  .project-chip .chip-label { display: none; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .topbar { padding: 16px 16px 0; }
  .brand-mark { width: 32px; height: 32px; }
  .brand h1 { font-size: 16px; }
  .brand p { font-size: 8.5px; }
  .project-chip { display: none; }
  .components-panel, .detail-panel {
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    bottom: 86px;
    max-height: min(58vh, 470px);
    transform: translateY(calc(100% + 110px));
    opacity: 0;
    pointer-events: none;
  }
  .components-panel.is-open, .detail-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .panel-close { display: block; }
  .detail-panel { max-height: min(52vh, 440px); }
  .mobile-only { display: flex !important; }
  .meta-left, .meta-right, .scalebar, .compass, .hint-strip { display: none; }
  .control-dock { bottom: 14px; max-width: calc(100vw - 20px); overflow-x: auto; }
  .control-dock button { padding: 0 10px; }
  .control-dock button span { display: none; }
  .control-dock button svg { width: 18px; height: 18px; }
  .control-dock button.is-on::after { bottom: 2px; }
  .tour-card { left: 12px; right: 12px; bottom: 84px; width: auto; }
  #labels-layer, #leader-layer { opacity: 0.9; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .modal-card { padding: 24px; }
  .modal-card h2 { font-size: 24px; }
  .info-columns { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  .kicker { font-size: 7.5px; letter-spacing: 0.12em; }
  .brand h1 { font-size: 14px; letter-spacing: 0.02em; }
  .brand-copy p { display: none; }
  .theme-switch button { padding: 0 7px; font-size: 8.5px; }
  .theme-switch button svg { width: 11px; height: 11px; }
  .icon-btn { width: 32px; height: 32px; }
  .theme-switch { height: 32px; }
  .theme-switch button { height: 24px; }
  .part-label { min-width: 0; height: 34px; }
  .label-copy b { font-size: 9px; }
  .label-copy em { font-size: 7px; }
  .label-index { width: 22px; font-size: 7px; }
  .guide-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 20px; max-height: calc(100vh - 24px); }
  .modal-card h2 { font-size: 21px; }
  .modal-actions button { flex: 1; padding: 0 12px; }
  .info-metrics { grid-template-columns: 1fr; }
  .info-metrics strong { font-size: 23px; }
  .shortcut-row { gap: 9px; }
  .tour-card { bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.context-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.55;
  letter-spacing: 0.02em;
}
.context-line i {
  width: 4px;
  height: 4px;
  margin-top: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

