/* ==========================================================================
   PG麻将胡了 · 共享外壳样式 /assets/site.css
   牌桌夜宴：象牙牌白 + 暖纸沙 + 竹青绿 + 珊瑚橙 + 鎏金 + 深墨绿
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

img, svg, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

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

button { background: none; border: 0; }

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Design tokens ---------- */
:root {
  --ivory: #F7F2E6;
  --paper: #EDE4D2;
  --bamboo: #4F7A5C;
  --bamboo-deep: #2F5741;
  --coral: #E4633C;
  --coral-deep: #C64A26;
  --coral-ink: #9D3A1D;
  --gold: #C79A3B;
  --ink-green: #0F241C;
  --ink: #1C1B17;
  --line: #CFC5AE;
  --mist: #DCE6DA;
  --coral-mist: #FBE3D9;
  --muted: #6B6455;

  --wrap: 1240px;
  --gutter: 24px;
  --radius: 10px;

  --shadow-sm: 0 2px 6px rgba(15, 36, 28, 0.07);
  --shadow-md: 0 4px 0 rgba(15, 36, 28, 0.08), 0 8px 18px rgba(15, 36, 28, 0.10);

  --font-display: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Source Han Mono SC", "SFMono-Regular",
    Menlo, Consolas, "Courier New", monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- 3. Base & 中文排版 ---------- */
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  word-break: break-word;
  overflow-x: hidden;
  background-color: var(--ivory);
  background-image:
    radial-gradient(circle at 16% -8%, rgba(199, 154, 59, 0.12), transparent 46%),
    radial-gradient(circle at 94% 2%, rgba(79, 122, 92, 0.12), transparent 44%),
    radial-gradient(rgba(28, 27, 23, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 4px 4px;
  background-attachment: fixed, fixed, scroll;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

strong { font-weight: 800; }

::selection {
  background: var(--coral-mist);
  color: var(--coral-ink);
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 3px;
}

#main-content:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: -4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -72px;
  z-index: 200;
  padding: 11px 18px;
  background: var(--ink-green);
  color: var(--ivory);
  font-size: 14px;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 18px rgba(15, 36, 28, 0.28);
  transition: top 160ms var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- 4. 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(40px, 6vw, 72px); }
.section--tight { padding-block: clamp(26px, 4vw, 44px); }
.section--paper { background: var(--paper); border-block: 1px solid var(--line); }
.section--ink { background: var(--ink-green); color: var(--ivory); }

.grid {
  display: grid;
  gap: clamp(18px, 2.6vw, 28px);
}
.grid--split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- 5. 标题区 / 正文 ---------- */
.page-lead {
  display: grid;
  gap: 14px;
  max-width: 70ch;
  padding-block: clamp(28px, 4vw, 48px);
}

.page-lead__title {
  font-size: clamp(30px, 4.4vw, 40px);
  line-height: 1.2;
}

.page-lead__desc {
  font-size: 17px;
  line-height: 1.75;
  color: #3D3A31;
}

.section-head {
  display: grid;
  gap: 10px;
  max-width: 62ch;
  margin-bottom: clamp(20px, 3vw, 30px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bamboo-deep);
}

.eyebrow::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--coral);
  transform: skewX(-14deg);
}

.section-head__title {
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.35;
  color: var(--ink);
}

.section-head__desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.05em; }

.prose h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  margin-top: 1.8em;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 21px;
  margin-top: 1.5em;
}

.prose p,
.prose li {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

.prose ul { display: grid; gap: 8px; }
.prose ul > li { position: relative; padding-left: 24px; }

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--bamboo);
  transform: rotate(12deg);
  box-shadow: 0 1px 0 rgba(15, 36, 28, 0.3);
}

.prose ol {
  list-style: decimal;
  padding-left: 1.5em;
  display: grid;
  gap: 8px;
}

.prose ol > li::marker {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--coral-deep);
}

.prose a {
  color: var(--bamboo-deep);
  border-bottom: 1px solid var(--gold);
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.prose a:hover {
  color: var(--coral-deep);
  border-color: var(--coral);
}

.prose strong { color: var(--ink-green); }

.prose blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease),
    border-color 160ms var(--ease), transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.btn--primary {
  background: var(--coral);
  color: #FFFFFF;
  box-shadow: 0 3px 0 var(--coral-deep);
}
.btn--primary:hover {
  background: var(--coral-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--coral-ink);
}
.btn--primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--coral-ink);
}

