/* ==========================================================================
   地理网站 · 主样式表
   设计语言参考 nasa.gov：高对比黑白、NASA 红点缀、粗体紧凑标题、
   满幅影像 Hero、无圆角的硬朗卡片。

   章节
     1  设计变量        7  卡片与栅格        13 订阅条
     2  基础重置        8  数据带            14 页脚
     3  容器与版式      9  页面头部 / 子导航  15 地图浏览区（天地图）
     4  顶栏 + 主菜单  10  工具条            16 动效与打印
     5  搜索抽屉       11  列表与表格        17 响应式
     6  按钮 / 标签    12  占位骨架 / 步骤
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 色彩 */
  --black: #000000;
  --ink: #101317;
  --ink-2: #1d2126;
  --gray-900: #22262b;
  --gray-700: #4a5058;
  --gray-500: #7b828c;
  --gray-300: #d5d9de;
  --gray-200: #e5e8ec;
  --gray-100: #f2f4f6;
  --white: #ffffff;

  --red: #f64137;          /* NASA 红 */
  --red-dark: #d3312a;
  --blue: #0b3d91;         /* NASA 蓝 */
  --blue-bright: #1a6fe8;
  --cyan: #4fd2ff;
  --gold: #f5b335;

  --line: rgba(255, 255, 255, 0.16);
  --line-dark: rgba(0, 0, 0, 0.12);

  /* 排版 */
  --font-display: "Helvetica Neue", Helvetica, "Arial Narrow", Arial,
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 尺寸 */
  --header-h: 74px;
  --shell: 1400px;
  --pad: clamp(20px, 4vw, 56px);
  --bar-h: 34px;
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

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

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

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

[hidden] {
  display: none !important;
}

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

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

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

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

/* 默认焦点环用青色：在深色底（header / hero / pagehead / 页脚 / 地图）上对比足够；
   浅色背景区域单独换成 NASA 红，避免青色在白底上看不清。 */
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.section :focus-visible,
.section--alt :focus-visible,
.site-footer :focus-visible,
.subnav :focus-visible,
.mappanel :focus-visible {
  outline-color: var(--red);
}

.gsp-viewer :focus-visible {
  outline-color: var(--white);
}

::selection {
  background: var(--red);
  color: var(--white);
}

/* ---------- 3. 容器与版式 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--pad);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: var(--red);
  color: var(--white);
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
}

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

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.h2 {
  font-size: clamp(28px, 3.6vw, 52px);
}

.h3 {
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.2;
}

.lede {
  font-size: clamp(16px, 1.2vw, 19px);
  color: var(--gray-700);
  max-width: 62ch;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
}

.eyebrow::after {
  content: "";
  flex: 0 0 auto;
  width: clamp(28px, 6vw, 76px);
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.section {
  padding: clamp(56px, 8vw, 112px) 0;
}

/* 窄屏兜底：任何超长英文/URL 都不把版心撑破 */
.section,
.mapframe,
.mappanel {
  overflow-wrap: anywhere;
}

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

.section--alt {
  background: var(--gray-100);
}

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

.section--dark .lede {
  color: rgba(255, 255, 255, 0.76);
}

.section--dark .eyebrow {
  color: var(--cyan);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 56px);
}

.section-head > div > .eyebrow {
  margin-bottom: 14px;
}

/* 卡片内的等宽小标签 */
.card__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-500);
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---------- 4. 顶栏 + 主菜单 ---------- */
.microbar {
  background: var(--black);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.microbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--bar-h);
}

.microbar__links a {
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.15s ease;
}

.microbar__links a:hover {
  color: var(--white);
}

.microbar > .shell > span {
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line-dark);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand__mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.brand__text {
  display: grid;
  gap: 1px;
}

.brand__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.nav {
  margin-left: auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 36px);
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 26px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-700);
  transition: color 0.15s ease;
}

.nav__link:hover {
  color: var(--ink);
}

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

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--red);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  transition: color 0.15s ease, background 0.15s ease;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  color: var(--red);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 20px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
}

/* ---------- 5. 搜索抽屉 ---------- */
.search-panel {
  display: none;
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid var(--line);
}

.search-panel.is-open {
  display: block;
}

