:root {
  --paper: #f5f2ea;
  --panel: #ffffff;
  --ink: #17303f;
  --ink-soft: #52636f;
  --line: #d9d2c4;
  --line-strong: #b9b1a0;
  --accent: #c8462f;
  --swatch-fei: #d9544d;
  --swatch-hupo: #dd9a2b;
  --swatch-tailv: #4c9b6a;
  --swatch-hulan: #3a86b5;
  --swatch-tengzi: #7f6bbd;
  --swatch-shimo: #5b646e;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 0 rgba(23, 48, 63, 0.04), 0 6px 18px rgba(23, 48, 63, 0.06);
  --shell: 1120px;
  --shell-narrow: 1040px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(23, 48, 63, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 48, 63, 0.035) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  background-position: -1px -1px, -1px -1px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

h1 { font-size: 34px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p {
  margin: 0 0 1em;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono,
code {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

/* ============================================================
   layout — site header & navigation
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(23, 48, 63, 0.03);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.brand-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.brand-slogan {
  font-weight: 700;
}

.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.nav-list li {
  display: block;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

.nav-list a.is-current {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ============================================================
   layout — breadcrumb & page header (inner pages)
   ============================================================ */

.breadcrumb,
.breadcrumb-bar {
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.breadcrumb-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-list li + li::before {
  content: "/";
  color: var(--line-strong);
}

.breadcrumb-list a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb-list a:hover {
  color: var(--accent);
}

.breadcrumb-list [aria-current] {
  color: var(--ink);
  font-weight: 600;
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 12px 0;
}

.breadcrumb a {
  color: var(--ink-soft);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  margin: 0 6px;
  color: var(--line-strong);
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 600;
}

.page-head,
.page-hero {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding-top: 32px;
  padding-bottom: 28px;
}

.page-head-inner,
.page-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-kicker,
.page-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.site-brand-heading {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.site-brand-heading::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}

.page-lead,
.page-intro {
  margin: 0;
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
}

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.page-header {
  padding-top: 28px;
  padding-bottom: 8px;
}

.page-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.inner-main {
  padding-bottom: 56px;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

.page-layout.layout-shell {
  grid-template-columns: minmax(0, 720px) minmax(280px, 320px);
  align-items: start;
}

/* ============================================================
   components — buttons & links
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #a93a26;
  border-color: #a93a26;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--panel);
  border-color: var(--ink);
  color: var(--ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

.text-link::after {
  content: "→";
  font-family: var(--font-mono);
  transition: transform 0.15s ease;
}

.text-link:hover::after {
  transform: translateX(3px);
}

/* ============================================================
   components — section head & common list styles
   ============================================================ */

.section {
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  margin-bottom: 24px;
}

.section-title,
.section-head h2 {
  font-size: 22px;
  margin: 0 0 6px;
}

.section-desc,
.section-intro,
.section-lead {
  margin: 0;
  color: var(--ink-soft);
  max-width: 720px;
  font-size: 15px;
}

.section-note {
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 14px;
}

.section-note a {
  color: var(--accent);
  font-weight: 600;
  margin-right: 12px;
}

/* ============================================================
   components — swatch & code chips
   ============================================================ */

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--line-strong);
  vertical-align: middle;
  flex: 0 0 auto;
}

.swatch-01, .swatch-fei { background: var(--swatch-fei); }
.swatch-02, .swatch-hupo { background: var(--swatch-hupo); }
.swatch-03, .swatch-tailv { background: var(--swatch-tailv); }
.swatch-04, .swatch-hulan { background: var(--swatch-hulan); }
.swatch-05, .swatch-tengzi { background: var(--swatch-tengzi); }
.swatch-06, .swatch-shimo { background: var(--swatch-shimo); }
.swatch-all {
  background: linear-gradient(135deg, var(--swatch-fei) 0 16%, var(--swatch-hupo) 16% 33%, var(--swatch-tailv) 33% 50%, var(--swatch-hulan) 50% 66%, var(--swatch-tengzi) 66% 83%, var(--swatch-shimo) 83% 100%);
}

.swatch-hu,
.swatch-hu-lan,
.swatch-shi,
.swatch-tai,
.swatch-zi {
  background: var(--swatch-hulan);
}

.swatch-code,
.code-chip,
.clause-num,
.mono-tag,
.tag-mono,
.rule-code,
.rank-index,
.step-index,
.legend-code,
.order-tag,
.route-badge,
.route-tag,
.path-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 8px;
  line-height: 1.6;
}

/* ============================================================
   components — figures & images
   ============================================================ */

figure {
  margin: 0;
}

.hero-visual,
.zone-figure,
.panel-media,
.route-map-figure,
.combo-figure,
.media-figure,
.rules-figure,
.order-figure {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hero-visual img,
.zone-figure img,
.panel-media img,
.route-map-figure img,
.combo-figure img,
.media-figure img,
.rules-figure img,
.order-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 10;
}

.hero-caption,
.media-caption,
.route-map-figure figcaption,
.combo-figure figcaption,
.rules-figure figcaption,
.order-figure figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

/* ============================================================
   components — tables
   ============================================================ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.directory-table,
.data-table,
.catalog-table,
.glossary-table,
.legend-table {
  width: 100%;
  min-width: 560px;
  font-size: 15px;
}

.directory-table caption,
.data-table caption,
.catalog-table caption,
.glossary-table caption,
.legend-table caption {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.directory-table th,
.data-table th,
.catalog-table th,
.glossary-table th,
.legend-table th {
  text-align: left;
  padding: 12px 16px;
  background: #faf7f0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.directory-table td,
.data-table td,
.catalog-table td,
.glossary-table td,
.legend-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink);
}

.directory-table tbody tr:last-child td,
.data-table tbody tr:last-child td,
.catalog-table tbody tr:last-child td,
.glossary-table tbody tr:last-child td,
.legend-table tbody tr:last-child td {
  border-bottom: 0;
}

.directory-table td:first-child,
.catalog-table td:first-child {
  font-weight: 600;
}

.legend-caption {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   components — faq
   ============================================================ */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 18px 16px;
  color: var(--ink-soft);
  font-size: 15px;
  border-top: 1px solid var(--line);
}

.faq-answer p {
  margin: 12px 0 0;
}

/* ============================================================
   components — footer
   ============================================================ */

.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-col {
  min-width: 0;
}

.footer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.footer-links li {
  display: block;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 2px 0;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links .current-mark,
.footer-links .curr {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.footer-text {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 12px;
}

.footer-copy {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0;
}

/* ============================================================
   pages — 404
   ============================================================ */

.site-error {
  background: var(--paper);
}

.error-main {
  padding: 80px 0 64px;
}

.error-inner {
  max-width: 640px;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.error-inner h1 {
  font-size: 34px;
  margin: 0 0 12px;
}

.error-text {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 8px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 32px;
}

.error-hints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 18px;
  list-style: disc;
  color: var(--ink-soft);
  font-size: 15px;
}

.error-hints li {
  list-style: disc;
}

/* ============================================================
   pages — index (home)
   ============================================================ */

.home-main {
  padding-bottom: 0;
}

/* hero */
.hero {
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.hero-visual {
  margin: 0;
}

.hero-copy {
  min-width: 0;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.hero-copy h1 {
  font-size: 34px;
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}

.hero-lede {
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0 0 22px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.legend-item {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.legend-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--ink);
  min-height: 44px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.legend-link:hover {
  background: #faf7f0;
  border-color: var(--line);
  color: var(--ink);
}

.legend-code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.legend-name {
  font-weight: 600;
  font-size: 13px;
}

/* zone wall */
.zone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
}

.zone-card {
  display: block;
  min-width: 0;
}

.zone-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.zone-card-link:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.zone-figure {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.zone-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zone-code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.zone-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.zone-note {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* route overview */
.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.route-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  min-width: 0;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.route-panel:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.route-name {
  font-size: 17px;
  margin: 0;
}

.node-strip {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 14px;
  padding: 0;
  position: relative;
}

.node-strip .node-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--line-strong);
  flex: 0 0 auto;
}

.node-strip .node-dot + .node-dot {
  margin-left: 26px;
}

.node-strip .node-dot + .node-dot::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 2px;
  background: var(--line);
}

.node-strip .node-dot.is-done {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.node-strip .node-dot.is-done + .node-dot::before {
  background: var(--ink-soft);
}

.node-strip .node-dot.is-current {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 70, 47, 0.14);
}

.route-meta {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* reading rank */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: baseline;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-index {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.rank-main {
  min-width: 0;
}

.rank-title {
  font-size: 16px;
  margin: 0 0 2px;
}

.rank-zone {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.rank-reason {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  min-width: 0;
}

/* path section */
.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.path-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.path-name {
  font-size: 17px;
  margin: 0;
}

.path-time,
.path-zone,
.path-way {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.path-zone {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}

/* observe excerpt */
.excerpt-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 16px;
}

.excerpt-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  min-width: 0;
}

.excerpt-title {
  font-size: 17px;
  margin: 0 0 6px;
}

.excerpt-title a {
  color: var(--ink);
}

.excerpt-summary {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

/* rule points */
.rule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.rule-text {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
  min-width: 0;
}

/* nav directory */
.nav-directory .table-wrap {
  margin-bottom: 4px;
}

/* ============================================================
   pages — ticai-fenqu
   ============================================================ */

.swatch-index {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.swatch-index-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

.swatch-index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.swatch-index-list li {
  display: block;
}

.swatch-index-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.swatch-index-list a:hover {
  border-color: var(--line-strong);
  background: #faf7f0;
  color: var(--ink);
}

.section-overview {
  padding-top: 40px;
}

.section-overview > p {
  max-width: 720px;
  color: var(--ink-soft);
}

.code-rule-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 0;
}

.code-rule-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
  scroll-margin-top: 96px;
}

.panel-media {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.panel-code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 18px 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.panel h3 {
  margin: 0 18px 8px;
  font-size: 18px;
}

.panel > p {
  margin: 0 18px 12px;
  color: var(--ink-soft);
  font-size: 15px;
}

.panel-audience {
  margin: 0 18px 18px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}

.panel-audience strong {
  color: var(--ink);
  margin-right: 6px;
}

.migrate-route {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 0;
  position: relative;
}

.migrate-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  min-width: 0;
  position: relative;
}

.migrate-step + .migrate-step::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 16px;
  height: 1px;
  background: var(--line-strong);
}

.migrate-node {
  margin: 0 0 8px;
}

.migrate-step h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.migrate-step p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.migrate-link {
  margin-top: 10px;
}

.migrate-link a {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

/* ============================================================
   pages — gengxin-xianlu
   ============================================================ */

.module {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

.module:last-of-type {
  border-bottom: 0;
}

.module-head {
  margin-bottom: 20px;
}

.module-head h2 {
  font-size: 22px;
  margin: 0 0 6px;
}

.module-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 720px;
}

.module-foot {
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-soft);
}

.module-foot a {
  color: var(--accent);
  font-weight: 600;
}

.route-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.route-map-rules {
  min-width: 0;
}

.route-map-rules h3 {
  font-size: 17px;
  margin: 0 0 12px;
}

.route-map-rules .rule-list {
  margin: 0;
}

.route-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.route-panel-grid .route-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-panel-head h3 {
  font-size: 17px;
  margin: 0;
}

.node-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 8px 0;
}

.node-track .node {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--line-strong);
  flex: 0 0 auto;
}

.node-track .node + .node {
  margin-left: 26px;
}

.node-track .node + .node::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 2px;
  background: var(--line);
}

.node-track .node.is-done {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.node-track .node.is-done + .node::before {
  background: var(--ink-soft);
}

.node-track .node.is-current {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 70, 47, 0.14);
}

.route-position,
.route-resume {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.pace-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.pace-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.pace-item p {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
  min-width: 0;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.related-item {
  min-width: 0;
}

.related-item a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-item a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  color: var(--ink);
}

.related-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.related-desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   pages — yuedu-lujing
   ============================================================ */

.section-compare .table-wrap {
  margin-top: 16px;
}

.section-paths .path-grid {
  margin-top: 16px;
}

.path-card-fast { border-top: 3px solid var(--swatch-hupo); }
.path-card-follow { border-top: 3px solid var(--swatch-hulan); }
.path-card-slow { border-top: 3px solid var(--swatch-tailv); }

.path-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  font-size: 14px;
}

.path-meta dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  align-self: center;
}

.path-meta dd {
  margin: 0;
  color: var(--ink);
}

.path-note,
.path-skip {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.path-skip {
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.path-tag-fast { border-color: var(--swatch-hupo); color: var(--swatch-hupo); }
.path-tag-follow { border-color: var(--swatch-hulan); color: var(--swatch-hulan); }
.path-tag-slow { border-color: var(--swatch-tailv); color: var(--swatch-tailv); }

.combo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 16px;
}

.combo-text {
  min-width: 0;
}

.combo-text .sub-title {
  font-size: 17px;
  margin: 20px 0 8px;
}

.combo-text p {
  color: var(--ink-soft);
}

.combo-figure {
  min-width: 0;
}

.section-related {
  padding: 40px 0;
}

.section-related .related-list {
  margin-top: 16px;
}

/* ============================================================
   pages — lianzai-guancha
   ============================================================ */

.page-layout.layout-shell {
  padding-top: 0;
}

.note-body .media-figure {
  margin: 0 0 24px;
}

.prose {
  max-width: 720px;
}

.prose p {
  color: var(--ink-soft);
}

.prose h3 {
  font-size: 18px;
  margin: 28px 0 10px;
}

.note-index {
  margin-top: 40px;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 16px 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.note-item {
  border-bottom: 1px solid var(--line);
}

.note-item:last-child {
  border-bottom: 0;
}

.note-article {
  padding: 16px 18px;
  min-width: 0;
}

.note-title {
  font-size: 16px;
  margin: 0 0 6px;
}

.note-excerpt {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.note-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #faf7f0;
}

.note-method {
  margin-top: 40px;
}

.method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.method-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.method-label {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 2px 8px;
  line-height: 1.6;
}

.method-item p {
  margin: 0;
  min-width: 0;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.related-links-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.related-links-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.related-links-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.content-aside {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 0;
  position: sticky;
  top: 88px;
}

.aside-title {
  font-size: 16px;
  margin: 0 0 6px;
}

.aside-lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.aside-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 18px;
}

.aside-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  min-width: 0;
}

.aside-item:last-child {
  border-bottom: 0;
}

.aside-item a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.aside-item a:hover {
  color: var(--accent);
}

.aside-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.aside-links {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.aside-subtitle {
  font-size: 13px;
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  font-weight: 700;
}

.aside-link-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.aside-link-list a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 14px;
  color: var(--ink-soft);
}

.aside-link-list a:hover {
  color: var(--accent);
}

/* ============================================================
   pages — yuedu-guifan
   ============================================================ */

.rules-notice .rules-figure {
  margin: 20px 0;
}

.rules-notice .legend-table {
  margin: 20px 0;
  min-width: 520px;
}

.swatch-hupo,
.swatch-tailv,
.swatch-hulan,
.swatch-tengzi,
.swatch-shimo {
  display: inline-block;
}

.rules-note {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 14px;
}

.rules-note a {
  color: var(--accent);
  font-weight: 600;
}

.clause-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 20px 0 0;
}

.clause-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  min-width: 0;
}

.clause-title {
  font-size: 17px;
  margin: 10px 0 8px;
}

.clause-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.maintain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 0;
}

