/* ===== CSS Variables ===== */
:root {
  --bg-main: #0B0B10;
  --bg-panel: #14141C;
  --gold: #D4AF37;
  --gold-bright: #F9D976;
  --gold-deep: #8B6914;
  --purple: #9D00FF;
  --purple-light: #C44DFF;
  --blue: #00E5FF;
  --text-strong: #F5F5F5;
  --text-weak: #B0B0B8;
  --red: #FF4D4F;
  --green: #00E676;
  --font-display: 'Rajdhani', 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-body: 'Noto Serif SC', 'Songti SC', 'SimSun', 'STSong', serif;
  --font-number: 'Orbitron', 'Consolas', 'Courier New', monospace;
  --header-h: 96px;
  --container-w: 1200px;
  --radius-cut: 8px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-strong);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 85% 10%, rgba(157, 0, 255, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 15% 90%, rgba(0, 229, 255, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: var(--header-h);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: rgba(212, 175, 55, 0.35);
  color: var(--text-strong);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.6);
}

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

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--gold-bright);
}

/* ===== Focus & Visibility ===== */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-strong);
  letter-spacing: 0.03em;
}

h1 {
  font-size: clamp(32px, 5vw, 48px);
}
h2 {
  font-size: clamp(24px, 3.5vw, 36px);
}
h3 {
  font-size: clamp(18px, 2vw, 24px);
}
h4 {
  font-size: 16px;
  font-weight: 600;
}

p {
  margin-bottom: 1em;
}

ul, ol {
  padding-left: 1.4em;
}

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

/* ===== Layout Utilities ===== */
.main-content {
  padding-top: 8px;
  min-height: 60vh;
}

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

@media (max-width: 600px) {
  .container {
    padding-inline: 16px;
  }
}

.section-overline {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-strong);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.page-lead {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-weak);
  max-width: 640px;
  margin-bottom: 24px;
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-weak);
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.breadcrumbs a {
  color: var(--text-weak);
  transition: color 0.2s ease;
}
.breadcrumbs a:hover {
  color: var(--gold);
}
.breadcrumbs .crumb-sep {
  color: rgba(212, 175, 55, 0.45);
  font-family: var(--font-number);
  font-size: 11px;
}
.breadcrumbs [aria-current="page"] {
  color: var(--gold-bright);
  font-weight: 700;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(11, 11, 16, 0.82);
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@supports not ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
  .site-header {
    background: rgba(11, 11, 16, 0.96);
  }
}

.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 40%, var(--purple) 100%);
  z-index: 1030;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 2000;
  background: var(--gold);
  color: var(--bg-main);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  padding: 12px 18px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

.header-shell {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 24px;
  position: relative;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.header-tagline {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-weak);
  letter-spacing: 0.1em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.14em;
  margin: 0;
  white-space: nowrap;
  text-transform: uppercase;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.8);
  animation: status-pulse 2.4s infinite;
  flex-shrink: 0;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.header-main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  position: relative;
}

/* Brand */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark:hover {
  color: var(--gold-bright);
}

.brand-icon {
  position: relative;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 55%, var(--gold-deep) 100%);
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
  flex-shrink: 0;
}
.brand-icon::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(11, 11, 16, 0.55);
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
}

.brand-textwrap {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-strong);
  white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-number);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-top: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ===== Navigation ===== */
.primary-nav {
  margin-left: auto;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
}
.nav-link {
  display: block;
  position: relative;
  padding: 8px 13px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-weak);
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 1px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease-out);
}
.nav-link:hover {
  color: var(--gold-bright);
}
.nav-link:hover::after {
  transform: scaleX(1);
}
.nav-link[aria-current="page"] {
  color: var(--gold);
}
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 70%);
  color: var(--bg-main);
}
.btn-gold:hover {
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}
.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.5);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn-ghost:hover {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-bright);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.2);
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 65%, var(--gold-deep));
  color: var(--bg-main);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 22px rgba(212, 175, 55, 0.45);
  color: var(--bg-main);
}
.btn-label {
  display: inline-block;
}
.btn-arrow {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn-header:hover .btn-arrow {
  transform: translate(2px, -2px);
}

/* ===== Nav Toggle (Mobile) ===== */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.4);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  padding: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.nav-toggle[aria-expanded="true"] {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
}
.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin: 0 auto;
}
.nav-toggle-line + .nav-toggle-line {
  margin-top: 4px;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(6px) 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(-6px) rotate(-45deg);
}
.nav-toggle-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  min-width: 22px;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  background:
    radial-gradient(circle at 80% 10%, rgba(157, 0, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 20% 90%, rgba(0, 229, 255, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-main) 0%, var(--bg-panel) 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  padding-top: 48px;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.footer-shell {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 24px;
  position: relative;
}

.footer-panel {
  background: var(--bg-panel);
  clip-path: polygon(0 0, calc(100% - 36px) 0, 100% 36px, 100% 100%, 36px 100%, 0 calc(100% - 36px));
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.16);
  padding: 44px 48px 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 1fr;
  gap: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-brandmark {
  position: relative;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
  margin-bottom: 14px;
}
.footer-brandmark::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(11, 11, 16, 0.55);
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
}
.footer-brandname {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-strong);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-trust {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-weak);
  margin-bottom: 14px;
  max-width: 480px;
}
.footer-note {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(176, 176, 184, 0.7);
  max-width: 480px;
  margin: 0;
}

.footer-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.heading-mark {
  width: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  flex-shrink: 0;
}

.footer-linklist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-linklist a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-weak);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.footer-linklist a::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.footer-linklist a:hover {
  color: var(--gold-bright);
  padding-left: 4px;
}

