/* ==========================================================================
   乐球CN · 共享站件样式 /assets/site.css
   1 reset · 2 变量 · 3 基础与中文排版 · 4 布局 · 5 通用组件 · 6 头部 · 7 页脚
   8 动效与可访问性 · 9 响应式
   ========================================================================== */

/* ---------- 1. 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, ul, ol, dl, dd, figure, blockquote { margin: 0; }

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

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

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%; }

/* ---------- 2. 变量 ---------- */
:root {
  /* 品牌色 */
  --orange: #FF5A2A;
  --orange-deep: #C93E12;
  --orange-tint: #FFDDD1;
  --indigo: #1B2A4A;
  --indigo-mid: #2F4370;
  --mint: #3DD9B0;
  --mint-deep: #0F7A5F;
  --warm-white: #FBF7F2;
  --blue-grey: #E8EDF5;
  --paper: #F2E9DF;
  --line: #C9D2E0;
  --ink-soft: #6B7794;

  /* 尺寸 */
  --wrap: 1280px;
  --wrap-bleed: 1440px;
  --gutter: 24px;
  --rail: 240px;

  /* 字体 */
  --font-display: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 480ms;
}

/* ---------- 3. 基础与中文排版 ---------- */
body {
  background: var(--warm-white);
  color: var(--indigo);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--orange-tint); color: var(--indigo); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--indigo);
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.45rem); letter-spacing: -0.01em; line-height: 1.35; }

p { max-width: 38em; }

strong { font-weight: 700; }

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

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-soft);
}

.annotation {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(27, 42, 74, 0.7);
}

.annotation--rot {
  display: inline-block;
  transform: rotate(-6deg);
  transform-origin: left center;
}

