/* ==========================================================================
   瑞祥电竞主站 · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 头部 / 页脚 / 通用组件
   ========================================================================== */

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

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

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

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

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

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

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

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

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

/* ---------- 2. 变量 ---------- */
:root {
  --ink-void: #05070D;
  --ink-console: #0B1220;
  --ink-panel: #0E1626;
  --line-steel: #1A2436;
  --grid-line: #22304A;
  --accent-cyan: #38F2E0;
  --accent-orange: #FF7A1A;
  --accent-violet: #7B61FF;
  --text-ice: #E8F4FF;
  --text-mist: #8EA0B8;
  --state-green: #2EE6A8;

  --font-display: "Sora", "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail-w: 176px;
  --header-h: 150px;
  --pad-x: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
  --dur: 160ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink-void);
  background-image:
    linear-gradient(rgba(34, 48, 74, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 48, 74, .22) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--text-ice);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.005em;
  color: var(--text-ice);
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: clamp(1.05rem, 1.4vw, 1.2rem); }

p { color: var(--text-mist); }
p strong { color: var(--text-ice); font-weight: 700; }

::selection { background: rgba(56, 242, 224, .28); color: var(--text-ice); }

/* ---------- 4. 焦点可见 ---------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

.btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px #E8F4FF;
}

/* ---------- 5. 跳到主要内容 ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  display: inline-block;
  padding: 10px 18px;
  background: var(--accent-cyan);
  color: #041014;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 10px;
  outline: 2px solid var(--text-ice);
  outline-offset: 2px;
}

/* ---------- 6. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, #070B14 0%, #05070D 100%);
  border-bottom: 1px solid var(--line-steel);
  transition: box-shadow var(--dur) var(--ease);
}

.site-header[data-scrolled] {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}

/* 6.1 HUD 状态条 */
.hud-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  padding: 7px var(--pad-x);
  background: #04060B;
  border-bottom: 1px solid var(--line-steel);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .08em;
  color: var(--text-mist);
}

.hud-bar__item {
  display: inline-flex;
  align-items: center;
  color: var(--text-mist);
}

.hud-bar__item--status {
  color: var(--accent-cyan);
}

.hud-bar__dot {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--state-green);
  box-shadow: 0 0 0 3px rgba(46, 230, 168, .16);
  animation: hud-pulse 2.6s ease-in-out infinite;
}

@keyframes hud-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46, 230, 168, .16); }
  50%      { box-shadow: 0 0 0 6px rgba(46, 230, 168, .04); }
}

.hud-bar__item--right {
  margin-left: auto;
  color: var(--text-mist);
}

/* 6.2 品牌条 */
.brand-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 13px var(--pad-x);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 2px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: linear-gradient(140deg, var(--accent-cyan), #14b9b0);
  color: #03201e;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
  transition: filter var(--dur) var(--ease);
}

.brand:hover .brand__mark { filter: brightness(1.12); }

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__name {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-ice);
  line-height: 1.3;
}

.brand__meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--text-mist);
  line-height: 1.3;
}

.brand-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid rgba(56, 242, 224, .35);
  background: rgba(56, 242, 224, .06);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  white-space: nowrap;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

/* 6.3 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-steel);
  background: var(--ink-console);
  color: var(--text-ice);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
  white-space: nowrap;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.btn--primary {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #170800;
}

.btn--primary:hover {
  background: #FF9647;
  border-color: #FF9647;
}

.btn--ghost {
  background: transparent;
  border-color: rgba(56, 242, 224, .42);
  color: var(--accent-cyan);
}

.btn--ghost:hover {
  background: rgba(56, 242, 224, .1);
  border-color: var(--accent-cyan);
  color: var(--text-ice);
}

/* 6.4 移动导航按钮 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--line-steel);
  background: var(--ink-console);
  color: var(--text-ice);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-toggle:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.nav-toggle__label {
  display: inline-block;
  line-height: 1;
}

.nav-toggle__icon {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--accent-cyan);
  transition: transform var(--dur) var(--ease), top var(--dur) var(--ease), bottom var(--dur) var(--ease);
}

.nav-toggle__icon::before { top: 0; }
.nav-toggle__icon::after { bottom: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  top: 4px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  bottom: 4px;
  transform: rotate(-45deg);
}

/* 6.5 轨道导航（移动端基础 = 抽屉） */
.rail {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-h, 150px);
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 22px var(--pad-x) 36px;
  background: rgba(5, 7, 13, .98);
  border-top: 1px solid var(--line-steel);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              visibility var(--dur) linear;
}

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

.rail__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--accent-cyan);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-steel);
}

.rail__list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 14px;
}

.rail__link {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 12px 12px 12px 12px;
  border-left: 2px solid transparent;
  color: var(--text-mist);
  font-size: 15px;
  line-height: 1.45;
  transition: color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.rail__link:hover {
  color: var(--text-ice);
  background: rgba(56, 242, 224, .06);
  border-left-color: rgba(56, 242, 224, .45);
}

.rail__link:focus-visible {
  outline-offset: -2px;
}

.rail__link[aria-current="page"] {
  color: var(--accent-cyan);
  background: rgba(56, 242, 224, .09);
  border-left-color: var(--accent-cyan);
}

.rail__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--line-steel);
  transition: color var(--dur) var(--ease);
}

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

