/* =========================================================
   乐优赛场 · 共享站点外壳  /assets/site.css
   奶油纸底 + 赛场深绿框架 + 活力橙动作 + 记分牌琥珀数字
   ========================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
  --paper: #F7EFDF;
  --paper-soft: #FFF9EE;
  --green: #0E3B2E;
  --green-deep: #08241C;
  --green-mid: #14513E;
  --ink: #1B1510;
  --orange: #F26B2A;
  --amber: #F2B134;
  --blue: #2F6FED;
  --grass: #CFE3D4;

  --font-display: "Archivo Black", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font-body: "Noto Sans SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;

  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --frame-max: 1280px;
  --gutter: clamp(16px, 3.2vw, 40px);
  --header-h: 120px;
}

/* ---------- 2. Reset 与中文排版 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(27, 21, 16, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.008em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.012em;
  color: var(--green);
}

h1 { font-size: clamp(30px, 4.4vw, 54px); }
h2 { font-size: clamp(24px, 3vw, 38px); }
h3 { font-size: clamp(19px, 2.1vw, 26px); }
h4 { font-size: clamp(16px, 1.5vw, 20px); }

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

ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
img, svg { max-width: 100%; height: auto; }

a {
  color: var(--blue);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover { text-decoration: underline; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

strong, b { font-weight: 700; color: var(--ink); }

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

.site-header :focus-visible,
.site-footer :focus-visible { outline-color: var(--amber); }

/* ---------- 3. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 999;
  display: inline-block;
  padding: 10px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--amber);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.02em;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  text-decoration: none;
}

/* ---------- 4. 页面容器与分栏骨架 ---------- */
.container {
  width: 100%;
  max-width: calc(var(--frame-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page-frame {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  width: 100%;
  max-width: calc(var(--frame-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(20px, 3vw, 40px) var(--gutter) clamp(48px, 7vw, 88px);
  align-items: start;
}

.rail {
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--paper-soft);
  padding: 18px 16px;
  box-shadow: 0 4px 0 var(--green);
}

.rail-sticky {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.rail-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--green);
  border-bottom: 2px dashed rgba(27, 21, 16, 0.28);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.rail-list { display: grid; gap: 6px; }

.rail-link {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border-left: 4px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.rail-link:hover,
.rail-link:focus-visible {
  background: var(--grass);
  border-left-color: var(--orange);
  text-decoration: none;
  transform: translateX(2px);
}

.rail-link[aria-current="page"] {
  background: var(--green);
  color: var(--paper-soft);
  border-left-color: var(--amber);
}

/* ---------- 5. 章节头与眉标 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--green);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--orange);
  flex: none;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 12px;
  margin-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 3px solid var(--ink);
}

.section-title { margin: 0; }

.section-lead {
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(27, 21, 16, 0.74);
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-primary { background: var(--orange); }
.btn-data { background: var(--blue); color: var(--paper-soft); }

.btn-ghost {
  background: transparent;
  border-color: currentColor;
  box-shadow: none;
}

.btn-ghost:hover { box-shadow: none; background: rgba(27, 21, 16, 0.06); }

/* ---------- 7. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--grass);
  color: var(--green);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.6;
  white-space: nowrap;
}

.tag-amber { background: var(--amber); color: var(--ink); font-family: var(--font-mono); }
.tag-blue { background: var(--blue); color: var(--paper-soft); }
.tag-orange { background: var(--orange); color: var(--ink); }

/* ---------- 8. 面包屑 ---------- */
.breadcrumbs {
  width: 100%;
  max-width: calc(var(--frame-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding: 18px var(--gutter) 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(27, 21, 16, 0.62);
}

.breadcrumb-list li + li::before {
  content: "／";
  margin-right: 8px;
  color: var(--orange);
}

.breadcrumb-list a {
  color: var(--green);
  border-bottom: 1px solid rgba(14, 59, 46, 0.32);
}

.breadcrumb-list a:hover { text-decoration: none; border-bottom-color: var(--orange); }

/* ---------- 9. 正文与网格 ---------- */
.prose {
  max-width: 70ch;
  font-size: 16.5px;
  line-height: 1.75;
}

.prose h2, .prose h3 { margin-top: 1.6em; margin-bottom: 0.5em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.2em; list-style: disc; }
.prose li { margin-bottom: 0.4em; }

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

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

/* ---------- 10. 图片容器（页面阶段放占位图） ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--green-mid);
  aspect-ratio: 16 / 10;
  box-shadow: 0 5px 0 rgba(27, 21, 16, 0.22);
}

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

.media-frame--wide { aspect-ratio: 21 / 9; }

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(27, 21, 16, 0.7);
}

.media-overlay {
  position: absolute;
  inset: auto 12px 12px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

/* ---------- 11. 头部框架 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--green);
  color: var(--paper-soft);
  border-bottom: 4px solid var(--ink);
}

.header-rail {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: calc(var(--frame-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding: 8px var(--gutter);
  background: var(--green-deep);
  border-bottom: 1px solid rgba(255, 249, 238, 0.16);
}

.header-eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--amber);
  white-space: nowrap;
  flex: none;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 107, 42, 0.24);
  flex: none;
}

.header-tagline {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 249, 238, 0.74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-entries {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}

.quick-entry {
  display: inline-block;
  padding: 4px 13px;
  border: 1px solid rgba(255, 249, 238, 0.36);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.quick-entry:hover,
.quick-entry:focus-visible {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
  text-decoration: none;
}

.header-main {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  width: 100%;
  max-width: calc(var(--frame-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding: 12px var(--gutter) 14px;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: inherit;
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-4deg) translateY(-1px);
  background: var(--amber);
}

.brand-text { display: grid; gap: 2px; }

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--paper-soft);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  line-height: 1.3;
  color: var(--amber);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 14px;
  border: 2px solid rgba(255, 249, 238, 0.4);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

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

.nav-toggle-icon {
  display: grid;
  gap: 4px;
  width: 18px;
}

.nav-toggle-icon span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header[data-open] .nav-toggle {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

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

.nav-toggle-label { white-space: nowrap; }

/* 主导航 */
.site-nav { margin-left: auto; min-width: 0; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-item { display: block; }

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: rgba(255, 249, 238, 0.82);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 249, 238, 0.12);
  color: var(--paper-soft);
  text-decoration: none;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--amber);
  opacity: 0.9;
}

.nav-link[aria-current="page"] {
  background: var(--amber);
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}

.nav-link[aria-current="page"] .nav-index { color: var(--green); opacity: 1; }

/* 阅读进度线 */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  background: var(--orange);
  transition: width 0.08s linear;
}

/* ---------- 12. 页脚 ---------- */
.site-footer {
  margin-top: clamp(44px, 7vw, 90px);
  background: var(--green);
  color: var(--paper-soft);
  border-top: 6px solid var(--ink);
  border-radius: 40px 40px 0 0;
  overflow: hidden;
  background-image: linear-gradient(180deg, var(--green-mid) 0%, var(--green) 34%, var(--green-deep) 100%);
}

.footer-frame {
  width: 100%;
  max-width: calc(var(--frame-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(38px, 5.4vw, 68px) var(--gutter) 26px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

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

.footer-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 0 14px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--amber);
  color: var(--green-deep);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
}

.footer-brand-line {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.35;
  color: var(--paper-soft);
}

.footer-update {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--amber);
}

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

.footer-heading {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 249, 238, 0.3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--grass);
}

.footer-list { display: grid; gap: 9px; }

.footer-list a {
  color: rgba(255, 249, 238, 0.82);
  font-size: 14px;
  line-height: 1.6;
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--amber);
  text-decoration: none;
  padding-left: 4px;
}

.footer-contact { display: grid; gap: 10px; }

.footer-contact-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.9;
  color: rgba(255, 249, 238, 0.56);
}

.footer-contact-value {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--paper-soft);
  word-break: break-word;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  margin-top: clamp(28px, 4vw, 52px);
  padding-top: 18px;
  border-top: 1px dashed rgba(255, 249, 238, 0.28);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: rgba(255, 249, 238, 0.72);
}