.search-panel__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.search-panel input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  color: var(--white);
  font-size: 16px;
  outline: none;
}

.search-panel input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.search-panel input:focus {
  border-bottom-color: var(--cyan);
}

/* ---------- 6. 按钮 / 标签 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn__arrow {
  font-size: 15px;
  transition: transform 0.15s ease;
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.btn--ghost-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--white);
}

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

.btn--dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.btn--dark:hover {
  background: var(--red);
  border-color: var(--red);
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-700);
  white-space: nowrap;
}

.tag--red {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(88vh, 860px);
  padding: clamp(72px, 10vw, 130px) 0 clamp(56px, 7vw, 88px);
  color: var(--white);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: -2%;
  z-index: -2;
  background-image: image-set(
    url("../images/hubble-pillars-hero.webp") type("image/webp"),
    url("../images/hubble-pillars-hero.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center;
  animation: heroDrift 48s ease-in-out infinite alternate;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.62) 0%,
      rgba(0, 0, 0, 0.35) 42%,
      rgba(0, 0, 0, 0.86) 100%
    ),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.1) 62%);
}

@keyframes heroDrift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.09) translate3d(-1.4%, -1.2%, 0);
  }
}

.hero__inner {
  position: relative;
  max-width: 940px;
}

.hero__tag {
  display: inline-block;
  margin: 0 0 24px;
  padding: 9px 14px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0 0 26px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}

.hero__sub {
  max-width: 56ch;
  margin: 0 0 34px;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.86);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 48px);
  margin-top: clamp(44px, 6vw, 82px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.meta-item__k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.meta-item__v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(17px, 1.7vw, 24px);
  letter-spacing: -0.01em;
}

.hero__credit {
  position: absolute;
  right: var(--pad);
  bottom: 18px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- 7b. 卡片与栅格 ---------- */
.grid {
  display: grid;
  gap: clamp(18px, 2vw, 28px);
}

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

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

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

.grid--viewer {
  grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr);
  align-items: start;
}

/* 入口卡（首页三大板块） */
.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 420px;
  padding: 30px 28px 32px;
  color: var(--white);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.entry__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transform: scale(1.001);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.entry::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.55) 52%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

.entry:hover .entry__media {
  transform: scale(1.06);
}

.entry__index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin: 0 0 10px;
}

.entry__title {
  font-size: clamp(26px, 2.6vw, 38px);
  margin-bottom: 12px;
}

.entry__desc {
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 18px;
}

.entry__cta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
}

.entry:hover .entry__cta {
  color: var(--cyan);
}

/* 内容卡 */
.card {
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  background: var(--white);
  border: 1px solid var(--line-dark);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.card__kicker + .card__title {
  margin-top: 10px;
}

.card__title {
  font-size: 21px;
  margin-bottom: 10px;
}

.card__text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--gray-700);
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* 图集卡（图片 + 文本） */
.tile {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line-dark);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.tile__media {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}

.tile__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 22px 20px;
}

.tile__title {
  font-size: 19px;
  margin: 12px 0 8px;
}

.tile__text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
}

.tile .card__foot {
  padding-top: 18px;
}

/* 文字按钮 / 下载链接：方角、下划线、红色悬停 */
.linkbtn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

.tile .card__foot .linkbtn + .linkbtn {
  margin-left: 4px;
}

/* ---------- 7c. 标准地图卡片与大图查看器 ---------- */
/* 地图不能裁：用 contain 完整显示图廓、图例与审图号，深色底补满 16:9 画框 */
.tile__media--map {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0d1b2a, #060a12);
}

.tile__media--map picture,
.tile__media--map img {
  display: block;
  width: 100%;
  height: 100%;
}

.tile__media--map img {
  object-fit: contain;
}

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

.gsp-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
}

.gsp-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, 0.9);
  backdrop-filter: blur(2px);
}

.gsp-viewer__box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(1500px, 100%);
  /* 用确定高度而不是 max-height:100%：查看器是 grid 容器，百分比 max-height 在
     这一层解析不出确定值，会让整个盒子按内容塌缩。 */
  height: min(100%, 900px);
  min-height: 0;
  margin: 0;
}

