/* ============================================================
   闲逸麻将局 · 共享站点样式 /assets/site.css
   暖纸象牙白 + 竹青深竹 + 朱砂靛蓝 + 木色铜金
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 6.5rem;
}

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

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; }

table { border-collapse: collapse; }

code, pre, samp { font-family: var(--font-mono, ui-monospace, monospace); }

::selection {
  background: rgba(180, 70, 50, 0.22);
  color: #1E2420;
}

/* ---------- 2. 变量 ---------- */
:root {
  /* 色彩 */
  --ivory: #F7F0DF;
  --paper: #EFE3CC;
  --ink: #1E2420;
  --bamboo: #4F6B58;
  --bamboo-deep: #2F4638;
  --cinnabar: #B44632;
  --indigo: #33577A;
  --wood: #8B5E3C;
  --copper: #C39A54;
  --mist: #D7E0D2;

  --cream: #FBF6EA;
  --on-dark: #EFE7D6;
  --on-dark-dim: rgba(239, 231, 214, 0.72);
  --copper-light: #D7B271;

  --line-wood: rgba(139, 94, 60, 0.32);
  --line-wood-soft: rgba(139, 94, 60, 0.2);
  --line-ink: rgba(30, 36, 32, 0.16);
  --line-dark: rgba(239, 231, 214, 0.2);

  /* 字体 */
  --font-head: "LXGW WenKai", "霞鹜文楷", "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* 尺度 */
  --width: 1180px;
  --width-wide: 1320px;
  --width-narrow: 760px;
  --radius: 6px;
  --radius-sm: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --shadow-soft: 0 6px 12px rgba(30, 36, 32, 0.07);
  --shadow-lift: 0 10px 20px rgba(30, 36, 32, 0.11);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- 3. 正文与中文排版 ---------- */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.22vw, 1.0625rem);
  line-height: 1.78;
  color: var(--ink);
  background-color: var(--ivory);
  background-image:
    radial-gradient(circle at 14% 8%, rgba(195, 154, 84, 0.1), transparent 46%),
    radial-gradient(circle at 86% 92%, rgba(79, 107, 88, 0.08), transparent 48%);
  background-repeat: no-repeat;
  text-underline-offset: 0.22em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.015em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.08rem; }

p { text-wrap: pretty; }

strong { font-weight: 700; }

/* ---------- 4. 焦点与可访问性 ---------- */
:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

.xy-footer :focus-visible {
  outline-color: var(--copper-light);
}

.xy-skip {
  position: fixed;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 200;
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--bamboo-deep);
  color: var(--cream);
  border: 1px solid var(--copper);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(30, 36, 32, 0.28);
  transform: translateY(-180%);
  transition: transform 0.24s var(--ease);
}

.xy-skip:focus,
.xy-skip:focus-visible { transform: translateY(0); }

.xy-lock { overflow: hidden; }

/* ---------- 5. 容器 ---------- */
.xy-container {
  width: 100%;
  max-width: var(--width);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.6rem);
}

.xy-container--wide { max-width: var(--width-wide); }
.xy-container--narrow { max-width: var(--width-narrow); }

/* ---------- 6. 页头 ---------- */
.xy-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(247, 240, 223, 0.96);
  border-bottom: 1px solid var(--line-wood);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.xy-header__inner {
  max-width: var(--width-wide);
  margin-inline: auto;
  padding: clamp(0.68rem, 1.6vw, 1.05rem) clamp(1.05rem, 4vw, 2.6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 2.4rem);
}

/* 品牌 */
.xy-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  flex: 0 0 auto;
}

.xy-brand__tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 3.05rem;
  border-radius: 5px;
  background: linear-gradient(168deg, #FBF6EA, #EDE0C6);
  border: 1px solid rgba(139, 94, 60, 0.55);
  box-shadow: 0 2px 0 rgba(139, 94, 60, 0.3), 0 6px 12px rgba(30, 36, 32, 0.09);
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bamboo-deep);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.xy-brand__tile::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(195, 154, 84, 0.55);
  border-radius: 3px;
  pointer-events: none;
}

