/* ==========================================================================
   吉祥访体育 · 共享样式表 /assets/site.css
   载入顺序：本文件 → 页面专属 CSS（页面 CSS 可覆写 --wave-accent 等变量）
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root {
  /* 色彩系统 */
  --paper: #F5F0E6;
  --ink: #141821;
  --deep-blue: #123BBF;
  --blue: #2E6BFF;
  --lime: #B6FF3C;
  --alert: #FF5230;
  --amber: #FFB020;
  --slate: #2C3A55;
  --silver: #C6CCD6;
  --paper-white: #FFFDF7;
  --ink-soft: #4B5468;
  --muted: #8B93A5;

  /* 波形主色（按栏目切换，页面级 CSS 覆写） */
  --wave-accent: var(--blue);

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

  /* 节奏与结构 */
  --shell-w: 1180px;
  --step-1: 24px;
  --step-2: 40px;
  --step-3: 72px;
  --rule: 3px;
  --shadow-hard: 7px 7px 0 rgba(20, 24, 33, 0.9);
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(90deg, rgba(20, 24, 33, 0.035) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(0deg, rgba(20, 24, 33, 0.035) 0 1px, transparent 1px 128px);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

body,
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, canvas { display: block; max-width: 100%; }

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

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.26;
  letter-spacing: -0.02em;
}

:target { scroll-margin-top: 148px; }

/* ---------- 3. 排版工具 ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.title-lg {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.title-md {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.title-sm {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--deep-blue);
}

.title-rule {
  position: relative;
  padding-bottom: 16px;
}

.title-rule::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 5px;
  background: var(--lime);
}

.prose {
  max-width: 38em;
  font-size: 17px;
  line-height: 1.85;
}

.prose p + p { margin-top: 1.1em; }

.prose a {
  color: var(--deep-blue);
  border-bottom: 2px solid rgba(18, 59, 191, 0.28);
}

.prose a:hover { border-bottom-color: var(--deep-blue); }

.slash {
  height: 12px;
  border: 0;
  background: repeating-linear-gradient(115deg, var(--blue) 0 14px, transparent 14px 30px);
}

/* ---------- 4. 焦点与跳转链接 ---------- */
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

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

.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -130%);
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--lime);
  border: 3px solid var(--ink);
  transition: transform 0.22s ease;
}

.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- 5. 容器与网格 ---------- */
.shell {
  width: min(100% - 36px, var(--shell-w));
  margin-inline: auto;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--step-1);
}

@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  white-space: nowrap;
  border: var(--rule) solid transparent;
  background: transparent;
  color: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
              transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-ghost {
  color: var(--silver);
  border-color: var(--slate);
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--paper-white);
  border-color: var(--paper-white);
}

.btn-pulse {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
  animation: pulse-ring 2s ease-out infinite;
}

.btn-pulse:hover {
  background: var(--paper-white);
  border-color: var(--paper-white);
}

.btn-paper {
  color: var(--ink);
  background: var(--paper-white);
  border-color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn-paper:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.btn-paper:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-ink {
  color: var(--paper-white);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 5px 5px 0 var(--blue);
}

.btn-ink:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--blue);
}

