/* ==========================================================================
   淄博实验中学 · 蹭饭地图   ——   样式表
   --------------------------------------------------------------------------
   目录：
     01  设计变量 / 主题
     02  基础重置
     03  通用组件（按钮 / 标签 / 卡片 / 表单）
     04  顶部导航
     05  首屏 Hero
     06  统计条
     07  区块标题
     08  方块地图
     09  城市榜
     10  筛选工具栏
     11  同学名录
     12  关于区块
     13  页脚
     14  弹层 / 表单
     15  提示条 / 空状态
     16  动画
     17  响应式
   ========================================================================== */

/* ============================================================ 01 设计变量 */
:root {
  /* 主色：校园红砖 + 秋日暖金 + 深夜藏蓝 */
  --brick: #b4432f;
  --brick-deep: #8f3222;
  --gold: #d99a2b;
  --gold-bright: #f0b445;
  --gold-soft: #f7e2b8;
  --ink: #10203a;
  --ink-2: #1e3252;
  --ink-3: #35507a;
  /* 恒定深色表面：深色模式下也保持深色（页脚 / 深色卡片 / 深色按钮） */
  --ink-solid: #10203a;
  --ink-solid-2: #1e3252;
  --ink-solid-3: #35507a;

  /* 中性色 */
  --paper: #faf7f2;
  --paper-2: #f3eee6;
  --card: #ffffff;
  --text: #1b2430;
  --text-2: #4a5464;
  --muted: #8a8478;
  --line: rgba(27, 36, 48, 0.09);
  --line-strong: rgba(27, 36, 48, 0.16);

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(16, 32, 58, 0.05);
  --shadow-sm: 0 2px 8px rgba(16, 32, 58, 0.06), 0 1px 2px rgba(16, 32, 58, 0.04);
  --shadow-md: 0 10px 30px -12px rgba(16, 32, 58, 0.18), 0 2px 8px rgba(16, 32, 58, 0.05);
  --shadow-lg: 0 30px 70px -30px rgba(16, 32, 58, 0.35), 0 8px 24px -12px rgba(16, 32, 58, 0.18);
  --shadow-gold: 0 12px 28px -12px rgba(217, 154, 43, 0.55);

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong",
    "SimSun", Georgia, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 布局 */
  --wrap: 1180px;
  --header-h: 68px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 深色主题 */
[data-theme="dark"] {
  --paper: #0c1523;
  --paper-2: #111c2d;
  --card: #131f31;
  --text: #e9e7e2;
  --text-2: #b9c2d0;
  --muted: #86909f;
  --line: rgba(233, 231, 226, 0.09);
  --line-strong: rgba(233, 231, 226, 0.18);
  --ink: #e9e7e2;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 34px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 34px 80px -34px rgba(0, 0, 0, 0.9);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 页面底纹：极淡的纸质颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: radial-gradient(currentColor 0.5px, transparent 0.5px);
  background-size: 4px 4px;
  color: var(--text);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* hidden 属性必须压过组件自身的 display */
[hidden] { display: none !important; }

::selection { background: var(--gold-soft); color: var(--ink); }
[data-theme="dark"] ::selection { background: rgba(217, 154, 43, 0.35); color: #fff; }

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

/* 自定义滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 32%, transparent); background-clip: content-box; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
  position: relative;
  z-index: 1;
}

.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;
}

/* ============================================================ 03 通用组件 */

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-full);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease),
    background-color 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.btn-primary {
  --btn-bd: transparent;
  --btn-fg: #2b1c02;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover { box-shadow: 0 16px 34px -14px rgba(217, 154, 43, 0.75); }

.btn-ink {
  --btn-bd: transparent;
  --btn-fg: #fff;
  background: linear-gradient(135deg, var(--ink-solid-3), var(--ink-solid));
  box-shadow: 0 12px 26px -14px rgba(16, 32, 58, 0.7);
}

.btn-ghost {
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep, #a9701a); }

.btn-light {
  --btn-fg: #fff;
  --btn-bd: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}
.btn-light:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.6); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- 小标签 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  background: var(--paper-2);
  color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-gold { background: rgba(217, 154, 43, 0.14); color: #9c6d12; border-color: rgba(217, 154, 43, 0.22); }
.chip-brick { background: rgba(180, 67, 47, 0.1); color: var(--brick); border-color: rgba(180, 67, 47, 0.16); }
.chip-ink { background: rgba(16, 32, 58, 0.07); color: var(--ink-2); }
.chip-line { background: transparent; border-color: var(--line-strong); color: var(--muted); }
[data-theme="dark"] .chip-gold { color: var(--gold-bright); }
[data-theme="dark"] .chip-ink { background: rgba(255, 255, 255, 0.07); color: var(--text-2); }

/* ---------- 通用卡片 ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ============================================================ 04 顶部导航 */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease), backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -20px rgba(16, 32, 58, 0.5);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 100%;
  position: relative;
}

/* 未滚动时（覆盖在照片上）用浅色文字 */
.site-header:not(.is-solid) .brand-name,
.site-header:not(.is-solid) .brand-sub,
.site-header:not(.is-solid) .nav-link { color: #fff; }
.site-header:not(.is-solid) .nav-link:hover { color: var(--gold-soft); }
.site-header:not(.is-solid) .theme-toggle { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  min-width: 0;
}
.brand-mark {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--brick), var(--brick-deep));
  color: #fff;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 6px 16px -8px rgba(180, 67, 47, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  transition: color 0.3s;
  white-space: nowrap;
}
.brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
  transition: color 0.3s;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  position: relative;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-full);
  transition: color 0.2s, background-color 0.2s;
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  width: 0; height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 16px; }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 6px; }