.xy-brand:hover .xy-brand__tile {
  transform: translateY(-2px) rotate(-1.2deg);
  box-shadow: 0 3px 0 rgba(139, 94, 60, 0.3), 0 9px 16px rgba(30, 36, 32, 0.12);
}

.xy-brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.15;
}

.xy-brand__name {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--bamboo-deep);
}

.xy-brand__tag {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--wood);
}

/* 抽屉按钮 */
.xy-navtoggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid rgba(139, 94, 60, 0.45);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--bamboo-deep);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  box-shadow: 0 2px 0 rgba(139, 94, 60, 0.22);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.xy-navtoggle:hover { background: #E7D9BE; }
.xy-navtoggle:active { transform: translateY(1px); }

.xy-navtoggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.xy-navtoggle__bars::before,
.xy-navtoggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.26s var(--ease);
}

.xy-navtoggle__bars::before { top: 0; }
.xy-navtoggle__bars::after { bottom: 0; }

.xy-navtoggle[aria-expanded="true"] .xy-navtoggle__bars::before {
  transform: translateY(5px) rotate(45deg);
}

.xy-navtoggle[aria-expanded="true"] .xy-navtoggle__bars::after {
  transform: translateY(-5px) rotate(-45deg);
}

/* 主导航（桌面） */
.xy-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.2vw, 2rem);
}

.xy-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.35rem, 1.3vw, 1.1rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.xy-nav__item { flex: 0 0 auto; }

.xy-nav__link {
  position: relative;
  display: inline-block;
  padding: 0.42rem 0.18rem;
  font-size: 0.94rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.22s var(--ease);
}

.xy-nav__link::after {
  content: "";
  position: absolute;
  left: 0.18rem;
  right: 0.18rem;
  bottom: 0.08rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bamboo), var(--copper));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s var(--ease);
}

.xy-nav__link:hover { color: var(--bamboo-deep); }
.xy-nav__link:hover::after { transform: scaleX(1); }

.xy-nav__link[aria-current="page"] {
  color: var(--cinnabar);
  font-weight: 600;
}

.xy-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--cinnabar);
}

.xy-nav__utility {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-left: clamp(0.7rem, 1.6vw, 1.2rem);
  border-left: 1px solid var(--line-wood);
}

.xy-nav__link--quiet {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--indigo);
  padding-inline: 0.1rem;
}

.xy-nav__link--quiet::after {
  left: 0.1rem;
  right: 0.1rem;
  background: var(--indigo);
}

.xy-nav__scrim {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: none;
  background: rgba(20, 28, 23, 0.46);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
}

.xy-nav__scrim[data-open] {
  opacity: 1;
  pointer-events: auto;
}

/* 进度条 */
.xy-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
}

.xy-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--bamboo) 0%, var(--copper) 58%, var(--cinnabar) 100%);
  box-shadow: 0 0 8px rgba(195, 154, 84, 0.5);
}

/* ---------- 7. 按钮 ---------- */
.xy-btn {
  --btn-bg: var(--bamboo);
  --btn-fg: var(--cream);
  --btn-bd: var(--bamboo-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(47, 70, 56, 0.26);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.xy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(47, 70, 56, 0.22), 0 9px 18px rgba(30, 36, 32, 0.12);
}

.xy-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(47, 70, 56, 0.3);
}

.xy-btn--primary {
  --btn-bg: var(--bamboo);
  --btn-fg: var(--cream);
  --btn-bd: var(--bamboo-deep);
}

