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

html,
body {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

:root {
  --color-teal: #1A3A2F;
  --color-gold: #C8A165;
  --color-terracotta: #B54A3A;
  --color-gray: #4A4A48;
  --color-cream: #F4EFE7;
  --color-ink: #1B1C1B;
  --color-pale-teal: #D7E3DC;
  --color-earth: #A67C4A;
  --font-heading: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', serif;
  --font-body: 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-accent: 'Courier New', 'Courier', monospace;
  --border-thick: 4px;
  --shadow-standard: 3px 3px 8px rgba(27, 28, 27, 0.16);
  --shadow-strong: 5px 5px 0 rgba(27, 28, 27, 0.22);
  --container-width: 1200px;
  --header-z: 1000;
  --float-z: 1001;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-ink);
  background: var(--color-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

#main-content {
  display: block;
  flex: 1;
  width: 100%;
  background: var(--color-cream);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.3;
  color: var(--color-teal);
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(32px, 5vw, 56px);
}

h2 {
  font-size: clamp(26px, 3.5vw, 40px);
}

h3 {
  font-size: clamp(20px, 2vw, 28px);
}

h4 {
  font-size: 20px;
}

p {
  margin: 0 0 1em;
}

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

:focus-visible {
  outline: 3px solid var(--color-terracotta);
  outline-offset: 2px;
}

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

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

.page-container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  background: var(--color-cream);
}

.section {
  margin-bottom: 56px;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.3;
  color: var(--color-teal);
  margin: 0 0 12px;
  padding-bottom: 12px;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 52px;
  height: 4px;
  background: var(--color-gold);
}

.section-title.is-centered {
  text-align: center;
}

.section-title.is-centered::after {
  left: 50%;
  transform: translateX(-50%);
}

.section-desc {
  font-size: 16px;
  color: var(--color-gray);
  line-height: 1.8;
  max-width: 680px;
}

.section-desc.is-centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.grid {
  display: grid;
  gap: 24px;
}

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

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  border: 3px solid var(--color-ink);
  box-shadow: var(--shadow-standard);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-strong);
}

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

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-teal);
  color: var(--color-cream);
  border-color: var(--color-teal);
}

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

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--color-teal);
  color: var(--color-cream);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 14px;
  color: var(--color-gray);
  background: transparent;
}

.breadcrumb a {
  color: var(--color-teal);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--color-terracotta);
}

.breadcrumb-sep {
  color: var(--color-earth);
  font-family: var(--font-accent);
}

.breadcrumb-current {
  color: var(--color-gray);
  font-weight: 500;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 10002;
  background: var(--color-gold);
  color: var(--color-ink);
  border: 3px solid var(--color-ink);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: var(--shadow-standard);
  transition: top 0.2s ease;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--header-z);
  background: var(--color-cream);
  box-shadow: 0 2px 12px rgba(27, 28, 27, 0.08);
  transition: box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 16px rgba(27, 28, 27, 0.18);
}

.header-top {
  background: var(--color-ink);
  color: var(--color-pale-teal);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  font-size: 13px;
}

.header-top-note {
  font-family: var(--font-accent);
  letter-spacing: 0.08em;
  color: var(--color-gold);
}

.header-top-link {
  color: var(--color-cream);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--color-earth);
  font-family: var(--font-accent);
  font-size: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.header-top-link:hover,
.header-top-link:focus-visible {
  background: var(--color-gold);
  color: var(--color-ink);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 28px 24px;
  max-width: var(--container-width);
  margin: 0 auto;
  background-color: var(--color-cream);
  background-image: linear-gradient(rgba(26, 58, 47, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 58, 47, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: padding 0.3s ease;
}

.masthead-deco {
  flex: 1 1 120px;
  max-width: 180px;
  height: 4px;
  position: relative;
  background: linear-gradient(to right, transparent, var(--color-earth), transparent);
}

.masthead-deco::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--color-gold);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 0 2px var(--color-cream);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--color-gold);
  border: 3px solid var(--color-ink);
  transform: rotate(45deg);
  box-shadow: var(--shadow-standard);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease, width 0.3s ease, height 0.3s ease;
}

