/* ==========================================================================
   谈球吧中心 · 共享样式表 /assets/site.css
   高原靛蓝底 + 蓝图网格 + 经幡五色语义标记
   ========================================================================== */

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

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

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

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

img, svg, video { 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%; }

/* ---------- tokens ---------- */
:root {
  /* 底色与结构 */
  --ink: #0B1230;
  --panel: #131C46;
  --line: #2A3564;

  /* 文字 */
  --text: #E4E9F7;
  --white: #F7F9FF;
  --muted: #8A93B8;

  /* 经幡五色 */
  --cyan: #2FD6C4;
  --cyan-soft: #8FF0E4;
  --violet: #7A6BFF;
  --red: #E4573D;
  --green: #4FB86B;
  --yellow: #F2C14E;

  /* 字体 */
  --font-head: "Helvetica Neue", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, "Courier New", monospace;

  /* 尺度 */
  --cut: 12px;
  --shell-max: 1280px;
  --shell-pad: clamp(20px, 5vw, 64px);
  --radius-0: 2px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- base ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, rgba(42, 53, 100, .30) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(42, 53, 100, .30) 1px, transparent 1px),
    linear-gradient(to right, rgba(42, 53, 100, .11) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(42, 53, 100, .11) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
  background-position: 0 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 62% at 50% -12%, rgba(122, 107, 255, .18), rgba(122, 107, 255, 0) 62%),
    radial-gradient(90% 55% at 100% 108%, rgba(47, 214, 196, .10), rgba(47, 214, 196, 0) 62%);
}

#main-content {
  position: relative;
  z-index: 1;
  display: block;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--white);
  line-height: 1.28;
}

h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); letter-spacing: .04em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

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

::selection {
  background: var(--cyan);
  color: var(--ink);
}

/* ---------- 布局骨架 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

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

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
  margin-bottom: clamp(20px, 3vw, 36px);
}

.lede {
  max-width: 62ch;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--text);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cyan);
}

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

.index-no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
}

.num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

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

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-block: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  transition: color .18s ease;
}

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

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

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--text);
  background: rgba(19, 28, 70, .72);
  border: 1px solid var(--line);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.btn:hover {
  color: var(--white);
  border-color: var(--cyan);
  background: rgba(47, 214, 196, .10);
}

.btn-entry {
  color: #06201C;
  font-weight: 600;
  background: var(--cyan);
  border-color: var(--cyan);
}

.btn-entry:hover {
  color: #06201C;
  background: var(--cyan-soft);
  border-color: var(--cyan-soft);
}

.btn-ghost {
  background: transparent;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 12px 20px;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink);
  background: var(--cyan);
  transition: top .18s ease;
}

.skip-link:focus {
  top: 12px;
  color: var(--ink);
}

/* ---------- 刊头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 18, 48, .93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-shell { padding-inline: clamp(16px, 4vw, 48px); }

.masthead-top {
  display: flex;
  align-items: center;
  gap: 14px;
  max-height: 44px;
  overflow: hidden;
  opacity: 1;
  transition: max-height .26s var(--ease), opacity .18s ease;
}

.meta-rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(to right, rgba(42, 53, 100, 0), var(--line), rgba(42, 53, 100, 0));
}

.masthead-meta {
  flex: 0 0 auto;
  padding-block: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  white-space: nowrap;
}

.masthead-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-block: 14px;
  transition: padding .26s var(--ease);
}

.masthead-stamp {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--muted);
  white-space: nowrap;
}

.masthead-brand {
  justify-self: center;
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  font-weight: 300;
  letter-spacing: .2em;
  text-indent: .2em;
  color: var(--white);
  white-space: nowrap;
  transition: font-size .26s var(--ease), color .18s ease;
}

.masthead-brand:hover { color: var(--cyan); }

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

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--text);
  border: 1px solid var(--line);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color .18s ease, color .18s ease;
}

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

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: var(--cyan);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--cyan);
}

.nav-toggle-icon::before { top: -5px; }
.nav-toggle-icon::after { top: 5px; }

/* ---------- 主导航 ---------- */
.primary-nav {
  border-top: 1px solid var(--line);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.6vw, 40px);
  padding-block: 4px 10px;
}

.nav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--muted);
  transition: color .18s ease;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s var(--ease);
}

.nav-list a:hover { color: var(--text); }
.nav-list a:hover::after { transform: scaleX(1); }

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

/* 收合态：滚动后刊头压成细条 */
.site-header[data-condensed] .masthead-top {
  max-height: 0;
  opacity: 0;
}

.site-header[data-condensed] .masthead-main { padding-block: 8px; }

.site-header[data-condensed] .masthead-brand {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}

.site-header[data-condensed] .nav-list { padding-block: 0 4px; }

