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

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

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

ul, ol { padding: 0; }

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

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

a { color: inherit; text-decoration: none; }

/* ===== 2. 变量 ===== */
:root {
  --ink-950: #07111F;
  --ink-900: #0C1B2E;
  --slate-700: #2A3644;
  --moss-500: #6F8F72;
  --clay-500: #B56A4A;
  --orange-500: #FF6A1A;
  --orange-700: #C8460A;
  --cyan-400: #2FF3D6;
  --red-500: #E23A2E;
  --bone-100: #F4F0E6;
  --fog-400: #A9B4C0;

  --font-display: "Archivo Black", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --edge: 2px solid var(--slate-700);
  --hard-shadow: 6px 6px 0 rgba(0, 0, 0, 0.38);
  --gutter: clamp(1rem, 3vw, 1.75rem);
  --nav-break: 860px;
}

/* ===== 3. 中文排版与全局 ===== */
body {
  min-height: 100vh;
  background-color: var(--ink-950);
  background-image:
    radial-gradient(1200px 620px at 84% -12%, rgba(47, 243, 214, 0.07), transparent 62%),
    radial-gradient(900px 520px at 4% -4%, rgba(255, 106, 26, 0.09), transparent 64%);
  background-repeat: no-repeat;
  color: var(--bone-100);
  font-family: var(--font-body);
  font-size: clamp(15px, 0.35vw + 14px, 17px);
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 8vw, 8rem); letter-spacing: 0.03em; }
h2 { font-size: clamp(2rem, 3.5vw, 3.5rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.5rem); }

p { text-wrap: pretty; }

::selection {
  background: var(--orange-500);
  color: var(--ink-950);
}

:focus-visible {
  outline: 3px solid var(--cyan-400);
  outline-offset: 3px;
}

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

/* ===== 4. 跳转链接 ===== */
.skip-link {
  position: fixed;
  top: -120%;
  left: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--orange-500);
  color: var(--ink-950);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  border: 2px solid var(--ink-950);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.5);
  transition: top 0.18s ease;
}

.skip-link:focus-visible,
.skip-link:focus {
  top: 0.75rem;
  outline-offset: 4px;
}

/* ===== 5. 页头 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 17, 31, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: var(--edge);
}

.header-pulse {
  background: var(--ink-900);
  border-bottom: 1px solid rgba(42, 54, 68, 0.9);
}

.pulse-inner {
  width: min(100% - 2.5rem, 1240px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--fog-400);
}

.pulse-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pulse-item--time { color: rgba(169, 180, 192, 0.82); }

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--orange-500);
  animation: pulse-ring 2.6s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(255, 106, 26, 0.55); }
  70%  { box-shadow: 0 0 0 0.55rem rgba(255, 106, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 106, 26, 0); }
}

.header-masthead { padding: clamp(0.6rem, 1.6vw, 1rem) 0 0.45rem; }

.masthead-inner {
  position: relative;
  width: min(100% - 2.5rem, 1240px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 3vw, 2.2rem);
}

.masthead-rule {
  flex: 1 1 2rem;
  max-width: 24rem;
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--slate-700) 0 10px, transparent 10px 18px);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.4rem;
  text-align: center;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.35rem, 3.1vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: 0.09em;
  color: var(--bone-100);
  text-shadow: 3px 3px 0 rgba(255, 106, 26, 0.3);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--cyan-400);
}

.brand:hover .brand-name { color: #fff; }

.nav-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: 2px solid var(--slate-700);
  color: var(--bone-100);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  transition: color 0.2s, border-color 0.2s;
}

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

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 1.05rem;
  height: 2px;
  background: currentColor;
  transition: background 0.2s;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.22s ease;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  background: linear-gradient(180deg, rgba(12, 27, 46, 0.7), transparent);
  border-top: 1px solid rgba(42, 54, 68, 0.8);
}

.nav-inner {
  width: min(100% - 2.5rem, 1240px);
  margin-inline: auto;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 clamp(0.8rem, 3vw, 2.6rem);
}

.nav-link {
  display: inline-block;
  padding: 0.9rem 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  color: var(--fog-400);
  border-bottom: 3px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  color: var(--bone-100);
  border-bottom-color: var(--orange-500);
  transform: translateY(-1px);
}

.nav-link[aria-current="page"] {
  color: var(--cyan-400);
  border-bottom-color: var(--cyan-400);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(42, 54, 68, 0.6);
  overflow: hidden;
  pointer-events: none;
}

.scroll-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--orange-500), var(--cyan-400));
}

/* ===== 6. 页脚 ===== */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 8vw, 7rem);
  padding: clamp(2.6rem, 5vw, 4.5rem) 0 0;
  overflow: hidden;
  background: var(--ink-950);
  border-top: var(--edge);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: linear-gradient(90deg,
    var(--orange-500) 0 34%,
    var(--clay-500) 34% 44%,
    var(--cyan-400) 44% 68%,
    var(--red-500) 68% 74%,
    var(--slate-700) 74% 100%);
}

.site-footer::after {
  content: "";
  position: absolute;
  right: -8%;
  bottom: -26%;
  width: min(520px, 62vw);
  height: min(520px, 62vw);
  background: radial-gradient(circle, rgba(47, 243, 214, 0.11), transparent 68%);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, 1240px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.9fr 1.4fr;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.footer-brand { align-self: start; }

.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  letter-spacing: 0.07em;
  line-height: 1.1;
  margin-bottom: 0.85rem;
  color: var(--bone-100);
}

.footer-tagline {
  max-width: 24ch;
  margin-bottom: 1.4rem;
  color: var(--fog-400);
  font-size: 0.94rem;
}

.footer-cta { margin-top: 0.2rem; }

