/* =========================================================
   开元棋盘官方版 · 共享样式表 /assets/site.css
   墨绿桌呢底 · 铜金刻度 · 象牙白阅读层 · 电光青交互
   ========================================================= */

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

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

body { margin: 0; }

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

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

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }

:root {
  --ink-green: #0E2A24;
  --indigo: #131A33;
  --felt: #1C3B33;
  --ivory: #F4EFE4;
  --ivory-soft: rgba(244, 239, 228, .84);
  --ivory-dim: rgba(244, 239, 228, .62);
  --card: #E3D9C6;
  --vermilion: #C2402A;
  --brass: #C9A227;
  --brass-deep: #8A6A2B;
  --cyan: #35D6C0;
  --graphite: #6B7570;
  --glass: rgba(244, 239, 228, .06);
  --brass-line: rgba(201, 162, 39, .28);
  --brass-hair: rgba(201, 162, 39, .16);
  --rail-w: 240px;
  --radius: 4px;
  --ease: cubic-bezier(.4, .15, .2, 1);
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 1080px) { :root { --rail-w: 208px; } }
@media (max-width: 900px)  { :root { --rail-w: 0px; } }
html[data-rail-min] { --rail-w: 72px; }

/* ---------------- 页面底座 ---------------- */

body {
  padding-left: var(--rail-w);
  min-height: 100vh;
  background-color: var(--ink-green);
  background-image:
    radial-gradient(1180px 560px at 82% -12%, rgba(53, 214, 192, .06), transparent 62%),
    radial-gradient(900px 620px at -8% 38%, rgba(19, 26, 51, .92), transparent 72%),
    radial-gradient(700px 500px at 100% 96%, rgba(28, 59, 51, .55), transparent 70%);
  background-attachment: fixed;
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.85;
  transition: padding-left .3s var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--brass); color: var(--ink-green); }

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

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

main:focus { outline: none; }

/* ---------------- 排版层级 ---------------- */

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.2vw, 64px);
  line-height: 1.16;
  letter-spacing: -.01em;
  color: var(--ivory);
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.36;
  letter-spacing: -.005em;
  color: var(--ivory);
}

h3, .h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ivory);
}

p { color: var(--ivory-soft); }

strong, b { font-weight: 600; color: var(--ivory); }

.num, code, kbd, samp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .2em;
  line-height: 1.6;
  color: var(--brass);
  text-transform: uppercase;
}

.lead {
  font-size: 18px;
  line-height: 1.8;
  color: var(--ivory-soft);
}

.note {
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: var(--graphite);
}

.link {
  color: var(--ivory);
  border-bottom: 1px solid var(--brass-line);
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.link:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ---------------- 跳至主内容 ---------------- */

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 3px;
  background: var(--ivory);
  color: var(--ink-green);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-180%);
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------------- 侧向牌位式索引轨道 ---------------- */

.site-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 18px 22px;
  background-color: #0C231F;
  background-image:
    linear-gradient(180deg, rgba(19, 26, 51, 0) 0%, rgba(19, 26, 51, .82) 56%, rgba(19, 26, 51, .98) 100%),
    radial-gradient(320px 200px at 50% 0%, rgba(201, 162, 39, .1), transparent 72%);
  border-right: 1px solid var(--brass-line);
  overflow-x: hidden;
  overflow-y: auto;
  transition: width .3s var(--ease), padding .3s var(--ease);
}

.rail-brand { flex: 0 0 auto; }

.rail-brand__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rail-brand__mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  background: var(--ivory);
  border: 1px solid var(--brass-line);
  box-shadow: inset 0 -3px 0 rgba(19, 26, 51, .16);
  color: var(--ink-green);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  transition: width .3s var(--ease), height .3s var(--ease), font-size .3s var(--ease);
}

.rail-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rail-brand__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ivory);
  white-space: nowrap;
}

.rail-brand__tag {
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--brass-deep);
  white-space: nowrap;
}

/* 导航 */

.rail-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-nav__title {
  padding: 0 10px 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--brass-deep);
}

.rail-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-nav__item { display: block; }

.rail-nav__link {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 3px 3px 0;
  color: var(--card);
  font-size: 14.5px;
  letter-spacing: .01em;
  transition: color .16s var(--ease), background-color .16s var(--ease),
              border-color .16s var(--ease), transform .16s var(--ease);
}