.theme-toggle {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); transform: rotate(-18deg); }
.theme-toggle svg { width: 17px; height: 17px; }

.nav-burger {
  display: none;
  width: 38px; height: 38px;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
}
.nav-burger svg { width: 18px; height: 18px; }

/* ============================================================ 05 首屏 Hero */
.hero {
  position: relative;
  min-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: calc(var(--header-h) + 30px);
  overflow: hidden;
  isolation: isolate;
  background: var(--ink-solid);
}
.hero__media {
  position: absolute;
  inset: -8% 0 -8% 0;
  z-index: -3;
  will-change: transform;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.02);
}
/* 照片压暗 + 暖色调 */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(9, 18, 34, 0.58) 0%, rgba(9, 18, 34, 0.12) 30%, rgba(9, 18, 34, 0.36) 62%, rgba(9, 18, 34, 0.92) 100%),
    linear-gradient(105deg, rgba(9, 18, 34, 0.66) 0%, rgba(9, 18, 34, 0.05) 56%, rgba(180, 67, 47, 0.1) 100%);
}
.hero__scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(125% 85% at 50% 0%, transparent 45%, rgba(6, 12, 24, 0.45) 100%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  padding-bottom: clamp(48px, 8vh, 96px);
  padding-top: clamp(40px, 10vh, 120px);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 7px 16px 7px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12.5px;
  letter-spacing: 0.16em;
}
.hero__eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 4px rgba(240, 180, 69, 0.22);
  animation: pulse 2.6s ease-in-out infinite;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 7.2vw, 5.3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  max-width: 15em;
}
.hero__title .line-2 {
  display: block;
  background: linear-gradient(100deg, #fff 10%, var(--gold-soft) 48%, var(--gold-bright) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero__title .accent { position: relative; white-space: nowrap; }
.hero__title .accent::after {
  content: "";
  position: absolute;
  left: 2%; right: 2%; bottom: 0.12em;
  height: 0.072em;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(240, 180, 69, 0), var(--gold-bright) 30%, var(--gold-bright) 70%, rgba(240, 180, 69, 0));
  opacity: 0.85;
}

.hero__rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 22px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.24em;
}
.hero__rule span { height: 1px; width: 72px; background: linear-gradient(90deg, var(--gold-bright), transparent); }
.hero__rule i {
  width: 5px; height: 5px;
  transform: rotate(45deg);
  background: var(--gold-bright);
  flex: none;
}

.hero__sub {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.8);
  max-width: 34em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
