/* ============================================================
   排列3中文专区 · 共享样式表 /assets/site.css
   负责：重置、变量、中文排版、头部、页脚、通用按钮、
   面包屑、正文容器、网格、基础组件、响应式与可达性
   ============================================================ */

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

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

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

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

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

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

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

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

/* ---------- 2. 变量 ---------- */
:root {
  /* 色板 */
  --red: #D7262E;
  --red-deep: #8E1118;
  --red-soft: #F3D6D6;
  --ink: #141414;
  --char: #2B2B2B;
  --cream: #F4EFE6;
  --paper: #FBF8F2;
  --teal: #1F7A8C;
  --teal-deep: #0E4E5A;
  --fog: #C9C2B6;

  /* 字体 */
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* 尺寸 */
  --rail-w: 96px;
  --bar-h: 68px;
  --rail-h: 0px;
  --flow-gap: 32px;
  --content-top-offset: calc(var(--bar-h) + var(--flow-gap));
  --page-max: 1200px;
  --pad: clamp(18px, 4vw, 56px);

  /* 形状 */
  --line: 1px solid var(--fog);
  --shadow-hard: 8px 8px 0 var(--ink);
  --shadow-mid: 6px 6px 0 var(--ink);

  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: 180ms;
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .01em;
  color: var(--ink);
  background-color: var(--cream);
  padding-left: var(--rail-w);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.015em;
  color: var(--ink);
}

h1 { font-size: clamp(32px, 4.4vw, 60px); font-weight: 900; }
h2 { font-size: clamp(24px, 2.5vw, 30px); }
h3 { font-size: clamp(19px, 1.9vw, 22px); }
h4 { font-size: 17px; }

p + p { margin-top: 1em; }

strong { font-weight: 700; }

code, kbd, samp { font-family: var(--mono); }

::selection { background: var(--red); color: var(--paper); }

/* ---------- 4. 可达性基础 ---------- */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.site-footer :focus-visible,
.rail :focus-visible {
  outline-color: var(--teal);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  display: inline-block;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  border: 2px solid var(--teal);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

html.is-locked { overflow: hidden; }

#main-content {
  display: block;
  padding-top: var(--content-top-offset);
  scroll-margin-top: calc(var(--bar-h) + 16px);
}

/* ---------- 5. 头部 · 品牌轨道 ---------- */
.site-header { position: relative; z-index: 100; }

.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 0 20px;
  background: var(--ink);
  color: var(--cream);
  border-right: 2px solid var(--red);
}

.rail__brand {
  display: block;
  color: var(--paper);
}

.rail__brand-line {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .22em;
  line-height: 1;
}

.rail__badge {
  display: inline-block;
  padding: 3px 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--paper);
  background: var(--teal);
  border: 1px solid var(--teal-deep);
}

.rail__rule {
  display: block;
  width: 2px;
  height: 44px;
  background: var(--red);
}

.rail__index {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.rail__index-item {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  color: rgba(244, 239, 230, .34);
}

.rail__toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 2px solid currentColor;
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.rail__toggle:hover { background: var(--red); color: var(--paper); }

.rail__toggle-bars {
  display: block;
  position: relative;
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

/* ---------- 6. 头部 · 顶部导航 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: var(--bar-h);
  z-index: 110;
  display: flex;
  align-items: center;
  color: var(--paper);
  background: transparent;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.topbar.is-solid {
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--fog), 0 14px 26px -24px rgba(20, 20, 20, .8);
}

.topbar__inner {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.topbar__lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  color: inherit;
}

.topbar__name {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.2;
}

.topbar__descriptor {
  font-size: 11px;
  letter-spacing: .12em;
  line-height: 1.3;
  opacity: .72;
}

.site-nav { margin-left: auto; }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 24px);
}

.site-nav__item { flex-shrink: 0; }

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 1px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  color: inherit;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: currentColor;
  transition: width var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.site-nav__link:hover::after { width: 100%; }

.site-nav__link[aria-current="page"] {
  font-weight: 800;
  color: var(--red);
}

.topbar.is-solid .site-nav__link[aria-current="page"] { color: var(--red); }

.site-nav__link[aria-current="page"]::after {
  width: 100%;
  background: var(--red);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 6px;
}

/* ---------- 7. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 160ms var(--ease),
              box-shadow 160ms var(--ease),
              background-color 160ms var(--ease),
              color 160ms var(--ease),
              border-color 160ms var(--ease);
}

.btn--solid {
  background: var(--red);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn--solid:hover {
  background: var(--red-deep);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.btn--solid:active {
  transform: translate(0, 0);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn--ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn--ghost:hover { background: rgba(20, 20, 20, .08); }

.btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  box-shadow: 4px 4px 0 var(--ink);
}

.btn--sm:hover { box-shadow: 6px 6px 0 var(--ink); }

.cmdbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 2px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.cmdbtn:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

.cmdbtn__key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  padding: 1px 5px;
  border: 1px solid currentColor;
  opacity: .8;
}

.cmdbtn__text { line-height: 1; }

/* ---------- 8. 命令面板 ---------- */
.cmp {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: start center;
  padding: 11vh 16px 24px;
}

.cmp[hidden] { display: none; }

.cmp__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, .68);
}

