/* ==========================================================================
   航海梦 · 前台主样式表（pages.css）
   --------------------------------------------------------------------------
   加载顺序：bootstrap.min.css → pages.css。本文件是前台唯一的自定义样式表，
   auth.css（登录页）与 map.css / leaflet.css（地图页动态注入）互不影响。

   主题气质：深海军蓝 + 黄铜 + 珊瑚红。克制、干净、专业，不做游戏化装饰。
   所有颜色、圆角、阴影均取自 :root 令牌，规则内不写死色值。

   区块索引：
     1. 设计令牌      8. 空状态
     2. 基础          9. 分页
     3. 导航         10. 副官对比浮动面板
     4. Hero         11. 对比页
     5. 页头         12. 页脚
     6. 区块标题     13. 地图页
     7. 列表卡片     14. 响应式
      7.1 类型筛选
                      15. 无障碍 / 减少动效
   ========================================================================== */

/* ==========================================================================
   1. 设计令牌
   ========================================================================== */
:root {
  /* 深海军蓝：导航、Hero、页脚的主色阶 */
  --navy-950: #060f1c;
  --navy-900: #081528;
  --navy-800: #0b1d36;
  --navy-700: #103153;
  --navy-600: #164a77;

  /* 黄铜：品牌强调色，用于分隔线、短线、高亮底 */
  --brass-600: #b8892f;
  --brass-500: #d9b25f;
  --brass-400: #e6c985;

  /* 珊瑚红：行动按钮（搜索 / 加入对比 / 开始对比） */
  --coral-600: #c23152;
  --coral-500: #e94560;

  /* 文字与中性面 */
  --ink: #17202e;
  --muted: #5c6879;
  --faint: #8b96a7;
  --line: #e5e9f1;
  --surface: #ffffff;
  --canvas: #f4f6fa;

  /* 圆角 */
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(8, 21, 40, .05);
  --shadow-sm: 0 6px 18px rgba(8, 21, 40, .06);
  --shadow-md: 0 14px 34px rgba(8, 21, 40, .10);
  --shadow-lg: 0 24px 60px rgba(6, 15, 28, .25);

  /* 导航高度，用于 scroll-padding */
  --nav-h: 70px;
}

/* ==========================================================================
   2. 基础
   ========================================================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background-color: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 两团极淡光晕，让纯色背景有层次（不参与命中测试） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(46rem 32rem at 8% -6%, rgba(16, 49, 83, .08), transparent 62%),
    radial-gradient(40rem 28rem at 96% 2%, rgba(217, 178, 95, .08), transparent 60%);
}

main.site-main {
  flex: 1 0 auto;
  width: 100%;
  padding-block: 1.75rem 3rem;
}

/* 链接颜色由组件各自控制，避免 Bootstrap 默认蓝串味 */
a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(217, 178, 95, .55);
  outline-offset: 2px;
}

::selection {
  background: rgba(217, 178, 95, .35);
  color: var(--ink);
}

/* 跳转主内容：平时视觉隐藏，聚焦后固定在左上角 */
.skip-link {
  position: absolute;
  top: -1px;
  left: -1px;
  z-index: 2000;
  padding: .55rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--navy-800);
  font-size: .82rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  clip-path: inset(50%);
  transform: scale(.9);
  transition: clip-path .16s ease, transform .16s ease;
}

.skip-link:focus-visible {
  position: fixed;
  top: 12px;
  left: 12px;
  clip-path: inset(0);
  transform: none;
}

/* ==========================================================================
   3. 导航（header / navbar / 搜索框）
   --------------------------------------------------------------------------
   Bootstrap 的 navbar / navbar-dark / navbar-expand-lg 行为全部保留，
   这里只换皮肤：深蓝三段渐变 + 黄铜细边。
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.site-navbar {
  background-image: linear-gradient(135deg, #081528 0%, #0b1d36 55%, #103153 100%);
  border-bottom: 1px solid rgba(217, 178, 95, .16);
  box-shadow: 0 12px 30px rgba(6, 15, 28, .22);
  padding-block: 10px;
}

.site-navbar__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 44px;
}

/* --- 品牌 --- */
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  /* 覆盖 Bootstrap .navbar-brand 的 5px 上下内边距，让导航条回到 60px 高 */
  padding: 0;
  margin-right: .35rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(217, 178, 95, .38);
  border-radius: 12px;
  background-image: linear-gradient(150deg, #0f2a49 0%, var(--navy-900) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 6px 16px rgba(6, 15, 28, .35);
  color: var(--brass-400);
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .12em;
  color: #fff;
  white-space: nowrap;
}

