:root {
  --emerald: #006B5E;
  --gold: #C7A252;
  --cinnabar: #A63A2B;
  --ink-black: #1A1A1A;
  --paper-white: #F7F4EC;
  --celadon: #90ADA5;
  --dark-gold: #8E6A2A;
  --ink-gray: #4A4A4A;
  --light-ink: #E9E8DE;
  --gold-gradient: linear-gradient(135deg, #C7A252, #8E6A2A);
  --font-heading: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif;
  --font-body: 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
  --h1-size: 2.5rem;
  --h2-size: 1.75rem;
  --h3-size: 1.25rem;
  --body-size: 1rem;
  --caption-size: 0.875rem;
  --font-weight-heading: 700;
  --font-weight-body: 400;
  --font-weight-strong: 600;
  --line-height-heading: 1.3;
  --line-height-body: 1.7;
  --content-width: 1200px;
  --radius: 6px;
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 6px 24px rgba(26, 26, 26, 0.12);
  --transition-fast: 0.18s ease;
  --transition-base: 0.3s ease;
}

*,
*::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: var(--body-size);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-body);
  color: var(--ink-black);
  background-color: var(--paper-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: var(--emerald);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  color: var(--ink-black);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

main {
  flex: 1;
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 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: -120px;
  left: 1rem;
  z-index: 999;
  background: var(--emerald);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 8px;
  font-size: 0.9rem;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
  color: #fff;
  outline: none;
}

.container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.page-container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-block: 2.5rem;
  padding-inline: 1.25rem;
  flex: 1;
  width: 100%;
}

.prose {
  max-width: 72ch;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow var(--transition-base), background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--emerald);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 107, 94, 0.25);
}

.btn-primary:hover {
  background: #005b4f;
  color: #fff;
  box-shadow: 0 5px 18px rgba(0, 107, 94, 0.35);
}

.btn-gold {
  background: var(--gold-gradient);
  color: #fff;
  box-shadow: 0 3px 10px rgba(142, 106, 42, 0.3);
}

.btn-gold:hover {
  color: #fff;
  opacity: 0.92;
}

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

.btn-outline:hover {
  background: var(--gold);
  color: #fff;
}

.card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(199, 162, 82, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.panel {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(199, 162, 82, 0.28);
  border-top-width: 3px;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel--emerald {
  border-top-color: var(--emerald);
}

.panel--gold {
  border-top-color: var(--gold);
}

.page-title {
  font-family: var(--font-heading);
  font-size: var(--h1-size);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.page-title::after {
  content: '';
  display: block;
  width: 96px;
  height: 4px;
  margin-top: 0.75rem;
  background: var(--gold-gradient);
  border-radius: 2px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 2px;
  color: var(--ink-black);
}

.section-heading {
  font-family: var(--font-heading);
  font-size: var(--h2-size);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-black);
  margin-bottom: 1.25rem;
  padding-left: 0.9rem;
  position: relative;
}

.section-heading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 4px;
  height: 0.72em;
  background: var(--gold-gradient);
  border-radius: 2px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  font-size: var(--caption-size);
  color: var(--ink-gray);
}

.breadcrumbs a {
  font-size: var(--caption-size);
  color: var(--dark-gold);
}

.breadcrumbs a:hover {
  color: var(--emerald);
}

.breadcrumbs .sep {
  color: var(--celadon);
  padding-inline: 0.15rem;
}

.term-list dt {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--dark-gold);
  margin-bottom: 0.2rem;
}

.term-list dd {
  margin: 0 0 1.25rem;
  line-height: 1.7;
  color: var(--ink-gray);
}

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--light-ink);
  aspect-ratio: 4 / 3;
}

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

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

.media-frame--ink {
  background: linear-gradient(135deg, var(--ink-black), #37413f);
}

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

.media-frame::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(199, 162, 82, 0.55);
  border-radius: 2px;
  pointer-events: none;
}

.scroll-progress {
  --progress: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: calc(var(--progress) * 100%);
  background: var(--gold-gradient);
  border-radius: 0 99px 99px 0;
  pointer-events: none;
  z-index: 300;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 236, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(199, 162, 82, 0.3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  min-height: 84px;
  padding-block: 0.5rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
}

.brand-link:hover {
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 12px 12px 12px 4px;
  background: var(--gold-gradient);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(142, 106, 42, 0.35);
  transform: rotate(-6deg);
  pointer-events: none;
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink-black);
  white-space: nowrap;
}

.brand-slogan {
  font-size: 0.78rem;
  color: var(--dark-gold);
  letter-spacing: 2px;
  line-height: 1.5;
  border-left: 2px solid var(--gold);
  padding-left: 0.85rem;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-left: auto;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.72rem;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  content: '';
  position: absolute;
  right: -0.35rem;
  bottom: -0.3rem;
  width: 0.5rem;
  height: 2px;
  background: var(--gold);
  transform: rotate(45deg);
  border-radius: 1px;
}

