/* ============================================================
   优发国际指南 — 共享站点样式 /assets/site.css
   档案室 × 信号塔：深靛蓝档案底、荧光青索引、琥珀批次脉冲
   ============================================================ */

:root {
  /* 色彩 */
  --indigo-900: #0B1736;
  --indigo-700: #132A5E;
  --cyan: #00E5FF;
  --amber: #FFB020;
  --paper: #F4F0E6;
  --mist: #E7ECF2;
  --ink: #101828;
  --white: #FFFFFF;
  --slate: #5B677A;
  --teal: #006B7A;

  /* 语义 */
  --bg: var(--paper);
  --fg: var(--ink);
  --line: rgba(16, 24, 40, 0.14);
  --line-strong: rgba(16, 24, 40, 0.3);
  --line-dark: rgba(0, 229, 255, 0.25);

  /* 字体 */
  --font-display: "Archivo Narrow", "Arial Narrow", "Helvetica Neue", Impact,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 尺度 */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 0px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-tone="cool"] { background: var(--mist); }
body[data-tone="paper"] { background: var(--paper); }

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
hr { border: 0; }
::selection { background: var(--cyan); color: var(--indigo-900); }

/* ---------- 中文排版与标题 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--indigo-900);
}

h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.12rem, 1.9vw, 1.42rem); line-height: 1.28; letter-spacing: -0.005em; }
h4 { font-size: 1.05rem; line-height: 1.35; letter-spacing: 0; }

p { text-wrap: pretty; }

/* ---------- 焦点与可访问性 ---------- */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.site-header :focus-visible,
.site-footer :focus-visible,
.on-dark :focus-visible,
.to-top:focus-visible { outline-color: var(--cyan); }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.5rem;
  z-index: 200;
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--cyan);
  color: var(--indigo-900);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ============================================================
   页头
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background-color: var(--indigo-900);
  background-image: linear-gradient(90deg, rgba(0, 229, 255, 0.07) 1px, transparent 1px);
  background-size: 96px 100%;
  color: var(--white);
  border-bottom: 1px solid var(--line-dark);
}

.header-batchbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.42rem var(--gutter);
  background: var(--indigo-700);
  border-bottom: 1px solid rgba(0, 229, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.66);
}

.batchbar-label {
  color: var(--cyan);
  flex: 0 0 auto;
}

.batchbar-note {
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batchbar-signal {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: signal-pulse 2.4s ease-out infinite;
}

@keyframes signal-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 176, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0); }
}

.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding: 0.85rem var(--gutter) 1rem;
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--cyan);
  transform: rotate(45deg);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--cyan);
}

.brand-text {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
  letter-spacing: 0.015em;
  white-space: nowrap;
  color: var(--white);
}

.batch-tag {
  display: inline-block;
  flex: 0 0 auto;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand-batch { margin-left: 0.1rem; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.7rem;
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.nav-toggle:hover { background: rgba(0, 229, 255, 0.12); }

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
}
.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 2.2vw, 2rem);
  min-width: 0;
}

.nav-index {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 1.6vw, 1.5rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-index a {
  position: relative;
  display: inline-block;
  padding: 0.45rem 0;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-index a:hover,
.nav-index a:focus-visible {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
.nav-index a[aria-current="page"] {
  color: var(--white);
  border-bottom-color: var(--amber);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn-signal {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--indigo-900);
  font-weight: 700;
}
.btn-signal:hover,
.btn-signal:focus-visible {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--indigo-900);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--white);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
}

.nav-subscribe { flex: 0 0 auto; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  position: relative;
  background-color: var(--indigo-900);
  background-image: radial-gradient(circle at 10% 0%, rgba(0, 229, 255, 0.14), transparent 46%);
  color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--line-dark);
  padding: clamp(2.4rem, 6vw, 4.2rem) 0 0;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  width: min(1240px, 100% - clamp(2.5rem, 8vw, 6rem));
  margin-inline: auto;
  padding-bottom: clamp(2rem, 5vw, 3.4rem);
}

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

.footer-col-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  font-size: 1.24rem;
  letter-spacing: 0.015em;
  color: var(--white);
}
.footer-brand:hover { color: var(--cyan); }

.batch-tag--dark {
  color: var(--amber);
  border-color: rgba(255, 176, 32, 0.5);
  background: rgba(255, 176, 32, 0.14);
}

.footer-note {
  max-width: 34ch;
  padding-left: 0.8rem;
  border-left: 2px solid rgba(0, 229, 255, 0.35);
  font-size: 13.5px;
  line-height: 1.72;
  color: rgba(255, 255, 255, 0.6);
}

.footer-title {
  margin-bottom: 0.95rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.2em;
  color: var(--cyan);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
}
.footer-list a {
  display: inline-block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.74);
  transition: color 0.18s ease;
}
.footer-list a:hover,
.footer-list a:focus-visible { color: var(--cyan); }

.footer-contact {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.54);
  word-break: break-word;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.1rem var(--gutter);
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.52);
}
.footer-legal { margin: 0; }

/* ============================================================
   通用容器与排版工具
   ============================================================ */