.brand__sub {
  margin-top: 2px;
  font-size: .62rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, .48);
  white-space: nowrap;
}

.brand:hover .brand__mark {
  border-color: rgba(217, 178, 95, .6);
  color: var(--brass-500);
}

/* --- 导航链接 --- */
.site-nav {
  min-width: 0;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: .55rem .9rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .72);
  font-size: .9rem;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}

.site-nav__link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, .06);
}

.site-nav__link:focus-visible {
  color: #fff;
  outline-offset: 1px;
}

.site-nav__link.is-active {
  color: #fff;
}

/* 当前页：底部居中一条 18×2 的黄铜短线 */
.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 18px;
  height: 2px;
  border-radius: var(--radius-pill);
  translate: -50% 0;
  background-color: var(--brass-500);
}

/* --- 折叠按钮（<992px） --- */
.navbar-toggler {
  flex: none;
  padding: .35rem .5rem;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .8);
  transition: border-color .18s ease, background-color .18s ease;
}

.navbar-toggler:hover {
  border-color: rgba(217, 178, 95, .5);
  background-color: rgba(255, 255, 255, .06);
}

.navbar-toggler:focus-visible {
  border-color: rgba(217, 178, 95, .7);
  box-shadow: 0 0 0 3px rgba(217, 178, 95, .3);
  outline: none;
}

/* --- 导航内搜索框（d-none d-lg-flex） --- */
.search-form {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: min(340px, 100%);
  padding: .28rem .3rem .28rem .9rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, .07);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.search-form:focus-within {
  border-color: rgba(217, 178, 95, .65);
  background-color: rgba(255, 255, 255, .1);
  box-shadow: 0 0 0 4px rgba(217, 178, 95, .12);
}

.search-form__icon {
  flex: none;
  width: 17px;
  height: 17px;
  color: rgba(255, 255, 255, .5);
}

.search-form__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .35rem 0;
  border: 0;
  background-color: transparent;
  color: #fff;
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.5;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.search-form__input::placeholder {
  color: rgba(255, 255, 255, .45);
  opacity: 1;
}

.search-form__input::-webkit-search-cancel-button,
.search-form__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-form__submit {
  flex: none;
  padding: .5rem .95rem;
  border: 0;
  border-radius: var(--radius-pill);
  background-image: linear-gradient(135deg, var(--brass-400), var(--brass-500));
  color: var(--navy-900);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: filter .18s ease, box-shadow .18s ease, transform .18s ease;
}

.search-form__submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 16px rgba(217, 178, 95, .28);
}

.search-form__submit:active {
  transform: translateY(1px);
  filter: brightness(.98);
}

/* --- 手机端搜索条（结构上由 d-lg-none 控制显示） --- */
.mobile-search {
  background-color: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-block: .6rem .7rem;
}

.mobile-search .search-form {
  width: 100%;
  background-color: rgba(255, 255, 255, .08);
}

/* ==========================================================================
   4. Hero（首页顶部）
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 1.75rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  border-radius: var(--radius-xl);
  background-image:
    radial-gradient(28rem 20rem at 82% 12%, rgba(217, 178, 95, .16), transparent 62%),
    radial-gradient(34rem 24rem at 6% 96%, rgba(22, 74, 119, .38), transparent 64%),
    linear-gradient(135deg, #081528 0%, #0b1d36 48%, #0f3a5f 100%);
  box-shadow: var(--shadow-lg);
}

/* 细密点阵，只在中上部可见 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(78% 62% at 46% 34%, #000 20%, transparent 100%);
  mask-image: radial-gradient(78% 62% at 46% 34%, #000 20%, transparent 100%);
}

/* 底部一条极淡的黄铜光带 */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background-image: linear-gradient(90deg, transparent, rgba(217, 178, 95, .35), transparent);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 42rem;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass-400);
}