.btn--bamboo {
  background: var(--bamboo-deep);
  color: var(--ivory);
  box-shadow: 0 3px 0 #1D3A2B;
}
.btn--bamboo:hover { background: var(--bamboo); transform: translateY(-1px); }
.btn--bamboo:active { transform: translateY(2px); box-shadow: 0 1px 0 #1D3A2B; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-green);
}
.btn--ghost:hover {
  background: var(--paper);
  border-color: var(--gold);
}

.btn--sm { padding: 8px 14px; font-size: 14px; }

/* ---------- 7. 面包屑 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumb__link {
  color: var(--bamboo-deep);
  border-bottom: 1px solid transparent;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}
.breadcrumb__link:hover { color: var(--coral-deep); border-color: var(--coral); }

.breadcrumb__sep { color: var(--line); }

.breadcrumb__current { color: var(--ink); }

/* ---------- 8. 档案卡 / 编号 / 标签 ---------- */
.card {
  position: relative;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card--slant { overflow: hidden; }

.card--slant::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  transform: rotate(-1deg);
  transform-origin: left center;
}

.card--link {
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease),
    border-color 200ms var(--ease);
}
.card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 36, 28, 0.14);
  border-color: var(--gold);
}

.card__title {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.45;
  font-weight: 800;
  color: var(--ink);
}

.card__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bamboo-deep);
}

.card__label { font-size: 13px; color: var(--muted); }

.rule-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ivory);
  box-shadow: 0 2px 0 rgba(15, 36, 28, 0.12);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--bamboo-deep);
}

.rule-no--coral {
  background: var(--coral);
  border-color: var(--coral-deep);
  color: #FFFFFF;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--mist);
  color: var(--bamboo-deep);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.tag--coral { background: var(--coral-mist); color: var(--coral-ink); }

.tag--gold {
  background: transparent;
  border-color: var(--gold);
  color: #8A6A1F;
}

/* ---------- 9. 索引表 ---------- */
.index-table__wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ivory);
  box-shadow: var(--shadow-sm);
}

