:root {
  --ink: #0E1B2A;
  --midnight: #08111C;
  --paper: #F3EFE7;
  --stone: #8A8F8C;
  --moss: #5B6F5A;
  --clay: #A45A3F;
  --amber: #F2A33C;
  --teal: #3FC1B0;
  --amber-dark: #C97A1E;
  --shadow: #D8D2C6;
  --ink-soft: rgba(14, 27, 42, 0.74);
  --paper-soft: rgba(243, 239, 231, 0.8);
  --line: rgba(243, 239, 231, 0.16);
  --line-dark: rgba(14, 27, 42, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --rail-width: 0px;
  --shell: 1200px;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (min-width: 1180px) {
  :root {
    --rail-width: 144px;
  }
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    radial-gradient(circle at 18% 0%, rgba(63, 193, 176, 0.08), transparent 34%),
    radial-gradient(circle at 82% 8%, rgba(242, 163, 60, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(8, 17, 28, 0.15), rgba(8, 17, 28, 0.62));
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

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

button {
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

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

#main-content {
  display: block;
  padding-left: var(--rail-width);
}

.site-header,
.site-footer {
  padding-left: var(--rail-width);
}

.shell {
  width: min(100% - 2rem, var(--shell));
  margin-inline: auto;
}

@media (min-width: 1180px) {
  .shell {
    width: min(100% - 3rem, var(--shell));
  }
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 400;
  transform: translateY(-160%);
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 800;
  transition: transform 0.2s ease;
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: var(--rail-width);
  right: 0;
  z-index: 350;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.site-header {
  position: relative;
  z-index: 100;
  background: linear-gradient(180deg, var(--ink), #0B1624);
  border-bottom: 1px solid var(--line);
}

.guide-strip {
  background: var(--midnight);
  border-bottom: 1px solid rgba(242, 163, 60, 0.24);
}

.guide-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding-block: 0.55rem;
  font-size: 0.78rem;
  color: var(--paper-soft);
}

.guide-strip__label {
  color: var(--amber);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}

.guide-links a {
  color: var(--paper-soft);
  border-bottom: 1px solid transparent;
}

.guide-links a:hover {
  color: var(--paper);
  border-color: var(--amber);
}

.masthead {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-block: 1.1rem 1rem;
}

.brand {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.brand__mark {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 10px 10px 10px 2px;
  background: var(--amber);
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(201, 122, 30, 0.35);
}

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

.brand__name {
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.brand__line {
  margin-top: 0.2rem;
  color: var(--stone);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.masthead__note {
  grid-column: 1;
  justify-self: start;
  max-width: 12rem;
  color: var(--stone);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.nav-toggle {
  grid-column: 3;
  justify-self: end;
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.45rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
}

.nav-toggle__bars {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
}

.nav-toggle__text {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.site-nav {
  border-top: 1px solid var(--line);
  background: rgba(8, 17, 28, 0.35);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.6rem;
  padding: 0.55rem 0 0.7rem;
}

.site-nav__item {
  min-width: 0;
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  color: var(--paper-soft);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-nav__link::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.site-nav__link:hover {
  color: var(--paper);
  background: rgba(242, 163, 60, 0.08);
}

.site-nav__link[aria-current="page"] {
  color: var(--amber);
}

.site-nav__link[aria-current="page"]::before {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(63, 193, 176, 0.14);
}

.index-rail {
  display: none;
}

@media (min-width: 1180px) {
  .index-rail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 150;
    display: block;
    width: var(--rail-width);
    height: 100vh;
    padding: 1.25rem 0.85rem;
    background: var(--midnight);
    border-right: 1px solid rgba(242, 163, 60, 0.18);
  }

  .index-rail__inner {
    position: sticky;
    top: 1.25rem;
  }

  .index-rail__title {
    margin-bottom: 1rem;
    color: var(--stone);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
  }

  .index-rail__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .index-rail__item {
    min-width: 0;
  }

  .index-rail__link {
    display: grid;
    grid-template-columns: 2.2rem 1fr;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.45rem;
    border-radius: 10px;
    color: var(--paper-soft);
    font-size: 0.84rem;
    line-height: 1.3;
  }

  .index-rail__link:hover {
    background: rgba(243, 239, 231, 0.06);
    color: var(--paper);
  }

  .index-rail__link[aria-current="page"] {
    background: rgba(63, 193, 176, 0.1);
    color: var(--paper);
  }

  .index-rail__link[aria-current="page"] .index-rail__num {
    color: var(--teal);
  }

  .index-rail__num {
    color: var(--amber);
    font-family: var(--font-mono);
    font-size: 0.72rem;
  }
}

@media (max-width: 820px) {
  .masthead {
    grid-template-columns: 1fr auto;
    padding-block: 0.9rem;
  }

  .masthead__note {
    display: none;
  }

  .brand {
    grid-column: 1;
    justify-self: start;
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 2;
  }

  .site-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, padding 0.28s ease;
  }

  .site-nav[data-open] {
    max-height: 72vh;
    padding-block: 0.4rem 0.8rem;
    overflow: auto;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0;
  }

  .site-nav__link {
    width: 100%;
    border-radius: 10px;
  }
}

.site-footer {
  padding-block: 3rem 2rem;
  background: var(--midnight);
  border-top: 1px solid rgba(242, 163, 60, 0.22);
  color: var(--paper-soft);
}

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

.footer-brand {
  min-width: 0;
}

.footer-brand__mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 10px 10px 10px 2px;
  background: var(--amber);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(201, 122, 30, 0.35);
}

.footer-brand__name {
  margin-top: 0.7rem;
  color: var(--paper);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.footer-brand__line {
  margin-top: 0.25rem;
  color: var(--stone);
  font-size: 0.86rem;
}

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

.footer-col {
  min-width: 0;
}

.footer-col__title {
  margin-bottom: 0.8rem;
  color: var(--amber);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-link {
  color: var(--paper-soft);
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}

.footer-link:hover {
  color: var(--paper);
  border-color: var(--teal);
}

.footer-contact {
  min-width: 0;
}

.footer-contact__item {
  margin-bottom: 0.55rem;
  color: var(--paper-soft);
  font-size: 0.88rem;
}

.footer-contact__value {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
  margin-top: 2.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.footer-legal__line {
  color: var(--stone);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.footer-note {
  max-width: 52rem;
  color: var(--stone);
  font-size: 0.8rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(243, 239, 231, 0.08);
}

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

.footer-bottom__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1.6fr;
  }

  .footer-contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-bottom {
    flex-direction: column;
  }
}

.section {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.section--paper {
  background: var(--paper);
  color: var(--ink);
}

.section--paper .section__title {
  color: var(--ink);
}

.section--paper .section__lead,
.section--paper .prose p,
.section--paper .prose li {
  color: var(--ink-soft);
}

.section--midnight {
  background: var(--midnight);
}

.section--moss {
  background: linear-gradient(180deg, rgba(91, 111, 90, 0.25), transparent);
}

.section__eyebrow {
  margin-bottom: 0.8rem;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}

.section__title {
  color: var(--paper);
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.section__lead {
  max-width: 62ch;
  margin-top: 1rem;
  color: var(--paper-soft);
  font-size: 1.05rem;
}

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

.content-grid > * {
  min-width: 0;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .span-2,
  .span-3,
  .span-4,
  .span-6,
  .span-8 {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3,
  .span-4,
  .span-6,
  .span-8 {
    grid-column: span 1;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.button--amber {
  background: var(--amber);
  color: var(--ink);
}

.button--amber:hover {
  background: var(--amber-dark);
  transform: translateY(-1px);
}

.button--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--paper);
}

.button--ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.button--small {
  min-height: 2.2rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}

.card {
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 rgba(216, 210, 198, 0.35);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
  box-shadow: 10px 12px 0 rgba(216, 210, 198, 0.45);
}

.card--outline {
  background: transparent;
  color: var(--paper);
  border-color: var(--line);
  box-shadow: none;
}

.card--outline .card__meta {
  color: var(--stone);
}

.card--outline .card__text {
  color: var(--paper-soft);
}

.card__meta {
  margin-bottom: 0.55rem;
  color: var(--clay);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.card__title {
  color: inherit;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.35;
}

.card__text {
  margin-top: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.label,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.label {
  background: rgba(138, 143, 140, 0.18);
  color: var(--paper-soft);
}

.tag--moss {
  background: var(--moss);
  color: var(--paper);
}

.tag--clay {
  background: var(--clay);
  color: var(--paper);
}

.tag--teal {
  background: var(--teal);
  color: var(--ink);
}

.tag--amber {
  background: var(--amber);
  color: var(--ink);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--stone);
  font-size: 0.8rem;
}

.breadcrumbs a {
  color: var(--paper-soft);
}

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

.breadcrumbs__sep {
  color: var(--clay);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-left: 1.4rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 1px;
  background: linear-gradient(var(--clay), var(--teal));
  opacity: 0.65;
}

.timeline__item {
  position: relative;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.18rem;
  top: 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(242, 163, 60, 0.15);
}

.timeline__title {
  color: var(--paper);
  font-weight: 800;
}

.timeline__text {
  color: var(--paper-soft);
  font-size: 0.92rem;
}

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

.step-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(243, 239, 231, 0.06);
}

.step-card__num {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 1.5rem;
}

.step-card__title {
  color: var(--paper);
  font-weight: 800;
}

.step-card__text {
  margin-top: 0.35rem;
  color: var(--paper-soft);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .step-grid {
    grid-template-columns: 1fr;
  }
}

.notice-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  border-radius: var(--radius);
  background: var(--amber);
  color: var(--ink);
}

.notice-banner__title {
  font-size: 1.2rem;
  font-weight: 900;
}

.notice-banner__text {
  color: rgba(14, 27, 42, 0.78);
  font-size: 0.92rem;
}

.tabs {
  display: block;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.tab[aria-selected="true"] {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--ink);
}

.tab-panel {
  padding-top: 0.2rem;
}

.tab-panel[hidden] {
  display: none;
}

.image-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(243, 239, 231, 0.08), rgba(63, 193, 176, 0.05));
  box-shadow: 0 18px 50px rgba(8, 17, 28, 0.28);
}

.image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

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

.image-frame--tall {
  aspect-ratio: 4 / 5;
}

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

.image-frame__caption {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(8, 17, 28, 0.82);
  color: var(--paper);
  font-size: 0.72rem;
}

.divider {
  height: 1px;
  margin-block: 2rem;
  border: 0;
  background: linear-gradient(90deg, var(--clay), var(--amber), var(--teal));
  opacity: 0.7;
}

.prose {
  max-width: 68ch;
}

.prose h2,
.prose h3 {
  color: var(--paper);
  line-height: 1.25;
}

.prose p {
  margin-bottom: 1.1rem;
  color: var(--paper-soft);
}

.prose a {
  color: var(--amber);
  border-bottom: 1px solid currentColor;
}

.prose ul,
.prose ol {
  margin: 1rem 0 1.2rem 1.2rem;
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.45rem;
  color: var(--paper-soft);
}

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

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

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  .card:hover,
  .button:hover {
    transform: none;
  }

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