:root {
  --c-dark: #0B1F3A;
  --c-light: #F5F7FA;
  --c-deep: #1A3A6B;
  --c-gold: #D4AF37;
  --c-red: #E63946;
  --c-text: #111827;
  --c-text2: #6B7280;
  --c-border: #E5E7EB;
  --c-white: #FFFFFF;
  --f-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --f-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --sidebar-w: 264px;
  --header-h: 62px;
  --radius: 10px;
  --shadow-soft: 0 8px 24px rgba(11, 31, 58, .06);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t-fast: .22s;
}

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

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

body {
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-light);
}

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

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

a {
  color: inherit;
}

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

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

.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: -48px;
  left: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--c-gold);
  color: var(--c-dark);
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  border: 2px solid var(--c-dark);
  text-decoration: none;
  transition: top var(--t-fast) var(--ease);
}

.skip-link:focus-visible {
  top: 8px;
}

/* ---------- 共享头部 / 侧边轨道 ---------- */
.site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  width: var(--sidebar-w);
  background: var(--c-dark);
  color: var(--c-white);
  box-shadow: 4px 0 14px rgba(11, 31, 58, .1);
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: linear-gradient(115deg, var(--c-gold) 0%, var(--c-gold) 48%, var(--c-red) 48.5%, var(--c-red) 72%, transparent 72.5%);
  opacity: .9;
  pointer-events: none;
}

.header-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  gap: 22px;
  overflow-y: auto;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--c-white);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--c-gold);
  color: var(--c-dark);
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 18px;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}

.brand-hl {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.brand-cn {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand-en {
  font-family: var(--f-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .06em;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 8px;
  cursor: pointer;
  padding: 0 10px;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--c-gold);
  border-radius: 2px;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

[data-nav][data-open] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

[data-nav][data-open] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

[data-nav][data-open] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 18px;
  min-height: 0;
}

.site-nav {
  flex-shrink: 0;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  color: rgba(255, 255, 255, .68);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--c-gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-fast) var(--ease);
}

.nav-link:hover {
  color: var(--c-white);
  background: rgba(255, 255, 255, .05);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  background: rgba(212, 175, 55, .12);
  border-left-color: var(--c-gold);
  color: var(--c-white);
  font-weight: 600;
}

.nav-index {
  min-width: 22px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-gold);
  text-align: right;
}

.nav-title {
  line-height: 1.2;
}

.header-scrollbar-wrap {
  margin-top: auto;
  height: 3px;
  background: rgba(255, 255, 255, .14);
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}

.header-scrollbar {
  width: 0;
  height: 100%;
  background: var(--c-gold);
  border-radius: 99px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, .48);
  line-height: 1.4;
  flex-shrink: 0;
}

.nav-status-text {
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--c-gold);
  animation: pulse-dot 2.4s infinite;
}

.status-dot--idle {
  background: var(--c-text2);
  animation: none;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, .45);
  }
  60% {
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
  }
}

/* ---------- 主内容布局 ---------- */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 75vh;
}

.content-shell {
  max-width: 1180px;
  margin-inline: auto;
  padding: 44px 40px 64px;
}

.content-narrow {
  max-width: 820px;
}

/* ---------- 共享页脚 ---------- */
.site-footer {
  position: relative;
  margin-left: var(--sidebar-w);
  padding: 48px 32px 20px;
  background: var(--c-dark);
  color: rgba(255, 255, 255, .76);
  background-image: linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-gold) 0%, var(--c-gold) 18%, var(--c-red) 18.5%, var(--c-red) 21%, var(--c-deep) 21.5%, var(--c-deep) 100%);
  z-index: 1;
}

.footer-shell {
  max-width: 1180px;
  margin-inline: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 14px;
}

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

.footer-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--c-gold);
  color: var(--c-dark);
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 14px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.footer-brand-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--c-white);
  letter-spacing: .02em;
}

.footer-tagline {
  max-width: 42ch;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .6);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
}

.footer-status--idle {
  margin-top: 2px;
}

.footer-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 14px;
  font-family: var(--f-mono);
}

.footer-link-list {
  display: grid;
  gap: 9px;
  font-size: 14px;
}

.footer-link-list a {
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}

.footer-link-list a:hover {
  color: var(--c-white);
  padding-left: 4px;
}

.footer-contact {
  display: grid;
  gap: 10px;
}

.footer-contact-item {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: rgba(255, 255, 255, .72);
  line-height: 1.6;
}

.footer-contact-item::before {
  content: "›";
  position: absolute;
  left: 4px;
  color: var(--c-gold);
  font-family: var(--f-mono);
  font-weight: 700;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, .46);
}

