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

:root {
  --c-bg: #0b1f3a;
  --c-panel: #1e3a5f;
  --c-panel-deep: #122a4a;
  --c-gold: #d4af37;
  --c-gold-light: #f1e5c3;
  --c-emerald: #2e8b57;
  --c-line: #3d5a80;
  --c-data: #4fc3f7;
  --c-text: #f5f7fa;
  --c-muted: #b0bec5;
  --font-heading: "Playfair Display", "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --font-body: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", "SF Mono", Consolas, monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --radius: 4px;
  --max-w: 1200px;
  --header-h: 72px;
}

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

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

ul, ol {
  list-style: none;
}

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

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-gold), #b8942f);
  color: #0b1f3a;
  font-weight: 600;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  padding: 12px 28px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e6c657, var(--c-gold));
  color: #0b1f3a;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--c-gold);
  color: var(--c-gold);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.12);
  color: var(--c-gold-light);
}

/* 通用卡片 */
.card {
  background: linear-gradient(145deg, rgba(30, 58, 95, 0.92), rgba(18, 42, 74, 0.85));
  border: 1px solid rgba(61, 90, 128, 0.6);
  border-radius: var(--radius);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  padding: 24px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 12px;
}

.card-desc {
  color: var(--c-muted);
  font-size: 14px;
}

/* 数据面板 */
.panel {
  background: linear-gradient(145deg, rgba(30, 58, 95, 0.88), rgba(11, 31, 58, 0.92));
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(61, 90, 128, 0.5);
}

.panel-body {
  padding: 20px;
}

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-emerald);
  background: rgba(46, 139, 87, 0.16);
  border: 1px solid rgba(46, 139, 87, 0.35);
  border-radius: 2px;
}

.badge[data-tone="gold"] {
  color: var(--c-gold);
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.35);
}

/* 网格 */
.grid {
  display: grid;
  gap: 24px;
}

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

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

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

/* 章节索引 */
.section-index {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
}

.section-index .index-num {
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  color: var(--c-gold);
  opacity: 0.75;
}

.section-index .index-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--c-text);
}

.section-index .index-note {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--c-muted);
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  margin-left: auto;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--c-muted);
  padding-block: 16px;
}

.breadcrumb a {
  color: var(--c-data);
}

.breadcrumb a:hover {
  color: var(--c-gold);
}

.breadcrumb .crumb-sep::before {
  content: "→";
  margin-inline: 6px;
  color: var(--c-line);
}

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

/* 页面标题区 */
.page-header {
  padding: 64px 0 40px;
  position: relative;
}

.page-header .page-kicker {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--c-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  color: var(--c-text);
  margin-top: 12px;
  line-height: 1.2;
}

.page-header .page-desc {
  color: var(--c-muted);
  max-width: 60ch;
  margin-top: 12px;
  font-size: 16px;
}

/* ===== Header ===== */
.site-header {
  position: relative;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 9999;
  background: var(--c-gold);
  color: #0b1f3a;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 0 0 4px 0;
}

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

/* 顶部状态条 */
.header-topbar {
  background: #081627;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  font-size: 13px;
  color: var(--c-muted);
}

.header-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  gap: 16px;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-emerald);
  box-shadow: 0 0 8px var(--c-emerald);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.topbar-clock {
  font-family: var(--font-mono);
  color: var(--c-data);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.topbar-service {
  color: var(--c-muted);
  font-size: 12px;
}

/* 主导航栏 */
.header-main {
  position: relative;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.07), transparent 30%, transparent 70%, rgba(79, 195, 247, 0.05)),
              linear-gradient(180deg, #142a48, #0f2238);
  border-bottom: 1px solid rgba(61, 90, 128, 0.7);
}

.header-main::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, var(--c-gold), transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 24px;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #e6c657 0%, var(--c-gold) 45%, #b8942f 100%);
  color: #0b1f3a;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 100%, 15% 100%, 0 85%);
  position: relative;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: 0.04em;
}

.brand-extension {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--c-gold);
  text-transform: uppercase;
}

