/* =========================================================
   JZ赛场 — /assets/site.css
   共享外壳：重置、变量、中文排版、侧边轨道头部、页脚、
   通用按钮 / 面包屑 / 容器 / 网格 / 基础组件
   ========================================================= */

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

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

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

ul, ol { padding: 0; }
ul[class], ol[class] { 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;
  padding: 0;
  cursor: pointer;
}

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

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

/* ---------- tokens ---------- */
:root {
  /* 品牌色板 */
  --ink: #0B0D10;
  --panel: #14181D;
  --float: #1E242B;
  --line: #2C343C;
  --cyan: #2BE8C8;
  --orange: #FF7A2F;
  --white: #E9EFF3;
  --mist: #93A2AE;
  --violet: #4C4E7C;
  --moss: #5A6B60;
  --clay: #C6B49C;

  /* 尺寸 */
  --rail-w: 88px;
  --bar-h: 56px;
  --gutter: clamp(18px, 4vw, 40px);
  --maxw: 1180px;
  --radius: 2px;

  /* 字体 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 中文排版基底 ---------- */
html { background: var(--ink); }

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .012em;
  color: var(--white);
  background-color: var(--ink);
  background-image:
    radial-gradient(1100px 620px at 88% -12%, rgba(76, 78, 124, .26), transparent 62%),
    radial-gradient(900px 520px at -6% 108%, rgba(43, 232, 200, .07), transparent 58%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.01em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

strong { font-weight: 700; color: var(--white); }

::selection {
  background: rgba(43, 232, 200, .28);
  color: var(--white);
}

/* ---------- 桌面：为常驻轨道让位 ---------- */
@media (min-width: 901px) {
  body { padding-left: var(--rail-w); }
}

@media (max-width: 900px) {
  body { padding-top: var(--bar-h); }
}

/* =========================================================
   跳转链接
   ========================================================= */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  display: inline-block;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
  background: var(--cyan);
  border-radius: var(--radius);
  transform: translateY(-180%);
  transition: transform .22s var(--ease);
}

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

/* =========================================================
   头部：侧边轨道
   ========================================================= */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 70;
  width: var(--rail-w);
  display: flex;
  background:
    linear-gradient(180deg, #0E1115 0%, #14181D 42%, #0F1216 100%);
  border-right: 1px solid var(--line);
}

.rail__inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0 14px;
  overflow-y: auto;
  scrollbar-width: none;
}

.rail__inner::-webkit-scrollbar { width: 0; height: 0; }

/* 品牌 */
.rail__brand {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 6px 0 12px;
  color: var(--white);
}

.rail__brand::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 1px;
  background: var(--cyan);
  transform: translateX(-50%);
}

.rail__brand::after {
  content: "";
  width: 24px;
  height: 1px;
  margin-top: 4px;
  background: var(--line);
}

.rail__mark {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.05em;
}

.rail__name {
  font-size: 10px;
  line-height: 1;
  letter-spacing: .34em;
  text-indent: .34em;
  color: var(--mist);
}

.rail__badge {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: .1em;
  color: var(--orange);
  border: 1px solid rgba(255, 122, 47, .46);
  border-radius: 1px;
  padding: 3px 5px;
  background: rgba(255, 122, 47, .07);
}

/* 导航 */
.rail__nav {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.rail__item { width: 100%; }

.rail__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 11px 0;
  color: var(--mist);
  transition: color .22s var(--ease);
}

.rail__link::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  background: var(--cyan);
  border-radius: 2px;
  opacity: 0;
  transform: scaleY(.4);
  transform-origin: center;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}

.rail__link:hover,
.rail__link:focus-visible { color: var(--white); }

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

.rail__link[aria-current="page"]::before {
  opacity: 1;
  transform: scaleY(1);
  box-shadow: 0 0 12px rgba(43, 232, 200, .62);
}

.rail__idx {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: .1em;
  color: var(--line);
  transition: color .22s var(--ease);
}

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

.rail__label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .18em;
}

/* 轨道底部 */
.rail__foot {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
}