.maintain-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  min-width: 0;
}

.maintain-card h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.maintain-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ============================================================
   pages — zhandian-daolan
   ============================================================ */

.catalog-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-soft);
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 16px;
}

.order-figure {
  min-width: 0;
}

.order-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  counter-reset: none;
}

.order-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: start;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.order-step .step-index {
  grid-row: span 2;
  align-self: start;
  background: #faf7f0;
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
  padding: 4px 8px;
}

.order-step .step-title {
  font-size: 16px;
  margin: 0;
}

.order-step .step-text {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  min-width: 0;
}

.glossary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}

.glossary-table {
  min-width: 480px;
}

.glossary-aside {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 0;
}

.glossary-aside .aside-title {
  font-size: 16px;
  margin: 0 0 12px;
}

.maintain-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.maintain-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink-soft);
}

.maintain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

/* ============================================================
   responsive — 1024px
   ============================================================ */

@media (max-width: 1024px) {
  .shell {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .hero-copy h1 {
    font-size: 30px;
  }

  .zone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-layout.layout-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-aside {
    position: static;
    top: auto;
  }

  .rank-row {
    grid-template-columns: 40px minmax(0, 1fr);
    row-gap: 6px;
  }

  .rank-reason {
    grid-column: 2 / -1;
  }

  .route-map-layout,
  .combo-layout,
  .order-layout,
  .glossary-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .related-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   responsive — 768px
   ============================================================ */

@media (max-width: 768px) {
  body {
    font-size: 15.5px;
  }

  h1, .page-title, .hero-copy h1, .error-inner h1 {
    font-size: 26px;
  }

  h2, .section-title, .section-head h2, .module-head h2 {
    font-size: 19px;
  }

  h3, .section-title {
    font-size: 17px;
  }

  .site-header {
    position: sticky;
  }

  .header-inner {
    min-height: 56px;
    gap: 12px;
  }

  .brand {
    font-size: 16px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    margin-left: 0;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    height: auto;
    min-height: 44px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
    border-bottom-width: 1px;
    border-bottom-color: var(--line);
    font-size: 16px;
  }

  .nav-list a.is-current {
    border-bottom-color: var(--accent);
  }

  .nav-list li:last-child a {
    border-bottom: 0;
  }

  .page-head,
  .page-hero {
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .page-header {
    padding-top: 20px;
  }

  .page-title {
    margin-bottom: 2px;
  }

  .section,
  .module {
    padding: 32px 0;
  }

  .hero {
    padding: 28px 0 32px;
  }

  .zone-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .path-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .code-rule-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .migrate-route {
    grid-template-columns: minmax(0, 1fr);
  }

  .migrate-step + .migrate-step::before {
    left: 18px;
    top: -16px;
    width: 1px;
    height: 16px;
  }

  .route-panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .related-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .maintain-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .footer-links a {
    min-height: 44px;
  }

  .directory-table,
  .data-table,
  .catalog-table,
  .glossary-table,
  .legend-table {
    min-width: 0;
  }

  .directory-table,
  .data-table,
  .catalog-table,
  .glossary-table,
  .legend-table {
    display: block;
  }

  .directory-table thead,
  .data-table thead,
  .catalog-table thead,
  .glossary-table thead,
  .legend-table thead {
    display: none;
  }

  .directory-table tbody,
  .data-table tbody,
  .catalog-table tbody,
  .glossary-table tbody,
  .legend-table tbody {
    display: block;
  }

  .directory-table tr,
  .data-table tr,
  .catalog-table tr,
  .glossary-table tr,
  .legend-table tr {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  .directory-table tr:last-child,
  .data-table tr:last-child,
  .catalog-table tr:last-child,
  .glossary-table tr:last-child,
  .legend-table tr:last-child {
    border-bottom: 0;
  }

  .directory-table td,
  .data-table td,
  .catalog-table td,
  .glossary-table td,
  .legend-table td {
    display: block;
    padding: 2px 0;
    border-bottom: 0;
  }

  .directory-table td:first-child,
  .catalog-table td:first-child {
    font-weight: 700;
    font-size: 15px;
  }

  .directory-table td:first-child::before,
  .data-table td:first-child::before,
  .catalog-table td:first-child::before,
  .glossary-table td:first-child::before {
    content: "";
  }

  .legend-table td:first-child {
    font-weight: 700;
  }

  .table-wrap {
    overflow-x: visible;
  }

  .rank-row {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 14px 16px;
  }

  .rank-reason {
    grid-column: 2 / -1;
  }

  .excerpt-item,
  .rule-item,
  .pace-item,
  .method-item,
  .clause-block,
  .maintain-card,
  .glossary-aside {
    padding: 14px 16px;
  }

  .content-aside {
    padding: 18px;
  }

  .order-step {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .error-main {
    padding: 48px 0 40px;
  }
}

/* ============================================================
   responsive — 480px
   ============================================================ */

@media (max-width: 480px) {
  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1, .page-title, .hero-copy h1, .error-inner h1 {
    font-size: 24px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .legend-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
  }

  .legend-item {
    flex: 0 0 auto;
    min-width: 130px;
  }

  .swatch-index-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .swatch-index-list li {
    flex: 0 0 auto;
  }

  .code-rule-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .related-links {
    flex-direction: column;
    align-items: stretch;
  }

  .related-links-item {
    justify-content: center;
  }

  .node-strip .node-dot + .node-dot,
  .node-track .node + .node {
    margin-left: 20px;
  }

  .node-strip .node-dot + .node-dot::before,
  .node-track .node + .node::before {
    left: -22px;
    width: 20px;
  }

  .error-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .error-actions .btn {
    width: 100%;
  }
}

/* ============================================================
   motion — reduced-motion safe enhancements
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
