/* ========== 变量与重置 ========== */
:root {
  --c-night: #0d1b2a;
  --c-deep: #1b263b;
  --c-orange: #f77f00;
  --c-sand: #fcbf49;
  --c-paper: #f4e9cd;
  --c-ink: #2b2d42;
  --c-muted: #a0aab5;
  --c-red: #e63946;
  --c-green: #588157;

  --f-display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --f-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --f-mono: "JetBrains Mono", "Roboto Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --container: 1280px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--c-orange) var(--c-deep);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

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

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

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

a:hover {
  color: var(--c-orange);
}

p,
h1,
h2,
h3,
h4,
ul,
ol,
dl,
blockquote {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 3rem);
}

h3 {
  font-size: 1.375rem;
}

::selection {
  background: var(--c-orange);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ========== 布局基础 ========== */
.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.section--tight {
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.section--wide {
  padding-block: clamp(4rem, 10vw, 9rem);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

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

/* ========== 章节标题 ========== */
.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 1.5rem;
  align-items: end;
  margin-bottom: 2.5rem;
}

.section-head__index {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  font-family: var(--f-mono);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1;
  color: var(--c-orange);
  background: rgba(247, 127, 0, .1);
  border-radius: var(--radius-pill);
  padding: .55rem 1.1rem;
}

.section-head__index::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-top: .5rem;
  background: linear-gradient(90deg, var(--c-orange), var(--c-sand));
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.section-head__title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.section-head__desc {
  margin: .5rem 0 0;
  color: var(--c-muted);
  font-size: .9375rem;
  max-width: 42em;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .85rem 1.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--f-body);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.btn--solid {
  background: linear-gradient(135deg, var(--c-orange), #e06b00);
  color: #fff;
  box-shadow: 0 6px 20px rgba(247, 127, 0, .28);
}

.btn--solid:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(247, 127, 0, .4);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(244, 233, 205, .28);
  color: var(--c-paper);
}

.btn--ghost:hover {
  border-color: var(--c-orange);
  color: var(--c-orange);
  transform: translateY(-2px);
}

/* ========== 标签 ========== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .85rem;
  border-radius: var(--radius-pill);
  background: rgba(247, 127, 0, .12);
  border: 1px solid rgba(247, 127, 0, .28);
  color: var(--c-sand);
  font-family: var(--f-mono);
  font-size: .75rem;
  letter-spacing: .06em;
}

.tag::before {
  content: "";
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: currentColor;
}

.tag--paper {
  background: rgba(43, 45, 66, .06);
  border-color: rgba(43, 45, 66, .16);
  color: var(--c-ink);
}

/* ========== 卡片 ========== */
.card {
  position: relative;
  background: var(--c-deep);
  border: 1px solid rgba(244, 233, 205, .1);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.card::after {
  content: "";
  position: absolute;
  top: .625rem;
  right: .625rem;
  width: .75rem;
  height: .75rem;
  border-top: 2px solid rgba(247, 127, 0, .55);
  border-right: 2px solid rgba(247, 127, 0, .55);
  border-radius: 0 4px 0 0;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(247, 127, 0, .5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .32);
}

.card--featured {
  background: linear-gradient(160deg, rgba(247, 127, 0, .14), var(--c-deep) 45%);
  border-color: rgba(247, 127, 0, .35);
}

.card--paper {
  background: #fff;
  border-color: rgba(43, 45, 66, .12);
}

/* ========== 数据读数 ========== */
.stat {
  display: inline-flex;
  flex-direction: column;
  background: rgba(244, 233, 205, .03);
  border: 1px solid rgba(244, 233, 205, .1);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  min-width: 9.5rem;
}

.stat__value {
  font-family: var(--f-mono);
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--c-orange);
}

.stat__label {
  margin-top: .4rem;
  font-family: var(--f-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* ========== 图片容器 ========== */
.figure {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--c-deep);
  border: 1px solid rgba(244, 233, 205, .08);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
}

.figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-muted);
  background:
    linear-gradient(45deg, rgba(247, 127, 0, .06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(247, 127, 0, .06) 25%, transparent 25%),
    var(--c-deep);
  background-size: 24px 24px;
}

/* ========== 面包屑 ========== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .85rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
  font-family: var(--f-mono);
  font-size: .8125rem;
  color: var(--c-muted);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.breadcrumbs li + li::before {
  content: "/";
  color: rgba(160, 170, 181, .35);
}

.breadcrumbs a {
  color: var(--c-muted);
  text-decoration: none;
  transition: color .2s ease;
}

.breadcrumbs a:hover {
  color: var(--c-sand);
}

.breadcrumbs [aria-current="page"] {
  color: var(--c-sand);
}

/* ========== 手风琴 ========== */
.accordion {
  display: block;
  border: 1px solid rgba(244, 233, 205, .12);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(27, 38, 59, .6);
}

.accordion details + details {
  border-top: 1px solid rgba(244, 233, 205, .1);
}

.accordion summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.375rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: .9375rem;
  transition: background .2s ease;
}

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

.accordion summary:hover {
  background: rgba(247, 127, 0, .08);
}

.accordion summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: var(--f-mono);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--c-orange);
}

.accordion details[open] summary::after {
  content: "–";
}

.accordion details > div {
  padding: 0 1.375rem 1.25rem;
  color: var(--c-muted);
  font-size: .875rem;
}

/* ========== 跳过链接 ========== */
.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 2000;
  padding: .75rem 1.25rem;
  background: var(--c-orange);
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  transform: translateY(-300%);
  transition: transform .2s ease;
}

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

