/* ==========================================================================
   澳发指南 · 共享样式表 /assets/site.css
   框架式导航 + 非对称编辑部网格 + 暖纸连续画布
   ========================================================================== */

/* 1. Reset ----------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
}

/* 2. 设计变量 -------------------------------------------------------------- */
:root {
  --ink-900: #0B1B2B;
  --ink-700: #16324A;
  --celadon-500: #2F7F76;
  --celadon-200: #BFDCD6;
  --gold-400: #D9A13B;
  --coral-500: #E4644B;
  --paper-100: #F5F1E8;
  --paper-50: #FBF9F4;
  --slate-500: #5A6B78;

  --font-head: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, "Liberation Mono", monospace;

  --rail-w: 260px;
  --topbar-h: 44px;

  --shadow-hard: 4px 4px 0 var(--ink-900);
  --shadow-hard-lg: 6px 6px 0 var(--ink-900);
  --edge: 2px solid var(--ink-900);

  --gutter: clamp(20px, 4vw, 56px);
  --shell: 1180px;
}

@media (max-width: 1100px) {
  :root { --rail-w: 224px; }
}

/* 3. 中文排版基底 ---------------------------------------------------------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  padding-top: var(--topbar-h);
  background-color: var(--paper-100);
  background-image:
    radial-gradient(900px 420px at 92% -6%, rgba(47, 127, 118, 0.10), transparent 70%),
    radial-gradient(700px 360px at 6% 8%, rgba(217, 161, 59, 0.08), transparent 72%);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  font-weight: 400;
  letter-spacing: 0.005em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

h1 { font-size: clamp(2.2rem, 6vw, 4.6rem); font-weight: 900; line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink-700); }

strong { font-weight: 700; }

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.82em;
  letter-spacing: 0.06em;
  font-variant-ligatures: none;
}

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

#main-content {
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

/* 4. 跳转链接 -------------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: -72px;
  left: 12px;
  z-index: 140;
  padding: 10px 18px;
  background: var(--gold-400);
  color: var(--ink-900);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: var(--edge);
  box-shadow: var(--shadow-hard);
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 12px;
}

/* 5. 顶部细带 -------------------------------------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  z-index: 80;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--ink-900);
  color: var(--paper-100);
  border-bottom: 2px solid var(--ink-900);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.topbar__brand {
  display: none;
  color: var(--paper-100);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.topbar__ver {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--celadon-200);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar__ver::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: var(--celadon-500);
  box-shadow: 0 0 0 3px rgba(47, 127, 118, 0.32);
}

.topbar__home {
  color: var(--paper-100);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px dotted rgba(245, 241, 232, 0.5);
  white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease;
}

.topbar__home:hover {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
}

.progress {
  position: relative;
  flex: 1 1 auto;
  min-width: 40px;
  height: 4px;
  background: rgba(191, 220, 214, 0.18);
  overflow: hidden;
}

.progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
  background: linear-gradient(90deg, var(--celadon-500), var(--gold-400));
  transition: transform 120ms linear;
}

/* 6. 移动导航按钮 ---------------------------------------------------------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  background: var(--paper-100);
  color: var(--ink-900);
  border: 2px solid var(--paper-100);
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-toggle:hover {
  background: var(--gold-400);
  border-color: var(--gold-400);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

/* 7. 左侧索引书脊 ---------------------------------------------------------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 70;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 22px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(168deg, var(--ink-900) 0%, var(--ink-700) 58%, #1B4B47 100%);
  color: var(--paper-100);
  border-right: 2px solid var(--ink-900);
}

.rail::-webkit-scrollbar { width: 8px; }
.rail::-webkit-scrollbar-track { background: rgba(11, 27, 43, 0.4); }
.rail::-webkit-scrollbar-thumb { background: rgba(191, 220, 214, 0.32); }

.rail__brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 auto;
}

.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 12px;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--gold-400);
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 2px solid var(--paper-100);
}

.brand__name {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--paper-100);
  line-height: 1.2;
}

.brand__domain {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--celadon-200);
  opacity: 0.9;
  word-break: break-all;
}

.brand__tagline {
  margin: 0;
  padding-left: 11px;
  border-left: 3px solid var(--celadon-500);
  font-size: 13px;
  line-height: 1.65;
  color: rgba(245, 241, 232, 0.74);
}

.rail__nav {
  flex: 1 1 auto;
  min-height: 0;
}

.nav-list {
  border-top: 1px solid rgba(191, 220, 214, 0.24);
}

.nav-item {
  border-bottom: 1px solid rgba(191, 220, 214, 0.14);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 10px 11px 13px;
  color: rgba(245, 241, 232, 0.82);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold-400);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.nav-link:hover {
  color: var(--paper-100);
  background: rgba(191, 220, 214, 0.1);
  transform: translateX(2px);
}

.nav-link:hover::before {
  transform: scaleY(1);
}

.nav-link[aria-current="page"] {
  color: var(--ink-900);
  background: var(--celadon-200);
  transform: none;
}

.nav-link[aria-current="page"]::before {
  transform: scaleY(1);
}

.nav-link__idx {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--celadon-200);
  opacity: 0.72;
}

.nav-link[aria-current="page"] .nav-link__idx {
  color: var(--ink-700);
  opacity: 1;
}

.rail__cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

.rail__cta .btn {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
}

/* 8. 通用按钮 -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--ink-900);
  border-radius: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.btn--gold {
  background: var(--gold-400);
  color: var(--ink-900);
  border-color: var(--ink-900);
  box-shadow: 4px 4px 0 rgba(11, 27, 43, 0.55);
}

.btn--gold:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(11, 27, 43, 0.55);
}

.btn--gold:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(11, 27, 43, 0.55);
}

.btn--ghost {
  background: transparent;
  color: currentColor;
  border-color: currentColor;
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(191, 220, 214, 0.18);
  transform: translate(-2px, -2px);
}

.btn--ghost:active {
  transform: translate(1px, 1px);
}

/* 9. 布局与正文容器 -------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: 68ch;
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
}

.section--tight {
  padding-block: clamp(32px, 4vw, 56px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--celadon-500);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
}

.lede {
  max-width: 62ch;
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.8;
  color: var(--ink-700);
}

.rule {
  height: 2px;
  border: 0;
  background: var(--ink-900);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--celadon-500);
  border: 1px solid currentColor;
  white-space: nowrap;
}

.tag--coral { color: var(--coral-500); }
.tag--ink { color: var(--ink-700); }

/* 10. 面包屑 --------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--slate-500);
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.breadcrumb a {
  color: var(--ink-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.breadcrumb a:hover {
  color: var(--ink-900);
  border-bottom-color: var(--gold-400);
}

/* 11. 图像容器 ------------------------------------------------------------- */
.media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, var(--ink-700), var(--celadon-500));
  border: var(--edge);
  box-shadow: var(--shadow-hard);
}

