/* ==========================================================================
   KI看台 / assets/site.css
   共享外壳：reset、变量、中文排版、头部、页脚、通用组件
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

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

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

h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; }

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

a { color: inherit; }

img, svg, picture { max-width: 100%; }

/* --------------------------------------------------------------------------
   设计令牌
   -------------------------------------------------------------------------- */
:root {
  /* 珠宝色分区 */
  --ink: #07111F;
  --ink-2: #0C2233;
  --teal: #0F3D3E;
  --wine: #4A1F33;
  --indigo: #2B2A5E;

  /* 前景与信号 */
  --paper: #EAF2F5;
  --signal: #B6FF3B;
  --whistle: #FF6B2C;
  --silver: #7D93A6;

  /* 边界与材质 */
  --hairline: rgba(234, 242, 245, .16);
  --hairline-soft: rgba(234, 242, 245, .08);
  --radius: 3px;
  --shadow-soft: 0 22px 56px -32px rgba(0, 0, 0, .92);

  /* 字体 */
  --font-display: "Barlow Condensed", "DIN Condensed", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 74px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  color-scheme: dark;
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }
}

/* --------------------------------------------------------------------------
   基础
   -------------------------------------------------------------------------- */
body {
  min-height: 100vh;
  padding-top: var(--header-h);
  background:
    radial-gradient(1100px 620px at 88% -10%, rgba(15, 61, 62, .58), transparent 62%),
    radial-gradient(780px 520px at -8% 10%, rgba(43, 42, 94, .42), transparent 60%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

#main-content:focus-visible {
  outline-offset: -4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 11px 18px;
  border-radius: 2px;
  background: var(--signal);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .04em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .22s var(--ease);
}

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

/* --------------------------------------------------------------------------
   容器与节奏
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

.container--wide { max-width: 1440px; }

.section { padding-block: clamp(40px, 6vw, 88px); }

.section--tight { padding-block: clamp(26px, 4vw, 52px); }

.divider {
  height: 1px;
  border: 0;
  background: var(--hairline);
}

/* --------------------------------------------------------------------------
   排版工具
   -------------------------------------------------------------------------- */
.display-xl {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(58px, 12vw, 152px);
  line-height: .86;
  letter-spacing: -.02em;
}

.title-xl {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -.01em;
}

.title-l {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.1;
}

.title-m {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.22;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--silver);
}

.lede {
  max-width: 62ch;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.8;
  color: #C4D5DE;
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
}

.annotation {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--silver);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.text-signal { color: var(--signal); }
.text-whistle { color: var(--whistle); }
.text-silver { color: var(--silver); }

/* --------------------------------------------------------------------------
   网格
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 32px);
}

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

.grid--split {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: start;
}

@media (max-width: 980px) {
  .grid--2,
  .grid--3,
  .grid--split { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  --btn-bd: var(--hairline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), color .2s var(--ease);
}

.btn:hover { transform: translateY(-2px); }

.btn:active { transform: translateY(0); }

.btn--ghost:hover {
  --btn-bd: rgba(182, 255, 59, .62);
  --btn-fg: var(--signal);
}

.btn--signal {
  --btn-bg: var(--signal);
  --btn-fg: var(--ink);
  --btn-bd: var(--signal);
  font-weight: 800;
}

.btn--signal:hover { --btn-bg: #CBFF6E; }

.btn--whistle {
  --btn-bg: var(--whistle);
  --btn-fg: #170A04;
  --btn-bd: var(--whistle);
  font-weight: 800;
}

.btn--whistle:hover { --btn-bg: #FF834D; }

/* --------------------------------------------------------------------------
   头部：比分条式导航
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  isolation: isolate;
  border-bottom: 1px solid transparent;
  transition: border-color .35s var(--ease);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(7, 17, 31, .94);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--hairline);
}

.site-header.is-stuck::before { opacity: 1; }

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
  min-height: var(--header-h);
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  padding-block: 4px;
  color: var(--paper);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
  letter-spacing: .02em;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  transition: transform .25s var(--ease);
}

.brand:hover .brand__mark { transform: translateY(-1px); }

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: .06em;
}

.brand__descriptor {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--silver);
  white-space: nowrap;
}

/* 导航 */
.site-nav { margin-left: auto; }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.1vw, 20px);
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 4px;
  color: var(--silver);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s var(--ease);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s var(--ease);
}

.site-nav__link:hover,
.site-nav__link:focus-visible { color: var(--paper); }

.site-nav__link:hover::after { transform: scaleX(1); }

.site-nav__link[aria-current="page"] { color: var(--paper); font-weight: 700; }

.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* 头部操作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.header-actions .btn {
  padding: 9px 15px;
  font-size: 13px;
}

/* 移动端开关 */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: rgba(12, 34, 51, .72);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.nav-toggle:hover { border-color: rgba(182, 255, 59, .55); }

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--paper);
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}

.site-header[data-open] .nav-toggle__bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle__bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 滚动进度光带 */
.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.scroll-meter__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--signal), var(--whistle));
}