.cmp__panel {
  position: relative;
  width: min(640px, 100%);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 var(--red);
  padding: 18px 18px 14px;
}

.cmp__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.cmp__title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .08em;
}

.cmp__close {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--char);
  padding: 4px 8px;
  border: 1px solid var(--fog);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.cmp__close:hover { color: var(--red); border-color: var(--red); }

.cmp__field { margin-top: 14px; }

.cmp__label {
  display: block;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--char);
  margin-bottom: 6px;
}

.cmp__input {
  width: 100%;
  padding: 11px 12px;
  border: 2px solid var(--ink);
  background: var(--cream);
  font-size: 15px;
  letter-spacing: .02em;
}

.cmp__input::placeholder { color: #8b8378; }

.cmp__hint {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: #6f6a62;
}

.cmp__list {
  margin-top: 12px;
  max-height: 46vh;
  overflow-y: auto;
  border-top: 1px solid var(--fog);
}

.cmp__row { border-bottom: 1px solid var(--fog); }

.cmp__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border-left: 3px solid transparent;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease);
}

.cmp__item:hover,
.cmp__item.is-active {
  background: var(--red-soft);
  border-left-color: var(--red);
}

.cmp__item-label { font-size: 15px; font-weight: 700; letter-spacing: .02em; }

.cmp__item-hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--teal-deep);
}

.cmp__empty {
  padding: 18px 4px 6px;
  font-size: 14px;
  color: var(--char);
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  border-top: 6px solid var(--red);
  margin-top: 96px;
}

.footer__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 64px var(--pad) 30px;
}

.footer__lede {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(244, 239, 230, .18);
}

.footer__brand {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--paper);
}

.footer__tagline {
  font-size: 14px;
  letter-spacing: .03em;
  color: rgba(244, 239, 230, .72);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.6fr;
  gap: 30px 32px;
  padding: 38px 0 12px;
}

.footer__title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--fog);
  margin-bottom: 14px;
}

.footer__list { display: flex; flex-direction: column; gap: 9px; }

.footer__link {
  position: relative;
  display: inline-block;
  font-size: 14.5px;
  letter-spacing: .02em;
  color: rgba(244, 239, 230, .88);
  padding-bottom: 1px;
  transition: color var(--dur) var(--ease);
}

.footer__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width var(--dur) var(--ease);
}

.footer__link:hover { color: var(--paper); }
.footer__link:hover::after { width: 100%; }

.footer__col--contact { min-width: 0; }

.footer__contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(244, 239, 230, .14);
}

.footer__value {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--paper);
  word-break: break-word;
  line-height: 1.6;
}

.copybtn {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  padding: 3px 8px;
  border: 1px solid rgba(244, 239, 230, .42);
  color: var(--fog);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.copybtn:hover { color: var(--paper); border-color: var(--red); }

.copybtn.is-done { color: var(--teal); border-color: var(--teal); }

.footer__note {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.8;
  letter-spacing: .01em;
  color: rgba(244, 239, 230, .62);
}

.footer__bottom {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 239, 230, .18);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--fog);
}

.footer__legal-item--ver {
  color: var(--paper);
  background: var(--teal);
  padding: 2px 7px;
}

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

.grid {
  display: grid;
  gap: clamp(18px, 2.4vw, 32px);
}

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