.footer-legal { margin: 0; }

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-legal-links a {
  color: var(--paper-soft);
  border-bottom: 1px solid rgba(255, 249, 238, 0.34);
}

.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
  color: var(--amber);
  border-bottom-color: var(--amber);
  text-decoration: none;
}

.footer-icp {
  margin: 0;
  color: var(--amber);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* ---------- 13. 滚动显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: opacity, transform;
}

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

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1100px) {
  .footer-top { grid-template-columns: 1.5fr 1fr 1.3fr; }
  .footer-col:nth-child(3) { grid-column: 1 / span 1; }
}

@media (max-width: 960px) {
  .page-frame {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 18px;
  }

  .rail-sticky { position: static; }
  .rail { padding: 14px; }
  .rail-list { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    padding: 12px var(--gutter) 22px;
    background: var(--green-deep);
    border-bottom: 4px solid var(--ink);
    border-radius: 0 0 26px 26px;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  }

  .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: 5px; }

  .nav-link {
    display: flex;
    justify-content: flex-start;
    padding: 13px 16px;
    border-radius: 14px;
    background: rgba(255, 249, 238, 0.07);
    font-size: 16px;
  }

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

  .header-tagline { display: none; }

  .quick-entries {
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .quick-entries::-webkit-scrollbar { display: none; }
}

@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-col:nth-child(3) { grid-column: auto; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  body { font-size: 15.5px; }

  .header-rail { gap: 12px; padding-block: 7px; }
  .header-eyebrow { font-size: 10px; letter-spacing: 0.14em; }
  .header-main { padding-block: 10px 12px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 9.5px; letter-spacing: 0.1em; }

  .footer-top { grid-template-columns: minmax(0, 1fr); }
  .footer-bottom { justify-content: flex-start; }

  .breadcrumbs { padding-top: 12px; }
}

/* ---------- 15. 降低动效 ---------- */
@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:hover,
  .brand:hover .brand-mark,
  .rail-link:hover { transform: none; }
}