.hero__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brass-400);
}

.hero__title {
  margin: 0 0 .9rem;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .01em;
  color: #fff;
  overflow-wrap: anywhere;
}

.hero__lead {
  max-width: 34rem;
  margin: 0 0 1.8rem;
  font-size: clamp(.9rem, 1.2vw, 1rem);
  line-height: 1.8;
  color: rgba(255, 255, 255, .66);
}

.hero-search {
  display: flex;
  align-items: center;
  gap: .6rem;
  max-width: 36rem;
  padding: .5rem .55rem .5rem 1.1rem;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
  transition: box-shadow .2s ease;
}

.hero-search:focus-within {
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25), 0 0 0 3px rgba(217, 178, 95, .4);
}

.hero-search__icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--faint);
}

.hero-search__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .6rem 0;
  border: 0;
  background-color: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.hero-search__input::placeholder {
  color: #9aa4b2;
  opacity: 1;
}

.hero-search__input::-webkit-search-cancel-button,
.hero-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.hero-search__btn {
  flex: none;
  padding: .75rem 1.4rem;
  border: 0;
  border-radius: 12px;
  background-image: linear-gradient(135deg, var(--coral-500), var(--coral-600));
  color: #fff;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(233, 69, 96, .32);
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}

.hero-search__btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(233, 69, 96, .38);
}

.hero-search__btn:active {
  transform: none;
  filter: brightness(.97);
  box-shadow: 0 6px 14px rgba(233, 69, 96, .3);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: 1.25rem;
}

.hero__chips-label {
  margin-right: .15rem;
  font-size: .75rem;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .45);
}

.hero__chip {
  display: inline-flex;
  align-items: center;
  padding: .3rem .7rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .75);
  font-size: .78rem;
  text-decoration: none;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.hero__chip:hover {
  border-color: rgba(217, 178, 95, .4);
  background-color: rgba(255, 255, 255, .12);
  color: var(--brass-400);
}

.hero__meta {
  margin: 1.4rem 0 0;
  font-size: .76rem;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .45);
}

.hero__meta strong {
  color: var(--brass-400);
  font-weight: 600;
}

/* 罗盘装饰：translate 负责居中，transform 只给旋转动画，两者不冲突 */
.hero__compass {
  position: absolute;
  top: 50%;
  right: -3%;
  width: clamp(260px, 32vw, 420px);
  height: auto;
  translate: 0 -50%;
  pointer-events: none;
  opacity: .5;
  color: var(--brass-500);
  animation: hh-spin 60s linear infinite;
}

/* 992–1199px 时内容区变窄，把罗盘收小、减淡，避免压到正文 */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .hero__compass {
    right: -5%;
    width: clamp(230px, 27vw, 320px);
    opacity: .36;
  }
}

@keyframes hh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   5. 页头（搜索页 / 对比页等）
   ========================================================================== */
.page-header {
  margin-bottom: 1.5rem;
  padding: clamp(1.1rem, 2.2vw, 1.6rem) clamp(1.1rem, 2.4vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
}

.page-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-header__eyebrow {
  margin: 0 0 .35rem;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass-600);
}

.page-header__title {
  margin: 0 0 .35rem;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.page-header__sub {
  margin: 0;
  font-size: .875rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.page-header__sub strong {
  color: var(--ink);
  font-weight: 600;
}

.page-header__aside {
  flex: none;
  min-width: 0;
}

/* ==========================================================================
   6. 区块标题
   ========================================================================== */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.25rem 0 1.1rem;
}

.section-title {
  margin: 0 0 .3rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.section-sub {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
}

.section-head__pager {
  flex: none;
  min-width: 0;
}

/* ==========================================================================
   7. 列表卡片（首页索引与搜索结果共用）
   ========================================================================== */
.entry-list {
  display: grid;
  gap: .85rem;
}

.entry-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background-color: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

/* 左侧黄铜竖条，hover 时淡入 */
.entry-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background-image: linear-gradient(180deg, var(--brass-500), rgba(217, 178, 95, 0));
  opacity: 0;
  transition: opacity .18s ease;
}

.entry-card:hover {
  border-color: #d5dce8;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.entry-card:hover::before {
  opacity: 1;
}

.entry-card__body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 0;
}

