/* ============================================================
   YOBO 竞技 · 全站共享样式 /assets/site.css
   设计体系：竞技档案 · 高原蓝 × 雪山白 × 经幡橙
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg-main: #0F2A4A;
  --bg-content: #F6F9FD;
  --primary: #1B3A6B;
  --secondary: #C7DEF7;
  --accent: #FF6B2C;
  --alert: #E11D48;
  --muted: #4A5A70;
  --line: #A8C5E5;
  --navy: #0B2242;
  --ink: #081E38;
  --snow: #F0F6FC;
  --text-main: #1E2A3A;

  --font-title: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --rail-width: 96px;
  --header-h: 56px;
  --max-container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset / 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-main);
  background: var(--bg-content);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, blockquote {
  margin: 0;
}

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

ul[class], ol[class] {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  color: var(--accent);
}

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

::selection {
  background: var(--accent);
  color: var(--navy);
}

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

main {
  display: block;
  min-height: 70vh;
}

@media (min-width: 1024px) {
  main,
  .site-footer {
    margin-left: var(--rail-width);
  }
}

/* ---------- 内容容器 ---------- */
.container {
  width: min(var(--max-container), calc(100% - 2rem));
  margin-inline: auto;
}

.container-wide {
  width: min(1440px, calc(100% - 2rem));
  margin-inline: auto;
}

.container-narrow {
  width: min(860px, calc(100% - 2rem));
  margin-inline: auto;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 400;
  background: var(--accent);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.75rem 1rem;
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform 0.25s var(--ease);
}

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

/* ============================================================
   侧边轨道头部
   ============================================================ */
.site-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-width);
  background: var(--navy);
  border-right: 1px solid rgba(199, 222, 247, 0.14);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  scrollbar-width: none;
}

.site-rail::-webkit-scrollbar {
  display: none;
}

.rail-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1.5rem;
}

/* 品牌 */
.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--snow);
}

.brand-mark:hover {
  color: var(--snow);
}

.brand-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--navy);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.3125rem;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}

.brand-name {
  display: block;
  writing-mode: vertical-rl;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 0.8125rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--snow);
  margin-top: 0.25rem;
}

/* 轨道导航 */
.rail-nav {
  margin-top: 2rem;
  width: 100%;
}

.rail-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.rail-link {
  display: block;
  writing-mode: vertical-rl;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.4;
  padding: 0.5rem 0.45rem;
  color: var(--secondary);
  text-decoration: none;
  border-right: 2px solid transparent;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}

.rail-link:hover,
.rail-link:focus-visible {
  color: var(--snow);
  background: rgba(199, 222, 247, 0.06);
}

.rail-link[aria-current="page"] {
  color: var(--snow);
  border-right-color: var(--accent);
  background: rgba(199, 222, 247, 0.08);
}

/* 章节追踪器 */
.rail-status {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1.5rem 0 1.25rem;
}

.status-index,
.status-total {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1;
  color: rgba(240, 246, 252, 0.55);
  letter-spacing: 0.1em;
  min-width: 2ch;
  text-align: center;
}

.status-track {
  position: relative;
  width: 2px;
  height: 88px;
  background: rgba(199, 222, 247, 0.18);
}

.status-dot {
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: translate(-50%, -50%);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 100%, 0 100%);
}

.rail-icp {
  writing-mode: vertical-rl;
  font-size: 0.625rem;
  letter-spacing: 0.28em;
  color: rgba(199, 222, 247, 0.38);
  margin: 0;
  padding: 0 0 1.5rem;
}

/* 移动端抽屉开关 */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 61;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(199, 222, 247, 0.35);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
}

.toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--snow);
  transition: transform 0.28s var(--ease), opacity 0.2s;
}

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

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

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

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  position: relative;
  background: var(--navy);
  color: rgba(240, 246, 252, 0.75);
  overflow: hidden;
  border-top: 1px solid rgba(199, 222, 247, 0.12);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  width: min(var(--max-container), calc(100% - 3rem));
  margin-inline: auto;
  padding: 4rem 0 2.75rem;
}

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

.footer-brand .brand-symbol {
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
}

.footer-brand .brand-name {
  writing-mode: horizontal-tb;
  font-size: 1.125rem;
  letter-spacing: 0.14em;
  margin-top: 0;
}

.footer-slogan {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.footer-heading {
  position: relative;
  padding-left: 0.75rem;
  font-family: var(--font-title);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--snow);
}

.footer-heading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 3px;
  height: 0.9em;
  background: var(--accent);
  transform: skewX(-12deg);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-list a {
  position: relative;
  color: rgba(240, 246, 252, 0.72);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.footer-list a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
  margin-top: 2px;
}

.footer-list a:hover {
  color: var(--accent);
}

.footer-list a:hover::after {
  width: 100%;
}

.meta-list li {
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(240, 246, 252, 0.62);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(var(--max-container), calc(100% - 3rem));
  margin-inline: auto;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid rgba(199, 222, 247, 0.14);
}

.footer-legal,
.footer-note {
  font-size: 0.8125rem;
  color: rgba(240, 246, 252, 0.5);
  margin: 0;
}

.footer-legal a {
  color: rgba(240, 246, 252, 0.68);
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--accent);
}

/* 山脉收尾 */
.footer-mountains {
  display: block;
  width: 100%;
  height: 96px;
  line-height: 0;
}

.mountains-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mountain-back {
  fill: var(--bg-main);
}

.mountain-front {
  fill: var(--ink);
}

/* 返回顶部 */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 260;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--snow);
  border: 1px solid var(--line);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s, background 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--accent);
  color: var(--navy);
  border-color: var(--accent);
}