/* 移动端吸底 dock */
.mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: var(--hairline);
  border-top: 1px solid var(--hairline);
}

.mobile-dock__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 10px;
  background: var(--ink-2);
  color: var(--paper);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease);
}

.mobile-dock__link--primary {
  background: var(--signal);
  color: var(--ink);
}

.mobile-dock__link:active { transform: translateY(1px); }

@media (max-width: 1100px) {
  .brand__descriptor { display: none; }
}

@media (max-width: 960px) {
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }

  .header-actions { display: none; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    margin-left: 0;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 8px clamp(18px, 5vw, 40px) 24px;
    background: rgba(12, 34, 51, .99);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s var(--ease);
  }

  .site-header[data-open] .site-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__list li + li { border-top: 1px solid var(--hairline-soft); }

  .site-nav__link {
    display: block;
    padding: 15px 2px;
    font-size: 16px;
    color: var(--paper);
  }

  .site-nav__link::after { display: none; }

  .site-nav__link[aria-current="page"] { color: var(--signal); }

  .mobile-dock { display: grid; }
}

@media (max-width: 400px) {
  .brand__name { font-size: 19px; }
  .brand__mark { width: 34px; height: 34px; font-size: 13px; }
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 140px);
  padding: clamp(40px, 6vw, 76px) 0 30px;
  overflow: hidden;
  background:
    radial-gradient(760px 340px at 12% 0%, rgba(15, 61, 62, .58), transparent 68%),
    radial-gradient(620px 300px at 94% 6%, rgba(43, 42, 94, .42), transparent 66%),
    var(--ink-2);
  border-top: 1px solid var(--hairline);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(115deg, rgba(234, 242, 245, .035) 0 1px, transparent 1px 46px);
}

.site-footer .container { position: relative; z-index: 1; }

.footer-top {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 2.1fr);
  gap: clamp(28px, 5vw, 72px);
  padding-bottom: clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--hairline);
}

.footer-brand__mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: .04em;
  color: var(--paper);
}

.footer-brand__line {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--signal);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.footer-col__title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--silver);
}

.footer-col__list {
  display: grid;
  gap: 9px;
  font-size: 14px;
}

.footer-col__list a {
  color: var(--paper);
  text-decoration: none;
  transition: color .2s var(--ease);
}

.footer-col__list a:hover { color: var(--signal); }

.footer-col__lines {
  display: grid;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--silver);
  word-break: break-word;
}

.footer-col__key {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--paper);
}

.footer-col__note {
  padding-top: 8px;
  border-top: 1px dashed var(--hairline-soft);
  font-size: 12.5px;
  color: rgba(125, 147, 166, .9);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  padding-top: 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--silver);
}

.footer-meta__icp { color: rgba(234, 242, 245, .72); }

.footer-meta__domain { color: rgba(125, 147, 166, .72); }

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

@media (max-width: 760px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-col--contact { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .footer-cols { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   通用内容组件
   -------------------------------------------------------------------------- */
.breadcrumb {
  margin-top: clamp(22px, 3.4vw, 42px);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--silver);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: rgba(125, 147, 166, .5);
}

.breadcrumb a {
  color: var(--silver);
  text-decoration: none;
  transition: color .2s var(--ease);
}

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

.breadcrumb [aria-current="page"] { color: var(--paper); }

.panel {
  position: relative;
  padding: clamp(18px, 2.6vw, 30px);
  background: linear-gradient(160deg, rgba(12, 34, 51, .94), rgba(7, 17, 31, .74));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel--teal {
  background: linear-gradient(160deg, rgba(15, 61, 62, .95), rgba(7, 17, 31, .82));
  border-color: rgba(182, 255, 59, .22);
}

.panel--wine {
  background: linear-gradient(160deg, rgba(74, 31, 51, .94), rgba(7, 17, 31, .84));
  border-color: rgba(255, 107, 44, .24);
}

.panel--indigo {
  background: linear-gradient(160deg, rgba(43, 42, 94, .92), rgba(7, 17, 31, .84));
  border-color: rgba(234, 242, 245, .22);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  line-height: 1.6;
  color: var(--silver);
}

.tag--signal {
  border-color: rgba(182, 255, 59, .45);
  color: var(--signal);
}

.tag--whistle {
  border-color: rgba(255, 107, 44, .5);
  color: var(--whistle);
}

.dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--signal);
  animation: ki-pulse 2.4s var(--ease) infinite;
}

@keyframes ki-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(182, 255, 59, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(182, 255, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(182, 255, 59, 0); }
}

/* 图片容器基础规则（页面阶段内嵌 <img>） */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 61, 62, .62), rgba(43, 42, 94, .46) 55%, rgba(12, 34, 51, .92));
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(234, 242, 245, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 242, 245, .06) 1px, transparent 1px);
  background-size: 38px 38px;
}

.media > img,
.media > picture > img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--silver);
}

/* 滚动显现协议 */
html.is-enhanced [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

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

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

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

  html.is-enhanced [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