.footer-back-top {
  margin-left: auto;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  color: var(--c-gold);
  font-family: var(--f-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}

.footer-back-top:hover {
  border-color: var(--c-gold);
  background: rgba(212, 175, 55, .1);
  transform: translateY(-2px);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  margin-bottom: 24px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: var(--f-mono);
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  margin-right: 6px;
  color: var(--c-text2);
}

.breadcrumb-link {
  color: var(--c-text2);
  text-decoration: none;
  transition: color var(--t-fast);
}

.breadcrumb-link:hover {
  color: var(--c-deep);
}

.breadcrumb-current {
  color: var(--c-text);
  font-weight: 600;
}

/* ---------- 章节板块 ---------- */
.section-group {
  margin: 36px 0;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}

.section-index {
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--c-gold);
  letter-spacing: .03em;
  line-height: 1;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2px;
}

.section-desc {
  color: var(--c-text2);
  margin-top: 8px;
  max-width: 60ch;
  font-size: .95rem;
}

/* ---------- 主题声明 ---------- */
.lead-block {
  border-left: 4px solid var(--c-gold);
  padding: 2px 0 2px 20px;
  margin: 30px 0 26px;
}

.lead-block h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.lead-block p {
  margin-top: 10px;
  color: var(--c-text2);
  max-width: 64ch;
  font-size: 1rem;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  background: var(--c-white);
  border: 2px solid var(--c-deep);
  color: var(--c-deep);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.btn:hover {
  background: var(--c-deep);
  color: var(--c-white);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--c-gold);
  border-color: var(--c-gold);
  color: var(--c-dark);
}

.btn-primary:hover {
  background: #b89529;
  border-color: #b89529;
  color: var(--c-dark);
}

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

.btn-outline:hover {
  background: var(--c-light);
}

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 20px;
}

.filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--c-border);
  border-radius: 99px;
  background: var(--c-white);
  color: var(--c-text2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}

.filter-btn:hover {
  border-color: var(--c-deep);
  color: var(--c-deep);
  transform: translateY(-1px);
}

.filter-btn.is-active {
  background: var(--c-deep);
  border-color: var(--c-deep);
  color: var(--c-white);
  font-weight: 600;
}

/* ---------- 卡片网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--c-deep);
  box-shadow: 0 12px 28px rgba(11, 31, 58, .1);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
}

.card-meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-gold);
  letter-spacing: .04em;
}

.card-desc {
  color: var(--c-text2);
  font-size: .92rem;
  line-height: 1.6;
}

/* ---------- 媒体占位 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--c-deep), var(--c-dark) 72%, var(--c-gold) 160%);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 45%, rgba(212, 175, 55, .18) 58%, transparent 82%);
  pointer-events: none;
}

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

.media-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 10px;
  background: linear-gradient(transparent, rgba(11, 31, 58, .8));
  color: var(--c-white);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .04em;
}

/* ---------- 数据表格 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--c-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--c-border);
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
  line-height: 1.5;
}

.data-table th {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--c-text2);
  background: var(--c-light);
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background-color var(--t-fast);
}

.data-table tbody tr:hover {
  background: var(--c-light);
}

/* ---------- 移动端 / 平板 ---------- */
@media (max-width: 1023px) {
  .site-header {
    position: sticky;
    top: 0;
    bottom: auto;
    width: 100%;
    height: var(--header-h);
    box-shadow: 0 2px 10px rgba(11, 31, 58, .12);
    overflow: visible;
  }

  .site-header::after {
    height: 6px;
    background: linear-gradient(115deg, var(--c-gold) 0%, var(--c-gold) 34%, var(--c-red) 34.5%, var(--c-red) 52%, transparent 52.5%);
  }

  .header-shell {
    flex-direction: row;
    align-items: center;
    height: var(--header-h);
    padding: 0 16px;
    gap: 12px;
  }

  .brand-badge {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .brand-cn {
    font-size: 15px;
  }

  .brand-en {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    flex-shrink: 0;
  }

  .header-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--c-dark);
    border-top: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 12px 20px rgba(11, 31, 58, .2);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  [data-nav][data-open] .header-panel {
    display: flex;
    flex-direction: column;
  }

  .nav-list {
    gap: 2px;
  }

  .nav-status {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-top: 12px;
  }

  .main-content {
    margin-left: 0;
  }

  .content-shell {
    padding: 32px 20px 48px;
  }

  .site-footer {
    margin-left: 0;
    padding: 36px 20px 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

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

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-brand {
    grid-column: auto;
  }

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

  .footer-back-top {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.5rem;
  }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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