:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --ink: #1a2230;
  --ink-2: #5a6678;
  --ink-3: #8a95a5;
  --line: #e2e8f0;
  --brand: #185FA5;
  --brand-2: #378ADD;
  --brand-soft: #E6F1FB;
  --accent: #0F6E56;
  --warn: #993C1D;
  --purple: #534AB7;
  --shadow: 0 1px 3px rgba(16, 32, 56, .06), 0 8px 24px rgba(16, 32, 56, .04);
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: .5px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  font-size: 13px; color: var(--ink-2); padding: 6px 11px; border-radius: 8px;
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--brand); text-decoration: none; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0d3b66 0%, #185FA5 55%, #2f7fd1 100%);
  color: #fff; overflow: hidden; position: relative;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -40px;
  width: 420px; height: 420px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 58px; position: relative; z-index: 1; }
.crumb { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; opacity: .8; margin-bottom: 14px; }
.hero h1 { margin: 0 0 10px; font-size: 38px; line-height: 1.25; letter-spacing: -.5px; }
.hero .sub { font-size: 17px; opacity: .92; margin-bottom: 24px; }
.hero .tags { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .tags span {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
}
.hero-stats { display: flex; gap: 36px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats div .n { font-size: 26px; font-weight: 700; display: block; }
.hero-stats div .l { font-size: 12px; opacity: .8; }

/* ===== Section ===== */
section { padding: 54px 0 10px; }
.sec-head { margin-bottom: 26px; }
.sec-kicker { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.sec-head h2 { margin: 6px 0 8px; font-size: 26px; letter-spacing: -.3px; }
.sec-head p { margin: 0; color: var(--ink-2); max-width: 760px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pad { padding: 22px 24px; }

/* ===== Method / V-model ===== */
.vmodel { display: grid; grid-template-columns: 1fr 1fr; gap: 0; position: relative; }
.vm-col { padding: 18px 22px; }
.vm-col.left { border-right: 2px solid var(--brand-soft); }
.vm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; background: var(--surface-2);
  margin-bottom: 9px; font-size: 13px;
}
.vm-row:last-child { margin-bottom: 0; }
.vm-row .ph { font-weight: 600; color: var(--brand); min-width: 88px; }
.vm-row .tx { color: var(--ink-2); }
.vm-row .lv { margin-left: auto; font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); padding: 1px 7px; border-radius: 12px; }
.vm-legend { display: flex; gap: 20px; font-size: 12px; color: var(--ink-2); margin-bottom: 14px; }
.vm-legend b { color: var(--ink); }

/* ===== Hierarchy tabs ===== */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: .15s;
}
.tab:hover { border-color: var(--brand-2); }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab .lvl { opacity: .7; font-weight: 500; margin-right: 4px; }

.hier-desc {
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  padding: 12px 16px; border-radius: 0 10px 10px 0; font-size: 13px; color: #0d3b66; margin-bottom: 16px;
}
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 16px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
  cursor: default;
}
.hcard:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.hcard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hcard .nm { font-weight: 600; font-size: 14px; }
.hcard .tg { font-size: 11px; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.hcard .nt { color: var(--ink-2); font-size: 12px; margin-top: 7px; line-height: 1.55; }

/* ===== Signal flow ===== */
.flow-wrap { overflow-x: auto; padding: 4px 0 8px; }
.flow-svg { display: block; min-width: 900px; margin: 0 auto; }
.flow-note { background: var(--surface-2); border-radius: 10px; padding: 13px 16px; font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.flow-note b { color: var(--ink); }
.stage-dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* ===== CPIOM table ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--ink-2); font-weight: 600; background: var(--surface-2); font-size: 12px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--brand); font-size: 12px; }
.tbl .ata-chip { font-size: 11px; color: var(--ink-2); background: var(--surface-2); padding: 1px 8px; border-radius: 12px; }

/* ===== Safety ===== */
.safety-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 12px; font-weight: 600; }
.b-cat { background: #FCEBEB; color: #A32D2D; }
.b-haz { background: #FAECE7; color: #993C1D; }
.b-maj { background: #FAEEDA; color: #854F0B; }
.b-min { background: #EAF3DE; color: #3B6D11; }
.fta-top {
  background: #FCEBEB; border: 1px solid #F09595; color: #791F1F;
  padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; text-align: center;
}
.fta-gate {
  text-align: center; color: var(--ink-2); font-size: 13px; margin: 6px 0 14px;
}
.fta-gate b { color: var(--warn); }
.fta-leaves { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.leaf { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.leaf .n { font-weight: 600; font-size: 13px; }
.leaf .t { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.leaf .m { font-size: 12px; color: var(--accent); margin-top: 7px; }

/* ===== ATA grid ===== */
.ata-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.ata {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.ata .c { font-family: ui-monospace, monospace; font-size: 12px; color: var(--brand); font-weight: 700; }
.ata .n { font-size: 13px; font-weight: 600; margin: 3px 0; }
.ata .s { font-size: 11px; color: var(--ink-3); line-height: 1.45; }

/* ===== Notes / footer ===== */
.callout {
  background: #FAEEDA; border: 1px solid #FAC775; color: #633806;
  border-radius: 12px; padding: 16px 18px; font-size: 13px; margin-top: 18px;
}
.callout b { color: #412402; }
footer {
  margin-top: 60px; border-top: 1px solid var(--line); background: var(--surface);
  padding: 28px 24px 40px; color: var(--ink-2); font-size: 12px;
}
.foot-inner { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-inner b { color: var(--ink); }

.to-top {
  position: fixed; right: 22px; bottom: 22px; width: 40px; height: 40px;
  border-radius: 50%; background: var(--brand); color: #fff; border: none;
  font-size: 18px; cursor: pointer; box-shadow: var(--shadow); opacity: .9;
}
.to-top:hover { opacity: 1; }

@media (max-width: 720px) {
  .hero h1 { font-size: 28px; }
  .vmodel { grid-template-columns: 1fr; }
  .vm-col.left { border-right: none; border-bottom: 2px solid var(--brand-soft); }
  .nav { display: none; }
  section { padding: 40px 0 6px; }
}
