:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --paper-deep: #efebe2;
  --white: #fffefb;
  --ink: #17202a;
  --muted: #53606c;
  --muted-soft: #737d87;
  --line: #d8d3c9;
  --line-strong: #aaa398;
  --red: #b51f2e;
  --red-soft: #f3e4e4;
  --navy: #2c3f50;
  --navy-soft: #e6edf1;
  --green: #3f6f57;
  --green-soft: #e7efe9;
  --amber: #8e611c;
  --amber-soft: #f2ead9;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background: var(--paper);
}

button,
input {
  color: inherit;
  font: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(181, 31, 46, 0.3);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(247, 245, 239, 0.97);
  box-shadow: inset 0 4px 0 var(--red);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  width: min(1440px, calc(100% - 56px));
  min-height: 82px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--red);
}

.brand-mark::before {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 14px;
  height: 18px;
  content: "";
  border: 1.5px solid #fff;
}

.brand-mark::after {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 6px;
  height: 10px;
  content: "";
  background: #fff;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.primary-nav {
  display: flex;
  align-self: stretch;
  gap: 28px;
}

.nav-button {
  min-height: 82px;
  padding: 0 2px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #4d5965;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.nav-button:hover {
  color: var(--ink);
}

.nav-button.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.search-trigger {
  display: inline-flex;
  min-height: 42px;
  padding: 0 13px;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #a9a49a;
  border-radius: 2px;
  color: #53606c;
  background: var(--white);
  font-size: 14px;
  cursor: pointer;
}

.search-trigger:hover {
  color: var(--red);
  border-color: var(--red);
}

.search-trigger kbd {
  padding: 2px 6px;
  border: 1px solid #c9c4bb;
  color: #757d85;
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 11px;
}

.page {
  width: min(1400px, calc(100% - 64px));
  margin: 0 auto;
  padding: 46px 0 72px;
}

.view-header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 64px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line-strong);
  align-items: start;
}