.xy-btn--primary:hover { --btn-bg: #46604F; }

.xy-btn--accent {
  --btn-bg: var(--cinnabar);
  --btn-fg: #FDF4EC;
  --btn-bd: #8E3423;
  box-shadow: 0 2px 0 rgba(142, 52, 35, 0.3);
}

.xy-btn--accent:hover {
  --btn-bg: #A23D2B;
  box-shadow: 0 4px 0 rgba(142, 52, 35, 0.26), 0 9px 18px rgba(30, 36, 32, 0.13);
}

.xy-btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--bamboo-deep);
  --btn-bd: rgba(47, 70, 56, 0.5);
  box-shadow: none;
}

.xy-btn--ghost:hover {
  --btn-bg: rgba(79, 107, 88, 0.1);
  --btn-bd: var(--bamboo);
  box-shadow: 0 2px 0 rgba(47, 70, 56, 0.16);
}

.xy-btn--sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

/* ---------- 8. 区块与章节 ---------- */
.xy-section {
  padding-block: clamp(2.6rem, 5.6vw, 5rem);
}

.xy-section--paper {
  background: var(--paper);
  border-block: 1px solid var(--line-wood-soft);
}

.xy-section--table {
  background: var(--bamboo-deep);
  color: var(--on-dark);
}

.xy-section--table h2,
.xy-section--table h3 {
  color: #F6EEDC;
}

.xy-chapter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: start;
  margin-bottom: clamp(1.4rem, 3vw, 2.4rem);
}

.xy-chapter__num {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--cinnabar);
  padding-top: 0.28rem;
}

.xy-chapter__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* ---------- 9. 标签 / 卡片 / 网格 ---------- */
.xy-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.62rem;
  border-radius: 2px;
  border: 1px solid var(--line-wood);
  background: var(--paper);
  color: var(--bamboo-deep);
  font-family: var(--font-body);
  font-size: 0.74rem;
  line-height: 1.45;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.xy-label--ink {
  background: var(--bamboo-deep);
  border-color: var(--bamboo-deep);
  color: #F3ECDC;
}

.xy-label--red {
  background: var(--cinnabar);
  border-color: #95351F;
  color: #FDF6EA;
}

.xy-label--blue {
  background: var(--indigo);
  border-color: #26415C;
  color: #F0F5FA;
}

.xy-label--mist {
  background: var(--mist);
  border-color: rgba(79, 107, 88, 0.42);
  color: var(--bamboo-deep);
}

.xy-card {
  position: relative;
  padding: clamp(1.1rem, 2.4vw, 1.7rem);
  border-radius: var(--radius);
  border: 1px solid var(--line-wood);
  background: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), var(--shadow-soft);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease),
              border-color 0.24s var(--ease);
}

.xy-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 107, 88, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), var(--shadow-lift);
}

.xy-card--tile::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 1px;
  background: var(--copper);
  box-shadow: 0 0 0 1px rgba(139, 94, 60, 0.45);
}

.xy-card--tile > *:first-child { margin-top: 0.9rem; }

.xy-grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.8rem);
}

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

.xy-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: start;
}

/* ---------- 10. 图片容器（供页面阶段放置素材） ---------- */
.xy-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-wood);
  background:
    linear-gradient(152deg, #F3E8D2 0%, #E4D6BA 58%, #D9C9A9 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), var(--shadow-soft);
}

.xy-media img,
.xy-media picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.xy-media--4x3 { aspect-ratio: 4 / 3; }
.xy-media--16x9 { aspect-ratio: 16 / 9; }
.xy-media--1x1 { aspect-ratio: 1 / 1; }
.xy-media--tall { aspect-ratio: 3 / 4; }

.xy-media__plate {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  padding: 0.24rem 0.55rem;
  border-radius: 2px;
  background: rgba(47, 70, 56, 0.9);
  color: #F3ECDC;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  transform: rotate(-1deg);
}

/* ---------- 11. 面包屑 / 正文 / 等宽 ---------- */
.xy-breadcrumb {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line-wood-soft);
  font-size: 0.82rem;
}

.xy-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--wood);
}

.xy-breadcrumb__list li + li::before {
  content: "／";
  margin-inline-end: 0.35rem;
  color: rgba(139, 94, 60, 0.55);
}

