:root {
  --c-bg: #F5F0E8;
  --c-card: #D9DFC5;
  --c-warm: #E5C9B5;
  --c-ink: #1A1A1A;
  --c-rail: #2E2E2E;
  --c-muted: #6B6B6B;
  --c-faint: #8A9A8A;
  --c-grass: #7A8450;
  --c-clay: #C1784F;
  --c-red: #E8381E;
  --c-blue: #2A7FFF;
  --c-neon: #7CFF3F;
  --c-white: #FFFFFF;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --rail-width: 80px;
  --header-h: 56px;
  --content-max: 1440px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --ease: 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-ink);
  background-color: var(--c-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% 0%, rgba(42, 127, 255, 0.07), transparent 60%),
    radial-gradient(760px 480px at 6% 100%, rgba(232, 56, 30, 0.06), transparent 55%);
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 900;
  line-height: 1.25;
  color: var(--c-ink);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
}
h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}
h3 {
  font-size: 1.2rem;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--c-clay);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- Header / Navigation ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-width);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--c-rail);
  border-right: 1px solid rgba(245, 240, 232, 0.08);
}

.skip-link {
  position: fixed;
  top: -48px;
  left: 1rem;
  z-index: 2000;
  padding: 0.6875rem 1.25rem;
  background: var(--c-blue);
  color: var(--c-white);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0 0 6px 6px;
  transition: top 0.2s ease;
}

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

.masthead {
  display: none;
}

.masthead-brand {
  display: none;
}

.brand-mark,
.brand-name {
  display: inline-block;
}

.masthead-brand .brand-mark {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--c-neon);
  line-height: 1;
}

.masthead-brand .brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--c-bg);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--c-bg);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.header-rail {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  align-items: stretch;
}

.rail-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid rgba(245, 240, 232, 0.12);
  text-decoration: none;
}

.rail-brand .brand-mark {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.08em;
  color: var(--c-blue);
  line-height: 1;
}

.rail-brand .brand-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--c-bg);
  opacity: 0.85;
}

.site-nav {
  flex: 1;
  overflow-y: auto;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.875rem 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 54px;
  padding: 0 6px;
  color: var(--c-bg);
  font-weight: 600;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(245, 240, 232, 0.08);
  color: var(--c-white);
}

.nav-link[aria-current="page"] {
  border-left-color: var(--c-neon);
  background: rgba(124, 255, 63, 0.08);
  color: var(--c-white);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--c-blue);
}

.nav-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: inherit;
}

.header-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 4px;
  border-top: 1px solid rgba(245, 240, 232, 0.08);
  margin-top: auto;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-neon);
  box-shadow: 0 0 8px rgba(124, 255, 63, 0.8);
  animation: live-pulse 2.4s ease-in-out infinite;
}

.live-text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--c-bg);
  opacity: 0.8;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(26, 26, 26, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: none;
}

body.nav-open {
  overflow: hidden;
}

/* ---------- Main content container ---------- */

.main-content,
.site-footer {
  margin-left: var(--rail-width);
}

.main-content {
  flex: 1;
  min-height: 100vh;
}

.page-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 3vw, 3rem) 5rem;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  background: var(--c-bg);
  border-top: 1px solid var(--c-warm);
}

.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--c-blue), var(--c-red), var(--c-neon));
  opacity: 0.35;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem 4rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3.5rem clamp(1.25rem, 3vw, 3rem) 2rem;
}

.footer-brand {
  max-width: 26rem;
}

.footer-brand-mark {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--c-blue);
  margin-top: 0.5rem;
}

