:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --ink: #171918;
  --muted: #686d68;
  --line: #dfe2dd;
  --line-strong: #c8cdc7;
  --red: #e94b4b;
  --red-soft: #fff0ee;
  --green: #177b68;
  --green-soft: #e7f5f1;
  --yellow: #e9a923;
  --yellow-soft: #fff6dc;
  --sidebar: #202422;
  --radius: 8px;
  --shadow: 0 12px 36px rgba(25, 32, 28, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}
button, a { font: inherit; }
button { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 252px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: var(--sidebar);
  color: #f5f6f4;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 8px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--red);
  border-radius: 8px;
}
.brand-mark svg { width: 23px; height: 23px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 2px; color: #aeb5af; font-size: 12px; }
.nav-list { display: grid; gap: 7px; margin-top: 42px; }
.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 6px;
  color: #abb2ac;
  transition: background-color 160ms ease, color 160ms ease;
}
.nav-link:hover, .nav-link.active { background: #303633; color: #fff; }
.nav-link.active::before { content: ""; width: 3px; height: 20px; margin-left: -12px; background: var(--red); border-radius: 0 3px 3px 0; }
.sidebar-note { display: flex; gap: 10px; margin-top: auto; padding: 15px 12px; border-top: 1px solid #39403c; }
.status-dot { width: 9px; height: 9px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: #55d6aa; box-shadow: 0 0 0 4px rgba(85, 214, 170, .12); }
.sidebar-note strong { display: block; font-size: 13px; }
.sidebar-note p { margin: 4px 0 0; color: #9da59f; font-size: 11px; line-height: 1.5; }

main { margin-left: 252px; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(244, 245, 242, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.breadcrumbs, .top-actions, .mode-badge { display: flex; align-items: center; }
.breadcrumbs { gap: 8px; color: var(--muted); font-size: 13px; }
.breadcrumbs svg { width: 14px; }
.breadcrumbs strong { color: var(--ink); }
.top-actions { gap: 10px; }
.mode-badge { gap: 7px; min-height: 34px; padding: 0 12px; background: var(--green-soft); color: var(--green); border: 1px solid #c9e6de; border-radius: 999px; font-size: 12px; font-weight: 700; }
.mode-badge svg { width: 15px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); cursor: pointer; }
.mobile-menu { display: none; }

.workspace, .results-band, .standards-band, .boundaries-band { padding: 54px clamp(24px, 5vw, 72px); }
.workspace { max-width: 1510px; margin: 0 auto; }
.intro-row { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--red); font-size: 11px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 66px); line-height: 1; font-weight: 780; }
.intro-copy { max-width: 720px; margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.agent-state { display: flex; align-items: center; gap: 11px; min-width: 220px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pulse { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.agent-state strong, .agent-state small { display: block; }
.agent-state strong { font-size: 13px; }
.agent-state small { margin-top: 4px; color: var(--muted); font-size: 11px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 42px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.metric { min-height: 126px; padding: 21px; background: var(--surface); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: 12px; }
.metric strong { display: block; margin: 12px 0 9px; font-size: 24px; }
.metric small { font-size: 11px; line-height: 1.5; }

.demo-layout { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(480px, 1.45fr); gap: 20px; margin-top: 20px; }
.control-panel, .run-panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; max-width: 1370px; margin: 0 auto 28px; }
.section-heading.compact { align-items: center; margin: 0 0 22px; }
.section-heading h2 { margin: 0; font-size: 28px; line-height: 1.2; }
.section-heading.compact h2 { font-size: 18px; }
.section-heading p { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.7; }
.safe-label, .run-status { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.safe-label { background: var(--green-soft); color: var(--green); }
.safe-label svg { width: 13px; }
.scenario-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 4px; background: #eef0ed; border-radius: 7px; }
.scenario-button { min-height: 38px; padding: 7px 8px; background: transparent; border: 0; border-radius: 5px; color: var(--muted); font-size: 12px; cursor: pointer; }
.scenario-button.active { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(20, 24, 22, .08); }
.input-preview { margin-top: 18px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.preview-header { display: flex; justify-content: space-between; padding: 12px 14px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.preview-header span:last-child { color: var(--green); font-weight: 700; }
.input-preview dl { margin: 0; }
.input-preview dl div { display: flex; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); }
.input-preview dt { color: var(--muted); }
.input-preview dd { margin: 0; font-weight: 700; }
.run-button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 18px; background: var(--red); border: 1px solid var(--red); border-radius: 7px; color: white; font-weight: 750; cursor: pointer; transition: transform 120ms ease, background-color 120ms ease; }
.run-button:hover { background: #d83e3e; }
.run-button:active { transform: translateY(1px); }
.run-button:disabled { background: #b9bdb9; border-color: #b9bdb9; cursor: wait; }
.control-hint { display: flex; gap: 7px; margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.control-hint svg { width: 14px; flex: 0 0 auto; }
.run-status { background: #f0f1ef; color: var(--muted); }
.run-status span { width: 7px; height: 7px; border-radius: 50%; background: #9da29e; }
.run-status.running { background: var(--yellow-soft); color: #8f6510; }
.run-status.running span { background: var(--yellow); animation: blink 900ms infinite; }
.run-status.done { background: var(--green-soft); color: var(--green); }
.run-status.done span { background: var(--green); }
@keyframes blink { 50% { opacity: .3; } }
.pipeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pipeline li { position: relative; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; min-height: 61px; padding: 7px 0; }
.pipeline li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 49px; width: 1px; height: 25px; background: var(--line-strong); }
.step-icon { width: 38px; height: 38px; display: grid; place-items: center; z-index: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; color: #7a807b; }
.pipeline strong, .pipeline small { display: block; }
.pipeline strong { font-size: 13px; }
.pipeline small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.pipeline em { color: #929793; font-size: 11px; font-style: normal; }
.pipeline li.active .step-icon { background: var(--yellow-soft); border-color: #efd88e; color: #9e6a00; }
.pipeline li.active em { color: #9e6a00; font-weight: 700; }
.pipeline li.complete .step-icon { background: var(--green-soft); border-color: #b9dfd5; color: var(--green); }
.pipeline li.complete::after { background: #8fcbbb; }
.pipeline li.complete em { color: var(--green); font-weight: 700; }

.results-band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tab-bar { max-width: 1370px; margin: 0 auto; display: flex; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-button { position: relative; min-height: 46px; padding: 0 2px; background: transparent; border: 0; color: var(--muted); white-space: nowrap; cursor: pointer; }
.tab-button.active { color: var(--ink); font-weight: 750; }
.tab-button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--red); }
.tab-panel { display: none; max-width: 1370px; min-height: 260px; margin: 0 auto; padding-top: 28px; }
.tab-panel.active { display: block; }
.keyword-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; max-width: 600px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.keyword-summary div { padding: 16px; background: var(--surface-2); }
.keyword-summary span, .keyword-summary strong { display: block; }
.keyword-summary span { color: var(--muted); font-size: 11px; }
.keyword-summary strong { margin-top: 7px; font-size: 21px; }
.keyword-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.keyword-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: #3f4541; font-size: 12px; }
.keyword-chip.primary { background: var(--red-soft); border-color: #f2c9c4; color: #a43333; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); color: var(--muted); font-size: 11px; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.result-status { display: inline-flex; min-height: 25px; align-items: center; padding: 0 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; }
.analysis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.analysis-item { min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.analysis-item span { color: var(--red); font-size: 11px; font-weight: 800; }
.analysis-item h3 { margin: 10px 0 8px; font-size: 16px; }
.analysis-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.review-list { display: grid; gap: 9px; }
.review-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; min-height: 62px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 7px; }
.review-item > i { color: var(--yellow); }
.review-item strong, .review-item small { display: block; }
.review-item strong { font-size: 13px; }
.review-item small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.review-item em { color: #9a6d14; font-size: 11px; font-style: normal; }

.standards-band { background: var(--bg); }
.standards-grid { max-width: 1370px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.standards-grid article { position: relative; min-height: 225px; padding: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.standards-grid .number { position: absolute; top: 13px; right: 16px; color: #e5e8e4; font-size: 42px; font-weight: 800; }
.standards-grid svg { width: 25px; height: 25px; color: var(--red); }
.standards-grid h3 { margin: 36px 0 10px; font-size: 17px; }
.standards-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }

.boundaries-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, .9fr); gap: 70px; align-items: center; background: #1e2320; color: #f3f5f2; }
.boundary-copy h2 { max-width: 620px; margin: 0; font-size: clamp(30px, 4vw, 48px); }
.boundary-copy > p { max-width: 650px; margin: 20px 0 0; color: #b9c0ba; line-height: 1.8; }
.privacy-seal { display: flex; align-items: center; gap: 14px; max-width: 560px; margin-top: 30px; padding: 17px; background: #2c332f; border: 1px solid #3b453f; border-radius: 7px; }
.privacy-seal > svg { width: 30px; height: 30px; color: #68d5b2; }
.privacy-seal strong, .privacy-seal small { display: block; }
.privacy-seal small { margin-top: 5px; color: #aab3ad; }
.boundary-list { display: grid; gap: 10px; }
.boundary-list div { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; background: #292f2c; border: 1px solid #39413d; border-radius: 7px; color: #d7dcd8; }
.boundary-list svg { flex: 0 0 auto; color: #ff7b70; }
.boundary-list div:last-child svg { color: #68d5b2; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px clamp(24px, 5vw, 72px); background: #171a18; color: #dfe3df; border-top: 1px solid #313632; }
footer strong, footer span { display: block; }
footer span, footer p { color: #929a94; font-size: 11px; }
footer span { margin-top: 4px; }
footer p { margin: 0; }

@media (max-width: 1120px) {
  .sidebar { width: 220px; }
  main { margin-left: 220px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-layout { grid-template-columns: 1fr; }
  .standards-grid { grid-template-columns: repeat(2, 1fr); }
  .boundaries-band { grid-template-columns: 1fr; gap: 38px; }
}

@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); width: min(84vw, 290px); transition: transform 180ms ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  main { margin-left: 0; }
  .mobile-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .42); }
  body.menu-open .mobile-scrim { display: block; }
  .mobile-menu { display: grid; }
  .topbar { height: 58px; padding: 0 16px; }
  .breadcrumbs span, .breadcrumbs svg, .mode-badge { display: none; }
  .workspace, .results-band, .standards-band, .boundaries-band { padding: 38px 18px; }
  .intro-row { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 42px; }
  .intro-copy { font-size: 14px; }
  .agent-state { width: 100%; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 118px; padding: 17px; }
  .metric strong { font-size: 20px; }
  .control-panel, .run-panel { padding: 18px; }
  .scenario-control { grid-template-columns: 1fr; }
  .pipeline li { grid-template-columns: 38px 1fr; }
  .pipeline em { grid-column: 2; margin-top: -7px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .section-heading h2 { font-size: 24px; }
  .section-heading.compact { flex-direction: row; align-items: center; }
  .keyword-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analysis-grid, .standards-grid { grid-template-columns: 1fr; }
  .boundaries-band { grid-template-columns: 1fr; }
  .boundary-list div { min-height: 60px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .keyword-summary { grid-template-columns: 1fr; }
  .keyword-summary div { display: flex; align-items: center; justify-content: space-between; }
  .keyword-summary strong { margin: 0; }
  .run-status { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