.rail-nav__link:hover {
  color: var(--ivory);
  background: var(--glass);
  border-left-color: var(--brass-deep);
  transform: translateX(2px);
}

.rail-nav__link[aria-current="page"] {
  color: var(--cyan);
  background: rgba(53, 214, 192, .07);
  border-left-color: var(--cyan);
}

.rail-nav__idx {
  flex: 0 0 auto;
  min-width: 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .02em;
  color: var(--brass-deep);
  transition: color .16s var(--ease);
}

.rail-nav__link[aria-current="page"] .rail-nav__idx { color: var(--cyan); }

.rail-nav__label { white-space: nowrap; }

/* 次级入口 */

.rail-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 0;
  padding: 12px 0 0;
  border-top: 1px dashed rgba(201, 162, 39, .2);
  list-style: none;
}

.rail-meta__link {
  display: block;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--graphite);
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.rail-meta__link:hover { color: var(--cyan); background: var(--glass); }

/* 阅读进度 */

.rail-progress {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-progress__track {
  height: 2px;
  border-radius: 2px;
  background: rgba(244, 239, 228, .14);
  overflow: hidden;
}

.rail-progress__fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass) 55%, var(--cyan));
  transition: transform .12s linear;
}

.rail-progress__value {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--brass-deep);
}

.rail-progress__unit { margin-left: 1px; color: var(--graphite); }

/* 移动端抽屉开关 */

.rail-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 44px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--brass-line);
  border-radius: 3px;
  background: var(--glass);
  cursor: pointer;
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.rail-toggle:hover { border-color: var(--brass); background: rgba(201, 162, 39, .12); }

.rail-toggle__bar {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--card);
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}

.rail-toggle__text { display: none; }

.rail-toggle[aria-expanded="true"] .rail-toggle__bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.rail-toggle[aria-expanded="true"] .rail-toggle__bar:nth-child(2) { opacity: 0; }
.rail-toggle[aria-expanded="true"] .rail-toggle__bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* 收窄态：只留编号刻度 */

html[data-rail-min] .site-rail { padding-left: 10px; padding-right: 10px; }
html[data-rail-min] .rail-brand__text,
html[data-rail-min] .rail-nav__title,
html[data-rail-min] .rail-nav__label,
html[data-rail-min] .rail-meta,
html[data-rail-min] .rail-progress__value { display: none; }
html[data-rail-min] .rail-brand__link { justify-content: center; }
html[data-rail-min] .rail-brand__mark { width: 34px; height: 34px; font-size: 14px; }
html[data-rail-min] .rail-nav__link { justify-content: center; padding: 9px 4px; border-left-width: 2px; }
html[data-rail-min] .rail-nav__idx { min-width: 0; font-size: 11.5px; }
html[data-rail-min] .rail-nav__link:hover { transform: none; }

/* ---------------- 正文容器与网格 ---------------- */

.page { padding: clamp(30px, 4.6vw, 68px) 0 0; }

.wrap {
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
}

.wrap--narrow { width: min(100% - 48px, 780px); }

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

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* ---------------- 面包屑 ---------------- */

.crumbs {
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--graphite);
}

.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs__list li { display: flex; align-items: center; gap: 8px; }

.crumbs__list li:not(:last-child)::after {
  content: "›";
  color: var(--brass-deep);
}

.crumbs a { color: var(--ivory-dim); transition: color .16s var(--ease); }
.crumbs a:hover { color: var(--cyan); }
.crumbs [aria-current="page"] { color: var(--brass); }

/* ---------------- 面板 / 卡片 ---------------- */

.panel {
  position: relative;
  padding: 24px 26px;
  border: 1px solid var(--brass-line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.panel--solid {
  background: var(--felt);
  border-color: rgba(201, 162, 39, .2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--brass-line);
  border-radius: var(--radius);
  background: rgba(28, 59, 51, .55);
  transition: transform .16s var(--ease), border-color .16s var(--ease),
              background-color .16s var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 162, 39, .58);
  background: rgba(28, 59, 51, .82);
}

/* ---------------- 数值 / 标签 ---------------- */

.stat { display: block; }

.stat__num {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--brass);
}

.stat__label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--graphite);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--brass-line);
  border-radius: 2px;
  background: rgba(201, 162, 39, .08);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  line-height: 1.7;
  color: var(--brass);
  white-space: nowrap;
}