/* ---------- 7. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
}

.masthead { background: var(--ink); }

.masthead-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 18px 0 16px;
}

.masthead-context {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--silver);
}

.masthead-brand {
  grid-column: 2;
  display: block;
  text-align: center;
}

.masthead-name {
  display: block;
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background-image: linear-gradient(96deg, var(--blue) 0%, var(--lime) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .masthead-name {
    color: var(--paper-white);
    -webkit-text-fill-color: var(--paper-white);
  }
}

.masthead-tag {
  display: block;
  margin-top: 7px;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--silver);
}

.masthead-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.wave-rail {
  line-height: 0;
  background: var(--ink);
  border-top: 1px solid rgba(198, 204, 214, 0.16);
  overflow: hidden;
}

.wave-svg {
  width: 100%;
  height: 36px;
}

.wave-path {
  fill: none;
  stroke: var(--wave-accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  transform-origin: center;
  animation: wave-breathe 8s ease-in-out infinite;
}

.site-nav { background: var(--ink); }

.nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(198, 204, 214, 0.16);
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0 12px;
}

.nav-link {
  display: block;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--silver);
  border: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: var(--paper-white);
  border-color: var(--wave-accent);
}

.nav-link[aria-current="page"] {
  color: var(--paper-white);
  background: rgba(255, 253, 247, 0.07);
  border-color: var(--wave-accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 4px;
  color: var(--paper-white);
}

.nav-toggle-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.nav-toggle-bars {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 26px;
  height: 18px;
}

.nav-toggle-bars::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  box-shadow: 0 7px 0 currentColor, 0 -7px 0 currentColor;
  transform: translateY(-50%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle-bars::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%) scaleX(0);
  transition: transform 0.2s ease;
}

[data-nav-toggle][aria-expanded="true"] .nav-toggle-bars::before {
  box-shadow: none;
  transform: translateY(-50%) rotate(45deg);
}

[data-nav-toggle][aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-50%) rotate(-45deg) scaleX(1);
}

.header-progress {
  height: 4px;
  background: rgba(198, 204, 214, 0.22);
}

.header-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--wave-accent) 0%, var(--lime) 100%);
  transition: width 0.12s linear;
}

/* ---------- 8. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: var(--paper-white);
  background: var(--ink);
  border: 3px solid var(--lime);
  box-shadow: 5px 5px 0 rgba(20, 24, 33, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease,
              background-color 0.2s ease, color 0.2s ease;
}

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

.to-top:hover {
  color: var(--ink);
  background: var(--lime);
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  background: var(--ink);
  color: var(--silver);
  border-top: 4px solid var(--blue);
}

.footer-wave {
  line-height: 0;
  border-bottom: 1px solid rgba(198, 204, 214, 0.14);
}

.footer-wave svg {
  width: 100%;
  height: 28px;
}

.footer-wave .wave-path {
  stroke: var(--blue);
  stroke-width: 2;
  opacity: 0.75;
  animation: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: 40px 32px;
  padding: 48px 0 36px;
}

.footer-mark {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--paper-white);
}

.footer-sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--silver);
}

.footer-meta {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--muted);
}

.footer-title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--paper-white);
  border-bottom: 2px solid rgba(198, 204, 214, 0.2);
}

.footer-links li + li { margin-top: 9px; }

.footer-links a {
  display: inline-block;
  font-size: 14.5px;
  color: var(--silver);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-links a:hover {
  color: var(--lime);
  border-bottom-color: var(--lime);
}

.footer-line {
  font-size: 14px;
  color: var(--silver);
  word-break: break-word;
}

.footer-line + .footer-line { margin-top: 9px; }

.footer-key {
  display: inline-block;
  min-width: 3.2em;
  margin-right: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 18px 0 30px;
  border-top: 1px solid rgba(198, 204, 214, 0.16);
  font-size: 13px;
}

.footer-address { color: var(--muted); }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- 10. 通用组件 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.crumbs a { color: var(--deep-blue); }

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

.crumbs .sep { color: var(--silver); }

.card {
  position: relative;
  padding: 24px;
  background: var(--paper-white);
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow-hard);
}

.card-ink {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 6px 6px 0 var(--blue);
}

.card-blue { box-shadow: 6px 6px 0 var(--blue); }
.card-lime { box-shadow: 6px 6px 0 var(--lime); }
.card-alert { box-shadow: 6px 6px 0 var(--alert); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.65;
  color: var(--ink);
  background: var(--amber);
  border: 2px solid var(--ink);
}

.tag-blue { background: var(--blue); color: var(--paper-white); }
.tag-lime { background: var(--lime); }
.tag-alert { background: var(--alert); color: var(--paper-white); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.status::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--alert);
  animation: dot-pulse 2s ease-in-out infinite;
}

.status-done::before {
  background: var(--slate);
  animation: none;
}

.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--slate);
  border: var(--rule) solid var(--ink);
  box-shadow: var(--shadow-hard);
}

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

.media figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--lime);
  background: var(--ink);
}

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

.media-ink {
  border-color: var(--paper-white);
  box-shadow: 7px 7px 0 var(--blue);
}

/* ---------- 11. 动效 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@keyframes wave-breathe {
  0%, 100% { opacity: 0.45; transform: scaleY(0.72); }
  50%      { opacity: 1;    transform: scaleY(1); }
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(182, 255, 60, 0.5); }
  70%  { box-shadow: 0 0 0 11px rgba(182, 255, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(182, 255, 60, 0); }
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.8); }
}

/* ---------- 12. 响应式 ---------- */
@media (max-width: 1080px) {
  .masthead-grid { gap: 14px; }
  .nav-link { padding: 8px 13px; font-size: 14.5px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px 24px;
    padding: 40px 0 30px;
  }
  .footer-identity { grid-column: 1 / -1; }
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav-shell {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0 14px;
  }
  .site-nav[data-open] .nav-menu { display: flex; }
  .nav-link {
    padding: 13px 12px;
    font-size: 16px;
    border-width: 0 0 1px 0;
    border-color: rgba(198, 204, 214, 0.16);
    border-radius: 0;
  }
  .nav-link:hover {
    border-color: var(--wave-accent);
    background: rgba(255, 253, 247, 0.05);
  }
  .nav-link[aria-current="page"] {
    color: var(--ink);
    background: var(--wave-accent);
    border-color: var(--wave-accent);
  }
}

@media (max-width: 780px) {
  .masthead-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    padding: 16px 0 14px;
    text-align: center;
  }
  .masthead-context { order: 2; white-space: normal; }
  .masthead-brand { order: 1; grid-column: 1; }
  .masthead-tools { order: 3; justify-content: center; }
  .masthead-tag { letter-spacing: 0.1em; }
  .wave-svg { height: 28px; }
  .to-top { right: 12px; bottom: 12px; width: 46px; height: 46px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .shell { width: min(100% - 24px, var(--shell-w)); }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .footer-base { flex-direction: column; align-items: flex-start; }
  .footer-legal { flex-direction: column; gap: 4px; }
  .btn { padding: 9px 14px; font-size: 13px; }
}

/* ---------- 13. 尊重减弱动效 ---------- */
@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;
  }

  .wave-path {
    opacity: 1;
    transform: none;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .btn-pulse { animation: none; }
  .status::before { animation: none; }
}