.entry-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.entry-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.entry-card__title a {
  color: var(--ink);
  text-decoration: none;
  transition: color .16s ease;
}

/* hover 下划线：brass 底纹，不改变行高 */
.entry-card__title a:hover {
  color: var(--navy-600);
  text-decoration: underline;
  text-decoration-color: rgba(217, 178, 95, .85);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.entry-card__badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .5rem;
  border: 1px solid rgba(217, 178, 95, .3);
  border-radius: var(--radius-pill);
  background-color: rgba(217, 178, 95, .14);
  color: #8a6b2a;
  font-size: .68rem;
  font-weight: 500;
  white-space: nowrap;
}

.entry-card__badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentColor;
}

.entry-card__excerpt,
.entry-card__highlight {
  margin: 0;
  font-size: .84rem;
  line-height: 1.75;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-card__excerpt {
  -webkit-line-clamp: 2;
}

.entry-card__highlight {
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}

/* 搜索命中高亮（Searchkick <em>） */
.entry-card__highlight em {
  font-style: normal;
  font-weight: 600;
  color: #7a5200;
  background-image: linear-gradient(180deg, transparent 58%, rgba(217, 178, 95, .5) 58%);
  padding: 0 .12em;
  border-radius: 2px;
}

.snippet-sep {
  color: #b5bdca;
  padding: 0 .35rem;
}

.entry-card__foot {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .15rem;
}

.entry-card__link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy-600);
  text-decoration: none;
  transition: color .16s ease;
}

.entry-card__link:hover {
  color: var(--coral-600);
}

.entry-card__aside {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 0;
}

