/* =========================================================
   米乐M6娱乐 · site.css
   北境赛场 / 堆叠画板 / 侧轨索引
   ========================================================= */

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

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

body, h1, h2, h3, h4, h5, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }

:root {
  /* 色彩 */
  --ink: #071426;
  --ink-panel: #0E233C;
  --ice: #2F7DF6;
  --aurora: #27E0C8;
  --signal: #FF6B3D;
  --frost: #F2F6FA;
  --steel: #A9C2D8;
  --paper: #E9E2D3;
  --graphite: #101820;
  --silver: #6F8BA8;

  --line: rgba(169, 194, 216, 0.16);
  --line-strong: rgba(169, 194, 216, 0.34);

  /* 尺寸 */
  --rail: 96px;
  --gutter: clamp(18px, 4vw, 64px);
  --maxw: 1440px;

  /* 字体 */
  --font-display: 'Oswald', 'Barlow Condensed', 'Noto Sans SC', 'Source Han Sans SC', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Roboto Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-body: 'Noto Sans SC', 'Source Han Sans SC', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 基础排版 ---------- */
body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--frost);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.15; font-weight: 700; }
p { max-width: 68ch; }

.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 6vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--aurora);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}

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

/* ---------- 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

.panel {
  background: var(--ink-panel);
  border: 1px solid var(--line);
  padding: clamp(18px, 3vw, 36px);
}

.panel--paper {
  background: var(--paper);
  color: var(--graphite);
  border-color: rgba(16, 24, 32, 0.18);
}
.panel--paper .eyebrow { color: #7B3A16; }

.panel--angled {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 22px));
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn--primary {
  background: var(--ice);
  color: var(--frost);
}
.btn--primary:hover { background: var(--aurora); color: #05131c; }

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--frost);
}
.btn--ghost:hover { border-color: var(--aurora); color: var(--aurora); }

.btn--signal {
  background: var(--signal);
  color: #1a0803;
}
.btn--signal:hover { background: #ff8459; }

.btn--block { width: 100%; }

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--silver);
}
.breadcrumb a { color: var(--steel); }
.breadcrumb a:hover { color: var(--aurora); }
.breadcrumb__sep { color: var(--line-strong); }

/* ---------- 图片容器基础规则 ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--ink-panel);
  border: 1px solid var(--line);
}
.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.32;
}
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--3x4 { aspect-ratio: 3 / 4; }

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--silver);
}

/* ---------- 滚动显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 跳至主要内容 ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--aurora);
  color: #05131c;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  transform: translateY(-200%);
  transition: transform 0.18s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 头部：移动端形态（默认） ---------- */
.site-header {
  position: relative;
  z-index: 100;
}

.site-header__bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--gutter);
  background: rgba(7, 20, 38, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  flex: 0 0 auto;
  padding: 4px 7px;
  background: var(--aurora);
  color: #05131c;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  line-height: 1.2;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--frost);
  white-space: nowrap;
}

.brand__note {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--silver);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  white-space: nowrap;
}

/* ---------- 抽屉按钮 ---------- */
.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  color: var(--frost);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-toggle:hover { border-color: var(--aurora); color: var(--aurora); }

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}
.nav-toggle__bar {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.18s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child {
  transform: translateY(2.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-child {
  transform: translateY(-2.5px) rotate(-45deg);
}

.nav-toggle__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
}

/* ---------- 导航：移动端抽屉 ---------- */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(330px, 88vw);
  z-index: 97;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 78px 22px 26px;
  background: var(--ink-panel);
  border-left: 1px solid var(--line-strong);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.26s var(--ease), visibility 0s linear 0.26s;
}
.site-nav[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.26s var(--ease), visibility 0s linear 0s;
}

.site-nav__list {
  display: flex;
  flex-direction: column;
}

.site-nav__item + .site-nav__item {
  border-top: 1px solid var(--line);
}

.site-nav__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 4px 14px 10px;
  color: var(--steel);
  font-size: 16px;
  border-left: 2px solid transparent;
  transition: color 0.16s var(--ease), padding-left 0.16s var(--ease), background 0.16s var(--ease);
}
.site-nav__link:hover {
  color: var(--frost);
  padding-left: 16px;
  background: rgba(47, 125, 246, 0.08);
}
.site-nav__link[aria-current="page"] {
  color: var(--aurora);
  border-left-color: var(--aurora);
  background: linear-gradient(90deg, rgba(39, 224, 200, 0.16), rgba(39, 224, 200, 0));
}

.site-nav__idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--silver);
  flex: 0 0 auto;
}
.site-nav__link[aria-current="page"] .site-nav__idx { color: var(--aurora); }

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

.site-nav__foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-nav__minor {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--silver);
}
.site-nav__minor:hover { color: var(--frost); }

/* 抽屉打开时锁定纵向滚动（仅移动端） */
@media (max-width: 1023px) {
  html.is-nav-open { overflow: hidden; }
}

/* ---------- 滚动进度 ---------- */
.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
  background: linear-gradient(90deg, var(--ice), var(--aurora));
  transform: scaleX(var(--scroll, 0));
  transform-origin: left center;
}

