/* ============================================================
   365官方游 · 全站共享样式 /assets/site.css
   暗色展览画册 × 赛博游戏厅
   ============================================================ */

:root {
  --ink-0: #070B16;
  --ink-1: #0A0F1E;
  --ink-2: #11152A;
  --cyan: #22D3EE;
  --violet: #A855F7;
  --orange: #FB923C;
  --yellow: #FDE047;
  --wine: #3B1220;
  --teal: #062C2E;

  --text: #E5E7EB;
  --text-2: #94A3B8;
  --text-hi: #F2F6FF;
  --line: rgba(34, 211, 238, 0.22);
  --line-soft: rgba(148, 163, 184, 0.14);
  --err: #F87171;

  --rail: 108px;
  --topbar: 60px;
  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-head: "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", sans-serif;
  --font-body: "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Courier New", monospace;
}

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

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

body {
  margin: 0;
  min-height: 100%;
  padding-left: var(--rail);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--ink-0);
  background-image:
    radial-gradient(1200px 640px at 6% -12%, rgba(168, 85, 247, 0.2), transparent 62%),
    radial-gradient(1000px 560px at 96% 2%, rgba(34, 211, 238, 0.15), transparent 60%),
    radial-gradient(900px 700px at 62% 112%, rgba(34, 211, 238, 0.07), transparent 66%),
    linear-gradient(rgba(34, 211, 238, 0.042) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.042) 1px, transparent 1px);
  background-size: auto, auto, auto, 72px 72px, 72px 72px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: var(--cyan);
}

ul,
ol {
  padding-left: 1.15rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.012em;
  margin: 0 0 0.6em;
  color: var(--text-hi);
  text-shadow: 0 0 34px rgba(34, 211, 238, 0.16);
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

h4 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 1.15em;
}

p:last-child {
  margin-bottom: 0;
}

hr {
  border: 0;
  height: 1px;
  background: var(--line-soft);
  margin: 2.5rem 0;
}

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

::selection {
  background: rgba(34, 211, 238, 0.28);
  color: #fff;
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  transform: translateY(-160%);
  padding: 0.8rem 1.25rem;
  background: var(--cyan);
  color: #04121a;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.22s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline-offset: -3px;
}

/* ---------- 布局容器 ---------- */
.wrap,
.wrap--mid,
.wrap--narrow {
  margin-inline: auto;
}

.wrap {
  width: min(1180px, 100% - 3rem);
}

.wrap--mid {
  width: min(960px, 100% - 3rem);
}

.wrap--narrow {
  width: min(720px, 100% - 3rem);
}

.zone {
  position: relative;
  padding: clamp(3rem, 7vw, 6.25rem) 0;
}

.zone--tight {
  padding: clamp(1.75rem, 3.5vw, 2.75rem) 0;
}

.zone--wine {
  background: linear-gradient(180deg, rgba(59, 18, 32, 0.82) 0%, rgba(59, 18, 32, 0.28) 100%);
  border-block: 1px solid rgba(248, 113, 113, 0.16);
}

.zone--teal {
  background: linear-gradient(180deg, rgba(6, 44, 46, 0.85) 0%, rgba(6, 44, 46, 0.26) 100%);
  border-block: 1px solid rgba(34, 211, 238, 0.16);
}

.zone--indigo {
  background: linear-gradient(180deg, rgba(17, 21, 42, 0.92) 0%, rgba(10, 15, 30, 0.6) 100%);
  border-block: 1px solid var(--line-soft);
}

.grid {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

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

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

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

.stack {
  display: grid;
  gap: var(--stack-gap, 1.25rem);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.rule {
  height: 1px;
  border: 0;
  background: var(--line-soft);
  margin: clamp(2rem, 4vw, 3rem) 0;
}

.lede {
  font-size: clamp(1.03rem, 1.5vw, 1.22rem);
  line-height: 1.85;
  color: var(--text-2);
  max-width: 62ch;
}

.mono-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* ---------- 头部：左侧展签轨道 ---------- */
.site-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  padding: 1.6rem 0.6rem 1.2rem;
  background: linear-gradient(180deg, rgba(17, 21, 42, 0.95) 0%, rgba(7, 11, 22, 0.98) 100%);
  border-right: 1px solid var(--line);
  box-shadow: 26px 0 70px -56px rgba(34, 211, 238, 0.95);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-rail::-webkit-scrollbar {
  width: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.2rem;
  flex: 0 0 auto;
}

.brand__mark {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
  padding: 0.35rem 0.5rem;
  border-radius: 2px;
  box-shadow: 0 0 22px -6px rgba(34, 211, 238, 0.9);
}

.brand__name {
  writing-mode: vertical-rl;
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  color: var(--text-2);
}

.rail__toggle {
  display: none;
}

.rail__nav {
  display: flex;
  justify-content: center;
}

.rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.05rem;
}

.rail__item {
  display: flex;
  justify-content: center;
}

.rail__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.15rem;
  text-decoration: none;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}

