:root {
  --paper: #F5F0E8;
  --ink: #1A1A1A;
  --river: #0E5A8A;
  --river-light: #3A7CA5;
  --torrent: #FF6B35;
  --volt: #A8E10C;
  --deep: #0B3B50;
  --mist: #E5F0EA;
  --slate: #5A6B7A;
  --sidebar-w: 300px;
  --header-h: 64px;
  --content-max: 1200px;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --heading-font: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --body-font: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono-font: "Roboto Mono", "JetBrains Mono", monospace;
}

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

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

body {
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

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

a {
  color: var(--river);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--torrent);
}

button {
  font: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

.skip-link {
  position: fixed;
  top: -48px;
  left: 1rem;
  z-index: 300;
  background: var(--torrent);
  color: var(--deep);
  font-weight: 700;
  padding: 0.55rem 1.2rem;
  border-radius: 0 0 6px 6px;
  transition: top 0.25s ease;
}

.skip-link:focus-visible {
  top: 0;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(11, 59, 80, 0.08);
  z-index: 190;
  pointer-events: none;
}

.reading-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--river) 0%, var(--river-light) 55%, var(--torrent) 100%);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background: var(--deep);
  color: var(--paper);
  box-shadow: 0 2px 8px rgba(11, 59, 80, 0.18);
  z-index: 120;
  overflow: visible;
}

.site-header::before,
.site-header::after {
  display: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  padding: 0 1rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  color: var(--paper);
  text-decoration: none;
}

.brand-lockup:hover {
  color: var(--paper);
}

.brand-glyph {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 10px;
  background: linear-gradient(135deg, var(--river) 0%, var(--river-light) 100%);
  overflow: hidden;
  transform: skewX(-8deg);
  box-shadow: inset 0 0 0 2px rgba(245, 240, 232, 0.15);
}

.brand-wave {
  position: absolute;
  left: -20%;
  right: -20%;
  height: 26%;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.75);
  pointer-events: none;
}

.brand-wave:first-child {
  top: 6%;
  opacity: 0.5;
}

.brand-wave-2 {
  top: 52%;
  height: 24%;
  background: rgba(168, 225, 12, 0.6);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--heading-font);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: 0.04em;
  transform: skewX(-5deg);
  color: var(--paper);
}

.brand-tagline {
  display: none;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(245, 240, 232, 0.6);
  margin-top: 3px;
  white-space: nowrap;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid rgba(245, 240, 232, 0.3);
  border-radius: 6px;
  color: var(--paper);
  line-height: 1;
}

.nav-toggle:hover {
  border-color: var(--volt);
  color: var(--volt);
}

.toggle-lines {
  position: relative;
  display: block;
  width: 24px;
  height: 16px;
}

.toggle-bar {
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--paper);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}

.toggle-bar-1 {
  top: 0;
}

.toggle-bar-2 {
  bottom: 0;
}

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

.nav-toggle[aria-expanded="true"] .toggle-bar-2 {
  bottom: 7px;
  transform: rotate(-45deg);
}

.toggle-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(245, 240, 232, 0.8);
}

.track-nav {
  position: absolute;
  top: 100%;
  left: 0;
  width: min(420px, 100vw);
  background: var(--deep);
  border-top: 1px solid rgba(168, 225, 12, 0.2);
  padding: 0.5rem 0.9rem 1.25rem;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
  border-radius: 0 0 12px 0;
}

.track-nav[data-open] {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 4px 12px 4px 12px;
  color: rgba(245, 240, 232, 0.82);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  transform: skewX(-5deg);
  transform-origin: left center;
  border-left: 3px solid transparent;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.nav-link:hover {
  color: var(--paper);
  background: rgba(14, 90, 138, 0.45);
  transform: skewX(-5deg) translateX(4px);
}

.nav-link[aria-current="page"] {
  color: var(--volt);
  background: rgba(168, 225, 12, 0.08);
  border-left-color: var(--volt);
}

.nav-index {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  opacity: 0.6;
  margin-right: 0.4em;
}

.header-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1.25rem;
  font-family: var(--heading-font);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--deep);
  background: var(--torrent);
  border-radius: 4px;
  transform: skewX(-5deg);
  transition: background 0.3s ease, color 0.3s ease;
}

.header-action:hover {
  background: var(--volt);
  color: var(--deep);
}

.action-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.header-action:hover .action-arrow {
  transform: translateX(4px);
}

.site-footer {
  position: relative;
  margin-top: 3rem;
  background: var(--deep);
  color: var(--paper);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--river-light) 0%, var(--torrent) 50%, var(--volt) 100%);
}

.footer-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) 1.5rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-logo {
  font-family: var(--heading-font);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  transform: skewX(-5deg);
  line-height: 1.2;
}

