:root {
  --c-blue-900: #172b6b;
  --c-blue-800: #1e40af;
  --c-blue-500: #3b82f6;
  --c-snow: #f8fafc;
  --c-orange: #f97316;
  --c-ink: #0f172a;
  --c-gray-100: #f1f5f9;
  --c-gray-200: #e2e8f0;
  --font-display: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", Consolas, "Courier New", monospace;
  --header-w: 268px;
  --header-h: 68px;
  --content-max: 1200px;
}

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

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-ink);
  background-color: var(--c-snow);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.04), transparent 40%),
    radial-gradient(circle at 88% 8%, rgba(249, 115, 22, 0.04), transparent 32%);
  background-attachment: fixed;
  padding-top: var(--header-h);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--c-blue-900);
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

ul, ol {
  list-style: none;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

button {
  cursor: pointer;
}

address, em {
  font-style: normal;
}

::selection {
  background: var(--c-blue-800);
  color: var(--c-snow);
}

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

body.is-locked {
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.65rem 1rem;
  background: var(--c-blue-900);
  color: #fff;
  font-weight: 700;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  transform: translateY(-300%);
  transition: transform 0.25s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.content-container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 2px;
  background: var(--c-blue-800);
  color: #fff;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  background: var(--c-blue-900);
  box-shadow: 0 8px 20px rgba(23, 43, 107, 0.2);
  transform: translateY(-1px);
}

.btn--accent {
  background: var(--c-orange);
}

.btn--accent:hover {
  background: #ea580c;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--c-blue-800);
  color: var(--c-blue-800);
}

.btn--ghost:hover {
  background: rgba(30, 64, 175, 0.06);
  color: var(--c-blue-900);
  box-shadow: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.8em;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  border: 1px solid var(--c-gray-200);
  color: var(--c-blue-800);
  background: #fff;
  border-radius: 999px;
}

.tag--accent {
  border-color: var(--c-orange);
  color: var(--c-orange);
  background: rgba(249, 115, 22, 0.06);
}

.chapter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--c-blue-500);
  text-transform: uppercase;
}

.chapter-label::before {
  content: "";
  width: 2.5rem;
  height: 2px;
  background: var(--c-orange);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: rgba(15, 23, 42, 0.5);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__item:not(:last-child)::after {
  content: "→";
  margin-left: 0.75rem;
  color: var(--c-gray-200);
  font-family: var(--font-mono);
}

.breadcrumb__link {
  color: var(--c-blue-500);
}

.breadcrumb__link:hover {
  color: var(--c-orange);
}

.breadcrumb__link[aria-current="page"] {
  color: var(--c-ink);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-gray-200);
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.75rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--c-gray-200);
}

.table thead th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-blue-500);
  background: var(--c-gray-100);
  border-bottom: 2px solid var(--c-blue-800);
}

.table tbody tr {
  transition: background 0.2s;
}

.table tbody tr:hover {
  background: var(--c-gray-100);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.media {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--c-gray-100);
  border: 1px solid var(--c-gray-200);
}

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

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

.media--1x1 {
  aspect-ratio: 1 / 1;
}

.media__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-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  color: var(--c-blue-500);
  background: linear-gradient(135deg, var(--c-gray-100) 0 55%, #e8eef7 55% 100%);
}

.media__placeholder::before {
  content: "◆";
  margin-right: 0.5rem;
  color: var(--c-orange);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: var(--c-blue-900);
  color: var(--c-snow);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.18);
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  background: repeating-linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.55) 0 8px,
    rgba(248, 250, 252, 0.16) 8px 16px
  );
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 0 1rem 0 calc(1rem + 12px);
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.brand-mark {
  position: relative;
  display: inline-block;
  flex: none;
  width: 36px;
  height: 36px;
  border: 2px solid var(--c-orange);
  border-radius: 2px;
  transform: rotate(45deg);
}

.brand-mark__cap {
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.9);
  transform: scale(0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  color: #fff;
}

.brand-suffix {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.36em;
  color: var(--c-blue-500);
}

.header-description {
  display: none;
  font-size: 0.8125rem;
  color: rgba(248, 250, 252, 0.55);
  letter-spacing: 0.04em;
}

.site-nav {
  display: none;
}

.site-nav[data-open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  padding: 1.5rem 1.25rem 2rem;
  background: var(--c-blue-900);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: drawer-in 0.25s ease both;
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.8rem 0.875rem;
  border-left: 3px solid transparent;
  color: rgba(248, 250, 252, 0.72);
  font-weight: 500;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(248, 250, 252, 0.06);
}

.nav-link[aria-current="page"] {
  border-left-color: var(--c-orange);
  background: rgba(59, 130, 246, 0.18);
  color: #fff;
}

