/* ==========================================================================
   球盟会主站 · 共享样式表 /assets/site.css
   1 重置  2 变量  3 中文排版  4 容器与栅格  5 通用组件  6 页头  7 页脚  8 响应式
   ========================================================================== */

/* --- 1 重置 ------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

/* --- 2 变量 ------------------------------------------------------------- */
:root {
  /* 色彩 */
  --ink: #0D2A26;
  --night: #101B2F;
  --paper: #F4EFE3;
  --slate: #3B403C;
  --moss: #4E7060;
  --gold: #C9A24A;
  --card-red: #B8402A;
  --card-yellow: #D6A521;
  --white: #FFFFFF;
  --line: #D9D2C2;

  /* 字阶 · 固定六档 */
  --fz-12: 0.75rem;
  --fz-14: 0.875rem;
  --fz-17: 1.0625rem;
  --fz-22: 1.375rem;
  --fz-34: 2.125rem;
  --fz-52: 3.25rem;

  /* 字体族 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
               "Noto Sans CJK SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas,
               "Noto Sans Mono CJK SC", "Courier New", monospace;

  /* 空间 */
  --maxw: 1240px;
  --gutter: clamp(18px, 4vw, 44px);
  --sec-gap: clamp(64px, 8vw, 110px);

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

/* --- 3 中文排版 --------------------------------------------------------- */
body {
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: var(--fz-17);
  font-weight: 400;
  line-height: 1.85;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.95rem, 6.4vw, var(--fz-52)); }
h2 { font-size: clamp(1.5rem, 4.2vw, var(--fz-34)); }
h3 { font-size: clamp(1.14rem, 2.6vw, var(--fz-22)); font-weight: 800; }
h4 { font-size: var(--fz-17); font-weight: 800; letter-spacing: 0; }

p { text-wrap: pretty; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.num {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
}
.num--gold { color: var(--gold); }

.meta__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  letter-spacing: 0.16em;
  line-height: 1.6;
  color: var(--moss);
}
.meta__value {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  letter-spacing: 0.08em;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  letter-spacing: 0.16em;
  line-height: 1.7;
  color: currentColor;
  opacity: 0.72;
}
.kicker--gold { color: var(--gold); opacity: 1; }

.lede {
  font-size: var(--fz-22);
  line-height: 1.7;
  letter-spacing: -0.01em;
  color: var(--moss);
  max-width: 30em;
}

.prose {
  font-size: var(--fz-17);
  line-height: 1.85;
  max-width: 38em;
}
.prose p + p { margin-top: 1.05em; }
.prose h3 { margin-top: 1.6em; margin-bottom: 0.5em; }

.rail {
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--moss);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* --- 4 容器与栅格 ------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 30px);
}
.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-5  { grid-column: span 5; }
.span-6  { grid-column: span 6; }
.span-8  { grid-column: span 8; }
.span-9  { grid-column: span 9; }
.span-12 { grid-column: span 12; }
.offset-1 { grid-column-start: 2; }
.offset-2 { grid-column-start: 3; }

.section { padding-block: var(--sec-gap); }
.section--tight { padding-block: calc(var(--sec-gap) * 0.55); }

.section__head {
  display: grid;
  gap: 12px;
  margin-bottom: clamp(26px, 3.4vw, 46px);
}
.section__title { max-width: 24em; }
.section__note {
  font-size: var(--fz-14);
  line-height: 1.8;
  color: var(--moss);
  max-width: 46em;
}

.rule {
  height: 0;
  border: 0;
  border-top: 1px solid var(--line);
  opacity: 0.4;
}
.rule--moss { border-top-color: var(--moss); opacity: 0.7; }

/* --- 5 通用组件 --------------------------------------------------------- */
.paper {
  background-color: var(--paper);
  color: var(--slate);
}

.panel {
  --cut: 14px;
  position: relative;
  background-color: var(--paper);
  color: var(--slate);
  padding: clamp(20px, 2.8vw, 34px);
  clip-path: polygon(
    0 var(--cut), var(--cut) 0,
    100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%,
    0 100%
  );
}
.panel--night { background-color: var(--night); color: var(--paper); }
.panel--ink { background-color: var(--ink); color: var(--paper); }

.figure {
  margin: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}