.hero__sub strong { color: #fff; font-weight: 600; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.hero__actions .btn { padding: 14px 28px; font-size: 15px; }

/* 首屏底部统计 */
.hero__stats {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.hero__stats .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
}
.stat {
  padding: 22px 8px 24px;
  text-align: center;
  position: relative;
}
.stat + .stat::before {
  content: "";
  position: absolute;
  left: 0; top: 24%;
  height: 52%;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}
.stat__num {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.stat__num small { font-size: 0.48em; font-weight: 500; margin-left: 3px; opacity: 0.7; }
.stat__label {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.56);
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 136px;
  transform: translateX(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 0.3em;
  gap: 9px;
  pointer-events: none;
}
.hero__scroll .mouse {
  width: 22px; height: 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 99px;
  position: relative;
}
.hero__scroll .mouse::after {
  content: "";
  position: absolute;
  left: 50%; top: 7px;
  width: 3px; height: 7px;
  margin-left: -1.5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.65);
  animation: scrollDot 1.8s ease-in-out infinite;
}

/* ============================================================ 06 统计条 */
.stats-strip {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.stats-strip .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
  flex-wrap: wrap;
}
.strip-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.strip-note svg { width: 15px; height: 15px; color: var(--gold); }
.strip-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================ 07 区块标题 */
.section {
  position: relative;
  padding: clamp(56px, 8vw, 100px) 0;
  z-index: 1;
}
.section--alt { background: var(--paper-2); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(28px, 4vw, 46px);
  flex-wrap: wrap;
}
.section-head__main { max-width: 44em; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.section-title em { font-style: normal; color: var(--brick); }
.section-desc {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-2);
}

/* ============================================================ 08 方块地图 */
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.map-card {
  padding: clamp(14px, 2.4vw, 26px);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(217, 154, 43, 0.07), transparent 55%),
    var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.map-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.legend-scale { display: flex; gap: 3px; }
.legend-scale i {
  width: 18px; height: 10px;
  border-radius: 3px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.legend-scale i.l1 { background: rgba(217, 154, 43, 0.18); }
.legend-scale i.l2 { background: rgba(217, 154, 43, 0.38); }
.legend-scale i.l3 { background: rgba(217, 154, 43, 0.6); }
.legend-scale i.l4 { background: rgba(217, 154, 43, 0.82); }
.legend-scale i.l5 { background: var(--gold); }

.map-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.tilemap {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 6px;
  min-width: 460px;
  aspect-ratio: 8 / 6.9;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--paper-2);
  color: var(--muted);
  cursor: default;
  font: inherit;
  padding: 2px;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
    background-color 0.22s, color 0.22s, border-color 0.22s;
  overflow: hidden;
  min-width: 0;
}
.tile:empty { background: transparent; border-color: transparent; }
.tile__name {
  font-size: clamp(9.5px, 1.05vw, 13px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tile__count {
  font-family: var(--font-serif);
  font-size: clamp(11px, 1.35vw, 16px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  opacity: 0.95;
}
.tile.is-empty .tile__count { opacity: 0.4; font-weight: 400; }

.tile[data-lvl="1"] { background: rgba(217, 154, 43, 0.13); color: #8a5f10; }
.tile[data-lvl="2"] { background: rgba(217, 154, 43, 0.24); color: #7d5510; }
.tile[data-lvl="3"] { background: rgba(217, 154, 43, 0.4); color: #5c3c05; }
.tile[data-lvl="4"] { background: rgba(217, 154, 43, 0.62); color: #452c02; }
.tile[data-lvl="5"] { background: linear-gradient(150deg, var(--gold-bright), var(--gold)); color: #2f1d00; box-shadow: 0 8px 20px -10px rgba(217, 154, 43, 0.9); }
[data-theme="dark"] .tile { background: rgba(255, 255, 255, 0.045); }
[data-theme="dark"] .tile[data-lvl="1"] { background: rgba(217, 154, 43, 0.16); color: #e3c892; }
[data-theme="dark"] .tile[data-lvl="2"] { background: rgba(217, 154, 43, 0.28); color: #f0d9ac; }
[data-theme="dark"] .tile[data-lvl="3"] { background: rgba(217, 154, 43, 0.45); color: #fff0d2; }
[data-theme="dark"] .tile[data-lvl="4"] { background: rgba(217, 154, 43, 0.68); color: #fff8ec; }

.tile.has-data { cursor: pointer; }
.tile.has-data:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-md);
  z-index: 2;
}
.tile.is-active {
  border-color: var(--brick);
  box-shadow: 0 0 0 2px rgba(180, 67, 47, 0.28), var(--shadow-md);
  z-index: 3;
}
.tile:focus-visible { outline: 2px solid var(--brick); outline-offset: 2px; }

.tile--overseas {
  grid-column: 1;
  background: transparent !important;
  border: 1.5px dashed var(--line-strong) !important;
  color: var(--muted) !important;
}
.tile--overseas.has-data {
  border-color: var(--gold) !important;
  color: #9c6d12 !important;
  background: rgba(217, 154, 43, 0.08) !important;
}
.tile--overseas.is-active { border-style: solid !important; border-color: var(--brick) !important; }

.map-hint {
  display: none;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-align: center;
}

/* ---------- 地图右侧：当前筛选摘要 + 城市榜 ---------- */
.map-side { display: flex; flex-direction: column; gap: 16px; }

.selection-card {
  padding: 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--ink-solid-2), var(--ink-solid));
  color: #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.selection-card::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 180, 69, 0.3), transparent 70%);
}
.selection-card__label { font-size: 11px; letter-spacing: 0.24em; color: rgba(255,255,255,.5); }
.selection-card__region {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.selection-card__count {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}
.selection-card__count b {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--gold-bright);
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.selection-card__actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.selection-card .btn-light { padding: 7px 14px; font-size: 12.5px; }

.rank-card { padding: 18px; }
.rank-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 14px;
}
.rank-list { display: flex; flex-direction: column; gap: 3px; }
.rank-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: background-color 0.18s;
  position: relative;
  overflow: hidden;
}
.rank-item:hover { background: var(--paper-2); }
.rank-item__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(217, 154, 43, 0.18), rgba(217, 154, 43, 0.03));
  border-radius: 8px;
  transition: width 0.7s var(--ease);
  z-index: 0;
  pointer-events: none;
}
.rank-item__idx,
.rank-item__name,
.rank-item__num { position: relative; z-index: 1; }
.rank-item__idx {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.rank-item:nth-child(1) .rank-item__idx,
.rank-item:nth-child(2) .rank-item__idx,
.rank-item:nth-child(3) .rank-item__idx { color: var(--gold); font-weight: 700; }
.rank-item__name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-item__num {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================================ 10 筛选工具栏 */
.toolbar {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 40;
  padding: 12px;
  margin-bottom: 22px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s;
}
.toolbar.is-stuck { box-shadow: var(--shadow-md); }

/* 手机端专用的一条细栏：显示「筛选 · 共 N 人」+ 收起/展开 */
.toolbar__bar { display: none; }
.toolbar__bar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 0;
}
.toolbar__bar-count {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.toolbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.toolbar__toggle:hover { border-color: var(--gold); color: var(--gold-deep, #a9701a); }
.toolbar__toggle svg { width: 13px; height: 13px; transition: transform 0.3s var(--ease); }
.toolbar.is-collapsed .toolbar__toggle svg { transform: rotate(180deg); }

.toolbar__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar__row + .toolbar__row { margin-top: 10px; }

.search-box {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
}
.search-box svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 11px 38px 11px 40px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.16);
  background: var(--card);
}
.search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  display: none;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--line);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.search-box.has-value .search-clear { display: grid; }

.select-wrap { position: relative; flex: none; }
.select-wrap svg {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  color: var(--muted);
  pointer-events: none;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding: 11px 32px 11px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  min-width: 108px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.select-wrap select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.16);
}
.select-wrap select.is-empty { color: var(--muted); }

.toolbar__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 4px;
}
.toolbar__count b {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--gold);
  margin: 0 2px;
  font-variant-numeric: tabular-nums;
}

.active-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.active-filters:empty { display: none; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 11px;
  border-radius: var(--r-full);
  background: rgba(217, 154, 43, 0.13);
  color: #8a5f10;
  border: 1px solid rgba(217, 154, 43, 0.25);
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.18s;
}
.filter-pill:hover { background: rgba(217, 154, 43, 0.22); }
.filter-pill span { font-size: 14px; line-height: 1; opacity: 0.7; }
[data-theme="dark"] .filter-pill { color: var(--gold-bright); }

/* ============================================================ 11 同学名录 */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
}

.person {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.25s;
}
.person::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  opacity: 0;
  transition: opacity 0.25s;
}
.person:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(217, 154, 43, 0.4);
}
.person:hover::before { opacity: 1; }

.person__top { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: hsl(var(--h, 30) 46% 46%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 14px -8px hsl(var(--h, 30) 46% 30% / 0.9);
  letter-spacing: 0;
  position: relative;
  overflow: hidden;
}
.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.22), transparent 55%);
}
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 26px; }