.nav-link__index {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--c-blue-500);
}

.nav-link__label {
  font-size: 0.9375rem;
}

.nav-footer {
  margin-top: 2rem;
}

.header-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.25rem;
  background: var(--c-orange);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(249, 115, 22, 0.28);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.header-cta:hover {
  background: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(249, 115, 22, 0.34);
}

.header-console {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(248, 250, 252, 0.14);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 2px;
}

.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.7;
  letter-spacing: 0.06em;
}

.ctrl-label {
  color: rgba(248, 250, 252, 0.4);
}

.ctrl-value {
  color: #fff;
}

.ctrl-value--live {
  color: var(--c-orange);
}

.ctrl-value--live::before {
  content: "●";
  font-size: 0.5rem;
  vertical-align: middle;
  margin-right: 0.4em;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.nav-toggle {
  position: relative;
  z-index: 1060;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding: 0.5rem;
  color: #fff;
  border-radius: 2px;
}

.nav-toggle__box {
  position: relative;
  width: 24px;
  height: 14px;
  flex: none;
}

.nav-toggle__bar {
  position: absolute;
  left: 0;
  top: 6px;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: background 0.3s;
}

.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.nav-toggle__bar::before {
  top: -5px;
}

.nav-toggle__bar::after {
  top: 5px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after {
  transform: translateY(-5px) rotate(-45deg);
}

.nav-toggle__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
}

.site-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1500;
  background: rgba(15, 23, 42, 0.14);
  pointer-events: none;
}

.site-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--c-blue-500), var(--c-orange));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.site-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  background: var(--c-blue-900);
  color: #fff;
  border: 1px solid rgba(248, 250, 252, 0.2);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
}

.site-top:hover {
  background: var(--c-blue-800);
}

.site-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-top__icon {
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
}

.site-top__label {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
}

.site-footer {
  position: relative;
  background: var(--c-blue-900);
  color: rgba(248, 250, 252, 0.7);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-orange), var(--c-blue-500));
}

.footer-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

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

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.footer-brand__suffix {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-blue-500);
  letter-spacing: 0.24em;
}

.footer-desc {
  max-width: 42ch;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(248, 250, 252, 0.6);
}

.footer-trust {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  color: var(--c-orange);
}

.footer-title {
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.45);
}

.footer-links {
  display: grid;
  gap: 0.5rem;
}

.footer-link {
  display: inline-block;
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.72);
  transition: color 0.2s, padding-left 0.2s;
}

.footer-link:hover {
  color: var(--c-orange);
  padding-left: 0.25rem;
}

.footer-contact {
  display: grid;
  gap: 0.6rem;
  font-style: normal;
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.72);
}

.footer-contact__line {
  display: flex;
  gap: 0.75rem;
}

.contact-tag {
  flex: none;
  width: 2.2em;
  padding-top: 0.15em;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--c-blue-500);
}

.footer-contact__value {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.footer-meta {
  border-top: 1px solid rgba(248, 250, 252, 0.12);
  background: rgba(15, 23, 42, 0.25);
}

.footer-meta__inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: rgba(248, 250, 252, 0.5);
}

.footer-icp {
  color: rgba(248, 250, 252, 0.45);
}

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

  .nav-toggle__label {
    display: none;
  }
}

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

  .footer-col--brand {
    grid-column: span 2;
  }

  .footer-meta__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .content-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .header-description {
    display: block;
  }

  .header-inner {
    gap: 1.25rem;
  }

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

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

  body.is-locked {
    overflow: hidden;
    padding-right: 0;
  }

  .site-header {
    right: auto;
    bottom: 0;
    width: var(--header-w);
    height: auto;
    box-shadow: none;
    border-right: 1px solid rgba(248, 250, 252, 0.12);
  }

  .site-header::before {
    width: 14px;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    height: 100%;
    padding: 1.75rem 1.5rem 1.5rem calc(1.5rem + 14px);
  }

  .header-brand {
    display: block;
  }

  .header-description {
    display: block;
    margin-top: 0.75rem;
  }

  .site-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    padding: 0;
    background: transparent;
    animation: none;
  }

  .site-nav[data-open] {
    display: flex;
    position: static;
    padding: 0;
    background: transparent;
    animation: none;
  }

  .nav-toggle {
    display: none;
  }

  .nav-list {
    gap: 0.125rem;
  }

  .nav-link {
    padding: 0.6rem 0.875rem;
  }

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

  .header-console {
    margin-top: 1.25rem;
  }

  .site-progress {
    left: var(--header-w);
    right: 0;
    width: auto;
  }

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

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

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

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