/* ============================================================
   LEYU 赛事 · shared site kit
   file: /assets/site.css
   sections: reset / tokens / typography / layout / buttons
             header / footer / media / utilities / responsive
   ============================================================ */

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

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

body { margin: 0; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
table { border-collapse: collapse; }
summary { cursor: pointer; }

/* ---------- 02. tokens ---------- */
:root {
  --ink-900: #0A1A2F;
  --ink-850: #071322;
  --panel: #0F2438;
  --card: #16324B;
  --line: #1E4560;
  --line-soft: rgba(30, 69, 96, 0.55);

  --mint: #00F0C0;
  --mint-soft: #7CFFDD;
  --amber: #FF8A3D;
  --amber-soft: #FFC46B;

  --text: #E8F1F8;
  --muted: #94A9BC;
  --deep-muted: #6D8296;
  --white: #FFFFFF;
  --paper: #F2F5F8;

  --font-sans: "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;

  --gutter: clamp(16px, 4vw, 56px);
  --page-max: 1440px;
  --grid-cell: 64px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 03. typography & page canvas ---------- */
body {
  background-color: var(--ink-900);
  background-image:
    linear-gradient(to right, rgba(30, 69, 96, 0.26) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 69, 96, 0.26) 1px, transparent 1px);
  background-size: var(--grid-cell) var(--grid-cell);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

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

h1 { font-size: clamp(30px, 5.2vw, 68px); }
h2 { font-size: clamp(24px, 3.2vw, 44px); }
h3 { font-size: clamp(19px, 2.1vw, 28px); }
h4 { font-size: 17px; font-weight: 700; }

p { text-wrap: pretty; }

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

::selection {
  background: var(--mint);
  color: #04121E;
}

/* ---------- 04. layout primitives ---------- */
.container {
  width: min(var(--page-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.container--narrow {
  width: min(1080px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.section { padding-block: clamp(48px, 7vw, 96px); }

.surface {
  background: var(--panel);
  border-block: 1px solid var(--line);
}

.surface--card {
  background: var(--card);
  border-block: 1px solid var(--line);
}

/* ---------- 05. text utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.text-muted { color: var(--muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
  line-height: 1.4;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}

.link {
  color: var(--mint);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 240, 192, 0.45);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.link:hover {
  color: var(--mint-soft);
  border-bottom-color: var(--mint-soft);
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.tag--mint { color: var(--mint); border-color: rgba(0, 240, 192, 0.4); }
.tag--amber { color: var(--amber-soft); border-color: rgba(255, 138, 61, 0.45); }

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

/* ---------- 06. breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

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

.breadcrumb__sep {
  color: var(--line);
  user-select: none;
}

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

/* ---------- 07. buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--btn-bd);
  border-radius: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  --btn-bg: var(--mint);
  --btn-fg: #04121E;
  --btn-bd: var(--mint);
  font-weight: 700;
}

.btn--primary:hover {
  --btn-bg: var(--mint-soft);
  --btn-bd: var(--mint-soft);
}

.btn--amber {
  --btn-bg: transparent;
  --btn-fg: var(--amber);
  --btn-bd: rgba(255, 138, 61, 0.55);
}

.btn--amber:hover {
  --btn-bg: rgba(255, 138, 61, 0.12);
  --btn-bd: var(--amber);
  --btn-fg: var(--amber-soft);
}

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

/* ---------- 08. skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 200;
  display: inline-block;
  padding: 10px 18px;
  background: var(--mint);
  color: #04121E;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transform: translateY(-240%);
  transition: transform 0.18s var(--ease);
}

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

/* ---------- 09. header ---------- */
.site-header {
  --h: 76px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 26, 47, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid transparent;
  color: var(--text);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 240, 192, 0.55) 18%,
    rgba(0, 240, 192, 0.55) 62%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.site-header.is-stuck {
  --h: 64px;
  background: var(--ink-900);
  border-bottom-color: var(--line);
}

.site-header.is-stuck::after { opacity: 1; }

.header-inner {
  width: min(var(--page-max), calc(100% - var(--gutter) * 2));
  min-height: var(--h);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 36px);
}

/* brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background-color: var(--panel);
  background-image:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 9px);
  transition: border-color 0.2s var(--ease);
}

.brand:hover .brand-mark { border-color: var(--mint); }

.brand-dot {
  width: 11px;
  height: 11px;
  background: var(--mint);
  box-shadow: 0 0 14px rgba(0, 240, 192, 0.75);
  transform: rotate(45deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.45vw, 26px);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s var(--ease);
}

.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(0.55); }

.nav-link[aria-current="page"] { color: var(--mint); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
  flex: 0 0 auto;
}

.header-cta { font-size: 13.5px; padding: 11px 16px; }
.header-cta-soft { font-size: 13px; padding: 10px 14px; }

/* mobile drawer extras (hidden on desktop) */
.nav-aside { display: none; }
.nav-cta-group { display: none; }

/* hamburger */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

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

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 12px;
  flex: 0 0 auto;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.site-header[data-open] .nav-toggle-bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle-bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- 10. footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(40px, 7vw, 96px);
  background: var(--ink-850);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14.5px;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(280px, 42vw);
  height: 2px;
  background: var(--mint);
}

.footer-top {
  width: min(var(--page-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding-block: clamp(34px, 5vw, 60px);
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(0, 2fr);
  gap: clamp(28px, 5vw, 72px);
}

.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }

.brand--footer .brand-name { font-size: 15px; }

.footer-note {
  max-width: 34ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.footer-stamp {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--deep-muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.footer-col { min-width: 0; }

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mint);
}

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

.footer-link {
  display: inline-block;
  padding: 5px 0;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}

.footer-link:hover {
  color: var(--text);
  transform: translateX(3px);
}

.footer-contact {
  width: min(var(--page-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.footer-contact-item { margin: 0; }

.footer-contact-key {
  display: inline-block;
  margin-inline-end: 6px;
  color: var(--amber-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
}

.footer-legal {
  width: min(var(--page-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding-block: 14px 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--deep-muted);
}

.footer-legal-line { margin: 0; }
.footer-legal-copy { text-transform: uppercase; }

/* ---------- 11. media frames ---------- */
.img-frame {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.img-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 240, 192, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 192, 0.1) 1px, transparent 1px);
  background-size: 32px 32px;
  mix-blend-mode: screen;
}

.img-frame--16x9 { aspect-ratio: 16 / 9; }
.img-frame--4x3 { aspect-ratio: 4 / 3; }
.img-frame--1x1 { aspect-ratio: 1 / 1; }
.img-frame--21x9 { aspect-ratio: 21 / 9; }

.img-frame--placeholder {
  background-image: repeating-linear-gradient(
    135deg,
    var(--panel) 0 12px,
    var(--card) 12px 24px
  );
}

/* ---------- 12. js-injected chrome ---------- */
.scroll-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 130;
  pointer-events: none;
  background: rgba(30, 69, 96, 0.4);
}

.scroll-rail__fill {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--mint) 0%, var(--mint-soft) 62%, var(--amber) 100%);
}

.to-top {
  position: fixed;
  right: clamp(14px, 2.4vw, 28px);
  bottom: clamp(14px, 2.4vw, 28px);
  z-index: 110;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0.22s,
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--card);
  border-color: var(--mint);
  color: var(--mint-soft);
}

.to-top__icon { font-size: 16px; line-height: 1; }
.to-top__label { line-height: 1; }

/* ---------- 13. responsive ---------- */
@media (max-width: 1180px) {
  .header-cta-soft { display: none; }
}

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .header-cta { font-size: 13px; padding: 10px 14px; }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--h);
    bottom: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: clamp(18px, 4vw, 34px) var(--gutter) 40px;
    background-color: var(--ink-900);
    background-image:
      linear-gradient(to right, rgba(30, 69, 96, 0.32) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(30, 69, 96, 0.32) 1px, transparent 1px);
    background-size: var(--grid-cell) var(--grid-cell);
    border-top: 1px solid var(--line);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  }

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

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

  .nav-list li + li { border-top: 1px solid var(--line-soft); }

  .nav-link {
    display: block;
    padding: 15px 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
  }

  .nav-link::after { display: none; }

  .nav-link[aria-current="page"] { color: var(--mint); }

  .nav-link[aria-current="page"]::before {
    content: "▸";
    margin-inline-end: 8px;
    font-family: var(--font-mono);
    color: var(--mint);
  }

  .nav-aside {
    display: block;
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 138, 61, 0.45);
    background: rgba(255, 138, 61, 0.07);
  }

  .nav-aside-label {
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--amber);
  }

  .nav-aside-link {
    display: inline-block;
    color: var(--amber-soft);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }

  .nav-aside-link:hover { text-decoration: underline; }

  .nav-aside-meta {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
  }

  .nav-cta-group {
    display: grid;
    gap: 10px;
    margin-top: 22px;
  }

  .footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .header-cta { display: none; }
  .brand-sub { display: none; }
  .brand-name { font-size: 15px; }
  .header-inner { gap: 12px; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-contact { font-size: 12px; }
  .to-top { width: 50px; height: 50px; font-size: 9px; }
}

@media (max-width: 420px) {
  .footer-cols { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; }
}

/* ---------- 14. reduced motion ---------- */
@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;
  }

  .btn:hover,
  .footer-link:hover { transform: none; }
}