.rail__link::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.85);
  opacity: 0;
  transform: scaleY(0.35);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.rail__link:hover {
  color: var(--text);
}

.rail__link:hover::before {
  opacity: 0.5;
  transform: scaleY(1);
}

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

.rail__link[aria-current="page"]::before {
  opacity: 1;
  transform: scaleY(1);
}

.rail__index {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--text-2);
  opacity: 0.65;
  transition: color 0.3s var(--ease), opacity 0.3s var(--ease);
}

.rail__link:hover .rail__index,
.rail__link[aria-current="page"] .rail__index {
  color: var(--cyan);
  opacity: 1;
}

.rail__label {
  writing-mode: vertical-rl;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.rail__quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.42rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
  width: 76%;
}

.rail__quick-title {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.18em;
  color: rgba(148, 163, 184, 0.75);
  margin-bottom: 0.15rem;
}

.rail__quick-link {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.rail__quick-link:hover {
  color: var(--orange);
}

.rail__current {
  margin: auto 0 0;
  text-align: center;
  padding: 0 0.35rem 0.25rem;
  max-width: 100%;
}

.rail__current-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  color: rgba(148, 163, 184, 0.8);
}

.rail__current-value {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}

/* ---------- 章节展签 ---------- */
.chapter {
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}

.chapter__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.chapter__no {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: var(--cyan);
  text-transform: uppercase;
}

.chapter__title {
  margin: 0;
}

.chapter__note {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  color: rgba(148, 163, 184, 0.7);
  align-self: flex-start;
  margin-left: auto;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 21, 42, 0.72);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.btn--sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.8125rem;
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.95) 0%, rgba(168, 85, 247, 0.92) 100%);
  color: #04121a;
  font-weight: 700;
  box-shadow: 0 0 34px -14px rgba(34, 211, 238, 0.95);
}

.btn--warm {
  border-color: transparent;
  background: linear-gradient(135deg, var(--orange) 0%, var(--yellow) 100%);
  color: #1a0f02;
  font-weight: 700;
  box-shadow: 0 0 34px -14px rgba(251, 146, 60, 0.95);
}

.btn--ghost:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 26px -12px rgba(34, 211, 238, 0.9);
}

.btn:hover {
  transform: translateY(-2px);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  line-height: 1.6;
  color: var(--text-2);
  background: rgba(17, 21, 42, 0.6);
}

.tag--cyan {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.1);
}

.tag--violet {
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.12);
}

.tag--warm {
  color: var(--orange);
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.12);
}

.tag--yellow {
  color: var(--yellow);
  border-color: rgba(253, 224, 71, 0.4);
  background: rgba(253, 224, 71, 0.1);
}

.tag--ghost {
  color: rgba(148, 163, 184, 0.85);
}

/* ---------- 卡片：作品说明牌 ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 21, 42, 0.9) 0%, rgba(10, 15, 30, 0.72) 100%);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.card:hover {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.14), 0 20px 44px -28px rgba(34, 211, 238, 0.65);
  transform: translateY(-3px);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card__title {
  margin: 0;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
}

.card__meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--text-2);
}

.card__body {
  color: var(--text-2);
  font-size: 0.9375rem;
  margin: 0;
}

.card__foot {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- 图片容器（页面阶段放置图片占位） ---------- */
.figure {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(140deg, rgba(17, 21, 42, 0.95) 0%, rgba(6, 9, 16, 0.95) 100%);
}

.figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mix-blend-mode: screen;
}

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

.figure--wide {
  aspect-ratio: 16 / 9;
}

.figure--panel {
  aspect-ratio: 21 / 9;
}

.figure--tall {
  aspect-ratio: 3 / 4;
}

.figure--square {
  aspect-ratio: 1 / 1;
}

.figure__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--text-2);
  background: linear-gradient(0deg, rgba(7, 11, 22, 0.94) 0%, rgba(7, 11, 22, 0) 100%);
}

/* ---------- 面包屑 ---------- */
.crumbs {
  padding: 0.9rem 0;
  font-size: 0.8125rem;
}

.crumbs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.crumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.crumbs__link {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

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

.crumbs__sep {
  color: rgba(148, 163, 184, 0.45);
}

.crumbs__current {
  color: var(--cyan);
}

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 页脚 ---------- */
.site-foot {
  position: relative;
  z-index: 2;
  margin-top: clamp(4rem, 9vw, 8rem);
  padding: clamp(2.75rem, 5vw, 4.5rem) 0 1.5rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.35) 0%, rgba(10, 15, 30, 0.96) 100%);
  color: var(--text-2);
  font-size: 0.9375rem;
}