/* 加入对比：默认弱描边，hover 转实心珊瑚渐变 */
.btn-compare {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .7rem;
  border: 1px solid rgba(233, 69, 96, .28);
  border-radius: 9px;
  background-color: rgba(233, 69, 96, .07);
  color: var(--coral-600);
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.btn-compare:hover {
  border-color: transparent;
  background-image: linear-gradient(135deg, var(--coral-500), var(--coral-600));
  color: #fff;
  box-shadow: 0 8px 18px rgba(233, 69, 96, .28);
}

.btn-compare:active {
  filter: brightness(.96);
  box-shadow: 0 4px 10px rgba(233, 69, 96, .24);
}

/* ==========================================================================
   7.1 搜索页类型筛选 chips（搜索结果上方，计数来自 ES content_type 聚合）
   --------------------------------------------------------------------------
   窄屏：单行横向滚动（容器内滚，不把整页撑出横向滚动条）；
   ≥768px：允许换行。chips 本身 flex:0 0 auto + white-space:nowrap，不参与压缩。
   ========================================================================== */
.type-filter {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* 滚动条隐藏：横向可滚的线索由 chips 在右缘被截断来表达 */
  scrollbar-width: none;
}

.type-filter::-webkit-scrollbar {
  display: none;
}

.type-filter__chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
  padding: .32rem .75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background-color: #eef2f8;
  color: var(--navy-700);
  font-size: .78rem;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.type-filter__chip:hover {
  border-color: rgba(217, 178, 95, .6);
  background-color: #e8eef6;
}

/* 选中态：黄铜描边 + 淡底，与卡片上的 entry-card__badge（小字、带圆点）区分开 */
.type-filter__chip--active {
  border-color: var(--brass-500);
  background-color: rgba(217, 178, 95, .22);
  color: var(--navy-800);
  font-weight: 600;
}

.type-filter__chip--active:hover {
  border-color: var(--brass-600);
  background-color: rgba(217, 178, 95, .3);
}

.type-filter__count {
  font-size: .68rem;
  font-weight: 500;
  color: var(--faint);
}

.type-filter__chip--active .type-filter__count {
  color: var(--brass-600);
}

/* 语义融合降级说明：克制的一行小字，不做告警块 */
.type-filter__note {
  margin: -.5rem 0 1rem;
  font-size: .76rem;
  line-height: 1.6;
  color: var(--muted);
}

@media (min-width: 768px) {
  .type-filter {
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* ==========================================================================
   8. 空状态
   ========================================================================== */
.empty-state {
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  border: 1px dashed #d9dfe9;
  border-radius: 20px;
  background-color: var(--surface);
  text-align: center;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background-color: rgba(22, 74, 119, .08);
  color: var(--navy-600);
}

.empty-state__icon svg {
  width: 28px;
  height: 28px;
}

.empty-state__title {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.empty-state__text {
  margin: 0 0 1.25rem;
  font-size: .86rem;
  line-height: 1.7;
  color: var(--muted);
}

.empty-state__text a {
  color: var(--navy-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty-state__text a:hover {
  color: var(--coral-600);
}

.empty-state__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
}

.empty-state__chip {
  display: inline-flex;
  align-items: center;
  padding: .32rem .75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background-color: #eef2f8;
  color: var(--navy-700);
  font-size: .78rem;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease;
}

.empty-state__chip:hover {
  border-color: rgba(217, 178, 95, .6);
  background-color: #e8eef6;
}

/* ==========================================================================
   9. 分页（kaminari：ul.pagination > li.page-item > a.page-link）
   --------------------------------------------------------------------------
   通过覆盖 Bootstrap 的 --bs-pagination-* 变量换肤，避免 !important。
   ========================================================================== */
.pager-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.pagination {
  --bs-pagination-color: var(--navy-700);
  --bs-pagination-bg: var(--surface);
  --bs-pagination-border-color: var(--line);
  --bs-pagination-border-width: 1px;
  --bs-pagination-border-radius: var(--radius-sm);
  --bs-pagination-hover-color: var(--navy-800);
  --bs-pagination-hover-bg: #f1f5fa;
  --bs-pagination-hover-border-color: #dbe3ee;
  --bs-pagination-focus-color: var(--navy-800);
  --bs-pagination-focus-bg: #f1f5fa;
  --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(16, 49, 83, .15);
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: var(--navy-700);
  --bs-pagination-active-border-color: transparent;
  --bs-pagination-disabled-color: #c3c9d4;
  --bs-pagination-disabled-bg: var(--surface);
  --bs-pagination-disabled-border-color: var(--line);
  --bs-pagination-font-size: .82rem;
  --bs-pagination-padding-x: .6rem;
  --bs-pagination-padding-y: .45rem;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--navy-700);
  font-size: .82rem;
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.page-link:hover {
  background-color: #f1f5fa;
  border-color: #dbe3ee;
  color: var(--navy-800);
}

.page-item.active .page-link {
  border-color: transparent;
  background-image: linear-gradient(135deg, var(--navy-600), var(--navy-700));
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 49, 83, .24);
}

.page-item.disabled .page-link {
  background-color: var(--surface);
  color: #c3c9d4;
  pointer-events: none;
}

/* ==========================================================================
   10. 副官对比浮动面板（右下角常驻）
   ========================================================================== */
.compare-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1050;
  width: min(320px, calc(100vw - 32px));
  border: 1px solid rgba(8, 21, 40, .06);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  box-shadow: 0 24px 60px rgba(6, 15, 28, .3);
  overflow: hidden;
  animation: hh-rise .28s ease-out;
}

@keyframes hh-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.compare-dock__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  background-image: linear-gradient(135deg, var(--navy-900), var(--navy-800) 60%, var(--navy-700));
  color: #fff;
}

.compare-dock__eyebrow {
  margin: 0 0 .2rem;
  font-size: .6rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--brass-400);
}

.compare-dock__title {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.compare-dock__title span {
  font-size: .72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .55);
}

.compare-dock__clear {
  flex: none;
  padding: .25rem .55rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background-color: transparent;
  color: rgba(255, 255, 255, .7);
  font-family: inherit;
  font-size: .72rem;
  text-decoration: none;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.compare-dock__clear:hover {
  border-color: rgba(255, 255, 255, .5);
  background-color: rgba(255, 255, 255, .08);
  color: #fff;
}

.compare-dock__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: .5rem;
  max-height: 36vh;
  overflow: auto;
  margin: 0;
  padding: .9rem 1rem .25rem;
  list-style: none;
}

.compare-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}