/* ---------- 4. 布局 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.wrap--bleed { max-width: var(--wrap-bleed); }

.section { padding-block: clamp(48px, 7vw, 96px); }
.section--tint { background: var(--blue-grey); }
.section--paper { background: var(--paper); }
.section--ink { background: var(--indigo); color: #E8EDF5; }
.section--ink h1,
.section--ink h2,
.section--ink h3 { color: #FFFFFF; }

.doc-layout {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.anchor-rail {
  position: sticky;
  top: 104px;
  align-self: start;
}

.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-asym { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }

.rule { height: 1px; border: 0; background: var(--line); margin: 0; }
.rule--dotted {
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--orange) 0 7px, transparent 7px 16px);
}

.texture-dots {
  background-image: radial-gradient(rgba(27, 42, 74, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}

/* ---------- 5. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 3px;
  border: 2px solid transparent;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s,
              box-shadow 0.2s, border-color 0.2s;
}

.btn--primary {
  background: var(--orange);
  color: #FFFFFF;
  box-shadow: 0 2px 0 var(--orange-deep);
}
.btn--primary:hover {
  background: var(--orange-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(201, 62, 18, 0.55);
}

.btn--ghost {
  background: transparent;
  color: var(--indigo);
  border-color: var(--indigo);
}
.btn--ghost:hover { background: var(--indigo); color: var(--warm-white); }

.btn--mint {
  background: var(--mint);
  color: #063A2E;
  box-shadow: 0 2px 0 var(--mint-deep);
}
.btn--mint:hover { background: var(--mint-deep); color: #FFFFFF; }

.btn--sm { padding: 8px 14px; font-size: 13.5px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 2px;
  background: var(--orange-tint);
  color: var(--orange-deep);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}
.tag--mint { background: rgba(61, 217, 176, 0.18); color: var(--mint-deep); }
.tag--line { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.tag--solid { background: var(--indigo); color: #FFFFFF; }

.card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: 5px 5px 0 var(--paper);
}
.card--framed {
  border: 2px solid var(--indigo);
  box-shadow: 5px 5px 0 var(--paper);
}

.dot-mint,
.dot-orange {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
}
.dot-mint { background: var(--mint); box-shadow: 0 0 0 3px rgba(61, 217, 176, 0.2); }
.dot-orange { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 90, 42, 0.18); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.crumbs a {
  color: var(--indigo-mid);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.crumbs a:hover { color: var(--orange-deep); border-bottom-color: var(--orange); }
.crumbs__sep { color: var(--line); }

.prose { max-width: 38em; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 1.8em; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.prose h3 { margin-top: 1.5em; }
.prose ul { padding-left: 0; }
.prose li { position: relative; padding-left: 1.05em; margin-top: 0.45em; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}
.prose a {
  color: var(--orange-deep);
  border-bottom: 1px solid rgba(201, 62, 18, 0.35);
  transition: border-color 0.2s;
}
.prose a:hover { border-bottom-color: var(--orange-deep); }

.media {
  position: relative;
  overflow: hidden;
  background: var(--blue-grey);
  border: 1px solid var(--line);
  border-radius: 3px;
  aspect-ratio: 4 / 3;
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--wide { aspect-ratio: 16 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 3 / 4; }
.media__caption {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.media__note {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--warm-white);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--indigo);
}

/* ---------- 6. 头部 ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 18px;
  border-radius: 3px;
  background: var(--indigo);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--warm-white);
  box-shadow: 0 1px 0 rgba(27, 42, 74, 0.06);
}

.header-top {
  background: var(--indigo);
  color: #E7EDF7;
  max-height: 96px;
  overflow: hidden;
  transition: max-height 0.48s var(--ease), opacity 0.3s linear;
}
.site-header.is-condensed .header-top { max-height: 0; opacity: 0; }

.header-top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 20px;
  min-height: 52px;
  padding-block: 9px;
}

.brand-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
  max-width: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  white-space: nowrap;
  transition: color 0.2s;
}
.brand::before {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 90, 42, 0.24);
}
.brand:hover { color: var(--orange-tint); }

.brand-tag {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(231, 237, 247, 0.6);
  white-space: nowrap;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 2px;
  border: 1px solid rgba(61, 217, 176, 0.32);
  background: rgba(61, 217, 176, 0.06);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: #D5F3EB;
  white-space: nowrap;
}
.status__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(61, 217, 176, 0.18);
}
.status__k { color: rgba(213, 243, 235, 0.75); }
.status__v {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--mint);
}

.header-nav {
  position: relative;
  background: var(--warm-white);
  border-bottom: 1px solid var(--line);
}

.header-nav__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding-block: 4px;
}

.site-nav { flex: 1 1 auto; min-width: 0; }

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  counter-reset: navidx;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 15px;
  font-weight: 500;
  color: var(--indigo-mid);
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.nav-link::before {
  counter-increment: navidx;
  content: counter(navidx, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.nav-link:hover { background: var(--blue-grey); color: var(--indigo); }
.nav-link:hover::before { color: var(--orange-deep); }

.nav-link[aria-current="page"] {
  background: var(--orange-tint);
  color: var(--indigo);
  font-weight: 700;
}
.nav-link[aria-current="page"]::before { color: var(--orange-deep); }
.nav-link[aria-current="page"]::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.cta-dot {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px 10px 13px;
  border-radius: 3px;
  background: var(--orange);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--orange-deep);
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.cta-dot__mark {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.25s var(--ease);
}
.cta-dot__label { line-height: 1; }
.cta-dot:hover {
  background: var(--orange-deep);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(201, 62, 18, 0.6);
}
.cta-dot:hover .cta-dot__mark { transform: scale(1.12); }
.cta-dot:active { transform: translateY(0); box-shadow: 0 1px 0 var(--orange-deep); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  color: var(--indigo);
  transition: border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--indigo); }
.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
  flex: none;
}
.nav-toggle__bars span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--orange);
  transition: transform 0.26s var(--ease), opacity 0.18s linear;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.nav-toggle__text { letter-spacing: 0.06em; }

.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  pointer-events: none;
}
.scroll-meter__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.1s linear;
}

/* ---------- 7. 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--indigo);
  color: rgba(232, 237, 245, 0.8);
}
.site-footer::before {
  content: "";
  display: block;
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--orange) 0 7px, transparent 7px 16px);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.7fr);
  gap: clamp(24px, 3.4vw, 48px);
  padding-block: clamp(40px, 5vw, 64px) clamp(28px, 3.4vw, 44px);
}

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

.footer-brand__mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}
.footer-brand__mark::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
}
.footer-brand__mark:hover { color: var(--orange-tint); }

.footer-brand__note {
  margin-top: 14px;
  max-width: 20em;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(232, 237, 245, 0.62);
}

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

.footer-col__title {
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--mint);
}

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

.footer-link {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(232, 237, 245, 0.82);
  transition: color 0.2s;
}
.footer-link:hover { color: var(--orange-tint); }

.footer-contact p {
  margin-bottom: 10px;
  max-width: none;
  font-size: 13px;
  line-height: 1.85;
  color: rgba(232, 237, 245, 0.72);
}
.footer-contact p:last-child { margin-bottom: 0; }
.footer-contact__val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  word-break: break-all;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid rgba(232, 237, 245, 0.16);
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(232, 237, 245, 0.55);
}
.footer-legal p { max-width: none; }
.footer-legal__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

/* ---------- 8. 动效与可访问性 ---------- */
.js-reveal {
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.js-reveal.is-pending { opacity: 0; transform: translateY(18px); }
.js-reveal.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition-duration: 150ms !important; }
  .js-reveal,
  .js-reveal.is-pending,
  .js-reveal.is-in { opacity: 1 !important; transform: none !important; }
  .cta-dot:hover,
  .cta-dot:active,
  .btn:hover { transform: none; }
  .site-header.is-condensed .header-top { transition: none; }
}

/* ---------- 9. 响应式 ---------- */
@media (max-width: 1080px) {
  .brand-tag { display: none; }
  .nav-link { padding: 8px 9px; font-size: 14.5px; }
  .cta-dot { font-size: 14px; padding: 9px 14px 9px 11px; }
}

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

@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; }
  .header-nav__inner { gap: 12px; min-height: 58px; }
  .header-top__inner { min-height: 48px; }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 90;
    display: none;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    padding: 6px clamp(18px, 4vw, 40px) 18px;
    background: var(--warm-white);
    border-bottom: 2px solid var(--indigo);
    box-shadow: 0 18px 32px -22px rgba(27, 42, 74, 0.55);
  }
  .site-nav[data-open] { display: block; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link {
    width: 100%;
    padding: 14px 8px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }
  .nav-link::after { margin-left: auto; }
  .nav-link:hover { background: transparent; color: var(--orange-deep); }
  .nav-link[aria-current="page"] { background: transparent; color: var(--orange-deep); }

  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .anchor-rail { position: static; top: auto; }

  .grid-2,
  .grid-3,
  .grid-asym { grid-template-columns: minmax(0, 1fr); }

  .status-strip .status:last-child { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 16px; line-height: 1.8; }
  .status-strip { display: none; }
  .cta-dot { padding: 9px 12px; gap: 7px; font-size: 13.5px; }
  .header-top__inner { min-height: 44px; padding-block: 7px; }
  .footer-top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: 8px; }
  .annotation--rot { transform: none; }
}