.rail__cta {
  display: inline-block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .22em;
  padding: 16px 8px;
  color: #180B04;
  background: var(--orange);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px -12px rgba(255, 122, 47, .9);
  transition: transform .22s var(--ease), background .22s var(--ease);
}

.rail__cta:hover {
  background: #FF8C4A;
  transform: translateY(-2px);
}

.rail__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .16em;
  color: var(--mist);
}

.rail__status-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* 状态脉冲 */
.pulse {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(43, 232, 200, .55);
  animation: jz-pulse 1.8s ease-out infinite;
}

@keyframes jz-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(43, 232, 200, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(43, 232, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 232, 200, 0); }
}

/* 移动端汉堡（桌面隐藏） */
.rail__toggle {
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  width: 38px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--float);
}

.rail__toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--white);
  border-radius: 1px;
  transition: transform .26s var(--ease), opacity .18s linear;
}

.rail__toggle[aria-expanded="true"] .rail__toggle-bar:nth-child(1) {
  transform: translateY(6.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(-6.5px) rotate(-45deg);
}

/* 滚动进度 */
.rail__progress {
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--cyan) 0%, var(--violet) 55%, var(--orange) 100%);
  transform: scaleY(var(--p, 0));
  transform-origin: top center;
  pointer-events: none;
  opacity: .9;
}

/* =========================================================
   头部：移动端形态（顶部窄条 + 底部抽屉）
   ========================================================= */
@media (max-width: 900px) {
  .rail {
    right: 0;
    bottom: auto;
    width: 100%;
    height: var(--bar-h);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: #0C0F13;
  }

  .rail__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 100%;
    padding: 0 14px;
    overflow: visible;
  }

  .rail__brand {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
  }

  .rail__brand::before,
  .rail__brand::after { display: none; }

  .rail__mark { font-size: 21px; }

  .rail__name {
    font-size: 12px;
    letter-spacing: .16em;
    text-indent: 0;
    color: var(--white);
  }

  .rail__badge { padding: 2px 4px; }

  /* 抽屉 */
  .rail__nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    flex: none;
    width: 100%;
    max-height: 76vh;
    overflow-y: auto;
    padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #171C22 0%, #0B0D10 86%);
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -24px 60px rgba(0, 0, 0, .68);
    transform: translateY(104%);
    transition: transform .4s var(--ease);
    z-index: 95;
  }

  .rail__nav[data-open] { transform: translateY(0); }

  .rail__nav::before {
    content: "";
    display: block;
    width: 38px;
    height: 2px;
    margin: 0 auto 14px;
    border-radius: 2px;
    background: var(--line);
  }

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

  .rail__link {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    padding: 15px 2px;
    border-bottom: 1px solid var(--line);
  }

  .rail__item:last-child .rail__link { border-bottom: 0; }

  .rail__link::before { display: none; }

  .rail__link[aria-current="page"] {
    color: var(--cyan);
    box-shadow: inset 2px 0 0 var(--cyan);
  }

  .rail__idx { font-size: 10px; }

  .rail__label {
    writing-mode: horizontal-tb;
    font-size: 15px;
    letter-spacing: .06em;
  }

  .rail__foot {
    order: 2;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: auto;
    padding: 0;
    border-top: 0;
  }

  .rail__cta {
    writing-mode: horizontal-tb;
    font-size: 12px;
    letter-spacing: .08em;
    padding: 9px 14px;
  }

  .rail__status { flex-direction: row; gap: 6px; }

  .rail__status-text { display: none; }

  .rail__toggle { display: flex; order: 3; }

  .rail__progress {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    transform: scaleX(var(--p, 0));
    transform-origin: left center;
  }
}

/* 矮屏桌面轨道微调 */
@media (min-width: 901px) and (max-height: 780px) {
  .rail__idx { display: none; }
  .rail__link { padding: 9px 0; gap: 0; }
  .rail__label { font-size: 12px; letter-spacing: .14em; }
  .rail__brand { padding-bottom: 8px; }
}

/* =========================================================
   页脚
   ========================================================= */