.wrap {
  width: min(1240px, 100% - clamp(2.5rem, 8vw, 6rem));
  margin-inline: auto;
}
.wrap--narrow { width: min(760px, 100% - clamp(2.5rem, 8vw, 6rem)); }

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

.on-dark {
  background-color: var(--indigo-900);
  background-image: linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 120px 100%;
  color: rgba(255, 255, 255, 0.82);
}
.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4 { color: var(--white); }

.section-label {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.22em;
  color: var(--teal);
}
.on-dark .section-label { color: var(--cyan); }

.lede {
  max-width: 60ch;
  font-size: clamp(1.04rem, 1.5vw, 1.26rem);
  line-height: 1.72;
  color: var(--slate);
}
.on-dark .lede { color: rgba(255, 255, 255, 0.74); }

.rule {
  height: 1px;
  margin-block: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--line);
  border: 0;
}
.on-dark .rule { background: rgba(0, 229, 255, 0.22); }

.prose { max-width: 68ch; }
.prose p + p { margin-top: 1em; }
.prose a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--indigo-900); }

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 2rem);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.grid-offset {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.grid-offset--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

/* ---------- 卡片与标签 ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: clamp(1.1rem, 2.4vw, 1.7rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover,
.card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(11, 23, 54, 0.1);
  border-left-color: var(--amber);
}

.card--dark {
  background: var(--indigo-700);
  border-color: rgba(0, 229, 255, 0.22);
  border-left-color: var(--cyan);
  color: rgba(255, 255, 255, 0.8);
}
.card--dark h3,
.card--dark h4 { color: var(--white); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.5rem;
  background: var(--mist);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.on-dark .tag {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.35);
  color: var(--cyan);
}

/* ---------- 图片容器 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--indigo-700), var(--indigo-900));
  border: 1px solid var(--line-dark);
}
.media-frame > img,
.media-frame > picture,
.media-frame > svg,
.media-frame > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.4;
}
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ---------- 面包屑 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--slate);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.45rem;
  color: var(--slate);
  opacity: 0.55;
}
.breadcrumb a { color: var(--teal); }
.breadcrumb a:hover { color: var(--indigo-900); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* ---------- 章节目录 ---------- */
.toc {
  padding: 1rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--line);
}
.toc-title {
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--slate);
}
.toc ul,
.toc ol {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.toc a {
  display: block;
  padding: 0.4rem 0.2rem 0.4rem 0.8rem;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--slate);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.toc a:hover {
  color: var(--teal);
  border-left-color: rgba(0, 107, 122, 0.5);
}
.toc a[aria-current="true"] {
  color: var(--indigo-900);
  font-weight: 600;
  border-left-color: var(--cyan);
  background: rgba(0, 229, 255, 0.1);
}

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.66rem 0.9rem;
  background: var(--indigo-900);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s,
    background 0.18s ease, color 0.18s ease;
}
.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover { background: var(--cyan); color: var(--indigo-900); }
.to-top-arrow { font-size: 13px; line-height: 1; }
.to-top-text { white-space: nowrap; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1140px) {
  .brand-batch { display: none; }
  .nav-index { gap: 0.8rem; }
  .nav-index a { font-size: 13px; }
  .nav-subscribe { padding: 0.62rem 0.85rem; }
}

@media (max-width: 940px) {
  .header-main {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding-block: 0.75rem 0.85rem;
  }

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

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.9rem;
    padding: 0 var(--gutter);
    background-color: var(--indigo-900);
    background-image: linear-gradient(90deg, rgba(0, 229, 255, 0.07) 1px, transparent 1px);
    background-size: 96px 100%;
    border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 26px 48px rgba(4, 10, 26, 0.5);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.32s ease, opacity 0.24s ease, padding 0.32s ease,
      visibility 0.32s;
  }

  .site-nav[data-open] {
    max-height: min(78vh, 580px);
    overflow-y: auto;
    padding: 1rem var(--gutter) 1.6rem;
    visibility: visible;
    opacity: 1;
  }

  .nav-index {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
  }
  .nav-index li + li { border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .nav-index a {
    display: block;
    padding: 0.85rem 0;
    font-size: 15px;
    border-bottom: 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
  }
  .nav-index a:hover,
  .nav-index a:focus-visible {
    border-bottom-color: transparent;
    border-left-color: var(--cyan);
  }
  .nav-index a[aria-current="page"] {
    border-bottom-color: transparent;
    border-left-color: var(--amber);
    color: var(--white);
  }

  .nav-subscribe {
    width: 100%;
    justify-content: center;
    padding-block: 0.8rem;
  }

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

@media (max-width: 620px) {
  html { scroll-padding-top: 96px; }
  h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
  .batchbar-note { letter-spacing: 0.08em; }
  .brand-text { font-size: 1rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.9rem; }
  .footer-base { flex-direction: column; font-size: 11px; }
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .to-top { padding: 0.6rem 0.7rem; }
}

@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;
    scroll-behavior: auto !important;
  }
  .batchbar-signal { animation: none; box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.25); }
}
