:root {
  --bg: #F5FAFF;
  --panel: #FFFFFF;
  --primary: #1554D1;
  --btn: #185CDA;
  --btn-hover: #1248B5;
  --cyan: #007D91;
  --purple: #6448BA;
  --text: #23364C;
  --muted: #64768B;
  --border: #DCE7F4;
  --tint: #EAF3FF;
  --wine: #8B2635;
  --radius-card: 14px;
  --radius-panel: 20px;
  --shadow-sm: 0 2px 10px rgba(21, 84, 209, 0.05);
  --shadow-md: 0 10px 30px rgba(21, 84, 209, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: var(--tint);
  color: var(--primary);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--btn);
  color: #fff;
  padding: 8px 14px;
  z-index: 1000;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: 8px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-link:hover {
  text-decoration: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.brand-domain {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.header-date-badge {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--cyan);
  border: 1px solid var(--border);
}

.header-ring-spin {
  transform-origin: 14px 14px;
  animation: hubSpin 24s linear infinite;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--tint);
  color: var(--primary);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--primary);
  background: var(--tint);
  font-weight: 600;
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 185px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 6px;
  margin: 0;
  z-index: 120;
}

.nav-dropdown.is-open .dropdown-menu {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
}

.dropdown-link:hover,
.dropdown-link.is-active {
  background: var(--tint);
  color: var(--primary);
  text-decoration: none;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search {
  position: relative;
}

.search-input {
  width: 210px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 84, 209, 0.12);
  background: var(--panel);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 310px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 150;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--text);
}

.search-result-item:hover {
  background: var(--tint);
  text-decoration: none;
}

.search-result-type {
  font-size: 0.72rem;
  color: var(--cyan);
  background: var(--tint);
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.btn-motion-toggle {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-motion-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-motion-toggle[aria-pressed="true"] {
  background: var(--tint);
  color: var(--primary);
  border-color: var(--primary);
}

.mobile-nav-toggle {
  display: none;
  padding: 7px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--primary);
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

/* Main */
.site-main {
  padding: 28px 0 56px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background-color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:active,
.btn-mini:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--btn);
  color: #fff;
}

.btn-primary:hover {
  background: var(--btn-hover);
}

.btn-secondary {
  background: var(--panel);
  color: var(--primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--tint);
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.84rem;
}

.btn-full {
  width: 100%;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--btn);
  color: #fff;
  flex-shrink: 0;
  transition: transform 0.14s ease, background-color 0.2s ease;
}

.btn-mini:hover {
  background: var(--btn-hover);
  text-decoration: none;
}

/* Panels & Cards */
.panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.prose-card p {
  max-width: 760px;
  margin: 0 0 12px;
}
.prose-card p:last-child {
  margin-bottom: 0;
}

/* Hero Section */
.hero-section {
  margin-bottom: 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 28px;
  align-items: center;
}

.scope-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.8rem;
}