.brand-mark:hover,
.brand-mark:focus-visible {
  background: var(--color-terracotta);
  box-shadow: var(--shadow-strong);
}

.brand-mark-glyph {
  display: block;
  transform: rotate(-45deg);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  color: var(--color-ink);
  transition: font-size 0.3s ease;
}

.brand-text {
  text-align: left;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.2;
  color: var(--color-teal);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: font-size 0.3s ease;
}

.brand-logo span {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--color-teal);
  color: var(--color-gold);
  border: 2px solid var(--color-gold);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.brand-slogan {
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--color-earth);
  margin-top: 6px;
  transition: opacity 0.3s ease;
}

.nav-wrap {
  position: relative;
  background: var(--color-teal);
  border-top: var(--border-thick) solid var(--color-gold);
  border-bottom: var(--border-thick) solid var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.header-nav {
  flex: 1;
  max-width: var(--container-width);
  margin: 0 auto;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: inline-block;
  padding: 14px 22px;
  color: var(--color-cream);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--color-gold);
  color: var(--color-ink);
  outline: none;
}

.nav-link[aria-current="page"] {
  background: var(--color-gold);
  color: var(--color-ink);
  box-shadow: inset 0 -4px 0 var(--color-terracotta);
}

.nav-toggle {
  display: none;
}

.site-header.is-scrolled .masthead {
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-header.is-scrolled .brand-mark {
  width: 44px;
  height: 44px;
}

.site-header.is-scrolled .brand-mark-glyph {
  font-size: 20px;
}

.site-header.is-scrolled .brand-logo {
  font-size: 22px;
}

.site-header.is-scrolled .brand-slogan {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.site-header.is-scrolled .masthead-deco {
  max-width: 120px;
}

.site-footer {
  background: var(--color-ink);
  color: var(--color-cream);
  border-top: 6px solid var(--color-gold);
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 56px;
  background-image: linear-gradient(rgba(200, 161, 101, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 161, 101, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.footer-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-gold);
  border: 2px solid var(--color-cream);
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: var(--shadow-standard);
}

.footer-brand-mark > span {
  transform: rotate(-45deg);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  color: var(--color-ink);
}

.footer-brand-text-block {
  display: flex;
  flex-direction: column;
}

.footer-brand-text {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  color: var(--color-gold);
  line-height: 1.2;
}

.footer-brand-sub {
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--color-pale-teal);
  letter-spacing: 0.12em;
}

.footer-about {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-pale-teal);
  margin-top: 16px;
  max-width: 320px;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-gold);
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-earth);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--color-pale-teal);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

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

.footer-contact {
  list-style: none;
}

.footer-contact li {
  font-size: 14px;
  color: var(--color-pale-teal);
  line-height: 1.8;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.contact-label {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 11px;
  color: var(--color-gold);
  border: 1px solid var(--color-earth);
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

.footer-bottom {
  border-top: 3px solid var(--color-gold);
  background: #0F100F;
  padding: 20px 0;
}

.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--color-pale-teal);
}

.footer-bottom-inner p {
  margin: 0;
}

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

.footer-bottom-inner a:hover {
  text-decoration: underline;
}

.footer-trust {
  width: 100%;
  font-size: 12px;
  color: var(--color-gray);
  padding-top: 10px;
  border-top: 1px solid rgba(244, 239, 231, 0.08);
}

.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--color-pale-teal);
  border: var(--border-thick) solid var(--color-earth);
  box-shadow: var(--shadow-standard);
}

.media-frame::before {
  content: '';
  display: block;
}

.media-frame-16-9::before {
  padding-top: 56.25%;
}

.media-frame-4-3::before {
  padding-top: 75%;
}

.media-frame-1-1::before {
  padding-top: 100%;
}

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