/* ---------- 返回顶部（移动端浮动） ---------- */
.back-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--ink-panel);
  border: 1px solid var(--line-strong);
  color: var(--frost);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.back-top[hidden] { display: none; }
.back-top:hover { border-color: var(--aurora); color: var(--aurora); }
.back-top__arrow { font-size: 12px; line-height: 1; }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  margin-top: clamp(48px, 8vw, 112px);
  background: var(--graphite);
  color: var(--steel);
  border-top: 1px solid var(--line);
  padding: clamp(40px, 6vw, 80px) var(--gutter) 0;
  font-size: 14px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 44px);
  max-width: var(--maxw);
  margin: 0 auto;
  padding-bottom: clamp(28px, 4vw, 48px);
}

.site-footer__brand-col {
  border-left: 2px solid var(--aurora);
  padding-left: 16px;
}

.site-footer__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--frost);
}

.site-footer__tagline {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--aurora);
}

.site-footer__meta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--silver);
}

.site-footer__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--frost);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.site-footer__link {
  display: inline-block;
  color: var(--steel);
  font-size: 14px;
  transition: color 0.16s var(--ease);
}
.site-footer__link:hover { color: var(--aurora); }

.site-footer__list--contact { gap: 14px; }

.site-footer__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--silver);
  margin-bottom: 3px;
}

.site-footer__text {
  display: block;
  color: var(--steel);
  font-size: 13px;
  line-height: 1.65;
}

.site-footer__note {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--silver);
  max-width: 42ch;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--frost);
  text-align: left;
  word-break: break-all;
  border-bottom: 1px dashed var(--line-strong);
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.copy-chip::after {
  content: "复制";
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--silver);
}
.copy-chip:hover { color: var(--aurora); border-color: var(--aurora); }
.copy-chip[data-copied="true"] { color: var(--aurora); border-color: var(--aurora); }
.copy-chip[data-copied="true"]::after { content: "已复制"; color: var(--aurora); }

.site-footer__bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  padding: 20px 0 30px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--silver);
}

.site-footer__build { color: var(--silver); opacity: 0.8; }

/* =========================================================
   断点
   ========================================================= */
@media (min-width: 640px) {
  .brand__note { display: inline-block; }
}

@media (min-width: 720px) {
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand-col { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
  body { padding-left: var(--rail); }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail);
    display: flex;
    flex-direction: column;
    background: var(--ink-panel);
    border-right: 1px solid var(--line);
    z-index: 100;
  }

  .site-header__bar {
    position: static;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 8px 16px;
    background: transparent;
    border-bottom: 1px solid var(--line);
    backdrop-filter: none;
    z-index: auto;
  }

  .brand {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .brand__mark { font-size: 12px; padding: 4px 6px; }
  .brand__name {
    writing-mode: vertical-rl;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--steel);
    white-space: normal;
  }
  .brand__note { display: none; }
  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    flex: 1 1 auto;
    width: 100%;
    transform: none;
    visibility: visible;
    padding: 12px 0 10px;
    gap: 0;
    background: transparent;
    border-left: 0;
    box-shadow: none;
    overflow-y: auto;
    overflow-x: hidden;
    transition: none;
    scrollbar-width: thin;
  }

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

  .site-nav__item + .site-nav__item { border-top: 1px solid var(--line); }

  .site-nav__link {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 2px;
    font-size: 13px;
    border-left: 2px solid transparent;
  }
  .site-nav__link:hover {
    padding-left: 2px;
    background: rgba(47, 125, 246, 0.1);
    color: var(--frost);
  }
  .site-nav__link[aria-current="page"] {
    border-left-color: var(--aurora);
    background: linear-gradient(90deg, rgba(39, 224, 200, 0.16), rgba(39, 224, 200, 0));
  }

  .site-nav__idx { font-size: 10px; }

  .site-nav__label {
    writing-mode: vertical-rl;
    letter-spacing: 0.26em;
    font-size: 13px;
  }

  .site-nav__foot {
    margin-top: auto;
    padding: 12px 6px 0;
    border-top: 1px solid var(--line);
    gap: 8px;
  }
  .site-nav__foot .btn {
    padding: 10px 4px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }
  .site-nav__minor { display: none; }

  .back-top {
    position: static;
    flex: 0 0 auto;
    width: calc(var(--rail) - 24px);
    margin: 8px auto 12px;
    padding: 9px 4px 9px 8px;
  }

  .scroll-meter {
    top: 0;
    left: auto;
    right: 0;
    bottom: 0;
    width: 2px;
    height: auto;
    transform: scaleY(var(--scroll, 0));
    transform-origin: top center;
  }

  .site-footer__grid { grid-template-columns: 1.5fr 0.8fr 0.8fr 1.1fr; }
  .site-footer__brand-col { grid-column: auto; }
}

@media (min-width: 1280px) {
  .site-nav__link { padding: 16px 2px; }
}

/* =========================================================
   降低动态效果
   ========================================================= */
@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;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .btn {
    clip-path: none;
  }
}
