/* ==========================================================================
   UC赛场 · 共享站点样式 /assets/site.css
   1. Reset  2. 变量  3. 基础排版  4. 容器与网格  5. 通用组件
   6. 头部  7. 页脚  8. 动效  9. 响应式与偏好
   ========================================================================== */

/* 1. Reset ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

ul,
ol { margin: 0; padding: 0; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

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

/* 2. 变量 ---------------------------------------------------------------- */
:root {
  /* 品牌色 */
  --ink: #0B0E0C;
  --paper: #F7F5EF;
  --green: #0E6B3F;
  --amber: #FFB000;
  --slate: #D9E2E8;
  --volt: #B7FF4A;
  --deep: #052517;
  --line: #6E7A72;
  --red: #C8443A;
  --mist: #E9E6DD;

  /* 结构 */
  --shell: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --unit: 8px;

  /* 字体 */
  --font-display: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas,
    Menlo, "Courier New", "Noto Sans Mono CJK SC", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --rail-h: 40px;

  /* 半透明纸白 */
  --paper-70: rgba(247, 245, 239, 0.72);
  --paper-55: rgba(247, 245, 239, 0.55);
  --paper-28: rgba(247, 245, 239, 0.28);
  --paper-18: rgba(247, 245, 239, 0.18);
}

/* 3. 基础排版 ------------------------------------------------------------ */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: condensed;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 0 0 0.55em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.4rem); letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; letter-spacing: 0; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

strong { font-weight: 700; }

small { font-size: 0.8125rem; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: clamp(28px, 4vw, 48px) 0;
}

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

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

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

.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)); }

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

/* 5. 通用组件 ------------------------------------------------------------ */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-220%);
  padding: 12px 18px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--ink);
  transition: transform 0.18s var(--ease);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease), color 0.18s var(--ease);
}

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

.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { box-shadow: 4px 4px 0 0 var(--green); }

.btn--action { background: var(--amber); color: var(--ink); }

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

.btn__arrow {
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  border: 1px solid var(--ink);
}

.tag--green { background: var(--green); border-color: var(--green); color: var(--paper); }
.tag--volt { background: var(--volt); border-color: var(--volt); color: var(--ink); }
.tag--line { background: transparent; color: var(--ink); border-color: var(--ink); }

.panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: clamp(20px, 3vw, 36px);
}

.panel--stack {
  box-shadow: 10px 10px 0 0 var(--mist), 10px 10px 0 1px var(--ink);
}

.panel--dark {
  background: var(--deep);
  border-color: var(--deep);
  color: var(--paper);
}

.panel--dark a { color: var(--volt); }

.panel--green {
  background: var(--green);
  border-color: var(--green);
  color: var(--paper);
}

.panel--green a { color: var(--paper); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0 0 clamp(20px, 3vw, 32px);
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crumbs li { display: flex; align-items: center; }

.crumbs li + li::before {
  content: "/";
  margin: 0 10px;
  color: var(--line);
}

.crumbs a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.crumbs a:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

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

.prose {
  max-width: 68ch;
  font-size: 1.0625rem;
}

.prose h2,
.prose h3 { margin-top: 1.6em; }

.prose ul,
.prose ol {
  padding-left: 1.25em;
  margin: 0 0 1.15em;
}

.prose li { margin-bottom: 0.5em; }

.prose blockquote {
  margin: 0 0 1.5em;
  padding: 16px 20px;
  border-left: 4px solid var(--green);
  background: var(--mist);
  font-weight: 500;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--slate);
  padding: 0.1em 0.4em;
}

/* 可复用图片容器（页面阶段放 <img> 或占位） */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--slate);
  border: 1px solid var(--ink);
}

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

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

.media--cut {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), calc(100% - 32px) 100%, 0 100%);
}

.media__tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 6px 10px;
  background: var(--ink);
  color: var(--volt);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* 6. 头部 ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
}

.header__rail {
  background: var(--deep);
  color: var(--paper);
  border-bottom: 1px solid rgba(183, 255, 74, 0.22);
}

.header__rail-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  min-height: var(--rail-h);
}

.header__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: condensed;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.header__brand:hover { color: var(--volt); }

.header__brand-sep {
  margin: 0 4px;
  color: var(--volt);
  font-family: var(--font-mono);
  font-weight: 400;
}

.header__brand-cn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--paper-55);
}

.header__tagline {
  flex: 1;
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--paper-55);
}