/* 移除按钮浮在 chip 右上角；表单本身不占布局空间 */
.compare-chip__remove-form {
  position: absolute;
  top: -6px;
  right: -4px;
  z-index: 2;
  margin: 0;
}

.compare-chip__remove {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background-color: #fff;
  box-shadow: var(--shadow-xs);
  color: var(--muted);
  font-family: inherit;
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.compare-chip__remove:hover {
  border-color: var(--coral-500);
  background-color: rgba(233, 69, 96, .08);
  color: var(--coral-600);
}

.compare-chip__remove:focus-visible {
  outline: 2px solid var(--navy-600);
  outline-offset: 1px;
}

.compare-chip__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background-color: #eef2f8;
  overflow: hidden;
}

.compare-chip__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-chip__ph {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-700);
}

.compare-chip__name {
  font-size: .68rem;
  line-height: 1.25;
  color: var(--ink);
  text-align: center;
  word-break: break-all;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.compare-dock__hint {
  margin: 0;
  padding: .1rem 1rem .55rem;
  font-size: .7rem;
  line-height: 1.45;
  color: var(--muted);
}

.compare-dock__foot {
  padding: .85rem 1rem 1rem;
}

.compare-dock__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  background-image: linear-gradient(135deg, var(--coral-500), var(--coral-600));
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(233, 69, 96, .28);
  transition: filter .18s ease, box-shadow .18s ease, transform .18s ease;
}

.compare-dock__cta:hover {
  filter: brightness(1.07);
  box-shadow: 0 12px 24px rgba(233, 69, 96, .34);
}

.compare-dock__cta:active {
  transform: translateY(1px);
  filter: brightness(.97);
}

/* ==========================================================================
   11. 对比页（抓取表格含 bgcolor / font[color] 等表现型标记，需覆盖）
   ========================================================================== */
.compare-list {
  display: grid;
  gap: 1.25rem;
}

/* 对比页头部操作组：追加副官 / 重新选择 */
.compare-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.compare-actions__link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--navy-700);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.compare-actions__link:hover {
  border-color: var(--navy-600);
  background-color: #f7f9fc;
}

.compare-actions__link--primary {
  border-color: transparent;
  background-image: linear-gradient(135deg, var(--coral-500), var(--coral-600));
  color: #fff;
  box-shadow: 0 8px 18px rgba(233, 69, 96, .24);
}

.compare-actions__link--primary:hover {
  border-color: transparent;
  background-image: linear-gradient(135deg, var(--coral-500), var(--coral-600));
  filter: brightness(1.07);
}

/* 已选数量与下一步提示 */
.compare-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1rem;
  margin-top: 1rem;
  padding: .6rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  font-size: .8rem;
  color: var(--muted);
}

.compare-summary__count {
  margin: 0;
}

.compare-summary__count strong {
  color: var(--ink);
  font-weight: 700;
}

.compare-summary__hint {
  margin: 0;
}

/* 差异高亮图例 */
.compare-legend {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .85rem;
  font-size: .75rem;
  color: var(--muted);
}

.compare-legend__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background-color: rgba(233, 69, 96, .18);
  box-shadow: inset 0 0 0 1px var(--coral-500);
}

.compare-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.compare-card__meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(180deg, #f8fafd, #fff);
}

.compare-card__index {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background-color: var(--navy-800);
  color: var(--brass-400);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
}

.compare-card__label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
}

/* 宽表在窄屏内横向滚动，而不是把整页撑出横向滚动条；
   max-height + overflow:auto 让长表纵向滚动，配合下方 sticky 表头常驻可见。 */
