
:root {
  --bg: #050505;
  --bg-2: #101010;
  --panel: rgba(17, 17, 17, 0.88);
  --panel-strong: rgba(12, 12, 12, 0.96);
  --card: rgba(26, 26, 26, 0.92);
  --line: rgba(220, 38, 38, 0.16);
  --line-strong: rgba(220, 38, 38, 0.32);
  --text: #f7f7f7;
  --muted: #b7b7b7;
  --muted-2: #8a8a8a;
  --red: #cf1f1f;
  --red-2: #ff4b4b;
  --green: #22c55e;
  --yellow: #f59e0b;
  --blue: #38bdf8;
  --cyan: #06b6d4;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --radius: 22px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(207, 31, 31, 0.18), transparent 30%),
    radial-gradient(circle at 78% 0%, rgba(255, 75, 75, 0.12), transparent 24%),
    radial-gradient(circle at 75% 90%, rgba(207, 31, 31, 0.08), transparent 30%),
    linear-gradient(145deg, #040404 0%, #090909 42%, #050505 100%);
}
button, input, select, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, .step-item:focus-visible, .seg-btn:focus-visible {
  outline: 3px solid rgba(255, 75, 75, 0.48);
  outline-offset: 2px;
}
.shell { display: grid; grid-template-columns: 350px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: auto; padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(18px);
}
.brand { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; margin-bottom: 20px; }
.brand-logo {
  width: 72px; height: 72px; object-fit: cover; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 36px rgba(207,31,31,0.25);
  background: #111;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 22px; line-height: 1.08; letter-spacing: -0.03em; }
h2 { margin-bottom: 6px; font-size: clamp(24px, 3vw, 40px); line-height: 1.03; letter-spacing: -0.05em; }
h3 { margin-bottom: 8px; font-size: 17px; letter-spacing: -0.02em; }
.kicker {
  margin-bottom: 6px; color: var(--red-2); text-transform: uppercase;
  font-size: 11px; font-weight: 800; letter-spacing: 0.11em;
}
.subtitle { color: var(--muted); margin-bottom: 0; line-height: 1.45; max-width: 880px; }
.small { font-size: 12px; line-height: 1.5; }
.muted { color: var(--muted); }
.brand-link {
  display: inline-flex; margin-top: 8px; font-size: 12px; font-weight: 700;
  color: #ffd7d7; text-decoration: none; border-bottom: 1px solid rgba(255,75,75,0.35);
}
.language-switch, .part-switch, .sample-card, .operator-note, .side-footer {
  border: 1px solid var(--line); background: rgba(17,17,17,0.88); border-radius: 18px; padding: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.20);
}
.language-switch { margin-bottom: 16px; }
.part-switch { margin-bottom: 16px; }
.lang-select {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(28,28,28,0.95);
  color: var(--text);
  padding: 0 14px;
  font-weight: 800;
  outline: none;
}
.lang-select:focus { border-color: rgba(255,75,75,0.68); box-shadow: 0 0 0 4px rgba(255,75,75,0.10); }
.segmented { display: flex; gap: 8px; margin-bottom: 8px; }
.seg-btn {
  flex: 1; min-height: 42px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(28,28,28,0.9); color: var(--muted); font-weight: 800;
}
.seg-btn.active {
  color: white; border-color: rgba(255, 75, 75, 0.48);
  background: linear-gradient(135deg, var(--red), #7f1010);
  box-shadow: 0 10px 20px rgba(207,31,31,0.22);
}
.sample-card { display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin-bottom: 18px; }
.sample-icon {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: white; background: linear-gradient(135deg, var(--red), #8f1111); font-weight: 900;
}
.sample-card span, .operator-note span, .side-footer span {
  display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45;
}
.operator-note { margin-top: 18px; }
.side-footer { margin-top: 18px; }
.side-footer a { color: #ffd7d7; font-size: 13px; font-weight: 800; text-decoration: none; }
.step-nav { display: grid; gap: 8px; }
.step-item {
  width: 100%; text-align: left; border: 1px solid transparent; background: transparent; color: var(--muted);
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  padding: 10px; border-radius: 16px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, color 160ms ease;
}
.step-item:hover { background: rgba(35, 35, 35, 0.92); color: var(--text); }
.step-item.active {
  border-color: rgba(255, 75, 75, 0.42);
  background: linear-gradient(135deg, rgba(207, 31, 31, 0.18), rgba(127, 16, 16, 0.14));
  color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.step-num {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06); font-weight: 800; color: var(--muted);
}
.step-item.active .step-num { color: white; background: linear-gradient(135deg, var(--red), #7f1010); }
.step-title { display: block; font-size: 13px; font-weight: 800; color: inherit; }
.step-cn { display: block; margin-top: 2px; font-size: 11px; color: var(--muted-2); }
.step-state { width: 9px; height: 9px; border-radius: 99px; background: rgba(255,255,255,0.12); }
.step-item.complete .step-state { background: var(--green); box-shadow: 0 0 0 5px rgba(34,197,94,0.08); }
.step-item.active .step-state { background: var(--red-2); box-shadow: 0 0 0 5px rgba(255,75,75,0.12); }
.main { min-width: 0; padding: 26px; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.btn, .chip {
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text);
  background: rgba(19, 19, 19, 0.92); min-height: 42px; padding: 0 15px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18); text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary {
  border-color: rgba(255, 75, 75, 0.48);
  background: linear-gradient(135deg, var(--red), #7f1010); color: white; font-weight: 900;
}
.website-btn { background: rgba(37, 37, 37, 0.92); color: #ffeaea; }
.btn.ghost:hover, .chip:hover { border-color: rgba(255,75,75,0.60); }
.chip { min-height: 34px; padding: 0 12px; color: var(--muted); font-size: 12px; }
.chip.active { color: white; background: var(--red); border-color: var(--red); font-weight: 900; }
.demo-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr); gap: 18px; align-items: stretch; }
.viewport-card, .info-panel, .panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); overflow: hidden;
}
.viewport-card { min-height: 640px; display: flex; flex-direction: column; }
.viewport-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); background: rgba(12, 12, 12, 0.52);
}
.viewport-header span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.viewport-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
#scene { width: 100%; height: 536px; display: block; flex: 1; background: #090909; }
.timeline { height: 8px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress-bar { height: 100%; width: 10%; background: linear-gradient(90deg, var(--red), var(--red-2)); transition: width 220ms ease; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.swatch { width: 10px; height: 10px; border-radius: 99px; box-shadow: 0 0 0 3px rgba(255,255,255,0.04); }
.info-panel { display: grid; gap: 0; align-content: start; }
.info-section { padding: 17px; border-bottom: 1px solid var(--line); }
.info-section:last-child { border-bottom: 0; }
.info-section.highlight { background: linear-gradient(145deg, rgba(207, 31, 31, 0.16), rgba(75, 0, 0, 0.08)); }
.info-section p { color: var(--muted); line-height: 1.55; margin-bottom: 0; }
.speaker-line { color: var(--text) !important; font-size: 15px; line-height: 1.6 !important; }
.algorithm-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.metric-list { display: grid; gap: 10px; }
.metric-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 11px 12px; border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; background: rgba(22, 22, 22, 0.72); }
.metric-item span { color: var(--muted); font-size: 12px; }
.metric-item strong { font-size: 15px; }
.metric-ok strong { color: var(--green); }
.metric-warn strong { color: var(--yellow); }
.metric-fail strong { color: var(--red-2); }
.bottom-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); gap: 18px; margin-top: 18px; }
.panel { padding: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); background: rgba(12, 12, 12, 0.42); }
.panel-head h3 { margin: 0; }
.table-wrap { padding: 16px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(25,25,25,0.5); }
td { color: #f7f7f7; }
.status-pill { display: inline-flex; min-width: 64px; justify-content: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 900; letter-spacing: 0.03em; }
.status-pass { background: rgba(34,197,94,0.16); color: #86efac; }
.status-warn, .status-review { background: rgba(245,158,11,0.16); color: #fcd34d; }
.status-fail { background: rgba(239,68,68,0.16); color: #fca5a5; }
.status-info { background: rgba(56,189,248,0.16); color: #7dd3fc; }
.status-badge { border: 1px solid var(--line-strong); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 12px; }
.flow-summary { padding: 16px; display: grid; gap: 9px; }
.flow-row { display: grid; grid-template-columns: 25px 1fr; gap: 10px; align-items: start; color: var(--muted); font-size: 13px; line-height: 1.4; }
.flow-dot { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.06); color: var(--muted); font-size: 11px; font-weight: 900; }
.flow-row.done .flow-dot { background: rgba(34,197,94,0.18); color: #86efac; }
.flow-row.active .flow-dot { background: rgba(255,75,75,0.16); color: #ffd7d7; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 340px; padding: 12px 14px; border-radius: 14px; background: rgba(17,17,17,0.96); color: #f8fafc; border: 1px solid rgba(255,75,75,0.3); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; z-index: 40; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1220px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .demo-grid, .bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .main { padding: 16px; }
  .topbar, .viewport-header, .panel-head { flex-direction: column; align-items: stretch; }
  #scene { height: 440px; }
}