.scope-pill {
  background: var(--tint);
  color: var(--cyan);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.scope-links a {
  color: var(--muted);
  font-weight: 500;
}
.scope-links a:hover {
  color: var(--primary);
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  line-height: 1.28;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.hero-gradient-phrase {
  background: linear-gradient(100deg, #1554D1 0%, #007D91 50%, #1554D1 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleGradientShift 9s ease-in-out infinite;
}

.hero-lead {
  margin: 0 0 20px;
  color: var(--text);
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.hero-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Topology Panel */
.topology-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.topology-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.topology-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan);
}

.btn-zoom-diagram {
  padding: 4px 10px;
  font-size: 0.76rem;
  font-family: inherit;
  color: var(--primary);
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.btn-zoom-diagram:hover {
  border-color: var(--primary);
}

.topology-stage {
  position: relative;
  border-radius: 14px;
  background: #F9FCFF;
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 560 / 400;
}

.topology-grid-bg {
  position: absolute;
  inset: -40px;
  background-image:
    linear-gradient(to right, rgba(21, 84, 209, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 84, 209, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: gridDrift 35s linear infinite;
  pointer-events: none;
}

.topology-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
}

.topo-ticks text {
  font-size: 9px;
  fill: var(--muted);
  font-family: ui-monospace, monospace;
  opacity: 0.75;
}

.topo-link {
  fill: none;
  stroke-width: 2;
  opacity: 0.45;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.topo-link-primary {
  stroke: var(--primary);
}

.topo-link-cyan {
  stroke: var(--cyan);
}

.topo-link.is-highlighted {
  opacity: 1;
  stroke-width: 3;
}

.topo-packet {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 14 260;
  opacity: 0.95;
}

.packet-1 { animation: packetFlow 7s linear infinite; }
.packet-2 { stroke: var(--cyan); animation: packetFlow 8.8s linear infinite 1.2s; }
.packet-3 { animation: packetFlow 10.4s linear infinite 2.4s; }
.packet-4 { stroke: var(--cyan); animation: packetFlow 11.6s linear infinite 0.6s; }

.hub-glow {
  fill: var(--tint);
  opacity: 0.9;
}

.hub-ring-outer {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-dasharray: 14 8 6 8;
  animation: hubSpin 24s linear infinite;
}

.hub-ring-inner {
  fill: #FFFFFF;
  stroke: var(--cyan);
  stroke-width: 1.5;
}

.hub-core {
  fill: var(--primary);
}

.hub-label {
  font-size: 12px;
  font-weight: 700;
  fill: var(--primary);
}

.topo-node {
  cursor: pointer;
  outline: none;
}

.node-body {
  transition: transform 0.2s ease;
}

.topo-node:hover .node-body,
.topo-node:focus-visible .node-body,
.topo-node.is-selected .node-body {
  transform: scale(1.09);
}

.node-circle {
  fill: #FFFFFF;
  stroke: var(--primary);
  stroke-width: 2;
}

.node-circle-cyan {
  stroke: var(--cyan);
}

.topo-node:focus-visible .node-circle,
.topo-node.is-selected .node-circle {
  fill: var(--tint);
  stroke-width: 2.8;
}

.node-icon {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-title {
  font-size: 11px;
  font-weight: 600;
  fill: var(--text);
}

.node-ripple {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: nodeRipple 4s ease-out infinite;
  pointer-events: none;
}

.node-ripple-2 {
  animation-delay: 2s;
}

.topology-inspector {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.inspector-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--primary);
  font-weight: 600;
}

.topology-inspector p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.55;
}

.inspector-link {
  font-weight: 600;
  font-size: 0.84rem;
}

/* Editorial Grid on Home */
.home-editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.section-block {
  margin-bottom: 34px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.section-sub,
.section-more {
  font-size: 0.84rem;
  color: var(--muted);
}

/* Wine-red date divider from Part 1 */
.wine-date-divider {
  border-top: 2px solid var(--wine);
  padding-top: 8px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wine);
  font-variant-numeric: tabular-nums;
}

/* Empty news state */
.empty-news-box {
  max-width: 760px;
}

.empty-news-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wine);
  background: #FDF2F4;
  border: 1px solid #F3D1D7;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.empty-news-lead {
  margin: 0 0 14px;
  color: var(--text);
}

.empty-news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Category Cards with top link bar animation on hover */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  position: relative;
  display: block;
  overflow: hidden;
  color: var(--text);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.card-top-link-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 28px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transition: width 0.28s ease;
}

.feature-card:hover .card-top-link-bar {
  width: 100%;
}

.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  color: var(--cyan);
  background: var(--tint);
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--primary);
}

.feature-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.65;
}

/* Sidebar */
.home-side-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-note-card h3,
.side-card-head h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--primary);
}

.side-note-card p {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.65;
}

.text-link {
  font-size: 0.84rem;
  font-weight: 600;
}

.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.date-chip {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  background: var(--tint);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 999px;
}

.side-disclosure {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.compact-service-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.compact-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.compact-service-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.compact-service-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
}

.compact-service-price {
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.compact-service-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Page Header Block */
.page-header-block {
  margin-bottom: 28px;
  max-width: 820px;
}

.eyebrow-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan);
  background: var(--tint);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.page-header-block h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.32;
  color: var(--primary);
}

.lead-text {
  margin: 0 0 14px;
  color: var(--text);
  max-width: 760px;
}

.notice-banner {
  background: var(--tint);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.86rem;
}

/* Directory Filter & Service Rows */
.directory-filter-bar {
  margin-bottom: 24px;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.filter-controls .search-input {
  flex: 1;
  min-width: 240px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.filter-pill.is-active {
  background: var(--btn);
  color: #fff;
  border-color: var(--btn);
}

.filter-status-text {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.service-rows-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.service-row[hidden] {
  display: none;
}

.service-row-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.service-title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.service-order-badge {
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--tint);
  color: var(--primary);
}

.service-name {
  margin: 0;
  font-size: 1.08rem;
  color: var(--primary);
}

.service-founded {
  font-size: 0.78rem;
  color: var(--muted);
}

.service-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 0.74rem;
  color: var(--muted);
}

.meta-val {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.service-detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* FAQ & About */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
}

.faq-q-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.faq-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--tint);
  flex-shrink: 0;
}

.faq-q {
  margin: 0;
  font-size: 1.02rem;
  color: var(--primary);
}

.faq-a {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

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

.about-anchors-grid h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: var(--primary);
}

/* Footer */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 36px 0 44px;
  font-size: 0.86rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr;
  gap: 32px;
}

.footer-title {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--primary);
}

.footer-desc {
  margin: 0 0 8px;
  color: var(--text);
}

.footer-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

.footer-col h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--primary);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 6px;
}

.footer-col a {
  color: var(--muted);
}

.footer-col a:hover {
  color: var(--primary);
}

/* Modal */
.diagram-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.diagram-modal[hidden] {
  display: none;
}