.footer-logo a {
  color: var(--paper);
  text-decoration: none;
}

.footer-logo a:hover {
  color: var(--volt);
}

.footer-tagline {
  font-size: 0.85rem;
  color: rgba(245, 240, 232, 0.55);
  letter-spacing: 0.06em;
}

.footer-trust {
  font-size: 0.8rem;
  max-width: 34ch;
  color: rgba(245, 240, 232, 0.45);
  line-height: 1.7;
  margin-top: 0.4rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-title {
  font-family: var(--heading-font);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--volt);
  margin-bottom: 0.2rem;
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: rgba(245, 240, 232, 0.7);
  text-decoration: none;
  transition: color 0.3s ease, padding-left 0.3s ease;
}

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

.footer-contact li {
  color: rgba(245, 240, 232, 0.65);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 240, 232, 0.12);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(245, 240, 232, 0.5);
}

.footer-copy [data-year] {
  font-family: var(--mono-font);
}

.footer-icp {
  font-family: var(--mono-font);
  font-size: 0.78rem;
  color: rgba(245, 240, 232, 0.4);
}

.scroll-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--torrent);
  color: var(--deep);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  box-shadow: 0 4px 14px rgba(11, 59, 80, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-top:hover {
  background: var(--volt);
}

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

.page-section {
  padding: clamp(2.5rem, 5vw, 5rem) 0;
}

.prose {
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.75;
}

.prose p {
  margin-bottom: 1.25em;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4ch;
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--slate);
}

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

.breadcrumb a:hover {
  color: var(--torrent);
}

.breadcrumb .sep {
  opacity: 0.5;
}

.seg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 0.95rem;
  border: 0;
  border-radius: 4px;
  background: var(--river);
  color: #fff;
  transform: skewX(-5deg);
  transition: background 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  background: var(--deep);
  color: var(--paper);
}

.btn-ghost {
  background: transparent;
  border: 2px solid var(--river);
  color: var(--river);
}

.btn-ghost:hover {
  background: var(--river);
  color: #fff;
}

.btn-solid {
  background: var(--torrent);
  color: var(--deep);
}

.btn-solid:hover {
  background: var(--deep);
  color: var(--volt);
}

.data-stat {
  position: relative;
  padding: 1.25rem 1.35rem;
  background: var(--mist);
  border: 1px solid rgba(14, 90, 138, 0.16);
  border-left: 4px solid var(--river);
  font-family: var(--mono-font);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}

.data-stat strong {
  font-size: 1.6rem;
  color: var(--river);
  font-weight: 700;
}

.pic-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(14, 90, 138, 0.18) 0%, transparent 50%),
    repeating-linear-gradient(115deg, rgba(14, 90, 138, 0.05) 0 2px, transparent 2px 10px),
    var(--mist);
  border: 1px solid rgba(14, 90, 138, 0.16);
  border-radius: 8px;
  overflow: hidden;
}

.pic-frame[data-ratio="16-9"] {
  aspect-ratio: 16 / 9;
}

.pic-frame::after {
  content: attr(data-caption);
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0.35rem 0.85rem;
  background: var(--deep);
  color: var(--paper);
  font-size: 0.72rem;
  font-family: var(--mono-font);
  letter-spacing: 0.06em;
}

@media (max-width: 1023.98px) {
  body {
    padding-top: var(--header-h);
  }

  main,
  .site-main,
  .site-footer {
    margin-left: 0;
  }
}

@media (min-width: 768px) {
  .brand-tagline {
    display: block;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .footer-inner {
    padding-inline: 2rem;
  }
}

@media (min-width: 1024px) {
  body {
    padding-top: 0;
  }

  .site-header {
    width: var(--sidebar-w);
    height: 100vh;
    bottom: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 16px rgba(11, 59, 80, 0.08);
    overflow: hidden;
  }

  .site-header::before,
  .site-header::after {
    display: block;
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    border-radius: 50%;
    z-index: 0;
  }

  .site-header::before {
    bottom: -80px;
    height: 140px;
    background: rgba(14, 90, 138, 0.35);
  }

  .site-header::after {
    bottom: -60px;
    height: 110px;
    background: rgba(168, 225, 12, 0.07);
  }

  .header-inner,
  .track-nav {
    position: relative;
    z-index: 1;
  }

  .header-inner {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2.5rem 1.5rem 0;
  }

  .nav-toggle {
    display: none;
  }

  .track-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: static;
    width: auto;
    padding: 2rem 1.25rem 1.5rem;
    max-height: none;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    transform: none;
    border-top: 0;
  }

  .header-action {
    margin-top: auto;
  }

  main,
  .site-main,
  .site-footer {
    margin-left: var(--sidebar-w);
  }
}

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

  .reading-progress-bar {
    transition: none;
  }
}