.footer-col { align-self: start; min-width: 0; }

.footer-col--nav { padding-top: 0.15rem; }

.footer-col--contact { min-width: 0; }

.footer-col-title {
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan-400);
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.footer-links a {
  display: inline-block;
  padding: 0.1rem 0;
  font-size: 0.94rem;
  color: var(--fog-400);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--bone-100);
  border-bottom-color: var(--orange-500);
}

.footer-contact {
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.footer-contact-item {
  display: grid;
  gap: 0.1rem;
}

.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fog-400);
}

.footer-contact-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--bone-100);
  overflow-wrap: anywhere;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, 1240px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.6rem;
  padding: 1.1rem 0 1.7rem;
  border-top: 1px solid rgba(42, 54, 68, 0.9);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--fog-400);
}

.footer-icp { color: var(--bone-100); }

/* ===== 7. 通用布局 ===== */
.container {
  width: min(100% - 2.5rem, 1240px);
  margin-inline: auto;
}

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

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }

.prose {
  max-width: 68ch;
}

.prose p { margin-bottom: 1.1em; }

.prose h2 {
  margin: 2.2rem 0 0.8rem;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
}

.prose h3 {
  margin: 1.8rem 0 0.6rem;
  color: var(--cyan-400);
}

/* ===== 8. 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.82rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.11em;
  line-height: 1.2;
  border: 2px solid transparent;
  background: transparent;
  color: var(--bone-100);
  cursor: pointer;
  box-shadow: var(--hard-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn--primary {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: var(--ink-950);
  box-shadow: 5px 5px 0 var(--orange-700);
}

.btn--primary:hover {
  background: var(--orange-500);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--orange-700);
}

.btn--ghost {
  border-color: var(--slate-700);
  color: var(--bone-100);
  box-shadow: 5px 5px 0 rgba(42, 54, 68, 0.85);
}

.btn--ghost:hover {
  border-color: var(--cyan-400);
  color: var(--cyan-400);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(47, 243, 214, 0.22);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.btn--block { width: 100%; }

/* ===== 9. 面包屑 ===== */
.breadcrumb {
  margin: clamp(1.1rem, 3vw, 2rem) 0 0;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-400);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--slate-700);
}

.breadcrumb a {
  color: var(--fog-400);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--cyan-400);
  border-bottom-color: var(--cyan-400);
}

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

/* ===== 10. 标签 / 卡片 / 媒体容器 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.62rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--slate-700);
  background: rgba(12, 27, 46, 0.72);
  color: var(--fog-400);
}

.tag--orange { color: var(--orange-500); border-color: rgba(255, 106, 26, 0.5); background: rgba(255, 106, 26, 0.1); }
.tag--cyan   { color: var(--cyan-400);   border-color: rgba(47, 243, 214, 0.45); background: rgba(47, 243, 214, 0.08); }
.tag--red    { color: var(--red-500);    border-color: rgba(226, 58, 46, 0.5);  background: rgba(226, 58, 46, 0.1); }

.card {
  position: relative;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  background: var(--ink-900);
  border: var(--edge);
  box-shadow: var(--hard-shadow);
}

.card-title {
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.02rem;
  letter-spacing: 0.05em;
}

.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: var(--edge);
  background:
    linear-gradient(135deg, var(--ink-900), var(--ink-950)),
    repeating-linear-gradient(45deg, rgba(47, 243, 214, 0.06) 0 2px, transparent 2px 12px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.34);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(47, 243, 214, 0.1), transparent 45%, rgba(255, 106, 26, 0.1));
  pointer-events: none;
}

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

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ===== 11. 章节标题组 ===== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan-400);
}

.eyebrow::before {
  content: "";
  width: 1.9rem;
  height: 2px;
  background: var(--orange-500);
}

.section-title {
  margin-bottom: 0.9rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  letter-spacing: 0.03em;
  line-height: 1.08;
}

.section-lede {
  max-width: 58ch;
  margin-bottom: 1.6rem;
  color: var(--fog-400);
}

/* ===== 12. 返回顶部 ===== */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 80;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--cyan-400);
  background: var(--ink-900);
  color: var(--cyan-400);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

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

.to-top:hover {
  background: var(--cyan-400);
  color: var(--ink-950);
}

/* ===== 13. 响应式 ===== */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-col--contact { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .col-3, .col-4, .col-5, .col-6, .col-8 { grid-column: span 12; }
  .grid-12 { gap: 1.1rem; }
}

@media (max-width: 860px) {
  .masthead-rule { display: none; }
  .nav-toggle { display: inline-flex; }

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

  .site-nav {
    border-top: var(--edge);
    background: var(--ink-900);
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0.35rem 0 0.9rem;
  }

  .nav-list li { width: 100%; }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 0.3rem;
    font-size: 0.98rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(42, 54, 68, 0.75);
  }

  .nav-link::after {
    content: "→";
    font-family: var(--font-mono);
    color: var(--orange-500);
  }

  .nav-link:hover { transform: none; }

  .nav-link[aria-current="page"] {
    border-bottom-color: rgba(42, 54, 68, 0.75);
    color: var(--cyan-400);
  }

  .nav-link[aria-current="page"]::after { color: var(--cyan-400); }

  .brand-name { text-shadow: 2px 2px 0 rgba(255, 106, 26, 0.3); }
}

@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-tagline { max-width: 34ch; }
}

@media (max-width: 620px) {
  .pulse-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    padding: 0.5rem 0;
  }

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

@media (max-width: 480px) {
  .nav-toggle-text { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ===== 14. 动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  .to-top { transform: none; }
  .to-top.is-visible { transform: none; }
  .pulse-dot { animation: none; box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.28); }
}
