:root {
  --bg: #120e0c;
  --bg-panel: #1c1713;
  --bg-cream: #f5efe2;
  --red: #b62e2e;
  --gold: #c9a44c;
  --blue-start: #0a1f3c;
  --blue-end: #1b4d8f;
  --border: #2e2622;
  --text-muted: #8a8178;
  --text-secondary: #7a7068;
  --success: #4f8a4f;
  --cream: #f5efe2;
  --sidebar-width: 280px;
  --font-heading: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  grid-column: 2;
  min-height: 65vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.25;
  color: var(--cream);
}

p {
  font-size: 1rem;
  line-height: 1.7;
}

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

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

:focus-visible {
  outline: 2px solid var(--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;
}

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

.container-wide {
  max-width: 1440px;
}

.container-narrow {
  max-width: 780px;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2vw, 32px);
}

.section {
  padding-block: clamp(40px, 8vh, 96px);
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-lead {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 65ch;
}

.page-header {
  padding-block: 48px 24px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 48px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.15;
}

.page-subtitle {
  margin-top: 12px;
  color: var(--text-muted);
  max-width: 60ch;
  font-size: 1rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.breadcrumb li + li::before {
  content: "›";
  margin: 0 8px 0 2px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--gold);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease-out, color 0.2s ease-out, box-shadow 0.2s ease-out;
}

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

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
  font-weight: 700;
}

.btn-primary:hover {
  background: transparent;
  color: var(--gold);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--cream);
}

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

.btn-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--red) 0%, #7d1a1a 100%);
  color: #fff;
  text-decoration: none;
  border: 2px solid #7d1a1a;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}

.btn-cta:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
}

.panel {
  background: var(--bg-panel);
  border: 2px solid var(--border);
  padding: clamp(20px, 3vw, 32px);
}

.panel-gradient {
  background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
  border: none;
  color: rgba(245, 239, 226, 0.9);
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  border: 1px solid var(--gold);
  text-transform: uppercase;
}

.tag-red {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.figure {
  position: relative;
  overflow: hidden;
  background: var(--bg-panel);
  border: 2px solid var(--border);
}

.figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure-landscape {
  aspect-ratio: 16 / 9;
}

.figure-wide {
  aspect-ratio: 21 / 9;
}

.figure-square {
  aspect-ratio: 1 / 1;
}

.figure-caption {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--gold);
  color: var(--bg);
  padding: 10px 20px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--bg);
  font-family: var(--font-body);
  transition: top 0.2s ease-out;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  grid-column: 1;
  grid-row: 1 / -1;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-panel);
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  z-index: 1000;
}

.scroll-progress {
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, var(--gold), var(--red));
  z-index: 3;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  flex-shrink: 0;
  width: 48px;
  height: 54px;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

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

.brand-text strong {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.brand-text small {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 40px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  font-size: 0.95rem;
  transition: background 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out;
}

.nav-link:hover {
  color: var(--cream);
  background: rgba(201, 164, 76, 0.06);
  border-left-color: var(--gold);
}

.nav-link[aria-current="page"] {
  color: var(--gold);
  background: rgba(201, 164, 76, 0.1);
  border-left-color: var(--gold);
  font-weight: 600;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold);
  opacity: 0.6;
  min-width: 22px;
}

.nav-label {
  font-weight: inherit;
}

.nav-item-space {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.header-bottom {
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.header-note {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.site-footer {
  grid-column: 2;
  background: var(--bg-panel);
  border-top: 3px solid var(--gold);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  max-width: 1280px;
  margin-inline: auto;
  padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 48px) 32px;
}

.footer-brand-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.footer-brand p,
.footer-contact p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.footer-brand .footer-trust {
  color: var(--gold);
  opacity: 0.75;
  font-size: 0.8rem;
  margin-top: 12px;
}

.footer-contact h3,
.footer-links h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 0.06em;
}

.footer-contact a {
  color: var(--gold);
  text-decoration: none;
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 0;
  font-size: 0.9rem;
  transition: color 0.2s ease-out, padding-left 0.2s ease-out;
}

.footer-links a:hover {
  color: var(--gold);
  padding-left: 6px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px clamp(20px, 4vw, 48px);
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

@media (max-width: 900px) {
  body {
    grid-template-columns: minmax(0, 1fr);
  }

  main,
  .site-footer {
    grid-column: 1;
  }

  .site-header {
    grid-row: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
  }

  .header-brand {
    flex: 1;
  }

  .brand-text small {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: var(--bg-panel);
    border-top: 2px solid var(--gold);
    padding: 24px;
    margin: 0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  }

  .site-nav[data-open="true"] {
    display: flex;
    flex-direction: column;
  }

  .header-note {
    text-align: left;
  }

  .scroll-progress {
    top: auto;
    bottom: -2px;
    right: auto;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--gold), var(--red));
  }

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

@media (min-width: 601px) and (max-width: 900px) {
  .site-nav {
    padding: 32px;
  }

  .nav-link {
    padding: 14px 16px;
    font-size: 1rem;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