.person__id { min-width: 0; flex: 1; }
.person__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.person__name .nick { font-size: 11px; font-weight: 400; color: var(--muted); }
.person__meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person__school {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.person__school strong {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person__school span {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
  max-width: 50%;
}

.person__tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }

.person__bio {
  font-size: 13px;
  line-height: 1.72;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 「曾在……」一行：常驻地点变更的回溯提示 */
.person__past {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: -4px;
  font-size: 11.5px;
  color: var(--muted);
  min-width: 0;
}
.person__past svg { width: 11px; height: 11px; flex: none; opacity: 0.6; }
.person__past span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.person__loc { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.person__loc svg { width: 12px; height: 12px; flex: none; color: var(--brick); }
.person__loc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__time { white-space: nowrap; font-variant-numeric: tabular-nums; }

.person.is-highlight { animation: highlight 1.6s var(--ease); }

/* 加载更多 */
.load-more-wrap { display: flex; justify-content: center; margin-top: 32px; }

/* ============================================================ 12 关于区块 */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.about-copy p { color: var(--text-2); line-height: 1.95; font-size: 15px; margin-bottom: 14px; }
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { color: var(--ink); font-weight: 650; }

.about-points {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
.point {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.point__ico {
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(217, 154, 43, 0.13);
  color: var(--gold);
}
.point__ico svg { width: 17px; height: 17px; }
.point__t { font-weight: 650; font-size: 14px; color: var(--ink); }
.point__d { font-size: 13px; color: var(--muted); line-height: 1.7; }

.about-photo {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3.2;
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.about-photo:hover img { transform: scale(1.045); }
.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 55%, rgba(9, 18, 34, 0.6));
}
.about-photo__cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 20px 22px;
  color: #fff;
}
.about-photo__cap b {
  display: block;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.06em;
}
.about-photo__cap span { font-size: 12px; opacity: 0.72; letter-spacing: 0.14em; }

.about-quote {
  margin-top: 34px;
  padding: 22px 26px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: linear-gradient(90deg, rgba(217, 154, 43, 0.07), transparent 70%);
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-2);
}
.about-quote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* 隐私说明 */
.privacy-panel {
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.privacy-panel__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink);
}
.privacy-panel__head svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.privacy-list { display: grid; gap: 8px; }
.privacy-list li {
  position: relative;
  padding-left: 15px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.privacy-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.66em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}
.privacy-list strong { color: var(--ink); font-weight: 650; }
.privacy-panel__foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.privacy-panel__foot a { color: var(--brick); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================ 12b 鸣谢 */
.thanks-section { padding-bottom: clamp(40px, 6vw, 72px); }

.thanks-card {
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3.4vw, 38px);
  border-radius: var(--r-xl);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(217, 154, 43, 0.06), transparent 55%),
    var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.thanks-list { display: grid; }

.thanks-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.thanks-row:first-child { padding-top: 4px; }
.thanks-row:last-child { border-bottom: none; padding-bottom: 4px; }

.thanks-year {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #a9701a;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .thanks-year { color: var(--gold-bright); }

.thanks-names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 26px;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text);
  min-width: 0;
}
.thanks-person { display: inline-flex; align-items: baseline; gap: 3px; }
.thanks-name { font-weight: 600; color: var(--ink); white-space: nowrap; }
.thanks-note {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.thanks-others {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
}
.thanks-other {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.7;
}
.thanks-other__label { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; }
.thanks-other__value { color: var(--text-2); }

/* ============================================================ 13 页脚 */
.site-footer {
  position: relative;
  background: var(--ink-solid);
  color: rgba(255, 255, 255, 0.68);
  padding: clamp(44px, 6vw, 72px) 0 26px;
  overflow: hidden;
  z-index: 1;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(90% 60% at 15% 0%, rgba(180, 67, 47, 0.25), transparent 60%),
    radial-gradient(70% 60% at 90% 10%, rgba(217, 154, 43, 0.16), transparent 60%);
  pointer-events: none;
}
.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 40px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand .brand-mark { box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.7); }
.footer-brand b {
  font-family: var(--font-serif);
  font-size: 17px;
  color: #fff;
  letter-spacing: 0.05em;
}
.footer-brand span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.42);
}
.footer-desc { font-size: 13px; line-height: 1.9; max-width: 30em; }
.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-col a,
.footer-col button {
  display: block;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  padding: 5px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s, transform 0.2s;
}
.footer-col a:hover,
.footer-col button:hover { color: var(--gold-bright); transform: translateX(3px); }

