:root {
  --paper: #F4EFE6;
  --ink: #1B1B2A;
  --ink-soft: #4A4A5A;
  --sky: #2E5B9F;
  --snow: #FFFFFF;
  --gold: #D9A441;
  --kiwi: #6FBF4A;
  --line: #D8D3C9;
  --font-head: 'Noto Sans SC', 'Source Han Sans CN', 'Microsoft YaHei', sans-serif;
  --font-body: 'Noto Serif SC', 'Source Han Serif CN', 'Songti SC', serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --shadow: 6px 6px 0 rgba(27, 27, 42, 0.14);
  --shadow-strong: 0 18px 30px rgba(0, 0, 0, 0.28);
  --header-w: 280px;
  --container: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

p {
  margin: 0 0 1em;
}

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

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

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

[hidden] {
  display: none !important;
}

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

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

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.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: -64px;
  left: 16px;
  z-index: 999;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 900;
  padding: 10px 18px;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: top 0.2s ease;
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: 0;
  height: 3px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(27, 27, 42, 0.18);
  pointer-events: none;
}

@media (min-width: 960px) {
  .scroll-progress {
    left: calc(var(--header-w) + 4px);
  }
}

/* 全站头部：移动端为经幡式抽屉，桌面端为左侧轨道栏 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-head);
  box-shadow: 0 4px 0 rgba(46, 91, 159, 0.6);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
}

.brand-mark {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 30px;
  height: 34px;
}

.brand-mark-peak {
  position: absolute;
  inset: 0;
  background: var(--sky);
  clip-path: polygon(50% 0%, 100% 100%, 0 100%);
  transition: background 0.2s ease;
}

.brand-mark-dot {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 9px;
  height: 9px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink);
  transform: translate(-50%, -50%);
}

.brand:hover .brand-mark-peak {
  background: var(--kiwi);
}

.brand-text {
  display: block;
  min-width: 0;
}

.brand-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--paper);
}

.brand-site {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--gold);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 2px solid rgba(244, 239, 230, 0.4);
  cursor: pointer;
}

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.nav-toggle-icon i {
  display: block;
  height: 2px;
  background: var(--paper);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

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

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

.nav-toggle-label-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-label-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-label-close {
  display: inline;
}

.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 290;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 14px 18px 24px;
  background: var(--ink);
  border-bottom: 4px solid var(--sky);
  box-shadow: var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.site-nav[data-open] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.15);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: rgba(244, 239, 230, 0.6);
}

.nav-eyebrow .mono {
  color: var(--gold);
}

.nav-eyebrow::after {
  content: '';
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--sky) 0 10px, var(--snow) 10px 14px, var(--gold) 14px 22px, var(--kiwi) 22px 28px);
  opacity: 0.85;
}

.nav-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.nav-item + .nav-item {
  margin-top: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  position: relative;
  text-decoration: none;
  color: rgba(244, 239, 230, 0.74);
  border-left: 3px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-link::after {
  content: '';
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: var(--gold);
  opacity: 0;
  transform: rotate(45deg);
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  color: var(--paper);
  background: rgba(46, 91, 159, 0.35);
  border-left-color: var(--gold);
}

.nav-link:hover::after {
  opacity: 1;
}

.nav-link[aria-current="page"] {
  color: var(--paper);
  background: linear-gradient(90deg, rgba(46, 91, 159, 0.55), rgba(46, 91, 159, 0.15) 70%, transparent);
  border-left-color: var(--gold);
}

.nav-link[aria-current="page"]::after {
  opacity: 1;
}

.nav-index {
  flex: 0 0 2.4ch;
  font-size: 0.7rem;
  color: var(--gold);
}

.nav-label {
  flex: 1;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.nav-en {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: rgba(244, 239, 230, 0.4);
}

.nav-link[aria-current="page"] .nav-en {
  color: var(--kiwi);
}

.nav-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 239, 230, 0.15);
}

.nav-cta {
  width: 100%;
}

.nav-footnote {
  margin: 14px 0 0;
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: rgba(244, 239, 230, 0.45);
}

/* 全站页脚 */

.site-footer {
  background: var(--ink);
  color: rgba(244, 239, 230, 0.7);
  font-family: var(--font-body);
  border-top: 6px solid var(--sky);
}

.footer-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 40px 20px 28px;
}

@media (min-width: 600px) and (max-width: 959px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 36px 40px;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
  }
}

@media (min-width: 960px) {
  .footer-inner {
    grid-template-columns: 1.3fr 1fr 0.8fr 1.2fr;
    gap: 40px;
  }
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
}

.footer-brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  background: var(--sky);
  color: var(--snow);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.05rem;
  clip-path: polygon(50% 0%, 100% 100%, 0 100%);
}

.footer-brand-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--paper);
}