.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--21x9 { aspect-ratio: 21 / 9; }

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--slate-500);
}

/* 12. 网格 ----------------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
}

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

/* 13. 显现动效 ------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

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

/* 14. 页脚 ----------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 128px);
  background: var(--ink-900);
  color: var(--paper-100);
  border-top: 2px solid var(--ink-900);
}

.footer__edge {
  height: 6px;
  background: linear-gradient(90deg, var(--celadon-500) 0%, var(--gold-400) 48%, var(--coral-500) 100%);
}

.footer__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 72px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  gap: clamp(32px, 5vw, 64px);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 16px;
  border-left: 3px solid var(--celadon-500);
}

.footer__logo {
  margin: 0;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--paper-100);
}

.footer__domain {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--celadon-200);
  word-break: break-all;
}

.footer__contact {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(245, 241, 232, 0.72);
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.footer__col {
  min-width: 0;
}

.footer__col-title {
  margin: 0;
  padding-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--celadon-200);
  border-bottom: 1px solid rgba(191, 220, 214, 0.28);
}

.footer__list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer__link {
  display: inline-block;
  padding: 3px 0;
  color: rgba(245, 241, 232, 0.78);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.footer__link:hover {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
  transform: translateX(2px);
}

.footer__bottom {
  width: 100%;
  max-width: var(--shell);
  margin: clamp(32px, 5vw, 56px) auto 0;
  padding: 20px var(--gutter) 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  border-top: 1px solid rgba(191, 220, 214, 0.2);
}

.footer__legal {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--celadon-200);
  opacity: 0.85;
}

.footer__copy {
  font-size: 13px;
  color: rgba(245, 241, 232, 0.62);
}

.to-top {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  color: var(--paper-100);
  border: 2px solid var(--celadon-500);
  border-radius: 0;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.to-top:hover {
  background: var(--celadon-500);
  color: var(--paper-100);
  border-color: var(--celadon-500);
}

/* 15. 移动端抽屉与遮罩 ----------------------------------------------------- */
.site-header::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(11, 27, 43, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.site-header[data-nav-open]::after {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  :root {
    --rail-w: 0px;
    --topbar-h: 48px;
  }

  body {
    padding-left: 0;
    font-size: 16px;
  }

  .topbar {
    left: 0;
    gap: 12px;
    padding: 0 12px;
  }

  .topbar__brand { display: inline-block; }

  .topbar__ver { display: none; }

  .topbar__home { display: none; }

  .nav-toggle { display: inline-flex; }

  .rail {
    width: min(300px, 84vw);
    padding: 26px 20px 24px;
    transform: translateX(-104%);
    transition: transform 280ms cubic-bezier(0.22, 0.7, 0.28, 1);
    box-shadow: 10px 0 0 rgba(11, 27, 43, 0.24);
  }

  .rail[data-open] {
    transform: translateX(0);
  }

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

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

  .footer__brand {
    padding-left: 14px;
  }
}

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

  .footer__cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

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

  .to-top {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* 16. 无障碍与降级 --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .progress__bar {
    transition: none;
  }

  .nav-link:hover,
  .footer__link:hover {
    transform: none;
  }
}

@media print {
  .topbar,
  .rail,
  .nav-toggle,
  .to-top,
  .skip-link {
    display: none !important;
  }

  body {
    padding: 0;
    background: #fff;
  }
}