.rail__text { display: block; }

.rail__foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line-steel);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.9;
  letter-spacing: .08em;
  color: var(--text-mist);
}

/* 6.6 滚动进度 */
.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(34, 48, 74, .5);
  overflow: hidden;
}

.scroll-meter__fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet) 58%, var(--accent-orange));
  transition: transform 90ms linear;
}

/* ---------- 7. 页脚 ---------- */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  border-top: 1px solid var(--line-steel);
  background:
    radial-gradient(110% 80% at 4% 0%, rgba(123, 97, 255, .1), transparent 58%),
    linear-gradient(180deg, #070B14 0%, #04060B 100%);
  color: var(--text-mist);
  font-size: 14px;
}

.footer__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(34px, 6vw, 64px) var(--pad-x) 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(26px, 4vw, 40px);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand--footer .brand__mark {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  font-size: 14px;
}

.footer__summary {
  max-width: 40ch;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-mist);
}

.footer__facts {
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line-steel);
}

.footer__fact {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.6;
}

.footer__fact-k {
  flex: 0 0 52px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-mist);
}

.footer__fact-v { color: var(--text-ice); }

.footer__col-title {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-steel);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.4;
  color: var(--accent-cyan);
}

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

.footer__item { display: block; }

.footer__link {
  position: relative;
  display: inline-block;
  padding: 4px 0;
  color: var(--text-mist);
  font-size: 13.5px;
  line-height: 1.6;
  transition: color var(--dur) var(--ease);
}

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

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

.footer__contact-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer__contact-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(34, 48, 74, .75);
  font-size: 12.5px;
  line-height: 1.65;
}

.footer__contact-k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--text-mist);
  padding-top: 1px;
}

.footer__contact-v {
  color: var(--text-ice);
  word-break: break-word;
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(28px, 4vw, 46px);
  padding: 16px 0 26px;
  border-top: 1px solid var(--line-steel);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-mist);
}

.footer__legal,
.footer__copy,
.footer__build {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-mist);
}

.footer__build { color: var(--line-steel); }

.footer__top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line-steel);
  background: var(--ink-console);
  color: var(--text-ice);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

/* ---------- 8. 通用布局与组件 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

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

.panel {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line-steel);
  background: linear-gradient(160deg, var(--ink-console) 0%, #080D17 100%);
}

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

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--text-mist);
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--accent-cyan), rgba(56, 242, 224, 0) 72%);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line-steel);
  background: transparent;
  color: var(--text-mist);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--cyan {
  color: var(--accent-cyan);
  border-color: rgba(56, 242, 224, .35);
  background: rgba(56, 242, 224, .07);
}

.tag--orange {
  color: var(--accent-orange);
  border-color: rgba(255, 122, 26, .38);
  background: rgba(255, 122, 26, .08);
}

.tag--violet {
  color: #B3A6FF;
  border-color: rgba(123, 97, 255, .42);
  background: rgba(123, 97, 255, .1);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid var(--line-steel);
  background: transparent;
  color: var(--text-mist);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.chip:hover {
  color: var(--text-ice);
  border-color: var(--accent-cyan);
}

.chip[aria-pressed="true"] {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(56, 242, 224, .09);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--text-mist);
}

.breadcrumb a {
  color: var(--text-mist);
  transition: color var(--dur) var(--ease);
}

.breadcrumb a:hover { color: var(--accent-cyan); }

.breadcrumb__sep {
  color: var(--line-steel);
}

/* ---------- 9. 图像容器基础（页面阶段放 <img>） ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-steel);
  background: linear-gradient(135deg, var(--ink-console), var(--ink-panel));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

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

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(5, 7, 13, .58) 100%);
}

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--portrait { aspect-ratio: 3 / 4; }

.media-frame__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 3px 9px;
  border: 1px solid rgba(56, 242, 224, .38);
  background: rgba(5, 7, 13, .78);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
}

/* ---------- 10. 响应式 ---------- */
@media (max-width: 639px) {
  .hud-bar__item--right { display: none; }
  .version-chip { display: none; }
  .brand-bar__actions .btn--ghost { display: none; }
  .brand__mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 13px; }
  .brand__name { font-size: 15px; }
  .footer__contact-item { grid-template-columns: 52px 1fr; }
}

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

@media (min-width: 900px) {
  .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}

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

  .nav-toggle { display: none; }

  .rail {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: var(--rail-w);
    padding: 24px 16px 26px;
    border-top: 0;
    border-right: 1px solid var(--line-steel);
    background: linear-gradient(180deg, #080D18 0%, #05070D 55%, #04060B 100%);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    overflow-y: auto;
    z-index: 60;
  }

  .rail__list { margin-top: 16px; }

  .rail__link {
    grid-template-columns: 24px 1fr;
    gap: 8px;
    padding: 11px 8px 11px 12px;
    font-size: 13px;
    line-height: 1.5;
  }

  .rail__foot { font-size: 10px; }
}

@media (min-width: 1140px) {
  .footer__grid { grid-template-columns: 1.5fr .85fr .85fr .85fr 1.15fr; }
  .footer__brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-bar__dot { animation: none; }
  .scroll-meter__fill { transition: none; }
  .rail { transition: none; }
}
