:root {
  --ink: #0a1930;
  --paper: #f4efe6;
  --gold: #d4af37;
  --orange: #ff7f2a;
  --body-on-dark: #e6e9ef;
  --body-on-light: #22303f;
  --muted: #8b93a7;
  --border-focus: #d4af37;
  --glow-overlay: rgba(212, 175, 55, 0.15);
  --error: #ff5a5a;
  --font-heading: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Menlo", monospace;
  --header-height: 72px;
}

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

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 400;
  line-height: 1.75;
  color: var(--body-on-dark);
  background:
    radial-gradient(ellipse 120% 80% at -10% 100%, rgba(212, 175, 55, 0.07) 0%, transparent 62%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

ul, ol { list-style: none; }

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

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible {
  outline: 1px solid var(--border-focus);
  outline-offset: 4px;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(32px, 5vw, 72px); }
h2 { font-size: clamp(24px, 3.2vw, 44px); }
h3 { font-size: clamp(20px, 2vw, 28px); }
h4 { font-size: 18px; }

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 64px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 3000;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 18px;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn--primary {
  background: var(--orange);
  color: var(--ink);
  border-color: var(--orange);
  box-shadow: 4px 4px 0 rgba(212, 175, 55, 0.35);
}

.btn--primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 rgba(212, 175, 55, 0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn--ghost:hover {
  background: var(--gold);
  color: var(--ink);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--gold);
  transition: opacity 0.2s ease;
}

.breadcrumbs a:hover {
  opacity: 0.8;
}

.breadcrumbs__current {
  color: var(--body-on-dark);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-label::before {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold);
}

.card {
  background: var(--paper);
  color: var(--body-on-light);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(212, 175, 55, 0.18);
  padding: 24px;
}

.frame {
  position: relative;
  background: var(--paper);
  color: var(--body-on-light);
  border: 1px solid rgba(10, 25, 48, 0.25);
  box-shadow: 8px 8px 0 rgba(212, 175, 55, 0.16);
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  border-color: var(--gold);
  border-style: solid;
}

.frame::before {
  top: -3px;
  left: -3px;
  border-width: 3px 0 0 3px;
}

.frame::after {
  bottom: -3px;
  right: -3px;
  border-width: 0 3px 3px 0;
}

.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid rgba(212, 175, 55, 0.4);
  aspect-ratio: 4 / 3;
}

.media-frame--wide {
  aspect-ratio: 16 / 9;
}

.media-frame--portrait {
  aspect-ratio: 3 / 4;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background:
    radial-gradient(ellipse 80% 120% at 8% -20%, rgba(212, 175, 55, 0.1) 0%, transparent 60%),
    var(--ink);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 0 clamp(16px, 4vw, 64px);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--paper);
  line-height: 1;
}

.site-header__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(212, 175, 55, 0.25);
  transform: rotate(-3deg);
  transition: transform 0.2s ease;
}

.site-header__brand:hover .site-header__mark {
  transform: rotate(0deg) scale(1.04);
}

.site-header__name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--paper);
}

.site-header__name em {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.55);
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 3px;
  letter-spacing: 0.06em;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__chapter {
  display: none;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(230, 233, 239, 0.28);
  color: var(--body-on-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-header__chapter:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.site-header__toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold);
  background: transparent;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.site-header__toggle:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.site-header__toggle-box {
  position: relative;
  width: 16px;
  height: 14px;
}

.site-header__toggle-box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: top 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}

.site-header__toggle-box span:nth-child(1) { top: 0; }
.site-header__toggle-box span:nth-child(2) { top: 6px; }
.site-header__toggle-box span:nth-child(3) { top: 12px; }

.site-header__toggle[aria-expanded="true"] .site-header__toggle-box span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-box span:nth-child(2) {
  opacity: 0;
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-box span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  width: min(440px, 100%);
  background: var(--paper);
  color: var(--body-on-light);
  border-left: 2px solid var(--gold);
  box-shadow: -12px 0 40px rgba(10, 25, 48, 0.5);
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease,
    visibility 0s 0.38s;
}

.site-nav[data-open] {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
}

.site-nav__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 88px 40px 40px;
  overflow-y: auto;
}

.site-nav__kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid rgba(212, 175, 55, 0.55);
  padding-bottom: 14px;
}

.site-nav__issue {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 8px;
  margin-bottom: 28px;
}

.site-nav__list {
  display: flex;
  flex-direction: column;
}

.site-nav__item {
  border-bottom: 1px solid rgba(34, 48, 63, 0.1);
}