.foot {
  position: relative;
  margin-top: clamp(48px, 8vw, 96px);
  padding: clamp(46px, 6vw, 76px) var(--gutter) calc(26px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #0F1319 0%, #0B0D10 64%);
  border-top: 1px solid var(--line);
}

/* 顶部刻度尺母题 */
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0 1px,
    transparent 1px 15px
  );
  opacity: .85;
  pointer-events: none;
}

.foot::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(64px, 14vw, 180px);
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  pointer-events: none;
}

.foot__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}

.foot__top {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: clamp(26px, 4vw, 56px);
}

.foot__brand { min-width: 0; }

.foot__mark {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--white);
}

.foot__tagline {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: .06em;
  color: var(--clay);
}

.foot__status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .05em;
  color: var(--mist);
}

.foot__col { min-width: 0; }

.foot__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mist);
}

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

.foot__link {
  display: inline-block;
  font-size: 14px;
  line-height: 1.6;
  color: var(--white);
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.foot__link:hover,
.foot__link:focus-visible {
  color: var(--cyan);
  border-bottom-color: rgba(43, 232, 200, .5);
}

.foot__contact-line {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  letter-spacing: .02em;
  color: var(--mist);
  word-break: break-word;
}

.foot__rule {
  height: 1px;
  margin: clamp(28px, 4vw, 44px) 0 18px;
  background: var(--line);
}

.foot__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
}

.foot__legal,
.foot__version {
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--mist);
}

.foot__version {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--clay);
}

@media (max-width: 980px) {
  .foot__top { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .foot__top { grid-template-columns: 1fr; gap: 28px; }
  .foot__bottom { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   通用容器 / 网格 / 排版原子
   ========================================================= */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}

@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mist);
}

.label::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  background: var(--cyan);
  border-radius: 1px;
}

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

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

/* =========================================================
   按钮
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .05em;
  color: var(--white);
  background: var(--float);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s var(--ease), border-color .2s var(--ease),
    background-color .2s var(--ease), color .2s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--cyan);
}

.btn:active { transform: translateY(0); }

.btn--signal {
  color: #180B04;
  font-weight: 700;
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 14px 30px -20px rgba(255, 122, 47, .95);
}

.btn--signal:hover,
.btn--signal:focus-visible {
  background: #FF8C4A;
  border-color: #FF8C4A;
}

.btn--ghost {
  background: transparent;
  color: var(--white);
}

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

/* =========================================================
   面包屑
   ========================================================= */
.crumb {
  padding-top: clamp(16px, 3vw, 26px);
}

.crumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: .1em;
  color: var(--mist);
}

.crumb__link {
  color: var(--mist);
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.crumb__link:hover,
.crumb__link:focus-visible {
  color: var(--cyan);
  border-bottom-color: rgba(43, 232, 200, .5);
}

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

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

/* =========================================================
   浮层卡
   ========================================================= */
.card {
  position: relative;
  padding: clamp(18px, 2.4vw, 26px);
  background: var(--float);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 44px -30px rgba(0, 0, 0, .95);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .01em;
  color: var(--white);
}

/* =========================================================
   图片容器基础规则（页面阶段放入 <img>）
   ========================================================= */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: #12161B;
  background-image:
    linear-gradient(135deg, rgba(76, 78, 124, .38), transparent 58%),
    linear-gradient(160deg, #1A2028 0%, #10141A 72%);
  isolation: isolate;
}

.media::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(147, 162, 174, .16);
  border-radius: 1px;
  pointer-events: none;
  z-index: 2;
}

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

.media > img { position: relative; z-index: 1; }

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

.media__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #15110D;
  background: var(--clay);
}

@media (max-width: 560px) {
  .media--tall { aspect-ratio: 4 / 5; }
}

/* =========================================================
   滚动显现（页面阶段给区块加 data-reveal）
   ========================================================= */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .52s var(--ease), transform .52s var(--ease);
  will-change: opacity, transform;
}

.js-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* =========================================================
   无障碍：减少动态效果
   ========================================================= */
@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;
  }

  .pulse { animation: none; box-shadow: 0 0 0 3px rgba(43, 232, 200, .18); }

  .js-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rail__nav { transition: none; }
}