.compare-table__scroll {
  overflow: auto;
  /* 让长表在卡片内部纵向滚动，首行表头才能 sticky；上限避免卡片高到一屏放不下 */
  max-height: min(60vh, 560px);
  -webkit-overflow-scrolling: touch;
  /* 顶部留白放在表格 margin 上：sticky 表头吸顶时不会露出上方的滚动内容 */
  padding: 0 1rem 1.1rem;
}

/* 窄屏下提示表格可以横向滑动（默认隐藏，见响应式区块） */
.compare-table__hint {
  display: none;
  margin: 0;
  padding: .7rem 1rem 0;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .02em;
}

.compare-table table {
  width: 100% !important;
  min-width: 680px;
  margin-top: .9rem;
  border-collapse: collapse;
  background-color: #fff;
  color: var(--ink);
  font-size: .8rem;
}

.compare-table td {
  border: 1px solid #e8ecf3 !important;
  padding: .35rem .5rem;
  vertical-align: middle;
}

/* 表头：原站点用 bgcolor="#329a98"，改成品牌深蓝 */
.compare-table td[bgcolor="#329a98"] {
  background-image: linear-gradient(180deg, var(--navy-600), var(--navy-700)) !important;
  background-color: var(--navy-700) !important;
  color: #fff;
}

.compare-table td[bgcolor="#329a98"] font {
  color: #fff !important;
}

.compare-table td[bgcolor="#bee7e7"] {
  background-color: #f2f6fb !important;
  background-image: none;
}

.compare-table td[bgcolor="#f2ffff"] {
  background-color: #fff !important;
  background-image: none;
}

/* 首行（表头）在纵向滚动时吸顶；抓取表格没有 thead，首行是带 bgcolor 的 td。 */
.compare-table tr:first-child > td,
.compare-table thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #fff;
  background-clip: padding-box;
}

/* 差异行：抓取表格用内联 bgcolor，无法直接覆盖背景，改用大半径内阴影压在底色之上。 */
.compare-table tr.compare-row--diff > td {
  background-image: none !important;
  box-shadow: inset 0 0 0 9999px rgba(233, 69, 96, .08);
}

.compare-table tr.compare-row--diff > td:first-child {
  box-shadow: inset 3px 0 0 var(--coral-500), inset 0 0 0 9999px rgba(233, 69, 96, .08);
}

.compare-table font[color="#0000ff"] {
  color: #0f6ea8 !important;
}

.compare-table img {
  display: block;
  max-width: 64px;
  height: auto;
  border-radius: 6px;
}

.compare-table a {
  color: #0f6ea8;
  text-decoration: none;
}

.compare-table a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.compare-card__empty {
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: .86rem;
  text-align: center;
}

/* ==========================================================================
   12. 页脚
   ========================================================================== */
.site-footer {
  margin-top: auto;
  padding: 2.25rem 0 1.75rem;
  border-top: 1px solid rgba(217, 178, 95, .14);
  background-image: linear-gradient(135deg, var(--navy-950), var(--navy-900) 55%, var(--navy-800));
  color: rgba(255, 255, 255, .6);
  font-size: .8rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: #fff;
  text-decoration: none;
}

.site-footer__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(217, 178, 95, .4);
  border-radius: 50%;
  color: var(--brass-400);
}

.site-footer__mark svg {
  width: 16px;
  height: 16px;
}

.site-footer__sub {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .4);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-footer__links a {
  color: rgba(255, 255, 255, .6);
  text-decoration: none;
  transition: color .16s ease, text-decoration-color .16s ease;
}

.site-footer__links a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(217, 178, 95, .8);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 0;
  font-size: .74rem;
  color: rgba(255, 255, 255, .48);
}

.site-footer__legal a {
  color: inherit;
  text-decoration: none;
  transition: color .16s ease;
}

.site-footer__legal a:hover {
  color: #fff;
}

/* ==========================================================================
   13. 地图页（map.css / leaflet.css 负责地图本体，这里只定基础框架避免闪烁）
   ========================================================================== */
.map-page {
  position: relative;
  padding: 12px 16px 18px;
}