.index-table {
  width: 100%;
  min-width: 560px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.index-table thead th {
  background: var(--bamboo-deep);
  color: var(--ivory);
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  white-space: nowrap;
}

.index-table tbody td {
  padding: 9px 12px;
  line-height: 1.5;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.index-table tbody tr:last-child td { border-bottom: 0; }
.index-table tbody tr:nth-child(even) { background: var(--mist); }
.index-table tbody tr:hover { background: var(--coral-mist); }

/* ---------- 10. 折叠面板 ---------- */
.fold {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.fold + .fold { margin-top: 10px; }

.fold__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  transition: background 160ms var(--ease);
}

.fold__head:hover { background: var(--coral-mist); }

summary.fold__head { list-style: none; }
summary.fold__head::-webkit-details-marker { display: none; }

.fold__no {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--coral-deep);
  letter-spacing: 0.04em;
}

.fold__title { flex: 1 1 auto; min-width: 0; }

.fold__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.fold__body {
  padding: 0 16px 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #3D3A31;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* ---------- 11. 横向卷轴 ---------- */
.rail {
  position: relative;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.rail > * {
  flex: 0 0 min(320px, 82vw);
  scroll-snap-align: start;
}

.rail__progress {
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.rail__progress-bar {
  display: block;
  height: 100%;
  width: 36%;
  border-radius: 2px;
  background: var(--bamboo);
}

/* ---------- 12. 图片容器 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--paper), var(--ivory) 62%, var(--mist));
  box-shadow: var(--shadow-sm);
}

.media-frame img,
.media-frame svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

.media-frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ivory);
  background: linear-gradient(180deg, transparent, rgba(15, 36, 28, 0.78));
}

/* ---------- 13. 提示与旁注 ---------- */
.notice {
  padding: 14px 16px;
  border: 1px solid rgba(228, 99, 60, 0.35);
  border-radius: 8px;
  background: var(--coral-mist);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.aside-note {
  padding: 10px 0 10px 14px;
  border-left: 2px solid var(--gold);
  font-size: 15px;
  line-height: 1.7;
  color: #4A463C;
  background: linear-gradient(90deg, rgba(199, 154, 59, 0.10), transparent);
}

/* ==========================================================================
   14. 页头
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
}

.site-header::after {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--ink-green) 0 58%,
    var(--bamboo) 58% 82%,
    var(--gold) 82% 92%,
    var(--coral) 92% 100%
  );
}

.masthead {
  background: linear-gradient(180deg, rgba(237, 228, 210, 0.6), var(--ivory) 78%);
}

.masthead__inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 20px var(--gutter) 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  transition: padding 200ms var(--ease);
}

.masthead__tagline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bamboo-deep);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.tagline-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--coral);
  transform: rotate(12deg);
  box-shadow: 0 0 0 2px var(--coral-mist);
  flex: 0 0 auto;
}

.masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
  padding: 4px;
  border-radius: 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bamboo-deep);
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(15, 36, 28, 0.22),
    inset 0 0 0 1px rgba(199, 154, 59, 0.6);
  transition: transform 200ms var(--ease), background 160ms var(--ease),
    width 200ms var(--ease), height 200ms var(--ease),
    font-size 200ms var(--ease);
}

.masthead__brand:hover .brand-mark {
  background: var(--coral);
  transform: rotate(-8deg);
}

.brand-text {
  display: grid;
  gap: 3px;
  line-height: 1;
}

.brand-text__name {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: font-size 200ms var(--ease);
}

.brand-text__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bamboo);
  transition: opacity 160ms var(--ease);
}

.masthead__tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-green);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
    color 160ms var(--ease);
}

.search-toggle:hover {
  background: var(--coral-mist);
  border-color: var(--coral);
}

.search-toggle[aria-expanded="true"] {
  background: var(--bamboo-deep);
  border-color: var(--bamboo-deep);
  color: var(--ivory);
}

.search-toggle__icon {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-toggle__icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-45deg);
}

.search-toggle__label { display: inline; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--ink-green);
  border-radius: 999px;
  background: var(--ink-green);
  color: var(--ivory);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.nav-toggle[aria-expanded="true"] {
  background: var(--coral);
  border-color: var(--coral);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
  flex: 0 0 auto;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { bottom: 0; }

.nav-toggle__label { display: inline; }

/* 检索抽屉 */
.search-panel {
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: inset 0 10px 16px -14px rgba(15, 36, 28, 0.7);
}

.search-panel[hidden] { display: none; }

.search-panel__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 18px var(--gutter) 22px;
  display: grid;
  gap: 12px;
}

.search-field { display: block; }

.search-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ivory);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.search-field input::placeholder { color: #8B8574; }

.search-field input:focus {
  border-color: var(--bamboo);
  box-shadow: 0 0 0 3px rgba(79, 122, 92, 0.16);
}

.search-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.search-suggest {
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.search-suggest[hidden] { display: none; }

.search-suggest__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.search-suggest__link:hover,
.search-suggest__link:focus-visible {
  background: var(--ivory);
  border-color: var(--line);
}

.search-suggest__title { font-size: 15px; font-weight: 700; }

.search-suggest__code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--bamboo-deep);
  white-space: nowrap;
}

.search-suggest__empty {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* 栏目导航 */
.site-nav {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 6px var(--gutter) 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
}

.nav-meta {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bamboo);
  white-space: nowrap;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.nav-list__link {
  position: relative;
  display: inline-block;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}

.nav-list__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--gold);
  transform: skewX(-14deg) scaleX(0);
  transform-origin: left center;
  transition: transform 160ms var(--ease), background 160ms var(--ease),
    height 160ms var(--ease);
}

.nav-list__link:hover {
  background: var(--paper);
  color: var(--bamboo-deep);
}

.nav-list__link:hover::after { transform: skewX(-14deg) scaleX(1); }

.nav-list__link[aria-current="page"] { color: var(--coral-deep); }

.nav-list__link[aria-current="page"]::after {
  height: 3px;
  background: var(--coral);
  transform: skewX(-14deg) scaleX(1);
}

.nav-actions {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--coral);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--coral-deep);
  transition: background 160ms var(--ease), transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.nav-cta:hover {
  background: var(--coral-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--coral-ink);
}

.nav-cta:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--coral-ink);
}

/* 滚动收缩 */
.site-header[data-scrolled] .masthead__inner {
  padding-top: 9px;
  padding-bottom: 7px;
}

.site-header[data-scrolled] .masthead__tagline {
  opacity: 0;
  transform: translateY(-6px);
}

.site-header[data-scrolled] .brand-mark {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.site-header[data-scrolled] .brand-text__name { font-size: 20px; }

.site-header[data-scrolled] .brand-text__sub { opacity: 0; }

/* ==========================================================================
   15. 页脚
   ========================================================================== */
.site-footer {
  margin-top: clamp(56px, 8vw, 96px);
  background: var(--ink-green);
  color: var(--ivory);
}

.footer__rule {
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--gold) 0 18%,
    var(--coral) 18% 34%,
    var(--bamboo) 34% 58%,
    var(--ivory) 58% 78%,
    var(--bamboo-deep) 78% 100%
  );
}

.footer__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 56px) var(--gutter) 28px;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.6fr);
  gap: clamp(28px, 4vw, 52px);
}