.to-top-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: 4px;
}

/* ============================================================
   通用按钮 / 标签 / 标题
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.875rem 1.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--navy);
}

.btn-primary:hover {
  background: var(--navy);
  color: var(--snow);
  border-color: var(--accent);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--snow);
}

.btn-light {
  background: var(--snow);
  color: var(--primary);
  border-color: var(--snow);
}

.btn-light:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--navy);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  background: var(--secondary);
  color: var(--primary);
  border: 1px solid var(--line);
}

.badge-accent {
  background: var(--accent);
  color: var(--navy);
  border-color: var(--accent);
}

.badge-alert {
  background: var(--alert);
  color: var(--snow);
  border-color: var(--alert);
}

.badge-ghost {
  background: transparent;
  color: var(--secondary);
  border-color: rgba(199, 222, 247, 0.4);
}

.display-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 1.25rem;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-kicker::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent);
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ============================================================
   网格 / 卡片 / 图片框架
   ============================================================ */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

.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-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-10 { grid-column: span 10; }
.span-12 { grid-column: span 12; }

.card {
  position: relative;
  background: var(--snow);
  border: 1px solid var(--line);
  padding: 1.5rem;
}

.card--accent {
  border-top: 3px solid var(--accent);
}

.card--dark {
  background: var(--bg-main);
  border-color: var(--primary);
  color: var(--snow);
}

.figure-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: var(--secondary);
  background-image:
    linear-gradient(rgba(27, 58, 107, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 58, 107, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  border: 1px solid var(--line);
}

.figure-frame::before {
  content: 'IMG · YOBO';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  color: rgba(27, 58, 107, 0.4);
  z-index: 1;
  pointer-events: none;
}

.figure-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(27, 58, 107, 0.1);
  pointer-events: none;
  z-index: 3;
}

.figure-frame img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.figure-frame:hover img {
  transform: scale(1.02);
}

.img-16x9 { aspect-ratio: 16 / 9; }
.img-4x3 { aspect-ratio: 4 / 3; }
.img-square { aspect-ratio: 1 / 1; }

/* ============================================================
   面包屑 / 章节块 / 装饰
   ============================================================ */
.crumb-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.crumb-item a {
  color: var(--muted);
  text-decoration: none;
}

.crumb-item a:hover {
  color: var(--accent);
}

.crumb-item + .crumb-item::before {
  content: '/';
  margin: 0 0.625rem;
  color: var(--line);
}

.crumb-item[aria-current="page"] {
  color: var(--primary);
  font-weight: 700;
}

.page-section {
  position: relative;
  padding: clamp(4rem, 9vw, 7.5rem) 0;
}

.page-section--dark {
  background: var(--bg-main);
  color: var(--snow);
}

.page-section--dark .section-title,
.page-section--dark .display-title {
  color: var(--snow);
}

.zone-divider {
  display: block;
  width: 100%;
  height: 24px;
  background: repeating-linear-gradient(
    -45deg,
    var(--primary) 0 12px,
    var(--accent) 12px 16px,
    var(--primary) 16px 28px
  );
}

.mountain-band {
  display: block;
  width: 100%;
  height: 56px;
  background: var(--navy);
  clip-path: polygon(
    0% 100%, 0% 40%, 7% 70%, 14% 30%, 22% 78%, 31% 35%,
    40% 82%, 50% 22%, 58% 68%, 66% 28%, 74% 76%, 83% 38%,
    91% 72%, 100% 42%, 100% 100%
  );
}

/* ============================================================
   筛选 / 手风琴 / 滚动显现
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.filter-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--snow);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-label:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-input:checked + .filter-label {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--snow);
}

.filter-input:focus-visible + .filter-label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.accordion {
  border: 1px solid var(--line);
  background: var(--snow);
}

.accordion-summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  padding: 1.125rem 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--navy);
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
}

.accordion[open] .accordion-summary::after {
  content: '−';
}

.accordion-body {
  padding: 0 1.5rem 1.25rem;
  color: var(--muted);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 1023px) {
  .site-rail {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: var(--header-h);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(199, 222, 247, 0.14);
    overflow: visible;
  }

  .rail-inner {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 0;
    width: auto;
  }

  .brand-mark {
    flex-direction: row;
    gap: 0.625rem;
  }

  .brand-name {
    writing-mode: horizontal-tb;
    font-size: 0.9375rem;
    letter-spacing: 0.14em;
    margin-top: 0;
  }

  .rail-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    z-index: 50;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0.32s;
  }

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

  .rail-list {
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
  }

  .rail-link {
    writing-mode: horizontal-tb;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    padding: 0.75rem 1.5rem;
    border-right: none;
    border-left: 3px solid transparent;
  }

  .rail-link[aria-current="page"] {
    border-right: none;
    border-left-color: var(--accent);
    background: rgba(199, 222, 247, 0.07);
  }

  .rail-status {
    display: none;
  }

  .rail-icp {
    display: block;
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    z-index: 51;
    writing-mode: horizontal-tb;
    letter-spacing: 0.2em;
    text-align: center;
    padding: 0;
    color: rgba(240, 246, 252, 0.38);
  }

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

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

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

  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-12 {
    grid-column: span 12;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 3rem;
  }

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

  .footer-mountains {
    height: 56px;
  }

  .to-top {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ============================================================
   无障碍 / 减少动画
   ============================================================ */
@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;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .figure-frame img,
  .footer-list a::after,
  .btn,
  .badge,
  .filter-label,
  .accordion-summary {
    transition: none !important;
  }
}