.footer-slogan {
  margin: 16px 0 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.footer-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(244, 239, 230, 0.55);
}

.footer-label {
  display: inline-block;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sky);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold);
}

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

.footer-list li {
  margin: 8px 0;
}

.footer-list a {
  font-family: var(--font-head);
  font-size: 0.9rem;
  color: rgba(244, 239, 230, 0.74);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-list a:hover {
  color: var(--paper);
  border-bottom-color: var(--gold);
}

.footer-contact li {
  display: flex;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(244, 239, 230, 0.65);
}

.footer-contact-key {
  flex: 0 0 3.4em;
  padding-top: 3px;
  font-size: 0.68rem;
  color: var(--kiwi);
}

.footer-bottom {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 20px 26px;
  border-top: 1px solid rgba(244, 239, 230, 0.14);
}

.footer-copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: rgba(244, 239, 230, 0.5);
}

.footer-trust {
  max-width: 640px;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: rgba(244, 239, 230, 0.4);
}

/* 桌面端轨道栏 */

@media (min-width: 960px) {
  body {
    padding-left: var(--header-w);
  }

  .site-header {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--header-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 0 var(--sky);
  }

  .header-top {
    padding: 28px 22px 18px;
  }

  .nav-toggle {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 44px;
  }

  .brand-mark-dot {
    width: 11px;
    height: 11px;
  }

  .brand-name {
    font-size: 1.18rem;
  }

  .brand-site {
    font-size: 0.68rem;
  }

  .site-nav {
    position: static;
    flex: 1;
    min-height: 0;
    padding: 10px 20px 22px;
    background: transparent;
    box-shadow: none;
    border-bottom: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .nav-foot {
    margin-top: auto;
  }

  .nav-footnote {
    display: block;
  }
}

/* 通用页面组件 */

#main-content {
  display: block;
  min-height: 70vh;
  padding-bottom: 72px;
  scroll-margin-top: 76px;
}

@media (min-width: 960px) {
  #main-content {
    scroll-margin-top: 0;
  }
}

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

@media (min-width: 1200px) {
  .container {
    padding-left: 32px;
    padding-right: 32px;
  }
}

.section {
  padding: 56px 20px;
  position: relative;
}

@media (min-width: 960px) {
  .section {
    padding: 80px 0;
  }
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
  padding-top: 10px;
  border-top: 3px solid var(--ink);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--sky);
}

.section-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--ink);
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

.button--kiwi {
  background: var(--kiwi);
  border-color: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(244, 239, 230, 0.28);
}

.button--kiwi:hover {
  box-shadow: 2px 2px 0 rgba(244, 239, 230, 0.28);
}

.button--sky {
  background: var(--sky);
  border-color: var(--ink);
  color: var(--snow);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 24px;
  padding: 10px 0;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-head);
  font-size: 0.85rem;
  list-style: none;
}

.breadcrumbs a {
  color: var(--sky);
  text-decoration: none;
}

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

.breadcrumbs [aria-current="page"] {
  font-weight: 900;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1em;
}

.prose h2,
.prose h3 {
  font-family: var(--font-head);
  color: var(--ink);
  margin-top: 1.6em;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.prose blockquote {
  margin: 0 0 1em;
  padding: 12px 16px;
  border-left: 4px solid var(--sky);
  background: var(--snow);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1em;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.media-placeholder {
  display: grid;
  place-items: center;
  min-height: 140px;
  border: 2px dashed var(--ink);
  background:
    linear-gradient(135deg, rgba(46, 91, 159, 0.16) 25%, transparent 25%),
    linear-gradient(225deg, rgba(46, 91, 159, 0.16) 25%, transparent 25%),
    var(--line);
  background-size: 40px 40px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-align: center;
}

.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(27, 27, 42, 0.16);
  background: var(--line);
}

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

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

.media-frame--square {
  aspect-ratio: 1 / 1;
}

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

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

.pattern-peaks {
  background-color: var(--snow);
  background-image:
    linear-gradient(135deg, rgba(46, 91, 159, 0.14) 25%, transparent 25%),
    linear-gradient(225deg, rgba(46, 91, 159, 0.14) 25%, transparent 25%);
  background-size: 40px 40px;
}

.pattern-grid {
  background-image:
    linear-gradient(rgba(27, 27, 42, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 27, 42, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--ink);
  background: var(--snow);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
}

.tag--gold {
  background: var(--gold);
}

.tag--kiwi {
  background: var(--kiwi);
}

.tag--sky {
  background: var(--sky);
  color: var(--snow);
}

/* 滚动显现 */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

[data-reveal][data-revealed] {
  opacity: 1;
  transform: translateY(0);
}

/* 减少动效 */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

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

  .site-nav {
    transition: none !important;
  }
}