.diagram-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 54, 76, 0.45);
  backdrop-filter: blur(4px);
}

.diagram-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

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

.diagram-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--primary);
}

.btn-icon-close {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--tint);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.diagram-modal-body {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #F9FCFF;
  padding: 12px;
}

.diagram-modal-body svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-modal-note {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Keyframes */
@keyframes packetFlow {
  0% { stroke-dashoffset: 274; }
  100% { stroke-dashoffset: 0; }
}

@keyframes nodeRipple {
  0% { transform: scale(1); opacity: 0.65; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes hubSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes titleGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes gridDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(28px, 28px, 0); }
}

@keyframes cardElasticIn {
  0% { opacity: 0; transform: translate3d(0, 22px, 0) scale(0.985); }
  75% { opacity: 1; transform: translate3d(0, -2px, 0) scale(1.002); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* Scroll Reveal (Progressive: default visible, only hidden when JS marks offscreen) */
html.has-reveal-io [data-reveal="phrase"].is-offscreen {
  opacity: 0;
  transform: translate3d(-14px, 0, 0);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

html.has-reveal-io [data-reveal="phrase"].is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 400ms cubic-bezier(0.22, 1, 0.36, 1), transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

html.has-reveal-io [data-reveal="block"].is-offscreen {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

html.has-reveal-io [data-reveal="block"].is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 400ms cubic-bezier(0.22, 1, 0.36, 1), transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

html.has-reveal-io [data-reveal="card"].is-offscreen {
  opacity: 0;
  transform: translate3d(0, 22px, 0) scale(0.985);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

html.has-reveal-io [data-reveal="card"].is-inview {
  animation: cardElasticIn 550ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms) both;
}

/* Motion Paused / Background / Reduced Motion */
html.is-motion-paused .topo-packet,
html.is-motion-paused .node-ripple,
html.is-motion-paused .hub-ring-outer,
html.is-motion-paused .header-ring-spin,
html.is-motion-paused .hero-gradient-phrase,
html.is-motion-paused .topology-grid-bg,
html.is-page-hidden .topo-packet,
html.is-page-hidden .node-ripple,
html.is-page-hidden .hub-ring-outer,
html.is-page-hidden .header-ring-spin,
html.is-page-hidden .hero-gradient-phrase,
html.is-page-hidden .topology-grid-bg {
  animation-play-state: paused !important;
}

html.is-motion-paused [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .topo-packet,
  .node-ripple,
  .hub-ring-outer,
  .header-ring-spin,
  .hero-gradient-phrase,
  .topology-grid-bg {
    animation: none !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid,
  .home-editorial-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .category-cards-grid,
  .service-meta-grid,
  .about-anchors-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 20px 18px;
    gap: 12px;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: 0;
    padding-left: 14px;
    background: var(--bg);
  }

  .header-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    width: 100%;
  }

  .search-results {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .category-cards-grid,
  .service-meta-grid,
  .about-anchors-grid,
  .footer-links-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile keeps title gradient, at least 1 packet path, and node ripples */
  .packet-2,
  .packet-3,
  .packet-4 {
    display: none;
  }
}

/* Guides Grid & Article Layout */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.45;
}

.guide-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.65;
}

.breadcrumb-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.guide-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.guide-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px;
  align-items: start;
}

.guide-layout-grid > *,
.guide-main-prose,
.guide-article {
  min-width: 0;
  max-width: 100%;
}

.guide-main-prose h2 {
  margin: 24px 0 10px;
  font-size: 1.2rem;
  color: var(--primary);
}
.guide-main-prose h2:first-child {
  margin-top: 0;
}

.guide-main-prose ol,
.guide-main-prose ul {
  padding-left: 22px;
  margin: 0 0 14px;
}

.guide-main-prose li {
  margin-bottom: 6px;
}

.guide-side-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.guide-recommend-box {
  border-color: var(--primary);
  background: linear-gradient(180deg, #FFFFFF 0%, #F9FCFF 100%);
}

.guide-recommend-box h2 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  color: var(--primary);
}

.guide-rec-reason {
  margin: 0 0 10px;
  font-size: 0.88rem;
}

.guide-rec-facts {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text);
}

.guide-rec-facts li {
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.guide-rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.guide-next-links {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
}

.guide-next-links li {
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.guide-next-links li:first-child {
  border-top: 0;
}

/* Responsive Tables */
.table-scroll-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.table-scroll-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.6;
  min-width: 540px;
}

.table-scroll-wrap th,
.table-scroll-wrap td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.table-scroll-wrap th {
  background: var(--tint);
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.table-scroll-wrap tr:last-child td {
  border-bottom: 0;
}

/* Copy Button & No-Link Badge */
.btn-copy-code {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-family: inherit;
  color: var(--primary);
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.btn-copy-code:hover {
  border-color: var(--primary);
}

.badge-no-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 8px;
}

@media (max-width: 980px) {
  .guide-layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .guides-grid {
    grid-template-columns: 1fr;
  }
}