.eyebrow {
  display: flex;
  margin-bottom: 16px;
  align-items: center;
  gap: 12px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.eyebrow::before {
  width: 34px;
  height: 2px;
  content: "";
  background: var(--red);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: #111820;
  font-size: clamp(42px, 4.5vw, 64px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.05em;
}

h1 span {
  color: var(--red);
}

.view-header > div > p {
  max-width: 820px;
  margin-bottom: 0;
  color: #4f5b68;
  font-size: 18px;
  line-height: 1.85;
}

.view-note {
  padding-top: 10px;
  border-top: 4px solid var(--ink);
}

.view-note strong {
  display: block;
  margin-bottom: 9px;
  color: #1a2530;
  font-size: 17px;
}

.view-note p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.view-shortcuts {
  display: flex;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.view-shortcuts button,
.view-shortcuts a {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bbb5ab;
  border-radius: 2px;
  color: #4f5b67;
  background: var(--white);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.view-shortcuts button:hover,
.view-shortcuts a:hover {
  color: var(--red);
  border-color: var(--red);
}

.section {
  margin-top: 50px;
  scroll-margin-top: 102px;
}

.section-heading {
  display: flex;
  margin-bottom: 20px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin-bottom: 6px;
  color: #16202a;
  font-size: clamp(29px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-heading p {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.overview-stats {
  display: grid;
  margin-top: 28px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.stat {
  min-height: 108px;
  padding: 21px 22px;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat strong {
  display: block;
  color: var(--red);
  font-size: 33px;
  font-weight: 700;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: #4f5a66;
  font-size: 14px;
  line-height: 1.6;
}

.focus-bar {
  display: flex;
  margin-bottom: 16px;
  border: 1px solid var(--line-strong);
  overflow-x: auto;
  scrollbar-width: none;
}

.focus-bar::-webkit-scrollbar {
  display: none;
}

.focus-label {
  display: flex;
  min-height: 44px;
  padding: 0 14px;
  flex: 0 0 auto;
  align-items: center;
  border-right: 1px solid var(--line-strong);
  color: #4e5964;
  font-size: 13px;
  font-weight: 700;
}

.focus-button {
  min-height: 44px;
  padding: 0 15px;
  flex: 0 0 auto;
  border: 0;
  border-right: 1px solid var(--line-strong);
  color: #53606c;
  background: var(--white);
  font-size: 14px;
  cursor: pointer;
}

.focus-button.active {
  color: #fff;
  background: var(--navy);
}

.architecture-map {
  padding: 25px;
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) 84px minmax(180px, 0.76fr) 84px minmax(300px, 1.42fr) 84px minmax(190px, 0.9fr);
  gap: 9px;
  align-items: stretch;
}

.map-group,
.endpoint-zone {
  padding: 15px;
  border: 1px solid var(--line);
  background: #f5f2eb;
}

.map-group[data-group="management"] {
  border-top: 4px solid var(--red);
}

.map-group[data-group="dispatch"] {
  border-top: 4px solid var(--navy);
}

.map-group[data-group="boundary"] {
  border-top: 4px solid var(--amber);
}

.endpoint-zone {
  border-top: 4px solid var(--green);
}

.map-group-title {
  margin-bottom: 10px;
  color: #3d4955;
  font-size: 14px;
  font-weight: 700;
}

.map-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.map-node {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 91px;
  padding: 13px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: var(--white);
  cursor: pointer;
}

.map-node:hover,
.map-node.focused {
  border-color: var(--red);
  box-shadow: inset 4px 0 0 var(--red);
}

.map-node.muted {
  opacity: 0.32;
}

.node-code {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  color: #fff;
  background: var(--navy);
  font-family: var(--mono);
  font-size: 11px;
  place-items: center;
}

.node-copy {
  min-width: 0;
}

.node-copy strong,
.node-copy span,
.node-copy em {
  display: block;
}

.node-copy strong {
  font-size: 16px;
}

.node-copy span {
  margin-top: 5px;
  color: #596570;
  font-size: 13px;
  line-height: 1.55;
}

.node-copy em {
  margin-top: 6px;
  color: #757e87;
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}

.map-rail {
  position: relative;
  display: grid;
  align-items: center;
  text-align: center;
}

.map-rail::before {
  position: absolute;
  right: 2px;
  left: 2px;
  height: 1px;
  content: "";
  background: #b0a9a0;
}

.map-rail::after {
  position: absolute;
  right: 1px;
  width: 7px;
  height: 7px;
  content: "";
  border-top: 1px solid #6c757e;
  border-right: 1px solid #6c757e;
  transform: rotate(45deg);
}

.map-rail span {
  position: relative;
  z-index: 1;
  padding: 4px 5px;
  color: #56616b;
  background: var(--white);
  font-size: 11px;
  line-height: 1.4;
}

.endpoint-node {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--white);
}

.endpoint-node button {
  width: 100%;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.endpoint-node button:hover strong {
  color: var(--red);
}

.endpoint-node strong {
  display: block;
  font-size: 16px;
}

.endpoint-node small {
  display: block;
  margin-top: 3px;
  color: #707984;
  font-family: var(--mono);
  font-size: 10px;
}

.chip-row {
  display: flex;
  margin-top: 11px;
  flex-wrap: wrap;
  gap: 5px;
}

.chip-row span {
  padding: 4px 6px;
  border: 1px solid #d2cec5;
  color: #56616c;
  background: #f5f2eb;
  font-size: 11px;
}

.peer-rail {
  display: grid;
  min-height: 38px;
  color: #6c757e;
  font-size: 11px;
  text-align: center;
  place-items: center;
}

.peer-rail span {
  padding: 3px 7px;
  border: 1px solid #d5c5c6;
  background: var(--white);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-card {
  min-height: 188px;
  padding: 20px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: var(--white);
  cursor: pointer;
}

.module-card:hover {
  border-color: var(--red);
}

.module-index {
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.module-card h3 {
  margin: 12px 0 8px;
  font-size: 21px;
}

.module-card p {
  margin-bottom: 15px;
  color: #53606c;
  font-size: 15px;
  line-height: 1.7;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #727b84;
  font-size: 12px;
}

.module-meta span + span::before {
  margin-right: 7px;
  content: "/";
  color: #b4aea4;
}

.layer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.layer-stack {
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.layer-row {
  display: grid;
  width: 100%;
  min-height: 102px;
  padding: 18px 20px;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.layer-row:last-child {
  border-bottom: 0;
}

.layer-row:hover,
.layer-row.active {
  background: var(--paper-deep);
  box-shadow: inset 5px 0 0 var(--red);
}

.layer-name {
  font-size: 17px;
  font-weight: 700;
}

.layer-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.layer-items span {
  padding: 5px 7px;
  border: 1px solid #d2cec4;
  color: #53606b;
  background: #f8f6f1;
  font-size: 13px;
}

.layer-index {
  color: #8a9198;
  font-family: var(--mono);
  font-size: 13px;
}

.layer-detail {
  padding: 28px;
  border: 1px solid var(--line-strong);
  background: var(--paper-deep);
}

.detail-kicker {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.layer-detail h3 {
  margin: 10px 0;
  font-size: 29px;
}

.layer-detail > p {
  color: #4d5965;
  font-size: 15px;
  line-height: 1.8;
}

.relation-list {
  margin-top: 21px;
  border-top: 1px solid #c5c0b5;
}

.relation-item {
  padding: 13px 0;
  border-bottom: 1px solid #c5c0b5;
}

.relation-item strong,
.relation-item span {
  display: block;
}

.relation-item strong {
  font-size: 14px;
}

.relation-item span {
  margin-top: 5px;
  color: #5d6874;
  font-size: 13px;
  line-height: 1.65;
}

.deploy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.deploy-zone {
  padding: 23px;
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.deploy-zone[data-accent="red"] {
  border-top: 4px solid var(--red);
}

.deploy-zone[data-accent="blue"] {
  border-top: 4px solid var(--navy);
}

.deploy-zone[data-accent="green"] {
  border-top: 4px solid var(--green);
}

.deploy-zone[data-accent="amber"] {
  border-top: 4px solid var(--amber);
}

.deploy-zone > small {
  color: #747d86;
  font-family: var(--mono);
  font-size: 11px;
}

.deploy-zone h3 {
  margin: 9px 0 18px;
  font-size: 24px;
}

.deploy-node {
  margin-top: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f6f3ec;
}

.deploy-node strong,
.deploy-node span {
  display: block;
}

.deploy-node strong {
  font-size: 15px;
}

.deploy-node span {
  margin-top: 5px;
  color: #58646f;
  font-size: 14px;
  line-height: 1.65;
}

.port-row {
  display: flex;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 5px;
}

.port {
  padding: 3px 6px;
  border: 1px solid #bcc8cc;
  color: #2d5965;
  background: var(--white);
  font-family: var(--mono);
  font-size: 10px;
}

.journey-toolbar {
  display: flex;
  margin-top: 26px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.journey-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.mode-switch {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
}

.mode-button {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  background: var(--white);
  font-size: 14px;
  cursor: pointer;
}

.mode-button + .mode-button {
  border-left: 1px solid var(--line-strong);
}

.mode-button.active {
  color: #fff;
  background: var(--navy);
}

.journey-layout {
  display: grid;
  margin-top: 26px;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.journey-sidebar {
  position: sticky;
  top: 108px;
}

.journey-nav {
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--ink);
}

.journey-nav-button {
  display: grid;
  min-height: 55px;
  padding: 10px 2px;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: #53606c;
  text-align: left;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
}

.journey-nav-button:hover,
.journey-nav-button.active {
  color: var(--red);
}

.journey-nav-button span:last-child {
  color: #8a9299;
  font-family: var(--mono);
  font-size: 11px;
}

.journey-stages {
  min-width: 0;
}

.journey-stage {
  position: relative;
  padding: 0 0 44px 70px;
  scroll-margin-top: 112px;
}

.stage-marker {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 46px;
  height: 46px;
  border: 1px solid #9fa6ad;
  border-radius: 50%;
  color: #53606b;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  place-items: center;
}

.journey-stage.active .stage-marker {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.journey-stage:not(:last-child)::after {
  position: absolute;
  top: 56px;
  bottom: 10px;
  left: 22px;
  width: 1px;
  content: "";
  background: var(--line);
}

.stage-kicker {
  margin-bottom: 7px;
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 700;
}

.stage-kicker em {
  margin-left: 8px;
  padding: 3px 6px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 11px;
  font-style: normal;
}

.journey-stage h3 {
  margin-bottom: 10px;
  font-size: 29px;
  letter-spacing: -0.03em;
}

.stage-summary {
  max-width: 850px;
  color: #4f5b67;
  font-size: 16px;
  line-height: 1.8;
}

.module-path {
  display: flex;
  margin: 14px 0 17px;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.module-path span {
  padding: 5px 8px;
  border: 1px solid #c8d0d3;
  color: #305361;
  background: var(--white);
  font-family: var(--mono);
  font-size: 12px;
}

.module-path i {
  color: #8c949c;
  font-style: normal;
}

.stage-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.stage-block {
  min-height: 170px;
  padding: 21px;
}

.stage-block + .stage-block {
  border-left: 1px solid var(--line);
  background: #f2efe8;
}

.stage-block small {
  display: block;
  margin-bottom: 9px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

.stage-block strong {
  display: block;
  margin-bottom: 7px;
  font-size: 17px;
}

.stage-block p {
  margin-bottom: 0;
  color: #505c68;
  font-size: 15px;
  line-height: 1.75;
}

.stage-actions {
  display: grid;
  gap: 6px;
  margin-top: 11px;
  color: #515d68;
  font-size: 13px;
  line-height: 1.65;
}

.journey-stage.mode-muted .stage-kicker em {
  color: #67706e;
  background: #eceee9;
}

.faq-tools {
  position: sticky;
  top: 83px;
  z-index: 30;
  margin-top: 25px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(247, 245, 239, 0.97);
  backdrop-filter: blur(12px);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-input {
  width: 100%;
  height: 54px;
  padding: 0 17px;
  border: 1px solid #9f9a91;
  border-radius: 2px;
  background: var(--white);
  font-size: 16px;
}

.search-input:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--red);
}

.search-count {
  display: grid;
  min-width: 160px;
  padding: 0 16px;
  border: 1px solid #b3aea5;
  color: #4f5b67;
  background: var(--paper-deep);
  font-size: 14px;
  font-weight: 600;
  place-items: center;
}

.filter-row {
  display: flex;
  margin-top: 10px;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.module-filter {
  min-height: 38px;
  padding: 0 12px;
  flex: 0 0 auto;
  border: 1px solid #bab5ab;
  color: #53606b;
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
}

.module-filter.active {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
}

.symptom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.symptom-button {
  min-height: 88px;
  padding: 15px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: var(--white);
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}

.symptom-button:hover {
  border-color: var(--red);
}

.faq-list,
.glossary-grid {
  margin-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  display: grid;
  min-height: 96px;
  padding: 18px 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  background: rgba(255, 255, 255, 0.5);
}

.faq-meta {
  display: flex;
  margin-bottom: 7px;
  flex-wrap: wrap;
  gap: 7px;
}

.module-tag,
.owner-tag {
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 600;
}

.module-tag {
  color: #2f5965;
  border: 1px solid #c6d2d5;
  background: var(--navy-soft);
}

.owner-tag {
  color: #72511e;
  border: 1px solid #d7c9ac;
  background: var(--amber-soft);
}

.faq-title {
  display: block;
  font-size: 18px;
  line-height: 1.55;
}

.faq-symptom {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.faq-toggle {
  display: grid;
  width: 32px;
  height: 32px;
  border: 1px solid #beb9af;
  color: var(--red);
  font-size: 19px;
  place-items: center;
}

.faq-item[open] .faq-toggle {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.faq-body {
  display: grid;
  padding: 0 20px 20px;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.faq-block {
  padding: 16px;
  border-top: 1px solid var(--line-strong);
  background: var(--white);
}

.faq-block h4 {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 11px;
}

.faq-block li,
.faq-block p {
  color: #4f5b67;
  font-size: 14px;
  line-height: 1.75;
}

.faq-block ol {
  margin: 0;
  padding-left: 18px;
}

.faq-block p {
  margin-bottom: 0;
}

.glossary-tools {
  margin-top: 24px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.glossary-item {
  min-height: 170px;
  padding: 21px;
  border-bottom: 1px solid var(--line);
}

.glossary-item:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.glossary-item:hover {
  background: rgba(255, 255, 255, 0.45);
}

.glossary-item h3 {
  margin-bottom: 9px;
  font-size: 20px;
}

.glossary-category {
  color: #796c52;
  font-size: 11px;
}

.glossary-definition {
  color: #4d5965;
  font-size: 15px;
  line-height: 1.75;
}

.glossary-distinction {
  margin-bottom: 0;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: #67717b;
  font-size: 13px;
  line-height: 1.65;
}

.ops-path-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ops-path-button {
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: #52606c;
  text-align: left;
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ops-path-button:hover {
  border-color: var(--red);
}

.ops-path-button.active {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
}

.ops-path-panel {
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  background: var(--white);
}

.ops-path-head {
  display: flex;
  padding: 22px 24px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.ops-path-head small {
  display: block;
  margin-bottom: 7px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

.ops-path-head h3 {
  margin-bottom: 7px;
  font-size: 25px;
}

.ops-path-head p {
  max-width: 820px;
  margin-bottom: 0;
  color: #53606c;
  font-size: 14px;
  line-height: 1.75;
}

.faq-link-button {
  min-height: 42px;
  padding: 0 13px;
  flex: 0 0 auto;
  border: 1px solid var(--red);
  color: var(--red);
  background: var(--red-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.faq-link-button:hover {
  color: #fff;
  background: var(--red);
}

.ops-path-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ops-path-block {
  min-height: 190px;
  padding: 22px 24px;
}

.ops-path-block + .ops-path-block {
  border-left: 1px solid var(--line);
  background: var(--paper-deep);
}

.ops-path-block h4 {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 11px;
}

.ops-path-block ol {
  margin: 0;
  padding-left: 19px;
}

.ops-path-block li {
  margin-bottom: 8px;
  color: #4e5a66;
  font-size: 14px;
  line-height: 1.7;
}

.ops-route {
  display: flex;
  margin: 13px 0 16px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ops-route span {
  padding: 5px 7px;
  border: 1px solid #c7cfd2;
  color: #2f5360;
  background: var(--white);
  font-family: var(--mono);
  font-size: 11px;
}

.ops-route i {
  color: #8a929a;
  font-style: normal;
}

.ops-path-block p {
  margin-bottom: 0;
  color: #505c67;
  font-size: 14px;
  line-height: 1.75;
}

.ops-process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}

.ops-step {
  position: relative;
  min-height: 205px;
  padding: 21px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.ops-step > span {
  display: block;
  margin-bottom: 15px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.ops-step h3 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.45;
}

.ops-step p {
  color: #53606c;
  font-size: 14px;
  line-height: 1.7;
}

.ops-step small {
  display: block;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: #747e87;
  font-size: 12px;
  line-height: 1.6;
}

.ops-matrix {
  border-top: 1px solid var(--line-strong);
}

.ops-matrix-row {
  display: grid;
  width: 100%;
  min-height: 78px;
  padding: 15px 18px;
  grid-template-columns: minmax(210px, 0.9fr) minmax(230px, 1fr) auto;
  gap: 20px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.ops-matrix-row:hover {
  background: var(--white);
}

.ops-matrix-row strong {
  font-size: 15px;
}

.ops-matrix-row span {
  color: #58646f;
  font-size: 13px;
  line-height: 1.6;
}

.ops-matrix-row em {
  color: var(--red);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
}

.ops-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.evidence-list,
.gate-list {
  border-top: 1px solid var(--line-strong);
}

.evidence-item,
.gate-item {
  display: grid;
  min-height: 72px;
  padding: 14px 4px;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.evidence-item > span,
.gate-item > span {
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.evidence-item strong,
.gate-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.evidence-item p,
.gate-item p {
  margin-bottom: 0;
  color: #53606c;
  font-size: 13px;
  line-height: 1.65;
}

.ops-gate {
  padding-left: 36px;
  border-left: 1px solid var(--line);
}

.port-topology {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 4px solid var(--ink);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.port-zone {
  min-height: 320px;
  padding: 21px;
  border-right: 1px solid var(--line);
}

.port-zone:last-child {
  border-right: 0;
}

.port-zone:nth-child(2) {
  background: #f1eee7;
}

.port-zone:nth-child(4) {
  background: #f2eadc;
}

.port-zone > small {
  color: #777f87;
  font-family: var(--mono);
  font-size: 10px;
}

.port-zone h3 {
  margin: 8px 0 17px;
  font-size: 22px;
}

.port-zone-item {
  margin-top: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  background: var(--white);
}

.port-zone-item strong {
  display: block;
  font-size: 14px;
}

.port-zone-item span {
  display: block;
  margin-top: 4px;
  color: #606b76;
  font-size: 12px;
  line-height: 1.55;
}

.port-zone-item code {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 6px;
  border: 1px solid #becacc;
  color: #2d5965;
  background: #f9f8f4;
  font-family: var(--mono);
  font-size: 10px;
}

.port-tools {
  position: sticky;
  top: 83px;
  z-index: 30;
  margin-bottom: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(247, 245, 239, 0.97);
  backdrop-filter: blur(12px);
}

.port-table {
  border-top: 1px solid var(--line-strong);
}

.port-table-head,
.network-port-row {
  display: grid;
  grid-template-columns: 115px minmax(260px, 1.35fr) minmax(210px, 0.9fr) minmax(210px, 0.8fr);
  gap: 20px;
}

.port-table-head {
  min-height: 45px;
  padding: 0 16px;
  align-items: center;
  color: #727b84;
  background: var(--paper-deep);
  font-size: 11px;
  font-weight: 700;
}

.network-port-row {
  padding: 19px 16px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.network-port-row:hover {
  background: rgba(255, 255, 255, 0.55);
}

.port-number {
  display: inline-flex;
  min-height: 38px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9c7ca;
  color: #244f5b;
  background: var(--white);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}

.port-service strong,
.port-service span,
.port-meta strong,
.port-meta span {
  display: block;
}

.port-service strong {
  font-size: 16px;
}

.port-service span {
  margin-top: 5px;
  color: #56626d;
  font-size: 13px;
  line-height: 1.65;
}

.port-meta strong {
  color: #27333e;
  font-size: 14px;
}

.port-meta span {
  margin-top: 5px;
  color: #6a747e;
  font-size: 12px;
  line-height: 1.55;
}

.exposure-tag {
  display: inline-flex !important;
  min-height: 27px;
  padding: 0 8px;
  align-items: center;
  border: 1px solid #d1c6ad;
  color: #76531e !important;
  background: var(--amber-soft);
  font-size: 11px !important;
  font-weight: 600;
}

.exposure-tag.local {
  color: #315f50 !important;
  border-color: #c0d0c6;
  background: var(--green-soft);
}

.exposure-tag.internal {
  color: #355a69 !important;
  border-color: #c5d2d7;
  background: var(--navy-soft);
}

.empty-state {
  display: none;
  padding: 40px 20px;
  border: 1px dashed #bbb6ac;
  color: var(--muted);
  background: var(--white);
  text-align: center;
  font-size: 15px;
}

.empty-state.show {
  display: block;
}

mark {
  padding: 0 2px;
  color: inherit;
  background: #f2d6a1;
}

.footer {
  display: flex;
  margin-top: 55px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #68727d;
  font-size: 12px;
}

.drawer-backdrop,
.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(30, 35, 41, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms;
}

.drawer-backdrop.open,
.search-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(430px, calc(100vw - 18px));
  height: 100vh;
  padding: 26px;
  overflow-y: auto;
  border-left: 1px solid var(--line-strong);
  background: var(--white);
  box-shadow: -18px 0 50px rgba(25, 32, 40, 0.2);
  transform: translateX(103%);
  visibility: hidden;
  transition: transform 220ms ease, visibility 220ms;
}

.detail-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-close {
  display: grid;
  width: 38px;
  height: 38px;
  margin-left: auto;
  border: 1px solid #bbb7ae;
  color: #4a5661;
  background: var(--paper-deep);
  font-size: 20px;
  cursor: pointer;
  place-items: center;
}

.drawer-code {
  margin: 20px 0 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

.detail-drawer h3 {
  margin-bottom: 9px;
  font-size: 30px;
}

.drawer-summary {
  color: #4e5a66;
  font-size: 15px;
  line-height: 1.8;
}

.drawer-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.drawer-section h4 {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 11px;
}

.drawer-list {
  margin: 0;
  padding-left: 18px;
}

.drawer-list li {
  margin-bottom: 7px;
  color: #4f5b67;
  font-size: 14px;
  line-height: 1.7;
}

.drawer-relations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.drawer-relation {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f3f0e9;
}

.drawer-relation strong,
.drawer-relation span {
  display: block;
}

.drawer-relation strong {
  color: #767f88;
  font-size: 10px;
}

.drawer-relation span {
  margin-top: 5px;
  color: #384450;
  font-size: 13px;
  line-height: 1.6;
}

.search-modal {
  position: fixed;
  top: 8vh;
  left: 50%;
  z-index: 100;
  display: flex;
  width: min(760px, calc(100vw - 28px));
  max-height: 78vh;
  padding: 22px;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  background: var(--white);
  box-shadow: 0 22px 70px rgba(20, 28, 36, 0.26);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -10px);
  transition: 180ms ease;
}

.search-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.search-modal-head {
  display: flex;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
}

.search-modal-head strong {
  font-size: 19px;
}

.search-modal-head button {
  width: 34px;
  height: 34px;
  border: 1px solid #bbb6ad;
  background: var(--paper-deep);
  font-size: 18px;
  cursor: pointer;
}

.global-search-input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid #9d988f;
  background: var(--paper);
  font-size: 17px;
}

.global-search-input:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--red);
}

.global-results {
  margin-top: 12px;
  overflow-y: auto;
}

.global-result {
  display: grid;
  width: 100%;
  padding: 13px 10px;
  grid-template-columns: 82px 1fr;
  gap: 13px;
  align-items: start;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.global-result:hover {
  background: var(--paper-deep);
}

.global-result em {
  color: var(--red);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.global-result strong {
  display: block;
  font-size: 15px;
}

.global-result small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.global-empty {
  padding: 28px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 26px;
  z-index: 65;
  display: inline-flex;
  min-width: 112px;
  min-height: 46px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #1d2d3d;
  border-left: 4px solid var(--red);
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 24px rgba(28, 38, 50, 0.2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.back-to-top span:first-child {
  color: #fff;
  font-family: var(--mono);
  font-size: 18px;
}

.back-to-top:hover {
  background: #203445;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 1160px) {
  .topbar-inner {
    width: calc(100% - 36px);
  }

  .page {
    width: calc(100% - 40px);
  }

  .primary-nav {
    gap: 20px;
  }

  .nav-button {
    font-size: 15px;
  }

  .map-layout {
    grid-template-columns: minmax(165px, 0.9fr) 62px minmax(160px, 0.75fr) 62px minmax(260px, 1.35fr) 62px minmax(165px, 0.9fr);
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .port-topology {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .port-zone:nth-child(2) {
    border-right: 0;
  }

  .port-zone:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .port-table-head,
  .network-port-row {
    grid-template-columns: 96px minmax(220px, 1.2fr) minmax(180px, 0.9fr) minmax(170px, 0.8fr);
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    padding: 12px 0 0;
    flex-wrap: wrap;
  }

  .primary-nav {
    width: 100%;
    order: 3;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    min-height: 54px;
    flex: 0 0 auto;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .primary-nav {
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .view-header {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .stat:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-rail {
    min-height: 44px;
  }

  .map-rail::before {
    top: 4px;
    bottom: 4px;
    left: 50%;
    width: 1px;
    height: auto;
  }

  .map-rail::after {
    right: auto;
    bottom: 2px;
    transform: rotate(135deg);
  }

  .layer-shell {
    grid-template-columns: 1fr;
  }

  .journey-layout {
    grid-template-columns: 1fr;
  }

  .journey-sidebar {
    position: static;
  }

  .journey-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
  }

  .journey-nav-button {
    min-height: 48px;
    padding: 8px;
    border-right: 1px solid var(--line);
    font-size: 13px;
    text-align: center;
    justify-content: center;
  }

  .journey-nav-button span:last-child {
    display: none;
  }

  .journey-nav-button.active {
    color: #fff;
    background: var(--red);
  }

  .stage-body {
    grid-template-columns: 1fr;
  }

  .stage-block + .stage-block {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .symptom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faq-body {
    grid-template-columns: 1fr;
  }

  .ops-path-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-process {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-path-body {
    grid-template-columns: 1fr;
  }

  .ops-path-block + .ops-path-block {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .ops-bottom-grid {
    grid-template-columns: 1fr;
  }

  .ops-gate {
    padding-top: 30px;
    padding-left: 0;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .port-topology {
    grid-template-columns: 1fr;
  }

  .port-zone,
  .port-zone:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .port-table-head {
    display: none;
  }

  .network-port-row {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
  }

  .port-meta {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .topbar-inner,
  .page {
    width: calc(100% - 24px);
  }

  .brand small {
    display: none;
  }

  .primary-nav {
    gap: 0;
  }

  .nav-button {
    padding: 0 10px;
    font-size: 14px;
  }

  .search-trigger span {
    display: inline;
  }

  .search-trigger {
    width: auto;
    padding: 0 12px;
    justify-content: center;
  }

  .search-trigger kbd {
    display: none;
  }

  .page {
    padding-top: 30px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.18;
  }

  .view-header > div > p {
    font-size: 16px;
  }

  .overview-stats {
    grid-template-columns: 1fr;
  }

  .stat + .stat,
  .stat:nth-child(3),
  .stat:nth-child(4) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .architecture-map {
    padding: 12px;
  }

  .module-grid,
  .deploy-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .layer-row {
    min-height: 0;
    padding: 16px 12px;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .layer-index {
    display: none;
  }

  .journey-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-button {
    flex: 1;
  }

  .journey-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journey-stage {
    padding: 0 0 38px 54px;
  }

  .stage-marker {
    width: 40px;
    height: 40px;
  }

  .journey-stage:not(:last-child)::after {
    top: 48px;
    left: 19px;
  }

  .journey-stage h3 {
    font-size: 26px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-count {
    min-height: 40px;
  }

  .symptom-grid,
  .glossary-grid {
    grid-template-columns: 1fr;
  }

  .ops-path-buttons,
  .ops-process {
    grid-template-columns: 1fr;
  }

  .ops-path-head {
    align-items: stretch;
    flex-direction: column;
  }

  .faq-link-button {
    width: 100%;
  }

  .ops-matrix-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .network-port-row {
    grid-template-columns: 1fr;
  }

  .port-meta {
    grid-column: auto;
  }

  .glossary-item:nth-child(odd) {
    border-right: 0;
  }

  .faq-item summary {
    min-height: 0;
    padding: 16px 10px;
    gap: 12px;
  }

  .faq-title {
    font-size: 17px;
  }

  .faq-body {
    padding: 0 10px 18px;
  }

  .drawer-relations {
    grid-template-columns: 1fr;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .faq-tools,
  .port-tools {
    position: static;
  }

  .search-input {
    height: 50px;
    padding: 0 14px;
    font-size: 16px;
  }

  .module-filter,
  .focus-button {
    min-height: 44px;
  }

  .back-to-top {
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    min-width: 104px;
    min-height: 46px;
    padding: 0 13px;
    font-size: 13px;
  }
}

@media print {
  .topbar,
  .search-trigger,
  .view-shortcuts,
  .focus-bar,
  .journey-sidebar,
  .journey-toolbar,
  .faq-tools,
  .symptom-grid {
    display: none !important;
  }

  .page {
    width: 100%;
    padding: 0;
  }
}