.xy-breadcrumb a {
  color: var(--bamboo-deep);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.xy-breadcrumb a:hover { color: var(--indigo); text-decoration: underline; }

.xy-breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

.xy-prose {
  max-width: 38em;
  font-size: 1.02rem;
  line-height: 1.84;
  color: var(--ink);
}

.xy-prose > * + * { margin-top: 0.95em; }

.xy-prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 1.7em; }
.xy-prose h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); margin-top: 1.5em; }

.xy-prose a {
  color: var(--indigo);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.xy-prose a:hover { color: var(--cinnabar); }

.xy-prose ul,
.xy-prose ol {
  padding-left: 1.35em;
  list-style: disc;
}

.xy-prose ol { list-style: decimal; }
.xy-prose li + li { margin-top: 0.4em; }

.xy-prose blockquote {
  padding: 0.9rem 1.2rem;
  border-left: 3px solid var(--copper);
  background: var(--paper);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--bamboo-deep);
}

.xy-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------- 12. 页脚 ---------- */
.xy-footer {
  position: relative;
  background:
    radial-gradient(130% 90% at 10% 0%, rgba(79, 107, 88, 0.55), transparent 62%),
    var(--bamboo-deep);
  color: var(--on-dark);
  border-top: 3px solid var(--bamboo);
  padding-top: 8px;
}

.xy-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    rgba(195, 154, 84, 0.55) 0 12px,
    transparent 12px 20px
  );
}

.xy-footer__inner {
  max-width: var(--width-wide);
  margin-inline: auto;
  padding: clamp(2.2rem, 4.6vw, 3.6rem) clamp(1.1rem, 4vw, 2.6rem) clamp(1.4rem, 3vw, 2.2rem);
  display: grid;
  grid-template-columns: minmax(230px, 1.05fr) minmax(0, 2fr);
  gap: clamp(1.8rem, 4vw, 3.4rem);
}

.xy-footer__brand { display: flex; flex-direction: column; gap: 0.4rem; }

.xy-footer__wordmark {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #F6EEDC;
  line-height: 1.2;
}

.xy-footer__motto {
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  color: var(--copper-light);
}

.xy-footer__blurb {
  margin-top: 0.5rem;
  max-width: 26em;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--on-dark-dim);
}

.xy-footer__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-top: 1rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(195, 154, 84, 0.6);
  color: #F1E4C8;
  font-size: 0.86rem;
  letter-spacing: 0.07em;
  text-decoration: none;
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease),
              transform 0.22s var(--ease);
}

.xy-footer__cta:hover {
  background: rgba(195, 154, 84, 0.18);
  color: #FFF6E2;
  transform: translateY(-2px);
}

.xy-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.2rem, 3vw, 2.4rem);
}

.xy-footer__title {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--copper-light);
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line-dark);
}

.xy-footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
  list-style: none;
  padding: 0;
}

.xy-footer__link {
  color: #E6DCC8;
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.xy-footer__link:hover,
.xy-footer__link:focus-visible {
  color: var(--copper-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.xy-footer__meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.4rem, 3vw, 3rem);
  margin-top: 0.6rem;
  padding-top: clamp(1.2rem, 2.4vw, 1.9rem);
  border-top: 1px solid var(--line-dark);
}

.xy-footer__contact { min-width: 0; }

.xy-footer__address {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #E6DCC8;
  overflow-wrap: anywhere;
}

.xy-footer__mail { color: #F1E4C8; }

.xy-footer__hours {
  font-size: 0.84rem;
  color: var(--on-dark-dim);
}

.xy-version {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  list-style: none;
  padding: 0;
}

.xy-version__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.32rem 0.6rem;
  border-radius: 3px;
  border: 1px solid rgba(195, 154, 84, 0.35);
  background: rgba(247, 240, 223, 0.06);
}

.xy-version__label {
  font-size: 0.73rem;
  letter-spacing: 0.12em;
  color: var(--on-dark-dim);
}

.xy-version__item code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--copper-light);
}

