/* ==========================================================================
   万博的会馆 — 共享样式表 /assets/site.css
   基调：墨蓝底 + 纸白阅读面 + 琥珀(变更) / 青瓷(正常) 语义色
   形态：锐利直角、1px 细线、12 列刻度、等宽索引
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root {
  --ink-950: #08141F;
  --ink-900: #0B1A2B;
  --ink-700: #1A3450;
  --blue-500: #33587A;
  --amber-500: #E08A17;
  --amber-200: #F6D9A8;
  --celadon-600: #1F7F6B;
  --celadon-200: #A9DAD0;
  --paper-050: #F4F6F5;
  --white-000: #FFFFFF;
  --slate-600: #4A5764;
  --line-300: #D5DBDF;

  --font-display: "Barlow Semi Condensed", "Oswald", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-text: "Inter", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;

  --shell-max: 1280px;
  --gutter: 20px;

  --dur-fast: 160ms;
  --dur-base: 200ms;
  --ease: cubic-bezier(0.2, 0.7, 0, 1);

  --ink-line: rgba(51, 88, 122, 0.55);
  --on-dark: #F4F6F5;
  --on-dark-dim: rgba(244, 246, 245, 0.62);
  --on-dark-soft: rgba(244, 246, 245, 0.45);
}

@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1200px) { :root { --gutter: 48px; } }

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

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

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

ul, ol { margin: 0; padding: 0; }

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

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

button { background: none; border: 0; padding: 0; cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

hr { border: 0; border-top: 1px solid var(--line-300); margin: 0; }

[hidden] { display: none !important; }

/* ---------- 3. 中文排版基线 ---------- */
body {
  background: var(--paper-050);
  color: var(--ink-900);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 200; line-height: 1.05; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: clamp(18px, 2.2vw, 22px); }

p { margin: 0; }

a {
  color: var(--blue-500);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  letter-spacing: 0;
}

::selection { background: var(--amber-200); color: var(--ink-950); }

:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
}

:target { scroll-margin-top: 96px; }

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

body.is-nav-open { overflow: hidden; }

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

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 400;
  display: inline-block;
  padding: 10px 18px;
  background: var(--amber-500);
  color: var(--ink-950);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  color: var(--ink-950);
  outline-offset: 3px;
}

/* ---------- 6. 状态点 ---------- */
.state-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--celadon-600);
  border: 1px solid var(--celadon-200);
}

.state-dot--ok { background: var(--celadon-600); border-color: var(--celadon-200); }
.state-dot--alert { background: var(--amber-500); border-color: var(--amber-200); }
.state-dot--idle { background: var(--blue-500); border-color: var(--line-300); }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.btn:hover { text-decoration: none; }

.btn--ghost {
  border-color: var(--amber-500);
  color: var(--amber-200);
}

.btn--ghost:hover {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: var(--ink-950);
}

.btn--solid {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: var(--ink-950);
}

.btn--solid:hover {
  background: var(--amber-200);
  border-color: var(--amber-200);
  color: var(--ink-950);
}

.btn--quiet {
  border-color: var(--blue-500);
  color: var(--on-dark);
}

.btn--quiet:hover {
  border-color: var(--celadon-200);
  color: var(--celadon-200);
}

.btn--outline {
  border-color: var(--ink-700);
  color: var(--ink-900);
}

.btn--outline:hover {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--paper-050);
}

/* ---------- 8. 页头：状态条 ---------- */
.site-header {
  position: relative;
  z-index: 60;
  background: var(--ink-900);
  color: var(--on-dark);
}

.status-strip {
  background: var(--ink-950);
  border-bottom: 1px solid var(--ink-700);
}

.status-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  padding-block: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.status-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--on-dark);
}

.status-strip__item--muted { color: var(--on-dark-dim); }

/* ---------- 9. 页头：品牌行 ---------- */
.masthead { position: relative; }

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.masthead__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.brand { min-width: 0; }

.brand__name {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--paper-050);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.brand__name:hover { color: var(--amber-200); }

.brand__index {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--on-dark-soft);
}

.masthead__cta { display: none; }

.nav-toggle {
  position: relative;
  z-index: 140;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--blue-500);
  background: transparent;
  color: var(--on-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.nav-toggle:hover { border-color: var(--amber-500); color: var(--amber-200); }

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

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  transition: transform var(--dur-base) var(--ease);
}

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { bottom: 0; }

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

/* ---------- 10. 页头：导航 ---------- */
.site-nav { display: block; }

.site-nav__top { display: none; }

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 24px;
  list-style: none;
}

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

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  color: rgba(244, 246, 245, 0.78);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--amber-500);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-base) var(--ease);
}

.site-nav__link:hover { color: var(--paper-050); }
.site-nav__link:hover::after { transform: scaleX(1); }

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

.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- 11. 页头：12 格刻度 ---------- */
.masthead__scale {
  height: 10px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--ink-line) 0 1px,
    transparent 1px calc(100% / 12)
  );
  opacity: 0.9;
}

/* ---------- 12. 页脚 ---------- */
.site-footer {
  background: var(--ink-950);
  color: var(--on-dark);
  border-top: 1px solid var(--ink-700);
  padding-block: 56px 26px;
}