.footer-bottom {
  position: relative;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}
.footer-bottom a { color: rgba(255, 255, 255, 0.55); }
.footer-bottom a:hover { color: var(--gold-bright); }

/* ============================================================ 14 弹层 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.28s var(--ease);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: modalIn 0.36s var(--ease-out);
}
.modal__dialog--narrow { max-width: 480px; }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 16px;
  flex: none;
}
.modal__title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.modal__sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.modal__close {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.modal__close:hover { background: var(--brick); color: #fff; border-color: var(--brick); transform: rotate(90deg); }
.modal__close svg { width: 15px; height: 15px; }

.modal__body {
  padding: 4px 26px 8px;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}
.modal__foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--line);
  flex: none;
  background: var(--card);
}
/* 内容区可滚动时，在底栏上方做一层柔和的渐隐，提示「上面还有内容」 */
.modal__foot::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -20px;
  height: 20px;
  background: linear-gradient(180deg, transparent, var(--card));
  pointer-events: none;
}
.modal__foot .spacer { flex: 1; }

/* ---------- 表单 ---------- */
.form-section { margin-bottom: 22px; }
.form-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 12px;
}
.form-section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field label .req { color: var(--brick); font-size: 13px; line-height: 1; }
.field label .opt {
  margin-left: auto;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.field textarea { resize: vertical; min-height: 78px; line-height: 1.7; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.85; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.15);
  background: var(--card);
}
.field input.has-error,
.field select.has-error { border-color: var(--brick); box-shadow: 0 0 0 3px rgba(180, 67, 47, 0.12); }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field .hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.field .err { font-size: 11.5px; color: var(--brick); display: none; }
.field.is-invalid .err { display: block; }