.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--color-teal);
  background: var(--color-pale-teal);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dense-list {
  list-style: none;
}

.dense-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-pale-teal);
  font-size: 15px;
}

.dense-list li:first-child {
  border-top: 1px solid var(--color-pale-teal);
}

.dense-list .dense-index {
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--color-terracotta);
  width: 32px;
  flex-shrink: 0;
  text-align: right;
}

.dense-list a {
  color: var(--color-teal);
  text-decoration: none;
  font-weight: 500;
}

.dense-list a:hover,
.dense-list a:focus-visible {
  color: var(--color-terracotta);
  text-decoration: underline;
}

.dense-list .dense-meta {
  margin-left: auto;
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--color-gray);
  white-space: nowrap;
}

.vertical-note {
  writing-mode: vertical-rl;
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.2em;
  line-height: 1.6;
  color: var(--color-earth);
  border-left: 2px solid var(--color-gold);
  padding-left: 8px;
  max-height: 160px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--color-teal);
  border: 2px solid var(--color-earth);
  background: transparent;
  text-transform: uppercase;
}

.tag-terracotta {
  color: var(--color-terracotta);
  border-color: var(--color-terracotta);
}

[data-chapter-nav] {
  list-style: none;
}

[data-chapter-nav] a {
  display: block;
  padding: 8px 12px;
  color: var(--color-teal);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

[data-chapter-nav] a:hover,
[data-chapter-nav] a:focus-visible {
  background: var(--color-pale-teal);
}

[data-chapter-nav] a.is-active {
  border-left-color: var(--color-terracotta);
  background: var(--color-pale-teal);
  font-weight: 700;
  color: var(--color-ink);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(to right, var(--color-gold), var(--color-terracotta));
  z-index: 10002;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 1px 4px rgba(181, 74, 58, 0.4);
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  background: var(--color-teal);
  color: var(--color-gold);
  border: 3px solid var(--color-gold);
  box-shadow: var(--shadow-standard);
  font-size: 22px;
  font-family: var(--font-body);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease, color 0.2s ease;
  z-index: 999;
}

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

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--color-gold);
  color: var(--color-ink);
}

@media (max-width: 992px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .nav-link {
    padding: 12px 14px;
    font-size: 15px;
  }

  .masthead-deco {
    max-width: 120px;
  }
}

@media (max-width: 768px) {
  .nav-wrap {
    justify-content: flex-end;
    padding: 0;
    border-top-width: 3px;
    border-bottom-width: 3px;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    background: var(--color-teal);
    border: none;
    border-left: 3px solid var(--color-gold);
    cursor: pointer;
    flex-shrink: 0;
  }

  .nav-toggle-bar {
    display: block;
    width: 22px;
    height: 3px;
    background: var(--color-gold);
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.2s ease;
  }

  .nav-toggle:hover .nav-toggle-bar {
    background: var(--color-cream);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(8px) 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(-8px) rotate(-45deg);
  }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-teal);
    display: none;
    box-shadow: 0 12px 20px rgba(27, 28, 27, 0.25);
    max-width: none;
    margin: 0;
  }

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

  .nav-list {
    flex-direction: column;
    padding: 0;
    max-width: none;
    margin: 0;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(244, 239, 231, 0.15);
  }

  .masthead {
    gap: 12px;
    padding: 16px 20px;
  }

  .masthead-deco {
    display: none;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-mark-glyph {
    font-size: 22px;
  }

  .brand-group {
    gap: 10px;
  }

  .brand-logo {
    font-size: 20px;
  }

  .brand-logo span {
    font-size: 11px;
    padding: 1px 6px;
    margin-left: 6px;
  }

  .brand-slogan {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 480px) {
  .header-top {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 6px 12px;
  }

  .header-top-note {
    font-size: 11px;
  }

  .page-container {
    padding: 24px 16px 56px;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .back-to-top,
  .scroll-progress {
    transition: none;
  }
}