/* ---------- 11. 基础组件 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--char);
}

.crumbs__item { display: inline-flex; align-items: center; gap: 8px; }

.crumbs__link {
  color: var(--char);
  transition: color var(--dur) var(--ease);
}

.crumbs__link:hover { color: var(--red); }

.crumbs__sep { color: var(--fog); }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--teal-deep);
}

.sec-num {
  display: block;
  font-family: var(--mono);
  font-weight: 300;
  font-size: clamp(46px, 7vw, 92px);
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--red);
}

.media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--char);
  box-shadow: var(--shadow-mid);
}

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

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(20, 20, 20, .10) 0,
    rgba(20, 20, 20, .10) 1px,
    transparent 1px,
    transparent 5px
  );
  opacity: .5;
  mix-blend-mode: multiply;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--21x9 { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }

/* ---------- 12. 响应式 · 平板 ---------- */
@media (max-width: 1140px) {
  .topbar__descriptor { display: none; }
  .cmdbtn__text { display: none; }
  .cmdbtn { padding: 0 10px; }
  .site-nav__link { font-size: 13.5px; }
  .footer__grid { grid-template-columns: 1fr 1fr 1.5fr; }
  .footer__col--contact { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .topbar__actions .btn--sm { display: none; }
}

/* ---------- 13. 响应式 · 移动端（轨道转顶部条，导航转抽屉） ---------- */
@media (max-width: 900px) {
  :root {
    --rail-w: 0px;
    --rail-h: 60px;
    --bar-h: 0px;
    --flow-gap: 24px;
    --content-top-offset: calc(var(--rail-h) + var(--flow-gap));
  }

  body { padding-left: 0; }

  #main-content { scroll-margin-top: calc(var(--rail-h) + 12px); }

  .rail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: var(--rail-h);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-right: 0;
    border-bottom: 2px solid var(--red);
  }

  .rail__brand-line {
    writing-mode: horizontal-tb;
    font-size: 15px;
    letter-spacing: .14em;
  }

  .rail__rule,
  .rail__index { display: none; }

  .rail__toggle { display: inline-flex; }

  .topbar {
    position: fixed;
    top: var(--rail-h);
    left: 0;
    right: 0;
    height: auto;
    max-height: calc(100vh - var(--rail-h));
    overflow-y: auto;
    display: block;
    background: var(--paper);
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
    box-shadow: 0 18px 30px -26px rgba(20, 20, 20, .9);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease),
                transform var(--dur) var(--ease),
                visibility var(--dur) var(--ease);
  }

  .topbar[data-open="true"] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .topbar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 16px;
    max-width: none;
  }

  .topbar__lockup { display: none; }

  .site-nav { margin-left: 0; }

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

  .site-nav__item { width: 100%; }

  .site-nav__link {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border-bottom: 1px solid var(--fog);
    white-space: normal;
  }

  .site-nav__link::after { display: none; }

  .site-nav__link[aria-current="page"] {
    background: var(--red-soft);
    box-shadow: inset 3px 0 0 var(--red);
  }

  .topbar__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px 20px 0;
    margin-left: 0;
  }

  .topbar__actions .btn--sm { display: inline-flex; }

  .cmdbtn {
    height: 42px;
    justify-content: center;
    border-color: var(--ink);
    color: var(--ink);
  }

  .cmdbtn:hover { color: var(--paper); }

  .cmdbtn__text { display: inline; }

  .cmp { padding: 8vh 12px 18px; }

  .cmp__panel { box-shadow: 6px 6px 0 var(--red); }

  .cmp__list { max-height: 52vh; }

  .site-footer { margin-top: 72px; }

  .footer__inner { padding: 48px var(--pad) 26px; }

  .footer__lede { padding-bottom: 22px; }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
    padding: 30px 0 8px;
  }

  .footer__col--contact { grid-column: 1 / -1; }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 32px;
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }

  .footer__grid { grid-template-columns: 1fr; }

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

  .cmp__item { flex-direction: column; gap: 2px; }

  .btn { width: 100%; }
}

/* ---------- 14. 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .btn--solid:hover,
  .btn--solid:active {
    transform: none;
  }

  .topbar[data-open="true"] { transform: none; }
}

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