.header__tools {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 20px);
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.tool:hover {
  color: var(--volt);
  border-bottom-color: var(--volt);
}

.tool__dot {
  display: block;
  width: 8px;
  height: 8px;
  background: var(--volt);
}

.tool__count {
  font-variant-numeric: tabular-nums;
  color: var(--volt);
}

.tool--member { color: var(--amber); font-weight: 700; }

.tool--search {
  position: relative;
  padding: 2px;
}

.tool__glass {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.tool__glass::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 2px;
  height: 6px;
  background: currentColor;
  transform: rotate(-45deg);
}

.header__bar {
  position: relative;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.header__bar-inner {
  display: flex;
  align-items: center;
  min-height: clamp(58px, 7vw, 70px);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--volt);
  transition: transform 0.2s var(--ease), top 0.2s var(--ease);
}

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { top: 10px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 5px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  top: 5px;
  transform: rotate(-45deg);
}

.nav {
  flex: 1;
  min-width: 0;
}

.nav__list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.8vw, 24px);
  list-style: none;
  width: 100%;
}

.nav__item { display: block; }

.nav__link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 2px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 transparent;
  transition: box-shadow 0.18s var(--ease), color 0.18s var(--ease);
}

.nav__num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--line);
  font-variant-numeric: tabular-nums;
  transition: color 0.18s var(--ease);
}

.nav__link:hover { color: var(--green); }
.nav__link:hover .nav__num { color: var(--green); }

.nav__link[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--green);
}

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

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.read-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--amber);
  transition: width 0.1s linear;
}

/* 7. 页脚 ---------------------------------------------------------------- */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--deep);
  color: var(--paper);
  border-top: 4px solid var(--green);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.35fr;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(40px, 6vw, 72px);
}

.footer__col { min-width: 0; }

.footer__brand {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: condensed;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  border-bottom: 3px solid var(--volt);
  padding-bottom: 2px;
}

.footer__brand:hover { color: var(--volt); }

.footer__note {
  max-width: 26ch;
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--paper-70);
}

.footer__title {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--volt);
}

.footer__list {
  display: grid;
  gap: 10px;
  list-style: none;
  font-size: 0.95rem;
}

.footer__list a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.footer__list a:hover {
  color: var(--volt);
  border-bottom-color: var(--volt);
}

.footer__list--contact { gap: 14px; }

.footer__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--paper-55);
}

.footer__value {
  display: block;
  color: var(--paper);
  word-break: break-word;
}

.footer__hint {
  margin: 16px 0 0;
  max-width: 34ch;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--paper-55);
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--paper-18);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--paper-70);
}

.footer__copy { margin: 0; }

.footer__icp {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--paper-28);
  color: var(--paper-55);
}

.footer__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer__version { color: var(--volt); }

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--paper-28);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.to-top:hover {
  color: var(--volt);
  border-color: var(--volt);
}

/* 8. 动效 ---------------------------------------------------------------- */
html.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

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

[data-spy] a[aria-current="true"] {
  color: var(--green);
  font-weight: 700;
}

/* 9. 响应式 -------------------------------------------------------------- */
@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .footer__col--brand { grid-column: 1 / -1; }
}

@media (max-width: 899px) {
  .header__tagline { display: none; }
  .header__bar-inner { justify-content: space-between; }
  .nav-toggle { display: inline-flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 70;
    display: none;
    flex: none;
    background: var(--paper);
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }

  .nav[data-open="true"] { display: block; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
  }

  .nav__item { width: 100%; }

  .nav__item + .nav__item { border-top: 1px solid var(--slate); }

  .nav__link {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px var(--gutter);
    font-size: 1rem;
    white-space: normal;
    box-shadow: none;
  }

  .nav__link[aria-current="page"] {
    background: var(--ink);
    color: var(--paper);
    box-shadow: none;
  }

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

  .nav__num {
    width: 2.4em;
    flex: none;
    font-size: 0.78rem;
  }

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

  .panel--stack {
    box-shadow: 6px 6px 0 0 var(--mist), 6px 6px 0 1px var(--ink);
  }
}

@media (max-width: 720px) {
  .header__brand-cn { display: none; }
  .tool--fav { font-size: 0.7rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__base { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
  .footer__col--brand { grid-column: auto; }
  .footer__icp { display: block; margin: 6px 0 0; padding: 0; border-left: 0; }
  .tool--member { display: none; }
}

@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;
  }

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

  .btn:hover { transform: none; }
  .read-progress__fill { transition: none; }
}