.map-panel {
  position: absolute;
  top: 28px;
  right: 32px;
  z-index: 500;
  min-width: 190px;
  padding: .9rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-md);
  background-color: rgba(8, 21, 40, .72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  color: #fff;
  pointer-events: none;
}

.map-panel__eyebrow {
  margin: 0 0 .25rem;
  font-size: .6rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--brass-400);
}

.map-panel__title {
  margin: 0 0 .25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.map-panel__hint {
  margin: 0;
  font-size: .7rem;
  color: rgba(255, 255, 255, .5);
}

/* ==========================================================================
   14. 响应式（390px–1440px，<=767.98px 不出现横向滚动）
   ========================================================================== */
@media (max-width: 991.98px) {
  .brand__sub {
    display: none;
  }

  /* Bootstrap 折叠菜单：整行可点、左对齐 */
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    margin-block: .6rem .2rem;
  }

  .site-nav__link {
    display: flex;
    width: 100%;
    padding: .7rem .85rem;
    font-size: .95rem;
  }

  .site-nav__link.is-active {
    background-color: rgba(255, 255, 255, .07);
  }

  .site-nav__link.is-active::after {
    left: 0;
    bottom: 50%;
    width: 3px;
    height: 16px;
    translate: 0 50%;
  }

  /* 折叠区里的搜索框：整行宽度 */
  .site-nav .search-form {
    width: 100%;
    margin-block: .35rem .25rem;
  }

  .hero__compass {
    display: none;
  }

  .page-header__aside,
  .section-head__pager {
    display: none;
  }

  /* 对比页的「追加副官 / 重新选择」是移动端主入口，不能跟随页头分页一起隐藏 */
  .page-header__aside.compare-actions {
    display: flex;
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  main.site-main {
    padding-block: 1.25rem 2.25rem;
  }

  .hero {
    margin-bottom: 1.35rem;
    border-radius: var(--radius-lg);
  }

  .hero-search {
    flex-wrap: wrap;
    padding: .55rem;
  }

  .hero-search__icon {
    margin-left: .45rem;
  }

  .hero-search__input {
    flex: 1 1 8rem;
    padding: .55rem 0;
    font-size: .95rem;
  }

  .hero-search__btn {
    flex: 0 0 auto;
    padding: .7rem 1rem;
  }

  .page-header,
  .section-head {
    align-items: flex-start;
  }

  .entry-card {
    grid-template-columns: minmax(0, 1fr);
    gap: .85rem;
    padding: 1rem;
  }

  .entry-card__title {
    font-size: 1.02rem;
  }

  .entry-card__aside {
    justify-content: flex-start;
  }

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

  .map-panel {
    top: 20px;
    right: 20px;
    min-width: 0;
    padding: .7rem .85rem;
  }

  .compare-table__hint {
    display: flex;
    align-items: center;
    gap: .35rem;
  }
}

@media (max-width: 575.98px) {
  .hero {
    padding: 1.5rem 1.25rem;
  }

  .compare-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .compare-dock__list {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  }

  .compare-chip__avatar {
    width: 40px;
    height: 40px;
  }

  /* 操作组在窄屏独占一行，避免与标题挤在一起 */
  .compare-actions {
    width: 100%;
  }
}

/* ==========================================================================
   15. 无障碍 / 减少动效
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .skip-link,
  .site-nav__link,
  .search-form,
  .search-form__submit,
  .hero,
  .hero-search,
  .hero-search__btn,
  .hero__chip,
  .entry-card,
  .entry-card::before,
  .entry-card__title a,
  .entry-card__link,
  .btn-compare,
  .empty-state__chip,
  .page-link,
  .compare-dock,
  .compare-dock__cta,
  .compare-dock__clear,
  .compare-actions__link,
  .compare-chip__remove,
  .site-footer__links a,
  .site-footer__legal a {
    transition: none;
  }

  /* hover 不再位移 */
  .entry-card:hover,
  .hero-search__btn:hover,
  .search-form__submit:active,
  .compare-dock__cta:active {
    transform: none;
  }

  .hero__compass {
    animation: none;
  }
}
