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

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper-light);
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

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

ul,
ol {
  list-style: none;
}

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

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

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

::selection {
  background: var(--orange);
  color: var(--paper-light);
}

/* ========== CSS VARIABLES ========== */
:root {
  --paper-light: #F8F4EC;
  --paper-dark: #E5DCC8;
  --ink: #1A1815;
  --ink-soft: #4A4A48;
  --accent-red: #C73E3A;
  --accent-gold: #B49A4B;
  --line: #D0C8B8;
  --shadow: rgba(0, 0, 0, 0.08);
  --navy: #102A43;
  --navy-light: #1C3C5B;
  --orange: #E85D26;
  --orange-light: #F0743D;
  --font-heading: "Arial Black", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-editorial: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
  --content-max: 1160px;
  --header-width: 232px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========== BASE TYPOGRAPHY ========== */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

.highlight {
  font-family: var(--font-editorial);
  font-weight: 700;
  color: var(--accent-red);
}

/* ========== LAYOUT ========== */
.container {
  width: min(100% - 2rem, var(--content-max));
  margin-inline: auto;
}

.page-main {
  padding: 3rem 0 4rem;
}

.page-main--bleed {
  padding-top: 0;
}

.section {
  padding-block: 3rem;
}

.section + .section {
  border-top: 1px solid var(--line);
}

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

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

.section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section__title {
  font-size: clamp(1.375rem, 2.4vw, 2rem);
  letter-spacing: 0.01em;
}

.section__title--editorial {
  font-family: var(--font-editorial);
  font-weight: 700;
}

.section__lead {
  margin-top: 0.5rem;
  max-width: 60ch;
  color: var(--ink-soft);
}

.section--navy .section__lead {
  color: rgba(248, 244, 236, 0.72);
}

/* ========== GRID ========== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.grid--asymmetric {
  grid-template-columns: 2fr 1fr;
}

.grid--asymmetric-rev {
  grid-template-columns: 1fr 2fr;
}

/* ========== CARD ========== */
.card {
  background: var(--paper-light);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px var(--shadow);
  padding: 1.5rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateY(-2px);
}

.card__title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.card__meta {
  font-family: var(--font-editorial);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

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

/* ========== FIGURE ========== */
.figure {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-dark);
  border: 1px solid var(--line);
}

.figure--wide {
  aspect-ratio: 16 / 7;
}

.figure--square {
  aspect-ratio: 1 / 1;
}

.figure::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(26, 24, 21, 0.05) 12px 13px),
    linear-gradient(135deg, rgba(16, 42, 67, 0.08) 0%, transparent 60%);
}

.figure::after {
  content: "IMG";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  color: rgba(26, 24, 21, 0.35);
}

/* ========== BUTTON ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  line-height: 1;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper-light);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-light);
}

.btn--gold {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--ink);
}

.btn--gold:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 2rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--line);
}

.breadcrumb__link {
  transition: color 0.15s ease;
}

.breadcrumb__link:hover {
  color: var(--accent-red);
}

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

/* ========== PAGE COVER ========== */
.page-cover {
  position: relative;
  padding: 3.5rem 0 3rem;
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--paper-light) 0%, var(--paper-light) 62%, var(--paper-dark) 62%, var(--paper-dark) 100%);
  border-bottom: 1px solid var(--line);
}

.page-cover__title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  letter-spacing: -0.01em;
}

.page-cover__lead {
  margin-top: 1rem;
  max-width: 64ch;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

/* ========== STEPS ========== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--paper-light);
  border: 1px solid var(--line);
  padding: 1.75rem 1.5rem 1.5rem;
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: inline-block;
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--accent-red);
  border-bottom: 2px solid var(--accent-gold);
  padding-bottom: 0.25rem;
  margin-bottom: 0.75rem;
}

.step__title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.step__text {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ========== DATA TABLE ========== */
.table-wrap {
  overflow-x: auto;
  background: var(--paper-light);
  border: 1px solid var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.data-table th {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--navy);
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--navy);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.data-table tr:hover td {
  background: var(--paper-dark);
}

/* ========== SKIP LINK ========== */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.75rem 1.25rem;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  transform: translateY(-400%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

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

/* ========== HEADER ========== */
.site-header {
  z-index: 900;
}

.header__rail {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  background:
    repeating-linear-gradient(-45deg, transparent 0 16px, rgba(248, 244, 236, 0.025) 16px 17px),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 120%);
  color: var(--paper-light);
  border-right: 1px solid rgba(248, 244, 236, 0.1);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(248, 244, 236, 0.16);
}

.brand__logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.625rem;
  letter-spacing: 0.02em;
  color: var(--paper-light);
  line-height: 1.1;
}

.brand__logo::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--orange);
  margin-left: 0.25rem;
  border-radius: 50%;
}

.brand__tagline {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
}

.nav-bar {
  flex: 1;
}

.nav-bar__list {
  display: flex;
  flex-direction: column;
}

.nav-bar__item {
  border-bottom: 1px solid rgba(248, 244, 236, 0.12);
}

