/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-light);
  background-color: var(--bg-deep);
}

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

ul,
ol {
  list-style: none;
}

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

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ===== 变量 ===== */
:root {
  --bg-deep: #0a1628;
  --bg-darker: #050e1c;
  --bg-card: #10233a;
  --accent: #ff4d2e;
  --accent-light: #ff7a5c;
  --accent-dark: #cc3a22;
  --silver: #c0c0c0;
  --text-light: #e6e6e6;
  --text-dim: #8a94a6;
  --grid: #2c3e50;
  --font-display: "DIN Condensed", "Arial Narrow", "Arial", sans-serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Roboto Mono", "Courier New", monospace;
  --header-h: 72px;
  --content-w: 1280px;
  --content-w-narrow: 880px;
  --radius: 2px;
  --dur: 0.3s;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== 中文排版基础 ===== */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-light);
  margin-bottom: 0.5em;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
}

h3 {
  font-size: clamp(20px, 2.5vw, 28px);
}

p {
  margin-bottom: 1em;
}

strong {
  font-weight: 700;
  color: var(--text-light);
}

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

/* ===== 工具类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: var(--bg-deep);
  padding: 12px 24px;
  z-index: 2000;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.3s var(--ease);
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.skip-link:focus {
  top: 0;
}

/* ===== 容器 ===== */
.container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: var(--content-w-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--bg-deep);
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.btn:hover {
  background: var(--accent-light);
  color: var(--bg-deep);
  transform: translateY(-1px);
}

.btn:active {
  background: var(--accent-dark);
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.btn--ghost:hover {
  background: rgba(255, 77, 46, 0.12);
  color: var(--accent-light);
  border-color: var(--accent-light);
}

.btn--dark {
  background: var(--bg-card);
  color: var(--text-light);
  border-color: var(--silver);
}

.btn--dark:hover {
  background: var(--bg-darker);
  color: var(--accent-light);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  padding: 16px 0;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb__link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb__link:hover {
  color: var(--accent);
}

.breadcrumb__sep {
  color: var(--silver);
  opacity: 0.5;
  font-family: var(--font-mono);
}

/* ===== 网格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.grid__item {
  grid-column: span 4;
  min-width: 0;
}

/* ===== 卡片 ===== */
.card {
  background: linear-gradient(135deg, rgba(255, 77, 46, 0.06), transparent 45%), var(--bg-card);
  border-radius: 4px 14px 4px 14px;
  padding: 24px;
  border-left: 3px solid var(--accent);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--silver);
  background: var(--bg-card);
  border: 1px solid rgba(192, 192, 192, 0.22);
  border-radius: 2px;
  letter-spacing: 0.04em;
}

.tag--accent {
  color: var(--accent);
  border-color: rgba(255, 77, 46, 0.35);
  background: rgba(255, 77, 46, 0.06);
}

/* ===== 章节装饰 ===== */
.section-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  margin-bottom: 16px;
}

.stripes {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent) 0,
    var(--accent) 6px,
    transparent 6px,
    transparent 12px
  );
}

/* ===== 数字与数据 ===== */
.data-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2em;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ===== 图片容器 ===== */
.img-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 16 / 9;
  border-radius: 2px;
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 65%, rgba(255, 77, 46, 0.14));
  pointer-events: none;
}

.img-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-frame--tall {
  aspect-ratio: 3 / 4;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.95);
  border-bottom: 1px solid rgba(192, 192, 192, 0.12);
}

.site-header__progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  z-index: 2;
  pointer-events: none;
}

.site-header__inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__mark {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  padding: 5px 10px;
  transform: skewX(-8deg);
  letter-spacing: 0.03em;
}

.brand__sub {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.site-search {
  flex: 1;
  max-width: 360px;
  margin: 0 auto;
  position: relative;
}

.site-search::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 18px;
  background: var(--accent);
  transform: translateY(-50%) skewX(-25deg);
  z-index: 1;
  pointer-events: none;
}

.site-search__input {
  width: 100%;
  padding: 8px 14px 8px 18px;
  background: var(--bg-card);
  border: 1px solid rgba(192, 192, 192, 0.18);
  border-radius: 2px;
  color: var(--text-light);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.site-search__input::placeholder {
  color: rgba(138, 148, 166, 0.8);
}

.site-search__input:hover {
  border-color: rgba(192, 192, 192, 0.35);
}

.site-search__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 77, 46, 0.15);
  background: rgba(16, 35, 58, 0.9);
}