.footer-contact {
  font-style: normal;
  color: var(--c-muted);
  line-height: 1.9;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

.footer-col {
  padding-top: 0.25rem;
}

.footer-col-sitemap,
.footer-col-legal {
  padding-top: 0.25rem;
}

.footer-heading {
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--c-ink);
  border-bottom: 1px solid var(--c-warm);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-list a {
  color: var(--c-muted);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-list a:hover {
  color: var(--c-red);
}

.footer-bottom {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 3vw, 3rem) 2.5rem;
  border-top: 1px solid var(--c-warm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-trust {
  flex-basis: 100%;
  font-size: 0.8125rem;
  color: var(--c-faint);
  line-height: 1.7;
}

.footer-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--c-muted);
}

.footer-sep {
  color: var(--c-warm);
}

.footer-icp {
  color: var(--c-muted);
}

.footer-copyright {
  color: var(--c-muted);
}

/* ---------- Common components ---------- */

.section {
  margin-bottom: 3.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--c-faint);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--c-red);
  flex-shrink: 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--c-ink);
}

.index-cluster {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.index-cluster > * {
  grid-column: span 4;
}

.card {
  background: var(--c-white);
  border: 1px solid var(--c-faint);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--c-warm);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.card--accent {
  border-top: 3px solid var(--c-blue);
}

.card--red {
  border-top: 3px solid var(--c-red);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--c-clay);
  color: var(--c-white);
}

.btn-primary:hover {
  background: #b06a42;
  transform: translateY(-1px);
}

.btn-data {
  background: var(--c-blue);
  color: var(--c-white);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.btn-data:hover {
  background: #1a6de8;
  transform: translateY(-1px);
}

.img-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--c-card) 0%, var(--c-warm) 100%);
  border: 1px solid var(--c-faint);
  border-radius: var(--radius);
  position: relative;
}

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

.img-frame--wide {
  aspect-ratio: 21 / 9;
}

div.img-frame::after {
  content: "图";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  color: var(--c-muted);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--c-faint);
  margin-bottom: 1.25rem;
}

.breadcrumbs-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs-item + .breadcrumbs-item::before {
  content: "/";
  color: var(--c-warm);
}

.breadcrumbs-item a {
  color: var(--c-blue);
  text-decoration: none;
}

.breadcrumbs-item a:hover {
  color: var(--c-red);
}

/* ---------- Scroll progress ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--c-blue), var(--c-red), var(--c-neon));
  z-index: 2001;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .index-cluster > * {
    grid-column: span 6;
  }
}

@media (max-width: 767px) {
  .site-header {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: var(--header-h);
    background: var(--c-rail);
    border-right: 0;
    box-shadow: 0 1px 0 rgba(245, 240, 232, 0.06);
  }

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

  .masthead-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
  }

  .header-rail {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 1001;
    background: var(--c-rail);
    padding: 1rem 0;
    transform: translateX(-110%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: none;
    overflow-y: auto;
  }

  .header-rail[data-open] {
    transform: translateX(0);
    box-shadow: 24px 0 32px rgba(0, 0, 0, 0.22);
  }

  .rail-brand {
    display: none;
  }

  .nav-list {
    gap: 4px;
    padding: 0 8px;
  }

  .nav-link {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    height: 48px;
    padding: 0 1rem;
    border-left: none;
    border-bottom: 1px solid rgba(245, 240, 232, 0.06);
  }

  .nav-link[aria-current="page"] {
    border-bottom-color: var(--c-neon);
    background: rgba(124, 255, 63, 0.08);
  }

  .nav-index {
    width: 24px;
  }

  .header-live {
    align-items: flex-start;
    padding: 1rem 1.25rem;
  }

  .live-text {
    writing-mode: horizontal-tb;
  }

  .nav-overlay {
    display: block;
  }

  body.nav-open .nav-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.nav-open .nav-toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.nav-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

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

  .page-wrap {
    padding: 1.5rem 1.25rem 3rem;
  }

  .index-cluster {
    grid-template-columns: 1fr;
  }

  .index-cluster > * {
    grid-column: span 1;
  }

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

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---------- 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;
  }

  .live-dot {
    animation: none;
  }

  .scroll-progress {
    display: none;
  }
}