.gsp-viewer__img {
  display: block;
  width: 100%;
  /* 高度必须撑满舞台：否则舞台高度会被图片自身布局高度（宽 × 固有比例）撑开，
     JS 里用 stage.clientHeight 算平移边界就会偏大，能把图拖出空白。 */
  height: 100%;
  object-fit: contain;
  background: var(--white);
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  /* 滚轮缩放靠 transform，原点设在左上角，缩放锚点由 JS 计算 */
  transform-origin: 0 0;
  will-change: transform;
}

/* 图片舞台：裁掉放大后溢出的部分，并作为拖动平移的命中区。
   flex-basis 必须是 0（不能是 auto）——用 auto 时舞台高度会被图片的固有宽高比撑开，
   标题栏被挤出视口；height:0 配合 flex-grow 让它只占「剩余空间」。 */
.gsp-viewer__stage {
  position: relative;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.gsp-viewer.is-zoomed .gsp-viewer__stage {
  cursor: grab;
  touch-action: none;
}

.gsp-viewer.is-panning .gsp-viewer__stage {
  cursor: grabbing;
}

/* 缩放工具条 */
.gsp-viewer__tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gsp-viewer__btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.15s ease;
}

.gsp-viewer__btn:hover {
  background: var(--red);
  border-color: var(--red);
}

.gsp-viewer__btn--wide {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.gsp-viewer__zoom {
  min-width: 4.4em;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.gsp-viewer__cap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--white);
  font-size: 14px;
}

.gsp-viewer__cap strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(15px, 1.6vw, 20px);
}

.gsp-viewer__cap span:not(.toolbar__spacer) {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
}

.gsp-viewer__close {
  position: absolute;
  top: -14px;
  right: -8px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  color: var(--white);
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.15s ease;
}

.gsp-viewer__close:hover {
  background: var(--red);
}

/* ---------- 8. 数据带 ---------- */
.stats {
  background: var(--white);
  border-bottom: 1px solid var(--line-dark);
}

.stats__inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 var(--pad);
}

.stat {
  padding: clamp(24px, 3vw, 40px) clamp(12px, 2vw, 30px);
  border-left: 1px solid var(--line-dark);
}

.stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat__label {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* ---------- 9. 页面头部（内页） ---------- */
.pagehead {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(66vh, 560px);
  padding: clamp(56px, 7vw, 96px) 0 clamp(36px, 4vw, 56px);
  color: var(--white);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.pagehead__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
}

.pagehead__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.42) 55%,
    rgba(0, 0, 0, 0.92) 100%
  );
}

.pagehead__inner {
  position: relative;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.crumbs a {
  color: rgba(255, 255, 255, 0.62);
}

.crumbs a:hover {
  color: var(--white);
}

.pagehead .eyebrow {
  color: var(--red);
}

.pagehead__title {
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.98;
  margin: 0 0 22px;
}

.pagehead__sub {
  max-width: 60ch;
  font-size: clamp(15px, 1.15vw, 17.5px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.84);
  margin: 0;
}

/* 内页子导航 */
.subnav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--white);
  border-bottom: 1px solid var(--line-dark);
}

.subnav__list {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2.6vw, 40px);
}

.subnav__link {
  position: relative;
  display: inline-block;
  padding: 20px 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gray-500);
  transition: color 0.15s ease;
}

.subnav__link:hover {
  color: var(--ink);
}

.subnav__link[aria-current="page"] {
  color: var(--red);
}

.subnav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--red);
}