.footer__brand { align-content: start; }

.footer__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ivory);
}

.footer__brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--coral);
  color: #FFFFFF;
  font-size: 17px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(247, 242, 230, 0.4);
}

.footer__note {
  margin-top: 16px;
  max-width: 40ch;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(247, 242, 230, 0.76);
}

.footer__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 6px 13px;
  border: 1px solid rgba(199, 154, 59, 0.55);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.3fr);
  gap: clamp(20px, 3vw, 34px);
}

.footer-col { min-width: 0; }

.footer-col__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-col__list { display: grid; gap: 8px; }

.footer-col__link {
  display: inline-block;
  padding: 2px 0;
  font-size: 15px;
  color: rgba(247, 242, 230, 0.82);
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.footer-col__link:hover {
  color: var(--ivory);
  border-bottom-color: var(--coral);
}

.footer-col__link[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.contact-list { display: grid; gap: 12px; }

.contact-list__row { display: grid; gap: 3px; }

.contact-list__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 242, 230, 0.52);
}

.contact-list__value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ivory);
  overflow-wrap: anywhere;
}

.footer__service {
  margin-top: 18px;
  padding-left: 12px;
  border-left: 2px solid rgba(199, 154, 59, 0.6);
  font-size: 13px;
  line-height: 1.75;
  color: rgba(247, 242, 230, 0.62);
}

.footer__legal {
  margin-top: clamp(30px, 4vw, 46px);
  padding-top: 20px;
  border-top: 1px solid rgba(247, 242, 230, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footer__copyright {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(247, 242, 230, 0.62);
}

.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer__legal-link {
  font-size: 13px;
  color: rgba(247, 242, 230, 0.78);
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.footer__legal-link:hover {
  color: #FFFFFF;
  border-bottom-color: var(--coral);
}

/* ==========================================================================
   16. 响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .nav-meta { display: none; }
}

@media (min-width: 768px) and (max-width: 900px) {
  .nav-list__link { padding: 8px 9px; font-size: 14px; }
  .nav-list__link::after { left: 9px; right: 9px; }
  .nav-cta { padding: 8px 12px; font-size: 13px; }
}

@media (max-width: 1023px) {
  .grid--split { grid-template-columns: minmax(0, 1fr); }
  .grid--thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer__top { grid-template-columns: minmax(0, 1fr); }
  .footer__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }
  .footer-col--contact { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  :root { --gutter: 18px; }

  body { font-size: 16px; }

  .masthead__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px var(--gutter) 10px;
  }

  .masthead__tagline { display: none; }

  .masthead__brand { justify-self: start; }

  .brand-mark { width: 38px; height: 38px; font-size: 19px; border-radius: 9px; }
  .brand-text__name { font-size: 19px; }
  .brand-text__sub { font-size: 9px; letter-spacing: 0.16em; }

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

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px var(--gutter) 16px;
  }

  .site-nav[data-open] { display: flex; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
  }

  .nav-list__link {
    display: block;
    padding: 12px 12px;
    font-size: 16px;
    border-radius: 6px;
  }

  .nav-list__link::after {
    left: 12px;
    right: auto;
    width: 28px;
    bottom: 6px;
  }

  .nav-list__link:hover::after,
  .nav-list__link[aria-current="page"]::after {
    transform: skewX(-14deg) scaleX(1);
  }

  .nav-actions {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 12px;
  }

  .nav-cta {
    width: 100%;
    justify-content: center;
    padding: 13px 18px;
    font-size: 15px;
  }

  .site-header[data-scrolled] .masthead__inner { padding-top: 8px; }
  .site-header[data-scrolled] .brand-text__sub { opacity: 1; }

  .search-panel__inner { padding: 14px var(--gutter) 18px; }
  .search-suggest { max-height: 220px; }

  .grid--halves { grid-template-columns: minmax(0, 1fr); }
  .grid--thirds { grid-template-columns: minmax(0, 1fr); }

  .card { padding: 16px; }
  .fold__head { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .fold__body { padding: 12px 14px 14px; }

  .footer__cols { grid-template-columns: minmax(0, 1fr); }
  .footer__legal { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 420px) {
  .search-toggle { padding: 9px 12px; }
  .search-toggle__label { display: none; }
  .nav-toggle { padding: 9px 13px; }
  .footer__legal-links { gap: 12px; }
}

/* ==========================================================================
   17. 动效降级
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .card--link:hover,
  .btn--primary:hover,
  .btn--bamboo:hover,
  .nav-cta:hover,
  .masthead__brand:hover .brand-mark {
    transform: none;
  }
}