.footer-contactlist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-key {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.7);
}
.contact-val {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-weak);
  word-break: break-all;
}

.footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 22px 4px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 32px;
}
.footer-meta p {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
  color: rgba(176, 176, 184, 0.7);
  margin: 0;
}
.footer-icp {
  font-family: var(--font-number);
  letter-spacing: 0.06em;
}
.footer-support {
  margin-left: auto;
}

/* Back to Top */
.top-button {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 990;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 11, 16, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: var(--gold);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.top-button.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.top-button:hover {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}
.top-arrow {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

/* ===== Shared Components ===== */
/* Grid */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 960px) {
  .grid-2, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Chamfer Card */
.card {
  background: var(--bg-panel);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.12);
  padding: 28px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.28),
              0 10px 32px rgba(0, 0, 0, 0.35);
}
.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.card-desc {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-weak);
  margin: 0;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  background: rgba(157, 0, 255, 0.12);
  color: var(--purple-light);
  border: 1px solid rgba(157, 0, 255, 0.4);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.tag-gold {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-bright);
  border-color: rgba(212, 175, 55, 0.35);
}
.tag-blue {
  background: rgba(0, 229, 255, 0.08);
  color: var(--blue);
  border-color: rgba(0, 229, 255, 0.35);
}
.tag-green {
  background: rgba(0, 230, 118, 0.08);
  color: var(--green);
  border-color: rgba(0, 230, 118, 0.35);
}

/* Chapter Heading */
.chapter-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.chapter-index {
  font-family: var(--font-number);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(212, 175, 55, 0.55);
  flex-shrink: 0;
  min-width: 64px;
}
.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-strong);
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}
.chapter-sub {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-weak);
  margin: 0;
  max-width: 640px;
}

/* Section spacing helper */
.section-block {
  padding: 80px 0;
}
.section-block + .section-block {
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}
@media (max-width: 768px) {
  .section-block {
    padding: 48px 0;
  }
}

/* ===== Image Frames ===== */
.img-frame {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, transparent 55%),
    linear-gradient(315deg, rgba(157, 0, 255, 0.06) 0%, transparent 40%),
    var(--bg-panel);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.2);
  min-height: 160px;
}
.img-frame::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(212, 175, 55, 0.35);
  pointer-events: none;
  z-index: 2;
}
.img-frame::after {
  content: '';
  position: absolute;
  inset: 5px;
  background:
    linear-gradient(var(--gold), var(--gold)) 0 0 / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) 0 0 / 1px 18px,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 1px 18px,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 1px 18px,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 1px 18px;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 3;
}
.img-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.frame-16x9 {
  aspect-ratio: 16 / 9;
}
.frame-4x3 {
  aspect-ratio: 4 / 3;
}
.frame-3x2 {
  aspect-ratio: 3 / 2;
}
.frame-1x1 {
  aspect-ratio: 1 / 1;
}

/* ===== Reveal Animation ===== */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal]:not(.is-revealed) {
  transform: translateY(28px);
}
[data-reveal="left"]:not(.is-revealed) {
  transform: translateX(-36px);
}
[data-reveal="right"]:not(.is-revealed) {
  transform: translateX(36px);
}
[data-reveal="scale"]:not(.is-revealed) {
  transform: scale(0.9);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Chapter Directory (JS-generated) */
.chapter-dir-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chapter-dir-list a {
  display: block;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-weak);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.chapter-dir-list a:hover {
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.05);
}
.chapter-dir-list a.is-active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

/* ===== Responsive Header/Footer ===== */
@media (max-width: 1080px) {
  .nav-link {
    padding-inline: 10px;
    font-size: 13.5px;
  }
  .header-main {
    gap: 12px;
  }
}

@media (max-width: 959px) {
  :root {
    --header-h: 88px;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-header {
    position: fixed;
  }
  .header-main {
    min-height: 58px;
  }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: -24px;
    right: -24px;
    background: rgba(11, 11, 16, 0.98);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s var(--ease-out), padding 0.2s ease;
    margin-left: 0;
    padding: 0 24px;
  }
  .primary-nav[data-open="true"] {
    max-height: 480px;
    overflow-y: auto;
    padding: 12px 24px 16px;
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-link {
    display: block;
    padding: 13px 6px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .nav-link::after {
    display: none;
  }
  .nav-link[aria-current="page"] {
    color: var(--gold);
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.12), transparent);
    padding-left: 14px;
  }
  .btn-header {
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  .btn-header {
    display: none;
  }
  .header-top {
    padding-inline: 4px;
  }
  .header-tagline {
    font-size: 10px;
    letter-spacing: 0.06em;
  }
  .header-main {
    gap: 10px;
  }
  :root {
    --header-h: 88px;
  }
}

@media (max-width: 600px) {
  :root {
    --header-h: 58px;
  }
  .header-top {
    display: none;
  }
  .header-main {
    min-height: 58px;
  }
  .header-shell {
    padding-inline: 16px;
  }
  .brand-text {
    font-size: 18px;
  }
  .brand-icon {
    width: 28px;
    height: 28px;
  }
  .primary-nav {
    left: -16px;
    right: -16px;
    padding-inline: 16px;
  }
  .primary-nav[data-open="true"] {
    padding: 10px 16px 14px;
  }
}

/* ===== Footer Responsive ===== */
@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-panel {
    padding: 36px 32px 32px;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: auto;
  }
  .footer-panel {
    padding: 28px 20px 24px;
    clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
  }
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .footer-support {
    margin-left: 0;
  }
  .top-button {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .status-dot {
    animation: none;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
  .top-button {
    transition: none;
  }
  .skip-link {
    transition: none;
  }
}