.select-arrow { position: relative; }
.select-arrow::after {
  content: "";
  position: absolute;
  right: 13px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-arrow select { padding-right: 32px; }

/* 标签选择器 */
.tag-picker { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------- 常驻地点变更编辑器 ---------- */
.history-editor {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px solid var(--line);
}
.history-list { display: block; }
.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 58px auto 58px 28px;
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
}
.history-row input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.history-row input::placeholder { color: var(--muted); opacity: 0.8; }
.history-row input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.14);
}
.history-row .h-from,
.history-row .h-to { text-align: center; padding-left: 4px; padding-right: 4px; font-variant-numeric: tabular-nums; }
/* 「从」「至」放在输入框外面 */
.h-label {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
}
.h-del {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  padding: 0;
}
.h-del:hover { background: var(--brick); border-color: var(--brick); color: #fff; }
.h-del svg { width: 12px; height: 12px; }

.history-empty {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.history-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.history-add:hover { border-color: var(--gold); color: var(--gold-deep, #a9701a); background: rgba(217, 154, 43, 0.05); }
.history-add svg { width: 13px; height: 13px; }

.tag-opt {
  padding: 6px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.tag-opt:hover { border-color: var(--gold); color: var(--gold); }
.tag-opt.is-on {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-color: transparent;
  color: #2b1c02;
  font-weight: 600;
  box-shadow: 0 4px 12px -6px rgba(217, 154, 43, 0.9);
}

/* 开关 */
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 1px solid var(--line);
}
.switch-row__text { flex: 1; min-width: 0; }
.switch-row__t { font-size: 13px; font-weight: 600; color: var(--text); }
.switch-row__d { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 1px; }
.switch {
  position: relative;
  width: 42px; height: 24px;
  flex: none;
  border-radius: 99px;
  background: var(--line-strong);
  border: none;
  cursor: pointer;
  transition: background-color 0.24s var(--ease);
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.24s var(--ease);
}
.switch[aria-checked="true"] { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* 表单提示条 */
.form-note {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: rgba(217, 154, 43, 0.08);
  border: 1px solid rgba(217, 154, 43, 0.18);
  font-size: 12px;
  line-height: 1.7;
  color: #8a5f10;
}
[data-theme="dark"] .form-note { color: var(--gold-soft); }
.form-note svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

/* ---------- 名片详情 ---------- */
.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 26px 26px 20px;
  position: relative;
  overflow: hidden;
}
.detail-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(217, 154, 43, 0.13), transparent 65%),
    linear-gradient(180deg, rgba(16, 32, 58, 0.035), transparent 100%);
  pointer-events: none;
}
.detail-head > * { position: relative; }
.detail-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.detail-sub { font-size: 13px; color: var(--muted); margin-top: 5px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.detail-item {
  background: var(--card);
  padding: 15px 18px;
}
.detail-item__k {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-item__v {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}
.detail-item__v.empty { color: var(--muted); font-weight: 400; font-size: 13px; }
.detail-item--full { grid-column: 1 / -1; }

.detail-bio {
  padding: 18px 26px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 常驻地点变更时间线 ---------- */
.timeline {
  padding: 16px 26px 8px;
  border-top: 1px solid var(--line);
}
.timeline__title {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 12px;
}
.timeline__list { display: grid; gap: 0; }
.timeline__list li {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 0 0 12px 18px;
  font-size: 13.5px;
}
/* 竖线 */
.timeline__list li::before {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 15px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 26%, transparent), color-mix(in srgb, var(--text) 12%, transparent));
}
.timeline__list li:last-child { padding-bottom: 4px; }
.timeline__list li:last-child::before { display: none; }
.tl-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line-strong);
}
.timeline__list li.is-now .tl-dot {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.18);
}
.tl-when {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timeline__list li.is-now .tl-when { color: var(--gold-deep, #a9701a); font-weight: 600; }
.tl-where { color: var(--text); word-break: break-word; }

/* ---------- 实验回忆 ---------- */
.detail-memory {
  margin: 4px 26px 18px;
  padding: 16px 18px 16px 20px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(217, 154, 43, 0.08), transparent 75%);
}
.detail-memory__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold-deep, #a9701a);
  margin-bottom: 8px;
  font-weight: 600;
}
.detail-memory__label svg { width: 13px; height: 13px; }
.detail-memory p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-meta {
  padding: 0 26px 20px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- 数据管理弹层 ---------- */
.data-block {
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.data-block:first-child { padding-top: 4px; }
.data-block:last-child { border-bottom: none; padding-bottom: 4px; }

.data-block__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.data-block__desc {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 11px;
}
.data-block__desc strong { color: var(--text); font-weight: 650; }
.data-block__desc code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.data-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.data-check input { accent-color: var(--gold); width: 14px; height: 14px; }

.data-token {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.data-token label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.data-token input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.data-token input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.14); }

.data-progress {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.data-progress.is-ok { color: #2e7d4f; }
.data-progress.is-err { color: var(--brick); }

.data-block--danger {
  margin-top: 6px;
  padding: 15px 16px 16px;
  border: 1px solid rgba(180, 67, 47, 0.18);
  border-radius: var(--r-md);
  background: rgba(180, 67, 47, 0.04);
  border-bottom: none;
}
.data-block--danger .data-block__title { color: var(--brick); }
.data-block--danger .data-block__desc strong { color: var(--brick); }
#clearConfirm {
  width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
#clearConfirm:focus { outline: none; border-color: var(--brick); box-shadow: 0 0 0 3px rgba(180, 67, 47, 0.12); }

.btn-danger {
  --btn-bd: transparent;
  --btn-fg: #fff;
  background: linear-gradient(135deg, #c9503a, var(--brick-deep));
  box-shadow: 0 10px 22px -12px rgba(180, 67, 47, 0.8);
}
.btn-danger:hover { box-shadow: 0 14px 26px -12px rgba(180, 67, 47, 0.95); }

/* ============================================================ 拍一拍 */
.btn-nudge {
  --btn-bd: transparent;
  --btn-fg: #3a2600;
  background: linear-gradient(135deg, #ffd978, var(--gold-bright));
  box-shadow: 0 10px 22px -12px rgba(240, 180, 69, 0.9);
}
.btn-nudge:hover { box-shadow: 0 14px 28px -12px rgba(240, 180, 69, 1); }
.btn-nudge svg { width: 15px; height: 15px; }

/* 名片卡片上的「被拍 N 次」 */
.person__nudge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--gold-deep, #a9701a);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.person__nudge svg { width: 11px; height: 11px; }

/* 详情页里的一行统计 */
.detail-nudge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 26px;
  border-top: 1px solid var(--line);
  background: rgba(217, 154, 43, 0.05);
  font-size: 13px;
  color: var(--text-2);
}
.detail-nudge svg { width: 14px; height: 14px; color: var(--gold); }
.detail-nudge b {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--gold-deep, #a9701a);
  margin: 0 2px;
  font-variant-numeric: tabular-nums;
}
.detail-nudge .sep { width: 1px; height: 14px; background: var(--line-strong); }

/* 本人看到的拍一拍列表 */
.nudge-panel {
  margin: 4px 26px 18px;
  border-radius: var(--r-md);
  border: 1px solid rgba(217, 154, 43, 0.28);
  background: linear-gradient(180deg, rgba(217, 154, 43, 0.08), transparent 60%);
  overflow: hidden;
}
.nudge-panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-deep, #a9701a);
  border-bottom: 1px dashed rgba(217, 154, 43, 0.3);
}
.nudge-panel__head svg { width: 14px; height: 14px; }
.nudge-panel__head .nudge-new {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--brick);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}
.nudge-list { display: grid; }
.nudge-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}
.nudge-item:last-child { border-bottom: none; }
.nudge-item__time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nudge-item__note { color: var(--text); line-height: 1.7; word-break: break-word; }
.nudge-item__note.empty { color: var(--muted); font-size: 12.5px; }
.nudge-item.is-unseen .nudge-item__time { color: var(--gold-deep, #a9701a); font-weight: 600; }
.nudge-item.is-unseen .nudge-item__time::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--brick);
  vertical-align: middle;
}
.nudge-panel__foot {
  padding: 10px 16px;
  border-top: 1px dashed rgba(217, 154, 43, 0.3);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}

/* ============================================================ 15 提示 / 空状态 */.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 440px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--r-full);
  background: var(--ink-solid);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s var(--ease-out);
  max-width: 100%;
}
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast--ok svg { color: #6ee7a8; }
.toast--err { background: var(--brick-deep); }
.toast--err svg { color: #ffd4cc; }
.toast.is-out { animation: toastOut 0.3s var(--ease) forwards; }

.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty-state.is-on { display: flex; }
.empty-state__ico {
  width: 66px; height: 66px;
  border-radius: 20px;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--muted);
  margin-bottom: 18px;
}
.empty-state__ico svg { width: 28px; height: 28px; }
.empty-state__t {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state__d { font-size: 13.5px; line-height: 1.8; max-width: 26em; }
.empty-state .btn { margin-top: 20px; }

/* 演示数据提示条 */
.demo-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--r-full);
  background: rgba(180, 67, 47, 0.08);
  border: 1px solid rgba(180, 67, 47, 0.2);
  color: var(--brick);
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.demo-banner.is-on { display: flex; }
.demo-banner svg { width: 15px; height: 15px; flex: none; }
.demo-banner .btn { margin-left: auto; flex: none; }

/* ============================================================ 16 动画 */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(240, 180, 69, 0.22); }
  50% { box-shadow: 0 0 0 7px rgba(240, 180, 69, 0.06); }
}
@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}
@keyframes highlight {
  0%, 100% { box-shadow: var(--shadow-xs); }
  30% { box-shadow: 0 0 0 4px rgba(217, 154, 43, 0.35), var(--shadow-md); }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================ 17 响应式 */
@media (max-width: 1080px) {
  .map-layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .footer-grid { grid-template-columns: 1.6fr 1fr; }
}

@media (max-width: 900px) {
  .nav-link { display: none; }
  .nav-burger { display: grid; }
  .nav.is-open {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 190px;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.24s var(--ease-out);
  }
  .nav.is-open .nav-link { display: block; color: var(--text); padding: 10px 12px; }
  .nav.is-open .nav-link:hover { background: var(--paper-2); }
  .nav.is-open .nav-link::after { display: none; }
  .nav.is-open .nav-actions {
    margin: 8px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .nav.is-open .nav-actions .btn { flex: 1 1 auto; }
  .map-layout { grid-template-columns: 1fr; }
  .map-side { flex-direction: row; flex-wrap: wrap; }
  .map-side > * { flex: 1 1 240px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { order: -1; aspect-ratio: 16 / 10; }
  .hero__scroll { display: none; }
  .map-hint { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }
  body { font-size: 14.5px; }

  /* 手机端顶栏只留品牌 + 汉堡菜单，其余收进菜单 */
  .nav-actions .theme-toggle,
  .nav-actions .btn-primary { display: none; }
  .nav.is-open .nav-actions .theme-toggle { display: grid; }
  .nav.is-open .nav-actions .btn-primary { display: inline-flex; flex: 1 1 100%; }

  .brand-sub { display: none; }
  .hero__title { font-size: clamp(2.1rem, 10vw, 3rem); }
  .hero__stats .wrap { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3)::before { display: none; }
  .stat { padding: 16px 6px 18px; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .hero__rule span { width: 36px; }
  /* 手机屏幕窄，正文压在照片上需要更浓的压暗层 */
  .hero__scrim {
    background:
      linear-gradient(180deg, rgba(9, 18, 34, 0.55) 0%, rgba(9, 18, 34, 0.22) 22%, rgba(9, 18, 34, 0.66) 56%, rgba(9, 18, 34, 0.96) 100%),
      linear-gradient(105deg, rgba(9, 18, 34, 0.55) 0%, rgba(9, 18, 34, 0.16) 100%);
  }

  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }

  /* 变更记录行在窄屏改成两行：地点一行，从/至 一行 */
  .history-row {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) 28px;
    gap: 6px;
  }
  .history-row .h-place { grid-column: 1 / -1; }
  .history-row .h-del { grid-row: 2; grid-column: 5; }
  .history-row .h-from { grid-column: 2; }
  .history-row .h-to { grid-column: 4; }
  .history-row .h-label:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .history-row .h-label:nth-of-type(2) { grid-column: 3; grid-row: 2; }

  .timeline { padding-left: 20px; padding-right: 20px; }
  .timeline__list li { grid-template-columns: 76px 1fr; gap: 8px; }
  .detail-memory { margin-left: 20px; margin-right: 20px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__dialog {
    max-width: none;
    max-height: 94vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: sheetIn 0.36s var(--ease-out);
  }
  .modal__head { padding: 20px 20px 12px; }
  .modal__body { padding: 4px 20px 8px; }
  .modal__foot { padding: 14px 20px 18px; flex-wrap: wrap; }
  .modal__foot .btn { flex: 1 1 auto; }
  .detail-head { padding: 22px 20px 16px; }
  .detail-bio, .detail-meta { padding-left: 20px; padding-right: 20px; }

  .toolbar { padding: 10px; }
  .toolbar__row { gap: 8px; }
  .search-box { flex: 1 1 100%; }
  .select-wrap { flex: 1 1 calc(50% - 4px); }
  .select-wrap select { width: 100%; min-width: 0; }
  .toolbar__count { flex: 1 1 100%; margin-left: 0; text-align: right; }

  /* 手机端才显示「筛选 · 共 N 人 / 收起」这条细栏 */
  .toolbar__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 28px;
  }
  .toolbar__body { margin-top: 10px; }
  .toolbar.is-collapsed .toolbar__body { display: none; }
  .toolbar.is-collapsed .toolbar__bar { min-height: 24px; }

  .people-grid { grid-template-columns: 1fr; }
  .section-head { gap: 16px; }
  .footer-bottom { flex-direction: column; gap: 8px; }

  /* 鸣谢：窄屏时年级单独占一行 */
  .thanks-row { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
  .thanks-other { grid-template-columns: 1fr; gap: 1px; }
  .thanks-names { gap: 0 18px; }

  /* 手机上让整张地图一次装下，不用左右滑 */
  .tilemap { min-width: 0; aspect-ratio: 8 / 7.6; gap: 4px; }
  .tile { border-radius: 7px; }
  .map-hint { display: none; }

  .toast-stack { bottom: 16px; }
}

@media (max-width: 420px) {
  .tile__name { font-size: 9px; letter-spacing: 0; }
  .tile__count { font-size: 11px; }
  .hero__eyebrow { font-size: 11px; letter-spacing: 0.1em; }
  .brand-name { font-size: 14.5px; letter-spacing: 0.02em; }
}

@keyframes sheetIn {
  from { transform: translateY(40px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

/* 打印：导出为 PDF 时更清爽 */
@media print {
  .site-header, .hero__actions, .hero__scroll, .toolbar, .site-footer,
  .modal, .toast-stack, .load-more-wrap { display: none !important; }
  .hero { min-height: auto; color: #000; }
  .person { break-inside: avoid; box-shadow: none; }
}