.figure__media {
  position: relative;
  aspect-ratio: var(--figure-ratio, 16 / 9);
  overflow: hidden;
  background-color: var(--night);
  background-image:
    repeating-linear-gradient(90deg, rgba(217, 210, 194, 0.07) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(217, 210, 194, 0.07) 0 1px, transparent 1px 34px),
    linear-gradient(135deg, rgba(78, 112, 96, 0.34), rgba(16, 27, 47, 0.95));
  clip-path: polygon(
    0 12px, 12px 0,
    100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%,
    0 100%
  );
}
.figure__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure__caption {
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  letter-spacing: 0.08em;
  line-height: 1.75;
  color: currentColor;
  opacity: 0.72;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  letter-spacing: 0.1em;
  line-height: 1.65;
  white-space: nowrap;
  border: 1px solid currentColor;
  color: var(--moss);
}
.tag--gold { color: var(--gold); }
.tag--moss { color: var(--moss); }
.tag--red { color: var(--card-red); }
.tag--yellow { color: var(--card-yellow); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: var(--fz-14);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.4;
  border: 1px solid transparent;
  clip-path: polygon(
    8px 0, 100% 0,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    0 100%, 0 8px
  );
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.btn--gold {
  background-color: var(--gold);
  color: var(--ink);
}
.btn--gold:hover,
.btn--gold:focus-visible {
  background-color: var(--paper);
  color: var(--ink);
}
.btn--line {
  background-color: transparent;
  color: var(--paper);
  border-color: var(--moss);
}
.btn--line:hover,
.btn--line:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}
.paper .btn--line,
.panel .btn--line {
  color: var(--slate);
  border-color: var(--moss);
}
.paper .btn--line:hover,
.panel .btn--line:hover { color: #7a5c18; border-color: var(--gold); }

.breadcrumb {
  font-size: var(--fz-12);
  letter-spacing: 0.08em;
}
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-family: var(--font-mono);
  color: var(--moss);
}
.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  margin-right: 10px;
  opacity: 0.6;
}
.breadcrumb__link {
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.breadcrumb__link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* --- 6 页头 ------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 120;
  padding: 10px 18px;
  background-color: var(--gold);
  color: var(--ink);
  font-size: var(--fz-14);
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; }

.masthead {
  position: relative;
  z-index: 20;
  background-color: var(--ink);
}
.masthead::after {
  content: "";
  display: block;
  height: 1px;
  background-image: linear-gradient(
    90deg,
    transparent,
    rgba(201, 162, 74, 0.55),
    transparent
  );
}

.masthead__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(22px, 3.4vw, 38px) var(--gutter) clamp(18px, 2.4vw, 26px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 18px;
}

.masthead__meta {
  display: grid;
  gap: 5px;
  padding-bottom: 6px;
}
.masthead__meta--left { justify-items: start; text-align: left; }
.masthead__meta--right { justify-items: end; text-align: right; }

.masthead__brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.brand {
  display: inline-block;
  font-size: clamp(1.75rem, 5.2vw, var(--fz-52));
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--paper);
}
.brand::after {
  content: "";
  display: block;
  height: 2px;
  width: 0;
  margin-top: 6px;
  background-color: var(--gold);
  transition: width 220ms var(--ease);
}
.brand:hover::after,
.brand:focus-visible::after { width: 100%; }

.brand__tagline {
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  letter-spacing: 0.16em;
  line-height: 1.7;
  color: var(--moss);
}

.nav-toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 14px var(--gutter);
  color: var(--paper);
  font-size: var(--fz-14);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: left;
}
.nav-toggle__bars {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 2px;
  background-color: var(--gold);
  flex: none;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background-color: var(--gold);
  transition: transform var(--dur) var(--ease);
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background-color: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

.nav {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  margin-top: clamp(16px, 2.4vw, 26px);
  border-top: 1px solid rgba(78, 112, 96, 0.5);
}
.nav__list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(14px, 3vw, 42px);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav__list::-webkit-scrollbar { display: none; }
.nav__item { display: flex; }

.nav__link {
  display: block;
  padding: 16px 2px 14px;
  font-size: var(--fz-14);
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: rgba(244, 239, 227, 0.72);
  border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav__link:hover { color: var(--paper); }
.nav__link[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--gold);
}

/* --- 7 页脚 ------------------------------------------------------------- */
.site-foot {
  background-color: var(--night);
  color: rgba(244, 239, 227, 0.78);
  border-top: 1px solid rgba(78, 112, 96, 0.55);
}

.site-foot__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 74px) var(--gutter) clamp(30px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3.2vw, 52px);
}