/* ---------- 通用面板 / 标签 / 媒体框 ---------- */
.plate {
  position: relative;
  padding: clamp(20px, 2.6vw, 32px);
  background: var(--panel);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.plate::after {
  content: "";
  position: absolute;
  left: 0;
  top: var(--cut);
  width: calc(var(--cut) * 1.45);
  height: 1px;
  background: var(--cyan);
  transform: rotate(-45deg);
  transform-origin: 0 0;
  opacity: 0;
  transition: opacity .18s ease;
}

.plate:hover::after,
.plate:focus-within::after { opacity: 1; }

.offset-1 { margin-top: 12px; }
.offset-2 { margin-top: 24px; }
.offset-3 { margin-top: 40px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--cyan);
  border: 1px solid currentColor;
  white-space: nowrap;
}

.tag--gold { color: var(--yellow); }
.tag--red { color: var(--red); }
.tag--green { color: var(--green); }
.tag--violet { color: var(--violet); }
.tag--muted { color: var(--muted); }

.media-frame {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  aspect-ratio: var(--media-ratio, 16 / 10);
  background:
    radial-gradient(120% 90% at 22% 0%, rgba(122, 107, 255, .22), rgba(122, 107, 255, 0) 62%),
    linear-gradient(160deg, var(--panel), #0C1334);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.82) contrast(1.06) brightness(.9);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(11, 18, 48, .72), rgba(11, 18, 48, 0) 58%);
}

.media-frame--wide { --media-ratio: 21 / 9; }
.media-frame--tall { --media-ratio: 4 / 5; }
.media-frame--square { --media-ratio: 1 / 1; }

.media-caption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(56px, 8vw, 120px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 28, 70, .62), rgba(11, 18, 48, .96));
}

.footer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding-block: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.footer-cta-text {
  max-width: 42ch;
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
  padding-block: clamp(32px, 5vw, 58px);
}

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

.footer-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.footer-links li { margin-bottom: 2px; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 14px;
  color: var(--muted);
  transition: color .18s ease;
}

.footer-links a:hover { color: var(--white); }

.footer-note {
  margin-bottom: 14px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 13.5px;
}

.contact-key {
  flex: 0 0 auto;
  min-width: 34px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--line);
  color: var(--muted);
}

.contact-val {
  color: var(--text);
  word-break: break-all;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px dashed var(--line);
  word-break: break-all;
  transition: color .18s ease, border-color .18s ease;
}

.copy-chip:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.copy-chip[data-copied] {
  color: var(--green);
  border-bottom-color: var(--green);
}

.copy-chip[data-copied]::after {
  content: " · 已复制";
  font-size: 11px;
  letter-spacing: .1em;
}

.footer-legal {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding-block: 18px 30px;
  border-top: 1px solid var(--line);
}

.footer-version {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
}

/* ---------- 滚动显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .42s ease, transform .42s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="line"] {
  opacity: 1;
  transform: scaleY(0);
  transform-origin: top center;
}

[data-reveal="line"].is-visible { transform: scaleY(1); }

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asym { gap: clamp(20px, 3.4vw, 40px); }
}

@media (max-width: 900px) {
  .masthead-stamp { display: none; }

  .masthead-main {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .masthead-brand { justify-self: start; }

  .nav-toggle { display: inline-flex; }

  .primary-nav {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    border-top-color: transparent;
    transition: max-height .26s var(--ease), opacity .18s ease, visibility .26s linear;
  }

  .primary-nav[data-open] {
    max-height: 108px;
    opacity: 1;
    visibility: visible;
    border-top-color: var(--line);
  }

  .nav-list {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 0 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list li { scroll-snap-align: start; }

  .nav-list a {
    min-height: 44px;
    padding: 0 14px;
    color: var(--text);
    white-space: nowrap;
    background: rgba(19, 28, 70, .72);
    border: 1px solid var(--line);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  }

  .nav-list a::after { display: none; }

  .nav-list a[aria-current="page"] {
    color: var(--ink);
    background: var(--cyan);
    border-color: var(--cyan);
  }

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

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .masthead-top { max-height: 40px; }

  .masthead-meta {
    font-size: 10px;
    letter-spacing: .1em;
    white-space: normal;
    line-height: 1.4;
    text-align: center;
    padding-block: 10px;
  }

  .masthead-brand { letter-spacing: .14em; text-indent: .14em; }

  .btn-entry { padding: 0 14px; font-size: 12px; letter-spacing: .08em; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .footer-cta { flex-direction: column; align-items: flex-start; }

  .footer-base { flex-direction: column; align-items: flex-start; }

  .grid-12 { gap: 16px; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  [data-reveal],
  [data-reveal="line"] {
    opacity: 1 !important;
    transform: none !important;
  }

  .site-header[data-condensed] .masthead-top {
    max-height: 44px;
    opacity: 1;
  }
}