.foot__inner {
  width: min(1180px, 100% - 3rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1.9fr) minmax(240px, 1.25fr);
  gap: clamp(2rem, 4vw, 3.5rem);
}

.foot__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.brand--foot {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.brand--foot .brand__name {
  writing-mode: horizontal-tb;
  letter-spacing: 0.2em;
  font-size: 0.8125rem;
  color: var(--text);
}

.foot__tagline {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 22ch;
}

.foot__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.foot__col-title {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--cyan);
  text-shadow: none;
}

.foot__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.foot__links a {
  display: inline-block;
  color: var(--text-2);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.foot__links a:hover {
  color: var(--cyan);
  padding-left: 0.35rem;
}

.foot__contact {
  min-width: 0;
}

.foot__contact-list {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.foot__contact-row {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
}

.foot__contact-row dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.8);
  padding-top: 0.22rem;
}

.foot__contact-row dd {
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.65;
  word-break: break-word;
}

.foot__copy {
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.foot__copy:hover {
  background: rgba(34, 211, 238, 0.12);
}

.foot__copy.is-done {
  color: var(--yellow);
  border-color: rgba(253, 224, 71, 0.45);
}

.foot__note {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
  line-height: 1.7;
  color: rgba(148, 163, 184, 0.8);
}

.foot__legal {
  width: min(1180px, 100% - 3rem);
  margin: clamp(2.5rem, 4vw, 3.5rem) auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
}

.foot__legal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.8);
}

/* ---------- 返回顶部 & 滚动进度 ---------- */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 130;
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
  background: rgba(10, 15, 30, 0.94);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
    visibility 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 26px -8px rgba(34, 211, 238, 0.9);
}

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  z-index: 129;
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: top center;
  background: linear-gradient(180deg, var(--cyan) 0%, var(--violet) 60%, var(--orange) 100%);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.55);
}

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

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

  .foot__contact {
    grid-column: 1 / -1;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line-soft);
  }
}

/* ---------- 移动端：顶部条 + 抽屉 ---------- */
@media (max-width: 899px) {
  body {
    padding-left: 0;
    padding-top: var(--topbar);
  }

  .site-rail {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: var(--topbar);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0.9rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 46px -38px rgba(34, 211, 238, 0.95);
    overflow: visible;
  }

  .brand {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
  }

  .brand__name {
    writing-mode: horizontal-tb;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
  }

  .rail__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    color: var(--text);
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    cursor: pointer;
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
  }

  .rail__toggle:hover {
    border-color: var(--cyan);
    color: var(--cyan);
  }

  .rail__toggle-bars {
    position: relative;
    display: block;
    width: 15px;
    height: 1px;
    background: currentColor;
  }

  .rail__toggle-bars::before,
  .rail__toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 15px;
    height: 1px;
    background: currentColor;
  }

  .rail__toggle-bars::before {
    top: -5px;
  }

  .rail__toggle-bars::after {
    top: 5px;
  }

  .rail__nav {
    position: fixed;
    top: var(--topbar);
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    display: block;
    padding: 1.25rem 1rem 2.5rem;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(17, 21, 42, 0.99) 0%, rgba(7, 11, 22, 0.99) 100%);
    border-right: 1px solid var(--line);
    box-shadow: 44px 0 90px -62px rgba(34, 211, 238, 1);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0.32s var(--ease);
  }

  .rail__nav[data-open] {
    transform: translateX(0);
    visibility: visible;
  }

  .rail__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .rail__item {
    display: block;
    border-bottom: 1px solid var(--line-soft);
  }

  .rail__link {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    width: 100%;
    padding: 0.95rem 0.35rem;
  }

  .rail__link::before {
    display: none;
  }

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

  .rail__label {
    writing-mode: horizontal-tb;
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
  }

  .rail__quick,
  .rail__current {
    display: none;
  }

  body[data-nav-open] {
    overflow: hidden;
  }

  .foot__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }

  .foot__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1.25rem;
  }

  .foot__contact {
    padding-top: 0;
    border-top: 0;
  }

  .chapter__note {
    display: none;
  }

  .to-top {
    right: 0.85rem;
    bottom: 0.85rem;
  }
}

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

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

  .wrap,
  .wrap--mid,
  .wrap--narrow,
  .foot__inner,
  .foot__legal {
    width: calc(100% - 2rem);
  }
}

/* ---------- 减少动态效果 ---------- */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .card:hover {
    transform: none;
  }
}