.xy-footer__base {
  max-width: var(--width-wide);
  margin-inline: auto;
  padding: clamp(0.9rem, 2vw, 1.3rem) clamp(1.1rem, 4vw, 2.6rem) clamp(1.3rem, 2.6vw, 1.9rem);
  border-top: 1px solid var(--line-dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.7rem 1.6rem;
  font-size: 0.79rem;
  line-height: 1.8;
  color: var(--on-dark-dim);
}

.xy-footer__note { max-width: 40em; margin: 0; }

.xy-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  margin: 0;
}

.xy-footer__legal .xy-footer__link { font-size: 0.79rem; }

.xy-footer__sep { color: rgba(195, 154, 84, 0.65); }

/* ---------- 13. 显现协议 ---------- */
[data-reveal] {
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.xy-js [data-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
}

/* ---------- 14. 平板 ---------- */
@media (max-width: 1024px) {
  .xy-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 15. 移动：牌墙抽屉 ---------- */
@media (max-width: 900px) {
  .xy-navtoggle { display: inline-flex; }

  .xy-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: min(84vw, 340px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 5.6rem clamp(1.1rem, 5vw, 1.6rem) 2rem;
    background:
      linear-gradient(180deg, rgba(47, 70, 56, 0.09), transparent 26%),
      var(--paper);
    border-left: 1px solid rgba(47, 70, 56, 0.4);
    box-shadow: -18px 0 40px rgba(30, 36, 32, 0.2);
    overflow-y: auto;
    transform: translateX(103%);
    transition: transform 0.3s var(--ease);
  }

  .xy-nav[data-open] { transform: translateX(0); }

  .xy-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .xy-nav__item {
    border-bottom: 1px dashed rgba(139, 94, 60, 0.35);
  }

  .xy-nav__link {
    display: block;
    padding: 0.92rem 0.15rem;
    font-size: 1.02rem;
    letter-spacing: 0.06em;
  }

  .xy-nav__link::after {
    left: 0.15rem;
    right: auto;
    width: 2.4rem;
  }

  .xy-nav__link[aria-current="page"] {
    border-left: 3px solid var(--cinnabar);
    padding-left: 0.6rem;
  }

  .xy-nav__utility {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    margin-top: 1.4rem;
    padding: 1.2rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--line-wood);
  }

  .xy-nav__link--quiet {
    text-align: center;
    font-size: 0.86rem;
    padding: 0.35rem 0;
  }

  .xy-nav__link--quiet::after { left: 50%; margin-left: -1.2rem; }

  .xy-nav .xy-btn { width: 100%; }

  .xy-nav__scrim { display: block; }

  .xy-header__inner { gap: 0.8rem; }

  .xy-footer__inner { grid-template-columns: minmax(0, 1fr); }
  .xy-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xy-footer__meta { grid-template-columns: minmax(0, 1fr); }
  .xy-split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 16. 小屏 ---------- */
@media (max-width: 720px) {
  .xy-grid--2,
  .xy-grid--3 { grid-template-columns: minmax(0, 1fr); }

  .xy-chapter {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  .xy-chapter__num { padding-top: 0; }

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

@media (max-width: 520px) {
  .xy-brand__tag { display: none; }

  .xy-brand__tile {
    width: 2.3rem;
    height: 2.75rem;
    font-size: 1.15rem;
  }

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

  .xy-footer__legal { gap: 0.3rem 0.5rem; }

  .xy-version { gap: 0.4rem; }
}

/* ---------- 17. 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .xy-js [data-reveal]:not(.is-revealed) {
    opacity: 1;
    transform: none;
  }

  .xy-card:hover,
  .xy-btn:hover,
  .xy-footer__cta:hover,
  .xy-brand:hover .xy-brand__tile {
    transform: none;
  }
}