.tag--vermilion { color: #E8745C; border-color: rgba(194, 64, 42, .5); background: rgba(194, 64, 42, .14); }
.tag--cyan { color: var(--cyan); border-color: rgba(53, 214, 192, .4); background: rgba(53, 214, 192, .1); }

/* ---------------- 表格 ---------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--brass-line);
  border-radius: var(--radius);
  background: var(--glass);
}

.table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--brass-hair);
  vertical-align: top;
}

.table thead th {
  background: rgba(19, 26, 51, .62);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--brass);
  white-space: nowrap;
}

.table tbody tr:nth-child(even) { background: rgba(244, 239, 228, .025); }
.table tbody tr:hover { background: rgba(53, 214, 192, .06); }
.table tbody tr:last-child td { border-bottom: 0; }

.table .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
  white-space: nowrap;
}

/* ---------------- 折叠面板 ---------------- */

.acc {
  border: 1px solid var(--brass-line);
  border-radius: var(--radius);
  background: rgba(19, 26, 51, .4);
  overflow: hidden;
}

.acc__item + .acc__item { border-top: 1px solid var(--brass-hair); }

.acc__btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border: 0;
  background: transparent;
  color: var(--ivory);
  font-size: 15.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}

.acc__btn:hover { background: var(--glass); }

.acc__icon {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--brass);
  transition: transform .2s var(--ease);
}

.acc__btn[aria-expanded="true"] .acc__icon { transform: rotate(45deg); }

.acc__body {
  padding: 0 20px 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ivory-soft);
}

.acc__body[hidden] { display: none; }

/* ---------------- 标签页 ---------------- */

.tabs__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--brass-line);
}

.tabs__btn {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 3px 3px 0 0;
  background: transparent;
  color: var(--card);
  font-size: 14.5px;
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease),
              background-color .16s var(--ease);
}

.tabs__btn:hover { color: var(--ivory); background: var(--glass); }

.tabs__btn[aria-selected="true"] {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: rgba(53, 214, 192, .07);
}

.tabs__panel { padding-top: 22px; }
.tabs__panel[hidden] { display: none; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--brass-line);
  border-radius: 3px;
  background: var(--glass);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: transform .16s var(--ease), border-color .16s var(--ease),
              background-color .16s var(--ease), color .16s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--brass);
  background: rgba(201, 162, 39, .12);
}

.btn--solid {
  background: var(--ivory);
  border-color: var(--ivory);
  color: var(--ink-green);
  font-weight: 600;
}
.btn--solid:hover { background: #FFFFFF; border-color: #FFFFFF; color: var(--ink-green); }

.btn--accent {
  background: var(--vermilion);
  border-color: var(--vermilion);
  color: #FFF3EF;
  font-weight: 600;
}
.btn--accent:hover { background: #D04B33; border-color: #D04B33; }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--glass); }

/* ---------------- 图片容器基础规则 ---------------- */

.img-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--brass-line);
  border-radius: var(--radius);
  background: var(--felt);
}

.img-frame__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.02);
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(158deg, rgba(14, 42, 36, .3), rgba(19, 26, 51, .48)),
    radial-gradient(circle at 30% 20%, rgba(244, 239, 228, .06), transparent 60%);
}

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

.img-frame__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 16px 12px;
  background: linear-gradient(180deg, transparent, rgba(14, 42, 36, .88));
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--card);
}

/* ---------------- 涌现动效 ---------------- */

html.is-ready [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}

html.is-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------- 回到顶部 ---------------- */

.footer-top {
  padding: 8px 14px;
  border: 1px solid var(--brass-line);
  border-radius: 3px;
  background: rgba(244, 239, 228, .06);
  color: var(--card);
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease),
              background-color .16s var(--ease);
}
.footer-top:hover { border-color: var(--brass); color: var(--ivory); background: rgba(201, 162, 39, .14); }

[data-to-top] {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}