.site-nav__link {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 18px 6px;
  color: var(--body-on-light);
  border-left: 3px solid transparent;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    padding-left 0.2s ease,
    border-color 0.2s ease;
}

.site-nav__link:hover {
  background: rgba(212, 175, 55, 0.09);
  padding-left: 14px;
  border-left-color: rgba(212, 175, 55, 0.5);
}

.site-nav__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}

.site-nav__label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.site-nav__en {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.site-nav__link[aria-current="page"] {
  background: var(--ink);
  border-left-color: var(--gold);
  padding-left: 14px;
}

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

.site-nav__link[aria-current="page"] .site-nav__en {
  color: rgba(230, 233, 239, 0.55);
}

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

.site-nav__footnote {
  margin-top: auto;
  padding-top: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed rgba(34, 48, 63, 0.2);
}

.site-footer {
  margin-top: auto;
  background:
    radial-gradient(ellipse 60% 80% at 90% 100%, rgba(212, 175, 55, 0.06) 0%, transparent 70%),
    var(--ink);
  border-top: 2px solid var(--gold);
  color: var(--body-on-dark);
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: 48px;
  max-width: 1440px;
  margin-inline: auto;
  padding: 64px clamp(20px, 4vw, 64px) 48px;
}

.site-footer__block {
  min-width: 0;
}

.site-footer__brand {
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--paper);
  line-height: 1.4;
  transition: color 0.2s ease;
}

.site-footer__brand:hover {
  color: var(--gold);
}

.site-footer__brand em {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.5);
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 2px;
}

.site-footer__desc {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(230, 233, 239, 0.72);
  max-width: 360px;
}

.site-footer__heading {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.site-footer__list li {
  margin-bottom: 9px;
  font-size: 14px;
  color: rgba(230, 233, 239, 0.75);
}

.site-footer__list a {
  color: rgba(230, 233, 239, 0.78);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.site-footer__list a:hover {
  color: var(--gold);
  padding-left: 5px;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1440px;
  margin-inline: auto;
  padding: 22px clamp(20px, 4vw, 64px);
  border-top: 1px solid rgba(230, 233, 239, 0.1);
  font-size: 13px;
  color: rgba(230, 233, 239, 0.55);
}

.site-footer__bottom p {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-footer__back:hover {
  background: var(--gold);
  color: var(--ink);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--orange) 100%);
  z-index: 2500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.scroll-progress[data-visible="true"] {
  opacity: 1;
}

.shortcuts-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2600;
  width: min(320px, calc(100vw - 40px));
  background: var(--paper);
  color: var(--body-on-light);
  border: 2px solid var(--gold);
  box-shadow: 8px 8px 0 rgba(10, 25, 48, 0.35);
  padding: 24px;
  transform: translateY(calc(100% + 24px));
  visibility: hidden;
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    visibility 0s 0.3s;
}

.shortcuts-panel[data-open] {
  transform: translateY(0);
  visibility: visible;
  opacity: 1;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
}

.shortcuts-panel__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  border-bottom: 1px solid rgba(212, 175, 55, 0.5);
  padding-bottom: 10px;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

.shortcuts-panel__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(34, 48, 63, 0.08);
}

.shortcuts-panel__list li:last-child {
  border-bottom: none;
}

.shortcuts-panel kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(212, 175, 55, 0.55);
  flex-shrink: 0;
}

.shortcuts-panel__close {
  margin-top: 14px;
  width: 100%;
  padding: 8px;
  background: var(--ink);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.2s ease, color 0.2s ease;
}

.shortcuts-panel__close:hover {
  background: var(--gold);
  color: var(--ink);
}

.js [data-reveal] {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.js [data-reveal][data-revealed] {
  opacity: 1;
}

@media (min-width: 768px) {
  .site-header__chapter {
    display: inline-flex;
  }
}

@media (max-width: 1024px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .site-header__bar {
    padding: 0 16px;
  }

  .site-header__toggle-text {
    display: none;
  }

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

  .site-footer__bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 20px 24px;
  }

  .site-footer__bottom p {
    justify-content: center;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .site-nav {
    transform: none;
    opacity: 0;
    transition: opacity 0.2s linear, visibility 0s 0.2s;
  }

  .site-nav[data-open] {
    opacity: 1;
    transition: opacity 0.2s linear;
  }

  .shortcuts-panel {
    transform: none;
    opacity: 0;
    transition: opacity 0.2s linear, visibility 0s 0.2s;
  }

  .shortcuts-panel[data-open] {
    opacity: 1;
    transition: opacity 0.2s linear;
  }

  .js [data-reveal] {
    opacity: 1 !important;
    transition: none !important;
  }
}