/* 导航 */
.site-nav {
  display: block;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  counter-reset: nav-index;
}

.nav-item {
  position: relative;
  counter-increment: nav-index;
}

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
  border-radius: 3px;
  transition: color 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}

.nav-link::before {
  content: "0" counter(nav-index);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--c-data);
  opacity: 0.7;
  letter-spacing: 0;
}

.nav-link:hover {
  background: rgba(212, 175, 55, 0.08);
  color: var(--c-gold);
}

.nav-link[aria-current="page"] {
  color: var(--c-gold);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: linear-gradient(90deg, var(--c-gold), rgba(212, 175, 55, 0.2));
}

/* 汉堡菜单 */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-line);
  border-radius: 4px;
  padding: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-gold);
  border-radius: 1px;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.nav-toggle-bar + .nav-toggle-bar {
  margin-top: 5px;
}

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

/* 滚动进度条 */
.header-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--c-emerald), var(--c-gold), var(--c-data));
  z-index: 3;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--c-bg);
  border-top: 1px solid rgba(61, 90, 128, 0.5);
  position: relative;
}

.footer-top {
  background: linear-gradient(180deg, #132b49, #0d1f36);
  position: relative;
  border-bottom: 1px solid rgba(61, 90, 128, 0.4);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.6fr;
  gap: 40px;
  padding-block: 56px 40px;
  position: relative;
  background-image: linear-gradient(rgba(61, 90, 128, 0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(61, 90, 128, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
}

.footer-grid::before {
  content: "";
  position: absolute;
  right: 60px;
  bottom: 40px;
  width: 96px;
  height: 96px;
  border: 2px solid rgba(212, 175, 55, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 14px rgba(212, 175, 55, 0.05), 0 0 0 28px rgba(212, 175, 55, 0.03);
  pointer-events: none;
}

.footer-brand {
  position: relative;
}

.footer-brand .brand {
  margin-bottom: 16px;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
}

.footer-desc {
  font-size: 14px;
  color: var(--c-muted);
  line-height: 1.8;
  max-width: 32em;
  margin-top: 12px;
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--c-gold);
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-list a {
  color: var(--c-muted);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-list a::before {
  content: "·";
  color: var(--c-gold);
  font-weight: 700;
}

.footer-list a:hover {
  color: var(--c-gold);
  transform: translateX(4px);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-contact-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--c-line);
  text-transform: uppercase;
}

.contact-value {
  font-size: 14px;
  color: var(--c-muted);
  line-height: 1.5;
}

/* 页脚底栏 */
.footer-bottom {
  background: #081627;
  padding-block: 20px;
  position: relative;
}

.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-muted);
}

.trust-statement {
  font-size: 13px;
  color: var(--c-muted);
  opacity: 0.8;
}

/* 返回顶部 */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #e6c657, var(--c-gold));
  color: #0b1f3a;
  border: none;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 900;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: linear-gradient(135deg, #f0d97a, #e6c657);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .container {
    padding-inline: 16px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #142a48, #0f2238);
    border-top: 1px solid var(--c-line);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 200;
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
    gap: 0;
  }

  .nav-item {
    border-bottom: 1px solid rgba(61, 90, 128, 0.3);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: flex;
    align-items: baseline;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
  }

  .nav-link[aria-current="page"]::after {
    left: 20px;
    right: auto;
    width: 32px;
    bottom: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding-block: 40px 32px;
  }

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

  .footer-grid::before {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .header-topbar-service {
    display: none;
  }

  .topbar-service {
    display: none;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-extension {
    font-size: 9px;
    letter-spacing: 0.2em;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .header-inner {
    min-height: 60px;
    gap: 12px;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 32px 24px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .section-index .index-num {
    font-size: 36px;
  }

  .section-index .index-title {
    font-size: 22px;
  }
}

@media (max-width: 420px) {
  .topbar-meta {
    display: none;
  }

  .header-topbar-inner {
    justify-content: flex-start;
  }

  .brand-name {
    font-size: 16px;
  }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .status-dot {
    animation: none;
  }

  .back-to-top {
    transition: none;
  }
}