.search-input {
  width: 190px;
  padding: 0.5rem 1rem 0.5rem 2.1rem;
  border: 1px solid rgba(144, 173, 165, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  color: var(--ink-black);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), width var(--transition-base);
}

.search-input::placeholder {
  color: var(--celadon);
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(199, 162, 82, 0.16);
  width: 220px;
}

.header-quick-link {
  font-size: 0.85rem;
  color: var(--dark-gold);
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

.header-quick-link:hover {
  border-color: rgba(199, 162, 82, 0.7);
  color: var(--emerald);
  background: rgba(199, 162, 82, 0.08);
}

.nav-wrap {
  border-top: 1px solid rgba(199, 162, 82, 0.4);
  background: linear-gradient(180deg, rgba(199, 162, 82, 0.1), rgba(199, 162, 82, 0));
}

.nav-cage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  gap: 1rem;
}

.main-nav {
  width: 100%;
}

.nav-list {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 0.9rem 1.15rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-black);
  letter-spacing: 1px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-base), border-color var(--transition-base), background-color var(--transition-base);
}

.nav-link:hover {
  color: var(--emerald);
  border-bottom-color: var(--gold);
  background: rgba(199, 162, 82, 0.06);
}

.nav-link[aria-current="page"] {
  color: var(--emerald);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(199, 162, 82, 0.6);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.nav-toggle:hover {
  background: rgba(199, 162, 82, 0.1);
  border-color: var(--gold);
}

.nav-toggle[aria-expanded="true"] {
  border-color: var(--emerald);
}

.toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--emerald);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

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

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

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

.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--ink-black);
  color: rgba(247, 244, 236, 0.85);
  margin-top: 2.5rem;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
  z-index: 1;
}

.footer-embellish {
  position: absolute;
  top: 0;
  right: 0;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(199, 162, 82, 0.12), transparent 70%);
  border-radius: 50%;
  transform: translate(35%, -35%);
  pointer-events: none;
  z-index: 0;
}

.footer-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.1fr 1.5fr;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-brand .brand-mark {
  width: 46px;
  height: 46px;
  font-size: 1.5rem;
  border-radius: 10px 10px 10px 3px;
}

.footer-brand .brand-text {
  font-size: 1.35rem;
  letter-spacing: 2px;
  color: var(--paper-white);
}

.footer-about {
  margin-top: 1rem;
  font-size: 0.87rem;
  line-height: 1.8;
  color: rgba(247, 244, 236, 0.7);
  max-width: 40ch;
}

.footer-trust {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(199, 162, 82, 0.9);
}

.trust-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 26px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--gold);
  background: rgba(199, 162, 82, 0.1);
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(199, 162, 82, 0.35);
}

.footer-links li + li {
  margin-top: 0.35rem;
}

.footer-links a {
  font-size: 0.87rem;
  color: rgba(247, 244, 236, 0.72);
  transition: color var(--transition-base), padding-left var(--transition-base);
}

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

.footer-contact-line {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(247, 244, 236, 0.78);
  margin-bottom: 0.35rem;
}

.footer-celadon {
  color: var(--celadon);
  font-size: 0.82rem;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid rgba(199, 162, 82, 0.25);
  padding-block: 1.2rem;
  font-size: 0.78rem;
  color: rgba(247, 244, 236, 0.55);
}

.footer-icp {
  margin: 0;
  max-width: 62ch;
}

.footer-copy {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 992px) {
  .brand-slogan {
    display: none;
  }

  .search-input {
    width: 150px;
  }

  .search-input:focus {
    width: 170px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-cage {
    min-height: 0;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    background: rgba(247, 244, 236, 0.98);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 16px 32px rgba(26, 26, 26, 0.16);
    z-index: 40;
  }

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

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-link {
    padding: 0.95rem 1.5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .nav-link:hover,
  .nav-link[aria-current="page"] {
    border-left-color: var(--gold);
    border-bottom-color: transparent;
    background: rgba(199, 162, 82, 0.08);
  }

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

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

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1.5rem;
  }
}

@media (max-width: 599px) {
  .header-actions {
    display: none;
  }

  .header-top {
    min-height: 64px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    font-size: 1.65rem;
  }

  .brand-text {
    font-size: 1.4rem;
    letter-spacing: 2px;
  }

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

  .footer-main {
    grid-template-columns: 1fr;
    padding-top: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-copy {
    white-space: normal;
  }

  .page-container {
    padding-block: 1.75rem;
    padding-inline: 1rem;
  }
}

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