[data-to-top][data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------------- 页脚 ---------------- */

.site-footer {
  margin-top: clamp(56px, 7vw, 104px);
  background-color: var(--indigo);
  background-image:
    radial-gradient(760px 300px at 12% 0%, rgba(28, 59, 51, .82), transparent 68%),
    linear-gradient(180deg, rgba(19, 26, 51, 1), #0D1226);
  border-top: 1px solid var(--brass-line);
  color: var(--card);
}

.footer-inner {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.5fr)
    repeat(3, minmax(112px, .82fr))
    minmax(230px, 1.3fr);
  gap: 32px;
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
  padding: 56px 0 40px;
}

.footer-brand { display: flex; flex-direction: column; gap: 8px; }

.footer-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.footer-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 3px;
  background: var(--ivory);
  border: 1px solid var(--brass-line);
  color: var(--ink-green);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.footer-brand__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ivory);
  letter-spacing: -.01em;
}

.footer-brand__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--brass-deep);
}

.footer-brand__intro {
  max-width: 34ch;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ivory-dim);
}

.footer-col { display: flex; flex-direction: column; gap: 12px; }

.footer-col__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--brass);
}

.footer-col__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-link {
  font-size: 14px;
  color: var(--ivory-dim);
  transition: color .16s var(--ease), padding-left .16s var(--ease);
}
.footer-link:hover { color: var(--cyan); padding-left: 3px; }

.footer-contact { display: flex; flex-direction: column; gap: 12px; }

.footer-contact__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-contact__item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13.5px;
  line-height: 1.7;
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--brass-deep);
  padding-top: 3px;
}

.footer-contact__val {
  color: var(--ivory-soft);
  word-break: break-word;
}

.footer-base {
  border-top: 1px solid rgba(201, 162, 39, .16);
}

.footer-base__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
  padding: 20px 0 26px;
}

.footer-base__legal {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--brass-deep);
}

.footer-base__note {
  flex: 1 1 260px;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--graphite);
}

/* 页脚里的回到顶部按钮同时出现在文档流中时保持紧凑 */
.footer-base .footer-top { margin-left: auto; }

/* ---------------- 平板 ---------------- */

@media (max-width: 1080px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 28px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-contact { grid-column: 1 / -1; }
  .footer-brand__intro { max-width: 52ch; }
}

/* ---------------- 手机 / 小屏：轨道变底部索引 ---------------- */

@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-bottom: 62px;
    font-size: 16px;
  }

  .site-rail {
    inset: auto 0 0 0;
    width: 100%;
    height: 62px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 0 14px;
    border-right: 0;
    border-top: 1px solid var(--brass-line);
    background-image: linear-gradient(180deg, rgba(19, 26, 51, .96), #0B1526);
    overflow: visible;
    transition: none;
  }

  .rail-brand { flex: 0 0 auto; }

  .rail-brand__link { gap: 8px; }

  .rail-brand__mark { width: 30px; height: 30px; font-size: 13px; }

  .rail-brand__name { font-size: 14px; }
  .rail-brand__tag { display: none; }

  .rail-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 62px;
    max-height: 68vh;
    overflow-y: auto;
    padding: 18px 16px 22px;
    background: #0B1F2C;
    border-top: 1px solid var(--brass-line);
    box-shadow: 0 -18px 40px rgba(6, 16, 14, .6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  }

  .site-rail[data-open] .rail-nav,
  .rail-nav[data-open] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .rail-nav__title { display: block; }
  .rail-nav__link { font-size: 15px; padding: 11px 10px; }
  .rail-nav__link:hover { transform: none; }
  .rail-meta { display: flex; }

  .rail-progress { flex: 1 1 auto; margin-left: auto; min-width: 60px; }
  .rail-progress__value { display: none; }

  .rail-toggle { display: inline-flex; flex: 0 0 auto; }

  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
  .col-3, .col-4, .col-5,
  .col-6, .col-7, .col-8, .col-9,
  .col-12 { grid-column: span 6; }

  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; padding: 44px 0 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-contact { grid-column: 1 / -1; }
  .footer-base .footer-top { margin-left: 0; }

  [data-to-top] { right: 16px; bottom: 78px; }
}

@media (max-width: 620px) {
  .wrap, .wrap--narrow, .footer-inner, .footer-base__inner {
    width: calc(100% - 32px);
  }

  .grid { grid-template-columns: minmax(0, 1fr); }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-12 { grid-column: span 1; }

  .panel { padding: 20px 18px; }
  .card { padding: 18px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-base__inner { padding: 18px 0 24px; }
}

/* ---------------- 降低动效 ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  html.is-ready [data-reveal] { opacity: 1; transform: none; }
  body { transition: none; }
  .site-rail { transition: none; }
}