/* ---------- 10. 工具条（筛选 / 搜索） ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-dark);
  margin-bottom: 34px;
}

.toolbar__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-right: 6px;
}

.chip {
  padding: 9px 16px;
  border: 1px solid var(--line-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gray-700);
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-dark);
  padding: 8px 14px;
  min-width: 240px;
  flex: 0 1 320px;
}

.field svg {
  width: 16px;
  height: 16px;
  color: var(--gray-500);
  flex: 0 0 auto;
}

.field input {
  border: 0;
  outline: none;
  font: inherit;
  font-size: 14px;
  width: 100%;
  min-width: 0;
  background: transparent;
}

.toolbar__spacer {
  flex: 1 1 auto;
}

/* ---------- 11. 列表 / 表格（题目汇总骨架） ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-dark);
}

.data {
  width: 100%;
  min-width: 720px;
  font-size: 14px;
}

.data thead th {
  background: var(--ink);
  color: var(--white);
  text-align: left;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data tbody td {
  padding: 15px 18px;
  border-top: 1px solid var(--line-dark);
  vertical-align: middle;
}

.data tbody tr:first-child td {
  border-top: 0;
}

.data tbody tr:hover td {
  background: var(--gray-100);
}

.data tbody td:first-child {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--gray-700);
  white-space: nowrap;
}

.table-empty {
  padding: 34px 18px !important;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gray-500);
}

.form-hint {
  margin-top: 14px;
  font-size: 12.5px;
}

/* ---------- 12. 占位骨架 / 步骤 ---------- */
.skeleton {
  height: 12px;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    var(--gray-200) 0%,
    var(--gray-100) 50%,
    var(--gray-200) 100%
  );
  background-size: 200% 100%;
  animation: skeleton 1.6s ease-in-out infinite;
}

@keyframes skeleton {
  from {
    background-position: 0% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.placeholder-note {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  font-size: 14.5px;
  color: var(--gray-700);
}

.placeholder-note > span {
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1.2;
  color: var(--red);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-dark);
}

.step {
  position: relative;
  padding: 28px 24px 28px 0;
  border-right: 1px solid var(--line-dark);
}

.step:last-child {
  border-right: 0;
}

.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 46px;
  height: 3px;
  background: var(--red);
}

.step__title {
  font-size: 18px;
  margin-bottom: 10px;
}

.step__text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
}

.section--alt .step::before {
  background: var(--red);
}

/* ---------- 13. 订阅条 ---------- */
.cta-band {
  background: var(--ink);
  color: var(--white);
  padding: clamp(44px, 6vw, 76px) 0;
}

.cta-band__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.cta-band__title {
  font-size: clamp(26px, 3vw, 42px);
  margin-bottom: 12px;
}

.cta-band__text {
  color: rgba(255, 255, 255, 0.76);
  font-size: 15.5px;
  max-width: 52ch;
}

.subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.subscribe input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--white);
  outline: none;
}

.subscribe input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.subscribe input[type="email"]:focus {
  border-color: var(--cyan);
}

/* ---------- 14. 页脚 ---------- */
.site-footer {
  background: var(--black);
  color: rgba(255, 255, 255, 0.72);
  padding: clamp(44px, 6vw, 74px) 0 30px;
  font-size: 14px;
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.site-footer__brandline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.site-footer h4 {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
}

.site-footer ul {
  display: grid;
  gap: 10px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: var(--white);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}

.site-footer__bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* ---------- 15. 地图浏览区（天地图） ---------- */
.mapframe {
  border: 1px solid var(--line-dark);
  background: var(--ink);
}

.mapframe__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-dark);
}

/* 窄屏时比例尺说明可以换行，避免把画布宽度撑出去 */
.mapframe__bar > *,
.mapframe__foot > * {
  min-width: 0;
}

.mapframe__map {
  position: relative;
  /* 注意：这里不能加 min-height —— 一旦同时有 aspect-ratio 与最小高度，
     浏览器会反过来用高度推算宽度（320px × 16/9 = 569px），把窄屏页面撑宽。 */
  aspect-ratio: 16 / 9;
  min-height: 0;
  background:
    radial-gradient(120% 100% at 20% 10%, #12233d 0%, #060a12 70%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 48px 48px;
}

/* Leaflet 需要容器自身有确定尺寸 */
.mapframe__map.leaflet-container {
  display: block;
  font-family: var(--font-body);
  background: #060a12;
}

.mapframe__map.gsp-canvas--offline::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 500;
  background: rgba(6, 10, 18, 0.55);
  pointer-events: none;
}

.gsp-fallback {
  position: absolute;
  inset: 0;
  z-index: 600;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.78);
}

.gsp-fallback__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.gsp-fallback__text {
  margin: 0;
  font-size: 13px;
  max-width: 42ch;
}

.mapframe__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #060a12;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.mapframe__coords {
  color: var(--cyan);
  min-width: 20ch;
}