.site-nav {
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.site-nav__item {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-block;
  position: relative;
  padding: 8px 12px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: 2px;
  width: 0;
  height: 3px;
  background: var(--accent);
  transform: skewX(-30deg);
  transition: width 0.25s var(--ease);
}

.site-nav__link:hover {
  color: var(--accent-light);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after {
  width: calc(100% - 24px);
}

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

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(192, 192, 192, 0.28);
  border-radius: 2px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 104;
  transition: border-color 0.2s, background 0.2s;
}

.nav-toggle:hover {
  border-color: var(--accent);
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-light);
  transition: transform 0.25s var(--ease), opacity 0.2s, background 0.2s;
}

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

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-darker);
  border-top: 3px solid var(--accent);
  position: relative;
  margin-top: 80px;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -3px;
  right: 0;
  width: 35%;
  height: 3px;
  background: var(--silver);
}

.site-footer__layer-brand {
  border-bottom: 1px solid rgba(192, 192, 192, 0.08);
}

.site-footer__brand-row {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px 24px 28px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.site-footer__brand .brand__mark {
  font-size: 26px;
  padding: 6px 12px;
}

.site-footer__brand .brand__sub {
  font-size: 15px;
}

.site-footer__statement {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}

.site-footer__layer-links {
  border-bottom: 1px solid rgba(192, 192, 192, 0.08);
}

.site-footer__links-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 40px;
  padding: 32px 24px 36px;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--text-light);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  text-transform: uppercase;
  position: relative;
  padding-left: 12px;
}

.site-footer__heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 14px;
  background: var(--accent);
  transform: translateY(-50%) skewX(-20deg);
}

.site-footer__link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}

.site-footer__link:hover {
  color: var(--accent-light);
  transform: translateX(4px);
}

.site-footer__line {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.site-footer__layer-bottom {
  padding: 16px 0;
}

.site-footer__bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.site-footer__bottom-row p {
  margin: 0;
}

/* ===== 搜索过滤协议 ===== */
[data-search-hidden="true"] {
  display: none !important;
}

/* ===== 响应式 ===== */
@media (max-width: 1060px) {
  .site-header__inner {
    gap: 12px;
    padding: 0 16px;
  }

  .site-search {
    max-width: 260px;
  }

  .site-nav__link {
    padding: 8px 8px;
    font-size: 13px;
  }

  .site-footer__links-grid {
    gap: 24px;
  }
}

@media (max-width: 900px) {
  .site-header__inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
    gap: 8px 12px;
  }

  .brand {
    order: 1;
  }

  .nav-toggle {
    display: flex;
    order: 2;
    margin-left: auto;
  }

  .site-search {
    order: 3;
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }

  .site-search__input {
    padding: 10px 14px 10px 18px;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    width: 100%;
    background: var(--bg-darker);
    z-index: 103;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease), visibility 0s 0.35s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 40px;
    visibility: hidden;
  }

  .site-nav[data-open] {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s var(--ease);
  }

  .site-nav__list {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 340px;
  }

  .site-nav__link {
    font-size: 24px;
    padding: 14px 8px;
    display: block;
    border-bottom: 1px solid rgba(192, 192, 192, 0.1);
    text-align: center;
  }

  .site-nav__link::after {
    left: 50%;
    transform: translateX(-50%) skewX(-30deg);
  }

  .site-nav__link:hover::after,
  .site-nav__link[aria-current="page"]::after {
    width: 60%;
    left: 20%;
  }

  body.nav-open {
    overflow: hidden;
  }

  .grid__item {
    grid-column: span 6;
  }

  .site-footer__brand-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 32px 24px 24px;
  }

  .site-footer__statement {
    border-left: none;
    border-top: 2px solid var(--accent);
    padding: 12px 0 0;
  }

  .site-footer__links-grid {
    grid-template-columns: 1fr 1fr;
    padding: 24px 24px 28px;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .grid__item {
    grid-column: span 12;
  }

  .site-footer__links-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__bottom-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header__inner {
    padding: 8px 12px;
  }

  .brand__sub {
    font-size: 12px;
  }

  .brand__mark {
    font-size: 20px;
    padding: 4px 8px;
  }
}

/* ===== 可访问性 ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .reduce-motion *,
  .reduce-motion *::before,
  .reduce-motion *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
