/* ==========================================================
   KAIYUN体育 全站共享样式 /assets/site.css
   黑白高对比 · 藏地红锚点 · 金色辅助 · 切角与轨道语言
   ========================================================== */

:root {
  --ink: #0A0A0A;
  --paper: #F5F5F0;
  --brand: #D32F2F;
  --deep-red: #A31313;
  --gold: #C9A227;
  --white: #FFFFFF;
  --gray-800: #2B2B2B;
  --gray-500: #8C8C8C;
  --ice-blue: #E0F0FF;
  --sand: #E8E0D0;

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", Consolas, "Courier New", monospace;

  --fs-display: clamp(2.5rem, 6vw, 4rem);
  --fs-section: 2rem;
  --fs-card: 1.25rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-data: 1.125rem;

  --header-w: 280px;
  --container-w: 1200px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-z: 1260;
  --backdrop-z: 1250;
  --topbar-z: 1300;
}

*,
*::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: var(--fs-body);
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(90deg, rgba(10, 10, 10, 0.02) 1px, transparent 1px);
  background-size: 4rem 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.75em;
  color: inherit;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  margin: 0 0 1.25em;
}

ul {
  padding-left: 1.25rem;
}

ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

/* 可访问性辅助 */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.btn:focus-visible {
  outline-offset: -4px;
}

::selection {
  background: var(--brand);
  color: var(--white);
}

/* 跳过链接 */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 2px;
  transform: translateY(-300%);
  transition: transform 150ms ease;
}

.skip-link:hover {
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================
   头部：移动端吸顶横条 + 左抽屉
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--ink);
  color: var(--white);
}

.header-topbar {
  position: relative;
  z-index: var(--topbar-z);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--ink);
  border-bottom: 2px solid var(--brand);
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
}

.brand:hover {
  color: var(--white);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--brand);
  border: 2px solid var(--gold);
  color: var(--white);
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.375rem;
  line-height: 1;
  clip-path: polygon(0 0, 84% 0, 100% 16%, 100% 100%, 16% 100%, 0 84%);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
}

.brand-tagline {
  margin-top: 0.125rem;
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* 汉堡按钮 */
.nav-toggle {
  position: relative;
  z-index: 1400;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 抽屉遮罩 */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--backdrop-z);
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.55);
  border: 0;
  cursor: pointer;
}

.nav-backdrop[hidden] {
  display: none;
}

/* 抽屉导航 */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--nav-z);
  display: flex;
  flex-direction: column;
  width: min(21rem, 88vw);
  height: 100vh;
  padding: 4.5rem 1rem 1.5rem;
  overflow-y: auto;
  background: var(--ink);
  border-right: 2px solid var(--brand);
  transform: translateX(-103%);
  transition: transform 300ms var(--ease-out);
}

.site-nav[data-open="true"] {
  transform: translateX(0);
}

.nav-kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
  padding-left: 0.625rem;
}

.nav-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  counter-reset: nav-index;
}

.nav-item {
  counter-increment: nav-index;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.625rem;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease;
}

.nav-link::before {
  content: counter(nav-index, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
}

.nav-link:hover {
  color: var(--white);
  background-color: rgba(255, 255, 255, 0.08);
  border-left-color: var(--gold);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--white);
  background-color: var(--brand);
  border-left-color: var(--gold);
}

.nav-link[aria-current="page"]::before {
  color: rgba(255, 255, 255, 0.8);
}

.nav-foot {
  margin-top: auto;
  padding-top: 1rem;
}

.nav-footline {
  margin: 1rem 0 0;
  padding-left: 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================
   滚动进度条
   ========================================================== */
.scroll-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1600;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.scroll-track-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

/* ==========================================================
   通用按钮
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

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

.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--deep-red);
  border-color: var(--deep-red);
  color: var(--white);
}

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

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

.btn-ghost-on-dark {
  border-color: var(--white);
  color: var(--white);
}

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

.nav-cta {
  width: 100%;
}

.nav-cta-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}

.nav-cta:hover .nav-cta-arrow {
  transform: translateX(4px);
}

/* ==========================================================
   页脚
   ========================================================== */
.site-footer {
  position: relative;
  overflow: hidden;
  background-color: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  border-top: 4px solid var(--brand);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  z-index: 1;
  width: 30%;
  height: 4px;
  background-color: var(--gold);
}

.footer-diag {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: 42%;
  height: 100%;
  pointer-events: none;
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 255, 255, 0.04) 14px 18px);
}

.footer-main {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.5rem;
  padding-top: 3rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3rem;
  }
}

@media (min-width: 1024px) {
  .footer-main {
    grid-template-columns: 1.6fr 0.8fr 1.2fr;
    gap: 3rem;
  }
}

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

.footer-about {
  margin: 1.25rem 0 0;
  max-width: 44ch;
  font-size: 0.875rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.55);
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-heading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-link {
  color: rgba(255, 255, 255, 0.68);
  transition: color 200ms ease;
}

.footer-link:hover {
  color: var(--gold);
  text-decoration: none;
}

.footer-line {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.62);
}

.footer-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 0.625rem;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(0, 0, 0, 0.35);
  padding: 0.875rem 0;
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .footer-bottom-inner {
    flex-direction: row;
    align-items: center;
  }
}

.footer-trust {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.42);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 1rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.42);
}

