/* ============================================================
   统一导航壳（对标小程序 tabBar：筛查 / 工具 / 动态 / 我的）
   由 server.js 注入到每个公开页，nav.js 负责渲染与交互。
   自带设计变量，不依赖各页 :root（仅取色与既有页面一致）。
   ============================================================ */
.mp-nav {
  --mp-navy: #12264a;
  --mp-navy-light: #2c5282;
  --mp-gold: #c8a24a;
  --mp-gold-dark: #a9832f;
  --mp-bg: #f5f7fa;
  --mp-card: #ffffff;
  --mp-text: #1a202c;
  --mp-text-2: #718096;
  --mp-text-muted: #a0aec0;
  --mp-border: #e2e8f0;
  --mp-shadow: 0 4px 18px rgba(16, 24, 40, 0.08);

  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--mp-border);
}
.mp-nav.scrolled { box-shadow: var(--mp-shadow); border-bottom-color: #dae2ec; }

.mp-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.mp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--mp-navy);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.mp-brand .mp-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--mp-navy) 0%, var(--mp-navy-light) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
}
.mp-brand b { color: var(--mp-navy); }
.mp-brand span { color: var(--mp-gold); }
.mp-brand small { font-size: 11px; color: var(--mp-text-muted); font-weight: 500; margin-left: 2px; }

.mp-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.mp-links a {
  color: var(--mp-text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  transition: all 0.16s;
  white-space: nowrap;
}
.mp-links a:hover { color: var(--mp-navy); background: var(--mp-bg); }
.mp-links a.active { color: var(--mp-navy); font-weight: 700; }
.mp-links a.active::after {
  content: ''; display: block; height: 2px; margin: 4px auto 0;
  background: var(--mp-gold); border-radius: 2px; width: 18px;
}

.mp-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 合规工具下拉 */
.mp-dropdown { position: relative; }
.mp-drop-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--mp-border);
  color: var(--mp-navy); font-size: 14px; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.mp-drop-trigger:hover { background: var(--mp-bg); }
.mp-drop-trigger svg { transition: transform 0.18s; }
.mp-dropdown.open .mp-drop-trigger svg { transform: rotate(180deg); }

.mp-drop-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 640px;
  max-width: 86vw;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: 14px;
  box-shadow: var(--mp-shadow);
  padding: 18px;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
  /* 工具条目较多时会超出视口高度，面板改为内部滚动，保证最底部条目也能点到 */
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.mp-dropdown.open .mp-drop-panel { display: grid; }
.mp-drop-line h4 {
  margin: 0 0 8px; font-size: 14px; color: var(--mp-navy);
  display: flex; align-items: center; gap: 6px;
}
.mp-drop-line h4 .mp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mp-gold); }
.mp-drop-line .mp-sub { font-size: 12px; color: var(--mp-text-2); margin: 0 0 8px; }
.mp-drop-line a, .mp-drop-line span.mp-soon {
  display: block;
  font-size: 13px;
  color: var(--mp-text-2);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.4;
}
.mp-drop-line a:hover { background: var(--mp-bg); color: var(--mp-navy); }
.mp-drop-line span.mp-soon { color: var(--mp-text-muted); }
.mp-drop-line span.mp-soon b { color: var(--mp-gold-dark); font-weight: 600; font-size: 11px; margin-left: 4px; }

/* 未上线网页版的工具：标注「小程序使用」并给出引导（避免「敬请期待」这种无去向的说法） */
.mp-drop-hint {
  grid-column: 1 / -1;
  font-size: 12px; color: var(--mp-text-muted); line-height: 1.65;
  margin-top: 2px;
}
.mp-drop-hint a { color: var(--mp-gold-dark); text-decoration: none; }
.mp-drop-hint a:hover { text-decoration: underline; }

/* 下拉底部：关于 / 联系 / 条款（保留原各页导航的入口，避免丢链） */
.mp-drop-foot {
  grid-column: 1 / -1;
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--mp-border);
}
.mp-drop-foot a {
  font-size: 13px; color: var(--mp-text-2); text-decoration: none;
}
.mp-drop-foot a:hover { color: var(--mp-navy); }

.mp-lang {
  background: transparent; border: 1.5px solid var(--mp-navy);
  color: var(--mp-navy); font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.mp-lang:hover { background: var(--mp-navy); color: #fff; }

.mp-hamburger {
  display: none;
  background: transparent; border: none; cursor: pointer;
  width: 40px; height: 40px; color: var(--mp-navy);
}
.mp-hamburger svg { width: 24px; height: 24px; }

/* 移动端底部 tabBar（对标小程序 tabBar） */
.mp-tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--mp-border);
  box-shadow: 0 -4px 18px rgba(16, 24, 40, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mp-tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 0 6px;
  text-decoration: none; color: var(--mp-text-muted);
  font-size: 11px;
}
.mp-tabbar a .mp-tb-ico { font-size: 19px; line-height: 1; }
.mp-tabbar a.active { color: var(--mp-gold-dark); font-weight: 700; }
.mp-tabbar a.mp-disabled { opacity: 0.5; pointer-events: none; }

@media (max-width: 768px) {
  .mp-nav-inner { gap: 8px; padding: 0 14px; height: 52px; }
  .mp-brand small { display: none; }
  .mp-links {
    display: none;
    position: absolute; top: 52px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--mp-card); border-bottom: 1px solid var(--mp-border);
    box-shadow: var(--mp-shadow); padding: 6px 0;
  }
  .mp-nav.open .mp-links { display: flex; }
  .mp-links a { padding: 13px 20px; font-size: 15px; border-radius: 0; text-align: left; }
  .mp-links a.active::after { display: none; }
  .mp-hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .mp-tabbar { display: flex; }
  body { padding-bottom: 56px; }          /* 给底部 tabBar 让位 */
}