/* ========== 滚动进度 ========== */
.site-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(27, 38, 59, .7);
  z-index: 1500;
  pointer-events: none;
}

.site-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--c-orange), var(--c-sand), var(--c-red));
  box-shadow: 0 0 12px rgba(247, 127, 0, .55);
}

/* ========== 头部胶囊 ========== */
.site-header {
  position: fixed;
  top: .875rem;
  left: 1rem;
  right: 1rem;
  z-index: 1200;
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, var(--container));
  margin-inline: auto;
  padding: .5rem .5rem .5rem 1.25rem;
  background: rgba(13, 27, 42, .82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(244, 233, 205, .1);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}

.site-header__brand {
  display: inline-flex;
  align-items: baseline;
  gap: .8rem;
  flex-shrink: 0;
  text-decoration: none;
}

.site-header__logo {
  font-family: var(--f-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--c-paper);
  line-height: 1;
}

.site-header__logo-accent {
  color: var(--c-orange);
  font-weight: 900;
}

.site-header__slogan {
  font-family: var(--f-mono);
  font-size: .6875rem;
  letter-spacing: .02em;
  color: var(--c-muted);
  line-height: 1;
  white-space: nowrap;
}

.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .15rem;
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  padding: .55rem .85rem;
  border-radius: var(--radius-pill);
  font-size: .875rem;
  font-weight: 500;
  color: rgba(244, 233, 205, .72);
  text-decoration: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.site-header__link:hover {
  background: rgba(244, 233, 205, .08);
  color: var(--c-paper);
}

.site-header__link[aria-current="page"] {
  background: linear-gradient(135deg, var(--c-orange), #e06b00);
  color: #fff;
  box-shadow: 0 4px 16px rgba(247, 127, 0, .35);
}

.site-header__toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .5rem .9rem;
  border: 1px solid rgba(244, 233, 205, .18);
  border-radius: var(--radius-pill);
  background: rgba(244, 233, 205, .06);
  color: var(--c-paper);
  font-family: var(--f-body);
  font-size: .8125rem;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.site-header__toggle:hover {
  background: rgba(244, 233, 205, .12);
  border-color: rgba(247, 127, 0, .5);
}

.site-header__toggle-bar {
  display: block;
  width: 1.15rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease;
}

.site-header__toggle-bar + .site-header__toggle-bar {
  margin-top: 4px;
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-bar:last-child {
  transform: translateY(-2px) rotate(-45deg);
}

.site-header__toggle-label {
  font-size: .75rem;
  letter-spacing: .12em;
}

@media (max-width: 960px) {
  .site-header {
    top: .75rem;
  }

  .site-header__inner {
    padding: .45rem .45rem .45rem 1rem;
  }

  .site-header__toggle {
    display: inline-flex;
  }

  .site-header__nav {
    position: absolute;
    top: calc(100% + .6rem);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: rgba(13, 27, 42, .97);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
    transition: max-height .3s ease, opacity .25s ease, padding .25s ease, border-color .25s ease;
  }

  .site-header__nav[data-open] {
    max-height: 480px;
    opacity: 1;
    padding: .6rem;
    border-color: rgba(244, 233, 205, .14);
  }

  .site-header__link {
    justify-content: space-between;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 480px) {
  .site-header__slogan {
    display: none;
  }
}

/* ========== 页脚 ========== */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--c-paper);
  color: var(--c-ink);
}

.site-footer::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--c-orange), var(--c-sand), var(--c-red), var(--c-deep));
}

.site-footer::after {
  content: "IM";
  position: absolute;
  right: -1rem;
  bottom: -2rem;
  font-family: var(--f-display);
  font-size: clamp(7rem, 22vw, 15rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(43, 45, 66, .04);
  pointer-events: none;
  z-index: 0;
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
  padding-block: 3.5rem 2rem;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
}

.site-footer__logo {
  font-family: var(--f-display);
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1.2;
}

.site-footer__logo:hover {
  color: var(--c-orange);
}

.site-footer__logo-accent {
  color: var(--c-orange);
  font-weight: 900;
}

.site-footer__slogan {
  margin: 0;
  font-family: var(--f-mono);
  font-size: .8125rem;
  letter-spacing: .04em;
  color: rgba(43, 45, 66, .65);
}

.site-footer__trust {
  margin: .5rem 0 0;
  max-width: 24em;
  font-size: .875rem;
  line-height: 1.7;
  color: rgba(43, 45, 66, .78);
}

.site-footer__nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.site-footer__link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem 0;
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-ink);
  border-bottom: 1px solid rgba(43, 45, 66, .14);
  transition: color .2s ease, border-color .2s ease;
}

.site-footer__link::before {
  content: "→";
  font-family: var(--f-mono);
  color: var(--c-orange);
  transition: transform .18s ease;
}

.site-footer__link:hover {
  color: var(--c-orange);
  border-color: rgba(247, 127, 0, .4);
}

.site-footer__link:hover::before {
  transform: translateX(4px);
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.site-footer__contact-item {
  margin: 0;
  font-family: var(--f-mono);
  font-size: .8125rem;
  color: rgba(43, 45, 66, .8);
}

.site-footer__note {
  margin: .4rem 0 0;
  font-size: .8125rem;
  color: rgba(43, 45, 66, .62);
  max-width: 22em;
}

.site-footer__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(43, 45, 66, .16);
  font-family: var(--f-mono);
  font-size: .8125rem;
  color: rgba(43, 45, 66, .65);
}

@media (min-width: 761px) {
  .site-footer__inner {
    grid-template-columns: 1.5fr .8fr 1fr;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .site-footer__inner {
    gap: 1.75rem;
    padding-top: 2.5rem;
  }

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