.footer-icp {
  color: var(--gold);
}

/* ==========================================================
   容器与章节
   ========================================================== */
.container {
  width: min(100% - 2rem, var(--container-w));
  margin-inline: auto;
}

.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section--paper {
  background-color: var(--paper);
}

.section--ink {
  background-color: var(--ink);
  color: rgba(255, 255, 255, 0.85);
}

.section--sand {
  background-color: var(--sand);
}

.section--brand {
  background-color: var(--brand);
  color: var(--white);
}

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-index {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.75rem, 5vw, 4.25rem);
  line-height: 1;
  color: var(--brand);
}

.section-index::after {
  content: "/";
  margin-left: 0.125em;
  color: var(--gold);
}

.section--ink .section-index {
  color: var(--gold);
}

.section--ink .section-index::after,
.section--brand .section-index::after {
  color: var(--brand);
}

.section-head-body {
  flex: 1 1 24rem;
}

.section-title {
  font-size: var(--fs-section);
  margin: 0;
}

.section-intro {
  margin: 0.5rem 0 0;
  color: var(--gray-500);
  max-width: 48rem;
}

.section--ink .section-intro,
.section--brand .section-intro {
  color: rgba(255, 255, 255, 0.65);
}

/* ==========================================================
   网格
   ========================================================== */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 1.5rem;
}

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

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

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================
   卡片
   ========================================================== */
.card {
  position: relative;
  padding: 1.5rem;
  background-color: var(--white);
  border: 1px solid rgba(10, 10, 10, 0.08);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}

.card--dark {
  background-color: var(--ink);
  border-color: transparent;
  color: rgba(255, 255, 255, 0.85);
}

.card--brand {
  background-color: var(--brand);
  border-color: transparent;
  color: var(--white);
}

.card-title {
  margin: 0 0 0.5em;
  font-size: var(--fs-card);
}

.card-body {
  margin: 0;
}

.card-meta {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.card--dark .card-meta {
  color: rgba(255, 255, 255, 0.45);
}

/* ==========================================================
   数据标签
   ========================================================== */
.data-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  background-color: var(--ice-blue);
  border: 1px solid rgba(10, 10, 10, 0.06);
  color: var(--gray-800);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1;
}

.data-chip--gold {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.data-chip--brand {
  background-color: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

.data-chip--outline {
  background-color: transparent;
  border-color: currentColor;
}

/* ==========================================================
   面包屑
   ========================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.breadcrumb li + li::before {
  content: "→";
  font-family: var(--font-mono);
  color: var(--brand);
}

.breadcrumb a {
  color: var(--gray-500);
}

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

/* ==========================================================
   表格
   ========================================================== */
.table-wrap {
  overflow-x: auto;
  background-color: var(--white);
  border: 1px solid rgba(10, 10, 10, 0.08);
}

.table-wrap table {
  min-width: 40rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.table-wrap thead th {
  background-color: var(--ink);
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 700;
}

.table-wrap tbody tr:nth-child(even) {
  background-color: rgba(10, 10, 10, 0.02);
}

.table-wrap tbody tr:hover {
  background-color: rgba(211, 47, 47, 0.06);
}

/* ==========================================================
   图片占位框
   ========================================================== */
.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: var(--sand);
  border: 1px solid rgba(10, 10, 10, 0.08);
  clip-path: polygon(0 0, calc(100% - 1rem) 0, 100% 1rem, 100% 100%, 0 100%);
}

.img-frame::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.img-frame--4-3::before {
  padding-top: 75%;
}

.img-frame--21-9::before {
  padding-top: 42.857%;
}

.img-frame--square::before {
  padding-top: 100%;
}

.img-frame > img,
.img-frame > .img-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-placeholder {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(10, 10, 10, 0.04) 12px 16px),
    var(--sand);
  color: var(--gray-500);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* ==========================================================
   斜线分隔
   ========================================================== */
.divider-slash {
  height: 1.5rem;
  margin: 2.5rem 0;
  border: 0;
  background-image: repeating-linear-gradient(90deg, var(--brand) 0 0.375rem, transparent 0.375rem 0.875rem);
}

/* ==========================================================
   滚动显现（渐进增强）
   ========================================================== */
[data-reveal] {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}

.js [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(20px);
}

/* ==========================================================
   桌面端：侧边轨道
   ========================================================== */
@media (min-width: 1024px) {
  body {
    margin-left: var(--header-w);
  }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--header-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--ink);
    border-right: 2px solid var(--brand);
  }

  .header-topbar {
    z-index: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.25rem;
    padding: 2rem 1.5rem 1.5rem;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-topbar .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .brand-mark {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.5rem;
  }

  .nav-toggle {
    display: none;
  }

  .nav-backdrop {
    display: none;
  }

  .site-nav {
    position: static;
    z-index: auto;
    flex: 1;
    width: auto;
    height: auto;
    padding: 1.5rem 1.25rem 1.25rem;
    overflow: visible;
    background: transparent;
    border-right: 0;
    transform: none;
  }

  .site-nav[data-open="true"] {
    transform: none;
  }

  .nav-link {
    font-size: 1.0625rem;
  }
}

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

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

  .scroll-track-fill {
    transition: none;
  }

  [data-reveal],
  .js [data-reveal]:not(.is-visible),
  .js [data-reveal].is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
