:root {
  --paper: #f0f0f0;
  --ink: #1a1a1a;
  --blue: #0090d8;
  --teal: #009090;
  --green: #2fa36b;
  --yellow: #f0d800;
  --coral: #d83048;
  --white: #fffaf0;
  --line: #1a1a1a;
  --muted: #626262;
  --radius: 28px;
  --shadow: 0 14px 0 rgba(26, 26, 26, 0.08);
  --eazo-safe-area-top: max(56px, env(safe-area-inset-top, 0px));
  --eazo-safe-area-bottom: max(34px, env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
.app {
  min-height: 100svh;
  padding: var(--eazo-safe-area-top) 14px var(--eazo-safe-area-bottom);
  position: relative;
  isolation: isolate;
}
.app:before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(26, 26, 26, 0.045) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(rgba(26, 26, 26, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--paper);
}
.cut {
  position: fixed;
  z-index: -1;
  border: 2px solid #111;
  transform: rotate(var(--r));
  opacity: 0.9;
  pointer-events: none;
}
.cut.a { width: 112px; height: 74px; background: var(--yellow); left: -24px; top: 150px; --r: -6deg; }
.cut.b { width: 118px; height: 120px; background: #9fe0ff; right: -35px; top: 300px; --r: 5deg; }
.cut.c { width: 98px; height: 64px; background: #ffb0a0; right: 20px; bottom: 150px; --r: -8deg; }
.cut.d { width: 72px; height: 72px; background: #73d271; left: 28px; bottom: 240px; --r: 7deg; }

.header { display: grid; gap: 12px; margin-bottom: 12px; }
.brand {
  border: 2px solid var(--line);
  background: var(--white);
  border-radius: 34px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.brand-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.pill { border: 2px solid #111; border-radius: 999px; padding: 6px 10px; background: #fff; font-size: 11px; letter-spacing: 0.08em; font-weight: 900; }
.pill.blue { background: var(--blue); color: #fff; }
.pill.green { background: var(--green); color: #fff; }
.pill.coral { background: var(--coral); color: #fff; }
.pill.yellow { background: var(--yellow); }
.lang-select {
  border: 2px solid #111;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 8px;
  max-width: 118px;
}
h1 { font-size: clamp(24px, 8.6vw, 62px); line-height: 0.92; margin: 14px 0 10px; letter-spacing: -0.04em; font-weight: 950; text-transform: uppercase; }
html[lang="zh-CN"] h1 { font-size: clamp(38px, 13vw, 76px); letter-spacing: -0.06em; }
h1 em { display: block; font-style: normal; color: var(--blue); margin-top: 2px; }
.motto { font-size: 17px; line-height: 1.3; margin: 0; font-weight: 800; max-width: 18em; }
.stamp {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.18em;
  font-weight: 900;
  background: var(--yellow);
  border: 2px solid #111;
  border-radius: 14px;
  padding: 6px 8px;
  transform: rotate(4deg);
  text-align: center;
}
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric {
  min-height: 92px;
  border: 2px solid #111;
  border-radius: 26px;
  padding: 12px;
  background: #fff;
  box-shadow: 7px 7px 0 #111;
  position: relative;
  overflow: hidden;
}
.metric.blue { background: var(--blue); color: #fff; }
.metric.yellow { background: var(--yellow); }
.metric.white { background: #fff; }
.metric.coral { background: var(--coral); color: #fff; }
.num { font-size: 42px; line-height: 0.9; font-weight: 1000; letter-spacing: -0.08em; }
.label { font-size: 11px; letter-spacing: 0.1em; font-weight: 950; text-transform: uppercase; margin-top: 8px; }

.main { display: grid; gap: 12px; }
.panel { border: 2px solid #111; border-radius: 30px; background: #fff; padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 1000; letter-spacing: 0.1em; text-transform: uppercase; }
.panel-title small { font-size: 10px; opacity: 0.7; margin-left: 6px; }
.badge { background: #111; color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 11px; white-space: nowrap; }

/* ---- Map ---- */
.map { position: relative; border: 2px solid #111; border-radius: 22px; background: #fbfbf4; overflow: hidden; min-height: 380px; touch-action: none; }
.map-stage { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
#mapLines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#mapNodes { position: absolute; inset: 0; }
.node {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid #111;
  border-radius: 14px;
  padding: 7px 9px;
  min-width: 108px;
  text-align: center;
  background: #fff;
  box-shadow: 4px 4px 0 rgba(26, 26, 26, 0.9);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.15;
}
.node strong { display: block; font-size: 13px; font-weight: 950; }
.node span { display: block; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; opacity: 0.75; margin-top: 2px; text-transform: uppercase; }
.node:hover { transform: translate(-50%, -50%) scale(1.06); }
.node.active { box-shadow: 0 0 0 3px #111, 6px 6px 0 rgba(26, 26, 26, 0.9); }
.node.lv-core { background: var(--blue); color: #fff; }
.node.lv-integrate { background: var(--green); color: #fff; }
.node.lv-split { background: var(--coral); color: #fff; }
.node.lv-develop { background: var(--yellow); }
.node.lv-tech { background: #fff; }
.region-label {
  position: absolute;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.map-controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 3; }
.map-controls button {
  border: 2px solid #111;
  border-radius: 999px;
  background: #fff;
  font-weight: 1000;
  font-size: 16px;
  width: 34px;
  height: 34px;
  box-shadow: 3px 3px 0 #111;
}
.map-controls button:last-child { width: auto; font-size: 11px; padding: 0 10px; letter-spacing: 0.05em; }
.map-controls button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111; }
.map-hint { position: absolute; left: 10px; bottom: 8px; z-index: 3; font-size: 10px; font-weight: 800; color: var(--muted); background: rgba(255, 255, 255, 0.85); border-radius: 8px; padding: 4px 8px; }

/* ---- Tabs & cards ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  border: 2px solid #111;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
  padding: 7px 12px;
  letter-spacing: 0.04em;
}
.tabs button.active { background: #111; color: #fff; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.concept {
  border: 2px solid #111;
  border-radius: 20px;
  background: #fff;
  padding: 12px;
  text-align: left;
  box-shadow: 5px 5px 0 rgba(26, 26, 26, 0.9);
  transition: transform 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.concept:hover { transform: translateY(-2px); }
.concept.active { box-shadow: 0 0 0 3px #111, 5px 5px 0 rgba(26, 26, 26, 0.9); }
.concept h3 { margin: 0; font-size: 16px; font-weight: 950; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #111; flex: none; }
.dot.lv-core { background: var(--blue); }
.dot.lv-integrate { background: var(--green); }
.dot.lv-split { background: var(--coral); }
.dot.lv-develop { background: var(--yellow); }
.dot.lv-tech { background: #fff; }
.concept p { margin: 0; font-size: 12.5px; line-height: 1.45; color: #333; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Matrix ---- */
.matrix-sub { margin: 0 0 12px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; }
.matrix-wrap { display: grid; grid-template-columns: 46px 1fr; gap: 6px; }
.matrix-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.matrix-cols .col-label { font-size: 11px; font-weight: 950; text-align: center; border-bottom: 2px dashed #111; padding-bottom: 6px; letter-spacing: 0.02em; }
.matrix { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.row-label { display: flex; align-items: center; justify-content: flex-end; font-size: 11px; font-weight: 950; text-align: right; border-right: 2px dashed #111; padding-right: 6px; letter-spacing: 0.02em; }
.cell {
  border: 2px solid #111;
  border-radius: 12px;
  min-height: 52px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  transition: transform 0.1s ease;
}
.cell:hover { transform: scale(1.04); }
.cell.selected { box-shadow: 0 0 0 3px #111; }
.cell .dots { display: flex; gap: 3px; }
.cell .dotp { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #111; }
.cell .dotp.on { background: var(--coral); }
.cell .cell-code { font-size: 9px; font-weight: 900; color: var(--muted); letter-spacing: 0.05em; }
.matrix-note { margin-top: 12px; font-size: 12.5px; line-height: 1.5; font-weight: 700; border: 2px solid #111; border-radius: 16px; background: #fff; padding: 10px 12px; min-height: 46px; }
.matrix-note b { background: var(--yellow); padding: 1px 6px; border-radius: 6px; }

/* ---- Chapters ---- */
.chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chapter {
  border: 2px solid #111;
  border-radius: 20px;
  background: #fff;
  padding: 12px;
  text-align: left;
  box-shadow: 5px 5px 0 rgba(26, 26, 26, 0.9);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.chapter:hover { transform: translateY(-2px); }
.chapter.active { box-shadow: 0 0 0 3px #111, 5px 5px 0 rgba(26, 26, 26, 0.9); }
.ch-top { display: flex; align-items: center; gap: 8px; }
.ch-num {
  width: 34px;
  height: 34px;
  flex: none;
  border: 2px solid #111;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 1000;
  font-size: 15px;
  background: var(--yellow);
}
.chapter:nth-child(3n) .ch-num { background: #9fe0ff; }
.chapter:nth-child(3n + 1) .ch-num { background: #ffb0a0; }
.ch-title { font-size: 14px; font-weight: 950; line-height: 1.25; }
.ch-desc { font-size: 12px; line-height: 1.45; color: #444; }
.track { display: block; height: 8px; border: 2px solid #111; border-radius: 99px; overflow: hidden; background: #fff; }
.track i { display: block; height: 100%; background: var(--blue); width: 0; }

/* ---- Drawer ---- */
.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--white);
  border: 2px solid #111;
  border-radius: 30px 30px 0 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 84svh;
  overflow-y: auto;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.25);
}
.drawer.open { transform: translateY(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.drawer-head h2 { margin: 8px 0 0; font-size: 34px; font-weight: 1000; letter-spacing: -0.04em; line-height: 1; }
.close {
  border: 2px solid #111;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 22px;
  font-weight: 900;
  background: #fff;
  box-shadow: 4px 4px 0 #111;
  flex: none;
}
.close:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111; }
.quote {
  border: 2px solid #111;
  border-radius: 18px;
  background: var(--yellow);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
  margin-bottom: 14px;
}
.def-label { font-size: 11px; font-weight: 1000; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.drawer-def { margin: 0 0 14px; font-size: 15px; line-height: 1.65; }
.detail-grid { display: grid; gap: 10px; }
.detail-card { border: 2px solid #111; border-radius: 18px; background: #fff; padding: 12px 14px; }
.detail-card b { display: block; font-size: 11px; font-weight: 1000; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; color: var(--muted); }
.detail-card ul { margin: 0; padding-left: 18px; }
.detail-card li { font-size: 13.5px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid #111;
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 900;
  padding: 6px 12px;
}
.chip:hover { background: #111; color: #fff; }
.chip.coral:hover { background: var(--coral); }
.chip.green:hover { background: var(--green); }
.chip.blue:hover { background: var(--blue); }
.chip.yellow:hover { background: var(--yellow); color: #111; }
.outline-list { margin: 0; padding-left: 18px; }
.outline-list li { font-size: 13.5px; line-height: 1.55; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--eazo-safe-area-bottom) + 10px);
  transform: translate(-50%, 20px);
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.panel, .metric, .brand { animation: pop 0.42s both; }
.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }

@media (min-width: 760px) {
  .app { padding-left: 22px; padding-right: 22px; }
  .header { grid-template-columns: 1.15fr 0.85fr; align-items: stretch; }
  .metrics { height: 100%; }
  .metric { min-height: 120px; }
  .main { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr); align-items: start; }
  .span { grid-column: 1 / -1; }
  .map { min-height: 560px; }
  .drawer { left: auto; right: 24px; bottom: 24px; width: min(480px, 42vw); border-radius: 30px; max-height: 84svh; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chapter-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