.nav-bar__link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.5rem;
  color: rgba(248, 244, 236, 0.72);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-bar__index {
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
  width: 1.75rem;
  flex-shrink: 0;
}

.nav-bar__label {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

.nav-bar__link:hover {
  background: var(--navy-light);
  color: var(--paper-light);
}

.nav-bar__link[aria-current="page"] {
  background: var(--navy-light);
  color: var(--paper-light);
  box-shadow: inset 4px 0 0 var(--orange);
}

.nav-bar__link[aria-current="page"] .nav-bar__index {
  color: var(--orange);
}

.header__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: rgba(248, 244, 236, 0.55);
}

.header__meta-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 93, 38, 0.2);
  flex-shrink: 0;
}

.header__cta {
  margin: 1rem 1.5rem 1.5rem;
  padding: 0.875rem 1rem;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  background: var(--orange);
  color: var(--ink);
  border: 2px solid var(--orange);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.header__cta:hover {
  background: transparent;
  color: var(--paper-light);
  transform: translateY(-2px);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: transparent;
  color: var(--paper-light);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
}

.nav-toggle__line {
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--orange);
  transition: background 0.15s ease;
}

.nav-toggle__line::before,
.nav-toggle__line::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--orange);
  transition: transform 0.2s ease;
}

.nav-toggle__line::before {
  top: -7px;
}

.nav-toggle__line::after {
  top: 7px;
}

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

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

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

/* ========== SCROLL PROGRESS ========== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1000;
  pointer-events: none;
}

.scroll-progress::after {
  content: "";
  display: block;
  width: calc(var(--scroll, 0) * 1%);
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--accent-gold));
}

/* ========== FOOTER ========== */
.site-footer {
  background:
    repeating-linear-gradient(-45deg, transparent 0 18px, rgba(248, 244, 236, 0.02) 18px 19px),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 140%);
  color: rgba(248, 244, 236, 0.8);
  border-top: 3px solid var(--orange);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.4fr;
  gap: 2.5rem;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 3.5rem 1rem;
}

.footer__logo {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: var(--paper-light);
  line-height: 1.1;
}

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

.footer__statement {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(248, 244, 236, 0.7);
  max-width: 30ch;
}

.footer__service-note {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: rgba(248, 244, 236, 0.55);
}

.footer__heading {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer__nav-link {
  display: inline-block;
  color: rgba(248, 244, 236, 0.75);
  font-size: 0.875rem;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.footer__nav-link:hover {
  color: var(--orange);
  padding-left: 0.375rem;
}

.footer__contact-item {
  position: relative;
  padding-left: 1.125rem;
  font-size: 0.875rem;
  color: rgba(248, 244, 236, 0.7);
}

.footer__contact-item + .footer__contact-item {
  margin-top: 0.625rem;
}

.footer__contact-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.5rem;
  height: 2px;
  background: var(--accent-gold);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 1.25rem 1rem;
  border-top: 1px solid rgba(248, 244, 236, 0.16);
}

.footer__copyright,
.footer__icp {
  font-size: 0.8125rem;
  color: rgba(248, 244, 236, 0.55);
}

.footer__icp {
  font-variant-numeric: tabular-nums;
}

/* ========== BACK TOP ========== */
.back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--paper-light);
  border: 1px solid rgba(248, 244, 236, 0.3);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.15s ease, border-color 0.15s ease;
}

.back-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

.back-top__icon {
  font-family: var(--font-editorial);
  font-size: 1.125rem;
  line-height: 1;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 1025px) {
  body {
    margin-left: var(--header-width);
  }

  .site-header {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--header-width);
  }

  .header__rail {
    position: static;
    height: 100%;
    visibility: visible;
    transform: none;
    box-shadow: 1px 0 0 rgba(0, 0, 0, 0.15);
  }

  .nav-toggle {
    display: none;
  }

  .scroll-progress {
    left: var(--header-width);
  }
}

@media (max-width: 1024px) {
  .site-header {
    position: sticky;
    top: 0;
    display: flex;
    background: var(--navy);
    border-bottom: 1px solid rgba(248, 244, 236, 0.12);
  }

  .nav-toggle {
    display: inline-flex;
    position: relative;
    z-index: 920;
  }

  .header__rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(78vw, 300px);
    z-index: 910;
    visibility: hidden;
    transform: translateX(-105%);
    transition: transform 0.28s var(--ease), visibility 0.28s;
  }

  .header__rail[data-open] {
    visibility: visible;
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 905;
    background: rgba(16, 42, 67, 0.55);
  }

  .scroll-progress {
    left: 0;
  }

  .page-cover {
    background:
      linear-gradient(180deg, var(--paper-dark) 0%, var(--paper-light) 100%);
  }
}

@media (max-width: 880px) {
  .grid--2,
  .grid--3,
  .grid--asymmetric,
  .grid--asymmetric-rev,
  .steps {
    grid-template-columns: 1fr;
  }

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

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

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

  .back-top {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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