.site-foot__brand {
  display: grid;
  gap: 12px;
  align-content: start;
}
.site-foot__logo {
  display: inline-block;
  font-size: var(--fz-22);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--paper);
}
.site-foot__logo::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin-top: 10px;
  background-color: var(--gold);
}
.site-foot__tagline {
  font-size: var(--fz-14);
  line-height: 1.8;
  color: rgba(244, 239, 227, 0.62);
  max-width: 18em;
}
.site-foot__stamp {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.site-foot__col {
  display: grid;
  gap: 14px;
  align-content: start;
}
.site-foot__title {
  font-family: var(--font-mono);
  font-size: var(--fz-12);
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.7;
  color: var(--moss);
}
.site-foot__list {
  display: grid;
  gap: 2px;
}
.site-foot__link {
  display: inline-block;
  padding-block: 4px;
  font-size: var(--fz-14);
  line-height: 1.8;
  color: rgba(244, 239, 227, 0.78);
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.site-foot__link:hover {
  color: var(--paper);
  border-bottom-color: var(--gold);
}

.site-foot__bar {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 22px var(--gutter) clamp(28px, 4vw, 44px);
  border-top: 1px solid rgba(78, 112, 96, 0.35);
  display: grid;
  gap: 16px;
}
.site-foot__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  font-size: var(--fz-14);
  line-height: 1.8;
}
.site-foot__contact > li {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.site-foot__contact-value {
  font-family: var(--font-mono);
  font-size: var(--fz-14);
  letter-spacing: 0.02em;
  color: rgba(244, 239, 227, 0.9);
}
.site-foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: var(--fz-12);
  letter-spacing: 0.08em;
  line-height: 1.8;
  color: rgba(244, 239, 227, 0.55);
}
.site-foot__icp {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
.site-foot__year {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* --- 阅读进度（由共享 JS 注入） ----------------------------------------- */
.read-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  z-index: 110;
  background-color: var(--gold);
  pointer-events: none;
}

/* --- 8 响应式 ----------------------------------------------------------- */
@media (max-width: 1024px) {
  .masthead__inner { gap: 14px; }
}

@media (max-width: 900px) {
  .site-foot__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-foot__brand { grid-column: 1 / -1; }
  .span-3, .span-4, .span-5 { grid-column: span 6; }
  .span-8, .span-9 { grid-column: span 12; }
  .offset-1, .offset-2 { grid-column-start: auto; }
}

@media (max-width: 760px) {
  .masthead__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    row-gap: 12px;
    padding-bottom: 18px;
  }
  .masthead__brand {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .masthead__meta { padding-bottom: 0; }
  .masthead__meta--left { grid-column: 1; grid-row: 2; }
  .masthead__meta--right { grid-column: 2; grid-row: 2; }

  .nav-toggle {
    display: flex;
    margin-top: 14px;
    border-top: 1px solid rgba(78, 112, 96, 0.5);
  }

  .nav {
    max-width: none;
    padding-inline: 0;
    margin-top: 0;
    border-top: 0;
  }
  .nav__list {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 220ms var(--ease);
  }
  .nav[data-open] .nav__list { max-height: 34rem; }

  .nav__item {
    display: block;
    border-top: 1px solid rgba(78, 112, 96, 0.32);
  }
  .nav__link {
    padding: 15px var(--gutter);
    font-size: var(--fz-17);
    letter-spacing: 0.06em;
    color: rgba(244, 239, 227, 0.82);
    border-bottom: 0;
    border-left: 3px solid transparent;
  }
  .nav__link[aria-current="page"] {
    color: var(--paper);
    border-bottom: 0;
    border-left-color: var(--gold);
    background-color: rgba(201, 162, 74, 0.07);
  }

  .span-3, .span-4, .span-5, .span-6 { grid-column: span 12; }
}

@media (max-width: 560px) {
  .site-foot__inner { grid-template-columns: minmax(0, 1fr); }
  .site-foot__contact { flex-direction: column; gap: 8px; }
  .brand__tagline { letter-spacing: 0.1em; }
}

/* --- 可访问性与动效偏好 ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