.mapframe__status[data-state="online"] {
  color: #6ee7a8;
}

.mapframe__status[data-state="warn"] {
  color: var(--gold);
}

.mapframe__status[data-state="error"] {
  color: var(--red);
}

/* 图层面板 */
.mappanel {
  border: 1px solid var(--line-dark);
  padding: 22px 20px;
}

.mappanel__group + .mappanel__group {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
}

.mappanel__note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--gray-500);
}

.mappanel__note code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--gray-100);
  padding: 1px 4px;
}

.mappanel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mappanel__chips .chip {
  padding: 7px 12px;
  font-size: 12px;
}

.gsp-radio,
.gsp-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
}

.gsp-radio input,
.gsp-check input {
  margin: 3px 0 0;
  accent-color: var(--red);
  flex: 0 0 auto;
}

.gsp-radio__body,
.gsp-check__body {
  display: grid;
  gap: 2px;
}

.gsp-radio__name,
.gsp-check__name {
  font-weight: 700;
  color: var(--ink);
}

.gsp-radio__desc,
.gsp-check__desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Leaflet 控件配色（深色画布上保持对比度） */
.mapframe__map .leaflet-control-zoom a {
  background: rgba(16, 19, 23, 0.92);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.mapframe__map .leaflet-control-zoom a:hover {
  background: var(--red);
  color: #fff;
}

.mapframe__map .leaflet-control-scale-line,
.mapframe__map .leaflet-control-attribution {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.mapframe__map .leaflet-control-scale-line {
  background: rgba(16, 19, 23, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-top: 0;
}

.mapframe__map .leaflet-control-attribution {
  background: rgba(16, 19, 23, 0.7);
  color: rgba(255, 255, 255, 0.7);
}

.mapframe__map .leaflet-control-attribution a {
  color: var(--cyan);
}

/* 经纬网 canvas 层：只保留线条与标注，不拦截鼠标 */
.mapframe__map .gsp-graticule-layer canvas,
.mapframe__map .gsp-graticule {
  pointer-events: none;
}

/* 天地图瓦片：避免拖拽时出现半透明接缝 */
.mapframe__map .gsp-tiles {
  image-rendering: auto;
}

/* ---------- 16. 动效与打印 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 无 JS（或脚本加载失败）时不做隐藏，保证内容始终可见 */
.no-js .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }

  .hero__media,
  .skeleton {
    animation: none;
  }

  .entry__media,
  .card,
  .tile,
  .btn__arrow {
    transition: none;
  }
}

@media print {
  .site-header,
  .microbar,
  .subnav,
  .cta-band,
  .gsp-viewer,
  .hero__actions {
    display: none !important;
  }

  .hero,
  .pagehead {
    color: #000;
    background: none;
  }

  .hero__media,
  .pagehead__media,
  .hero__scrim,
  .pagehead__scrim {
    display: none;
  }
}

/* ---------- 17. 响应式 ---------- */
@media (max-width: 1180px) {
  .microbar > .shell > span {
    display: none;
  }
}

@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    margin: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.12);
  }

  .nav.is-open {
    display: block;
  }

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

  .nav__link {
    display: block;
    padding: 18px var(--pad);
    border-top: 1px solid var(--line-dark);
    letter-spacing: 0.16em;
  }

  .nav__link[aria-current="page"]::after {
    left: 0;
    right: auto;
    width: 4px;
    height: auto;
    top: 0;
    bottom: 0;
  }

  .subnav {
    position: static;
  }
}

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

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

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

  .step:nth-child(2n) {
    border-right: 0;
  }

  .cta-band__inner,
  .site-footer__top {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__top {
    gap: 34px;
  }

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

  .stat:nth-child(odd) {
    border-left: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line-dark);
  }
}

@media (max-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }
}

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

  .hero__meta {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero {
    min-height: 0;
  }
}

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

  .steps {
    grid-template-columns: 1fr;
  }

  .step {
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
    padding: 24px 0;
  }

  .step:last-child {
    border-bottom: 0;
  }

  .microbar {
    font-size: 11px;
  }

  .brand__mark {
    width: 32px;
    height: 32px;
  }

  .brand__title {
    font-size: 17px;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

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