.site-footer__grid {
  display: grid;
  gap: 40px;
}

.site-footer__name {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--paper-050);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.site-footer__name:hover { color: var(--amber-200); }

.site-footer__index {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--on-dark-soft);
}

.site-footer__note {
  margin-top: 18px;
  max-width: 36em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--on-dark-dim);
}

.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.footer-col__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.1em;
  color: var(--amber-200);
}

.footer-col__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
  font-size: 14px;
  line-height: 1.5;
}

.footer-col__list a {
  color: rgba(244, 246, 245, 0.78);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.footer-col__list a:hover { color: var(--amber-500); }

.footer-col__list--plain li {
  color: var(--on-dark-dim);
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.footer-col__list--plain a {
  color: var(--celadon-200);
  text-decoration: none;
}

.footer-col__list--plain a:hover { color: var(--amber-500); }

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 28px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-700);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  color: var(--on-dark-soft);
}

.site-footer__legal { color: var(--on-dark-dim); }
.site-footer__base-note { color: var(--on-dark-soft); }

/* ---------- 13. 面包屑 ---------- */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--slate-600);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  list-style: none;
}

.breadcrumbs__item { display: inline-flex; align-items: center; gap: 10px; }

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

.breadcrumbs__item a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

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

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

/* ---------- 14. 章节头 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  color: var(--amber-500);
}

.eyebrow::before {
  content: "";
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
}

.section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 18px;
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line-300);
}

.section-head__num {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--blue-500);
}

.section-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  line-height: 1.2;
}

/* ---------- 15. 正文容器 ---------- */
.prose {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-900);
}

.prose > * + * { margin-top: 1em; }

.prose h2 {
  margin-top: 1.9em;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 600;
}

.prose h3 {
  margin-top: 1.5em;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
  list-style: disc;
}

.prose ol { list-style: decimal; }

.prose li + li { margin-top: 0.4em; }

.prose code {
  padding: 1px 6px;
  background: var(--white-000);
  border: 1px solid var(--line-300);
  color: var(--ink-700);
}

/* ---------- 16. 栅格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  grid-template-columns: minmax(0, 1fr);
}

.grid--tight { gap: clamp(10px, 1.2vw, 14px); }

@media (min-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 17. 图文容器基础规则 ---------- */
.figure-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ink-900);
  border: 1px solid var(--line-300);
}

.figure-frame > img,
.figure-frame > svg,
.figure-frame > picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure-frame--wide { aspect-ratio: 21 / 9; }
.figure-frame--tall { aspect-ratio: 4 / 5; }
.figure-frame--square { aspect-ratio: 1 / 1; }

.figure-frame--grid {
  background-color: var(--ink-900);
  background-image:
    linear-gradient(var(--ink-700) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-700) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- 18. 滚动进度线 ---------- */
.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 300;
  background: var(--amber-500);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* ---------- 19. 进入视区 ========== */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}

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

/* ---------- 20. 标签页基础 ---------- */
[data-tabs] [data-tab] {
  cursor: pointer;
}

[data-tabs] [data-tab][aria-selected="true"] {
  color: var(--ink-950);
  font-weight: 700;
}

[data-tabs] [data-panel] {
  animation: panel-in var(--dur-base) var(--ease) both;
}

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

/* ---------- 21. 断点：平板 ---------- */
@media (min-width: 768px) {
  .status-strip__inner { font-size: 12px; }
  .masthead__inner { padding-block: 22px; }
  .site-footer { padding-block: 64px 30px; }
}

/* ---------- 22. 断点：桌面 ---------- */
@media (min-width: 960px) {
  .masthead__inner {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    align-items: end;
    gap: 32px;
    padding-block: 26px 22px;
  }

  .masthead__cta { display: inline-flex; }

  .nav-toggle { display: none; }

  .site-footer__grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 48px;
  }

  .site-footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
}

/* ---------- 23. 断点：窄屏抽屉导航 ---------- */
@media (max-width: 959px) {
  .masthead__actions { gap: 12px; }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px));
    background: var(--ink-950);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      opacity var(--dur-base) var(--ease),
      transform var(--dur-base) var(--ease),
      visibility var(--dur-base) linear;
  }

  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--ink-700);
  }

  .site-nav__crumb {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.08em;
    color: var(--on-dark-dim);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
  }

  .site-nav__item { border-bottom: 1px solid var(--ink-700); }

  .site-nav__link {
    display: block;
    padding: 18px 0;
    font-size: 16px;
    letter-spacing: 0.1em;
    color: var(--on-dark);
  }

  .site-nav__link::after { display: none; }

  .site-nav__link[aria-current="page"] {
    color: var(--amber-500);
    padding-left: 14px;
    box-shadow: inset 2px 0 0 var(--amber-500);
  }
}

@media (max-width: 519px) {
  .site-footer__cols { grid-template-columns: minmax(0, 1fr); }
  .site-footer__base { flex-direction: column; align-items: flex-start; }
}

/* ---------- 24. 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
  .site-nav { transition: none; }
}
