/* ==========================================================================
   base.css —— 设计变量 + 重置 + 通用组件 + 动画
   --------------------------------------------------------------------------
   职责：
     1) 定义全局设计令牌（:root CSS 变量），后续所有模块只允许复用这些变量；
     2) 提供与业务无关的通用组件类（卡片 / 列表 / 胶囊 / 按钮 / 表单 / 反馈 /
        骨架屏 / 空态 / 错误态 / 演示角标 / 下载进度 / 底部导航）；
     3) 提供页面入场动画与无障碍降级（prefers-reduced-motion）。

   后续模块接入约定（重要）：
     · 颜色、间距、圆角、阴影、字号一律使用本文件 :root 中的变量，禁止硬编码色值；
     · 结构类优先复用 .card / .list / .sec-title / .chip / .btn / .field 等，
       不要另造一套视觉体系；
     · 新增模块私有样式请写入各自的 h5 CSS（如后续如需可新增，但需经统一评审）。
   ========================================================================== */

:root {
  /* —— 品牌色 —— */
  --c-primary: #0E7C5A;        /* 主色：低碳绿 */
  --c-primary-deep: #0A5C43;
  --c-primary-soft: #E8F4EF;
  --c-tech: #1677A8;           /* 科技蓝：计量 / 数据类标识 */
  --c-tech-soft: #E6F2F8;

  /* —— 文字 —— */
  --c-ink: #14231F;            /* 主文字 */
  --c-ink-2: #46574F;          /* 次文字 */
  --c-ink-3: #8A9A93;          /* 辅助文字 */

  /* —— 线与底 —— */
  --c-line: #E4EAE6;
  --c-bg: #F4F7F5;
  --c-card: #FFFFFF;

  /* —— 状态色 —— */
  --c-warn: #B4690E;
  --c-warn-soft: #FBF3E6;
  --c-danger: #B3261E;
  --c-danger-soft: #FBECEA;
  --c-success: #0E7C5A;
  --c-success-soft: #E8F4EF;

  /* —— 圆角 —— */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-pill: 999px;

  /* —— 阴影 —— */
  --shadow-1: 0 1px 2px rgba(20, 35, 31, .06), 0 2px 8px rgba(20, 35, 31, .04);
  --shadow-2: 0 6px 20px rgba(20, 35, 31, .10);

  /* —— 间距 —— */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;

  /* —— 字号 —— */
  --font-xs: 12px;
  --font-s: 13px;
  --font-m: 15px;
  --font-l: 17px;
  --font-xl: 20px;
  --font-xxl: 24px;

  /* —— 布局 —— */
  --tabbar-h: 56px;
  --page-max: 720px;           /* H5 在大屏下的最大内容宽度 */
}

/* ============================ 重置 ============================ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 横向裁切放在 html 上：body 若设 overflow-x:hidden，
     会因"另一轴自动变 auto"而生成滚动容器，导致 sticky 失效。
     根因修复（移动端底部菜单不可见）：
     原为 overflow-x:hidden，会让 html 自身成为滚动容器
     （计算后 overflow-y 变为 auto）。iOS Safari / 微信 iOS WebView
     在"根元素为滚动容器"时，会把 position:fixed 元素相对 html 的
     padding box（仅一屏高）定位，页面滚动后固定底栏不再跟随视口，
     表现为"底部菜单在移动端看不见"；桌面 Chromium 仍按视口定位，
     故只在真机复现。改用 clip：只裁切、不生成滚动容器。 */
  overflow-x: clip;
}

/* 旧内核（Safari < 16 等不支持 overflow:clip）回退为原行为 */
@supports not (overflow: clip) {
  html { overflow-x: hidden; }
}

body {
  margin: 0;
  padding: 0;
  /* clip 不产生滚动容器，不支持时由 html 的 hidden 兜底 */
  overflow-x: clip;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--font-m);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: break-word;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, p, figure, ul, ol, dl, dd {
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5 {
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.42;
}

ul, ol { list-style: none; }

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

[hidden] { display: none !important; }

::selection {
  background: var(--c-primary-soft);
  color: var(--c-primary-deep);
}

/* 细滚动条（PC / 后台预览友好） */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb {
  background: #CBD6D0;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-track { background: transparent; }

/* ======================= 应用骨架（H5） ======================= */
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: calc(env(safe-area-inset-top, 0px) + var(--sp-2)) var(--sp-4) var(--sp-2);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-line);
}

/* 不支持毛玻璃时降级为实色 */
@supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .app-header { background: #FFFFFF; }
}

.app-header .ah-title {
  flex: 1;
  min-width: 0;
  font-size: var(--font-l);
  font-weight: 600;
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header .ah-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  color: var(--c-ink);
  border-radius: var(--radius-pill);
}

.app-header .ah-back:active { background: rgba(20, 35, 31, .06); }

.app-body {
  flex: 1;
  width: 100%;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

/* ======================= 移动端壳层：内部滚动容器（根因修复） =======================
   背景：.tabbar 是 .app-shell（flex column）的尾部元素，文档流自然位置在文档底部，
   长页面必须依赖 position:sticky;bottom:0 吸附回视口底部。
   但 iOS Safari / 微信 iOS WebView 对"flex 容器内子项的 sticky bottom 吸附"
   存在已知实现缺陷：元素停留在文档流自然位置（视口之外），不吸附 →
   移动端滚动到底部时底部菜单不可见、内容尾部被截断；桌面 Chromium 实现完整，
   故 PC 端（>720px）一直正常。

   修复（改祖先，不改 .tabbar 的定位方式）：
   · ≤720px 下给 .app-shell 一个"确定高度"（100dvh，旧内核回退 100vh），
     使 .app-body（flex:1 + min-height:0 + overflow-y:auto）成为真正的
     约束性滚动容器——此前 .app-shell 只有 min-height（无确定 height），
     flex 容器随内容增高，.app-body 的 overflow-y:auto 从未形成约束，
     即 home.css「第 2 轮」修复实际未生效；
   · 滚动发生在 .app-body 内部后，.app-shell 高度恒等于视口，
     .tabbar 作为 flex 尾部元素天然恒定位于视口底部：
     不依赖 sticky 的 bottom 吸附，更不引入 fixed（fixed 在 iOS 布局视口
     含可折叠地址栏时 bottom:0 会落到可视区之下，见 home.css 警告）；
   · .app-header 位于滚动容器之外（flex 头部），天然常驻顶部，
     原 sticky top 在壳层不滚动时退化为普通定位，表现一致；
   · 桌面端（>720px）不命中本断点：滚动仍发生在视口，布局完全不变。
   配套：滚动位置存取与锁定见 router.js（saveScroll/restoreScroll）
   与下方 html:has(body.no-scroll) 的 .app-body 锁定规则。 */
@media (max-width: 720px) {
  .app-shell {
    height: 100vh;
    height: 100dvh;
  }
  .app-body {
    min-height: 0;
    overflow-y: auto;
  }
}

.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  /* 底栏已改为文档流内的 sticky 尾部元素（见下方 .tabbar），
     不再与内容重叠，因此这里只保留普通底部留白。
     原 calc(--tabbar-h + 16px + safe-area) 是给 position:fixed 底栏
     预留的"遮挡补偿"，继续保留会形成 72px 的双份留白。 */
  padding: 0 var(--sp-4) var(--sp-4);
}

/* 页面入场动画（前进时由 Router 添加） */
.page-enter {
  animation: pageIn 180ms ease-out both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================ 卡片 ============================ */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.card + .card { margin-top: var(--sp-3); }

.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  font-size: var(--font-m);
  font-weight: 600;
  letter-spacing: .01em;
}

.card-hd .card-hd-extra {
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--c-ink-3);
}

.card-bd {
  padding: var(--sp-4);
  font-size: var(--font-m);
  line-height: 1.72;
}

.card-ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--c-line);
  background: #FBFCFB;
  font-size: var(--font-xs);
  color: var(--c-ink-3);
}

/* ============================ 列表 ============================ */
.list { display: block; }

.list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-height: 44px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-card);
  border-bottom: 1px solid var(--c-line);
  transition: background-color .15s ease;
}

.list-item:last-child { border-bottom: 0; }
.list-item:active { background: #F7FAF8; }

.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title {
  font-size: var(--font-m);
  color: var(--c-ink);
  font-weight: 500;
  line-height: 1.55;
}
.list-item .li-desc {
  margin-top: var(--sp-1);
  font-size: var(--font-xs);
  color: var(--c-ink-3);
  line-height: 1.6;
}
.list-item .li-extra {
  flex: none;
  color: var(--c-ink-3);
  font-size: var(--font-xs);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ========================= 区块标题 ========================= */
.sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin: var(--sp-5) 0 var(--sp-3);
}

.sec-title h2,
.sec-title .st-text {
  position: relative;
  padding-left: 12px;
  font-size: var(--font-l);
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--c-ink);
  line-height: 1.4;
}

.sec-title h2::before,
.sec-title .st-text::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: var(--c-primary);
  border-radius: 2px;
}

.sec-title .st-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  /* 保证 44px 点击热区，同时用负外边距抵消占位，
     避免把 .sec-title 行高撑到 44px 导致与标题错位。 */
  min-height: 44px;
  margin: -12px 0;
  padding-left: var(--sp-2);
  font-size: var(--font-s);
  font-weight: 400;
  color: var(--c-ink-3);
  background: transparent;
}

.sec-title .st-more:active { color: var(--c-primary); }

.sec-title .st-more svg { width: 14px; height: 14px; display: block; }

/* ============================ 胶囊 ============================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #F0F4F2;
  color: var(--c-ink-2);
  font-size: var(--font-xs);
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip--kw {
  background: var(--c-primary-soft);
  color: var(--c-primary-deep);
}

.chip--source {
  background: #F1F4F6;
  color: var(--c-ink-2);
  border: 1px solid var(--c-line);
}

.chip--tag {
  background: var(--c-tech-soft);
  color: #105E86;
}

.chip--active {
  background: var(--c-primary);
  color: #FFFFFF;
  border-color: var(--c-primary);
}

/* 状态点 */
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-ink-3);
  flex: none;
}
.dot--on { background: var(--c-success); }
.dot--warn { background: var(--c-warn); }
.dot--off { background: var(--c-ink-3); }
.dot--danger { background: var(--c-danger); }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-card);
  color: var(--c-ink);
  font-size: var(--font-m);
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease;
}

.btn:active { transform: scale(.98); background: #F5F8F6; }

.btn--primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #FFFFFF;
}
.btn--primary:active { background: var(--c-primary-deep); }

.btn--ghost {
  background: transparent;
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.btn--ghost:active { background: var(--c-primary-soft); }

.btn--danger {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #FFFFFF;
}
.btn--danger:active { background: #8F1E18; }

.btn--sm {
  min-height: 34px;
  padding: 0 var(--sp-3);
  font-size: var(--font-s);
  border-radius: var(--radius-s);
}

.btn--block { width: 100%; }

.btn:disabled,
.btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  background: var(--c-card);
  color: var(--c-ink-3);
  border-color: var(--c-line);
}

.btn--primary:disabled,
.btn--primary.is-disabled {
  background: var(--c-primary);
  color: #FFFFFF;
}

/* ============================ 表单 ============================ */
.field { margin-bottom: var(--sp-4); }

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--font-s);
  font-weight: 500;
  color: var(--c-ink-2);
}

.field-label .req { color: var(--c-danger); margin-left: 2px; }

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px var(--sp-3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-s);
  background: var(--c-card);
  color: var(--c-ink);
  font-size: var(--font-m);
  line-height: 1.5;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.textarea { min-height: 96px; resize: vertical; }

.select {
  background-image: linear-gradient(45deg, transparent 50%, var(--c-ink-3) 50%),
    linear-gradient(135deg, var(--c-ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 20px, calc(100% - 11px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 90, .12);
}

.input::placeholder,
.textarea::placeholder { color: #AEBAB5; }

.input--error,
.input--error:focus {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, .10);
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: var(--font-xs);
  color: var(--c-danger);
  line-height: 1.5;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: var(--font-xs);
  color: var(--c-ink-3);
  line-height: 1.5;
}

/* ============================ 反馈：Toast ============================ */
.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  pointer-events: none;
}

.toast {
  max-width: min(560px, 100%);
  padding: 10px var(--sp-4);
  background: rgba(255, 255, 255, .98);
  color: var(--c-ink);
  font-size: var(--font-s);
  line-height: 1.5;
  border: 1px solid var(--c-line);
  border-left: 3px solid var(--c-ink-3);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-2);
  animation: toastIn 180ms ease-out both;
  pointer-events: auto;
  word-break: break-word;
}

.toast--success { border-left-color: var(--c-success); background: var(--c-success-soft); }
.toast--info    { border-left-color: var(--c-tech);    background: var(--c-tech-soft); }
.toast--warn    { border-left-color: var(--c-warn);     background: var(--c-warn-soft); }
.toast--error   { border-left-color: var(--c-danger);   background: var(--c-danger-soft); }

.toast.is-out { animation: toastOut 180ms ease-in both; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ======================= 反馈：Modal（底部抽屉） ======================= */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(12, 24, 20, .42);
  animation: maskIn 160ms ease-out both;
  padding: 0;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--page-max);
  max-height: 84vh;
  background: var(--c-card);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-2);
  animation: sheetUp 220ms cubic-bezier(.22, .68, .36, 1) both;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}

.modal-hd {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--c-line);
}

.modal-hd h3 {
  flex: 1;
  min-width: 0;
  font-size: var(--font-l);
  font-weight: 600;
  letter-spacing: .01em;
}

.modal-close {
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--c-ink-3);
  font-size: 18px;
  line-height: 1;
}
.modal-close svg { width: 16px; height: 16px; display: block; }

.modal-close:active { background: #F2F5F3; }

.modal-bd {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4);
  font-size: var(--font-m);
  line-height: 1.72;
  color: var(--c-ink-2);
  text-align: justify;
}

.modal-ft {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--c-line);
  background: #FCFDFC;
}

.modal-ft .btn { flex: 1; }

.modal.is-closing { animation: sheetDown 180ms ease-in both; }
.modal-mask.is-closing { animation: maskOut 180ms ease-in both; }

@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes maskOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheetUp {
  from { transform: translateY(18px); opacity: .6; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes sheetDown {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(24px); opacity: 0; }
}

/* ============================ 骨架屏 ============================ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #EDF2EF;
  border-radius: var(--radius-s);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .75) 50%, rgba(255, 255, 255, 0) 100%);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.sk-wrap { display: block; }

.sk-card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }
.sk-block { height: 96px; margin-top: var(--sp-2); }

/* ======================= 空态 / 错误态 ======================= */
.state-empty,
.state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
}

.state-empty .se-illus,
.state-error .se-illus {
  width: 96px;
  height: 96px;
  margin-bottom: var(--sp-1);
  color: var(--c-primary);
  opacity: .9;
}

.state-error .se-illus { color: var(--c-warn); }

.state-empty .se-title,
.state-error .se-title {
  font-size: var(--font-m);
  font-weight: 600;
  color: var(--c-ink);
  letter-spacing: .01em;
}

.state-empty .se-desc,
.state-error .se-desc {
  max-width: 34em;
  font-size: var(--font-s);
  color: var(--c-ink-3);
  line-height: 1.65;
  text-align: center;
}

.state-empty .btn,
.state-error .btn { margin-top: var(--sp-2); }

/* ========================= 演示数据角标 ========================= */
.demo-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-s);
  background: #F6F8F7;
  color: var(--c-ink-3);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
  vertical-align: middle;
}

/* ========================= 下载进度 ========================= */
.dl-progress {
  padding: var(--sp-2) 0 var(--sp-1);
}

.dl-progress .dl-file {
  font-size: var(--font-s);
  color: var(--c-ink);
  font-weight: 500;
  word-break: break-all;
}

.dl-progress .dl-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: 6px;
  font-size: var(--font-xs);
  color: var(--c-ink-3);
}

.dl-progress .dl-pct { color: var(--c-primary); font-weight: 600; }

.dl-bar {
  height: 6px;
  margin-top: var(--sp-2);
  border-radius: var(--radius-pill);
  background: #EDF2EF;
  overflow: hidden;
}

.dl-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--c-primary) 0%, #17A176 100%);
  transition: width .16s linear;
}

.dl-progress .dl-cancel {
  margin-top: var(--sp-2);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--font-s);
  color: var(--c-ink-3);
}
.dl-progress .dl-cancel:active { color: var(--c-danger); }

/* ============================ 底部导航 ============================ */
/* 根因修复（移动模拟态底部菜单不可见）：
   原先用 position:fixed + left/right/bottom 贴底。fixed 的包含块是"视口"，
   但一旦 .tabbar 的任意祖先出现 transform / filter / backdrop-filter /
   will-change / contain / perspective（DevTools 移动模拟的等比缩放、
   某些 WebView 的合成层优化、弹层动画等都会触发），包含块就会改成该祖先，
   bottom:0 于是相对"整篇文档的底边"而不是"视口底边"解析：
   实测故障注入下 rect.top 由 876 → 1237.9（文档末尾），且元素被祖先缩放为
   55.333px 高（= 56 × 0.98809），完全落到 932 高的可视区之外。
   桌面窗口足够宽、无等比缩放 → 无 transform 祖先 → fixed 正常，故只在移动模拟态复现。

   现改为"flex 纵向壳层的尾部元素 + position:sticky; bottom:0"：
   · 不再依赖 fixed 包含块，祖先的 transform/缩放不影响贴底；
   · .app-shell 已是 flex column + min-height:100dvh，.app-body 为 flex:1，
     短页面时底栏自然贴底（sticky 生效），长页面滚动时持续吸底；
   · 桌面端由 .app-shell 的 720px 居中继承宽度，无需 left:50% + translateX。 */
.tabbar {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 60;
  flex: none;
  width: 100%;
  display: flex;
  align-items: stretch;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--c-line);
}

/* 移动端兜底：关闭固定底栏的毛玻璃。
   iOS Safari / 微信 iOS WebView 对"position:fixed + backdrop-filter"
   在滚动过程中存在合成层不重绘的已知缺陷，底栏会短暂消失或只剩残影。
   .tabbar 背景本身已是不透明 .95 白色，关闭毛玻璃后视觉差异不可见；
   桌面端（>720px）保持毛玻璃不变。 */
@media (max-width: 720px) {
  .tabbar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #FFFFFF;
  }
}

@supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .tabbar { background: #FFFFFF; }
}

.tabbar-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  padding: 6px 2px 4px;
  color: var(--c-ink-3);
  font-size: var(--font-xs);
  line-height: 1.2;
  text-align: center;
  transition: color .15s ease;
}

.tabbar-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(.3);
  width: 24px;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: var(--c-primary);
  opacity: 0;
  transition: opacity .15s ease, transform .18s ease;
}

.tabbar-item .ti-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.tabbar-item .ti-ico svg { width: 22px; height: 22px; display: block; }

.tabbar-item .ti-name {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tabbar-item.is-active {
  color: var(--c-primary);
  font-weight: 600;
}

.tabbar-item.is-active::before {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

/* 说明：底部菜单已无"父级菜单 / 二级抽屉"形态（中心概况三个子入口下线），
   因此不再需要 .is-parent-open 与 .ti-arrow 的展开态样式。 */

.tabbar-item:active { background: rgba(14, 124, 90, .05); }

/* ======================= 外链提示框（UI.externalLink） ======================= */
.ext-box { display: block; }

.ext-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 8px 0;
  border-bottom: 1px dashed var(--c-line);
  font-size: var(--font-s);
}

.ext-row:last-of-type { border-bottom: 0; }

.ext-k {
  flex: none;
  width: 62px;
  color: var(--c-ink-3);
  line-height: 1.6;
}

.ext-v {
  flex: 1;
  min-width: 0;
  color: var(--c-ink);
  line-height: 1.6;
  word-break: break-all;
}

.ext-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--font-xs);
  color: var(--c-tech);
  background: var(--c-tech-soft);
  border-radius: var(--radius-s);
  padding: 4px 8px;
}

.ext-tip {
  display: block;
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-s);
  background: var(--c-warn-soft);
  color: var(--c-warn);
  font-size: var(--font-xs);
  line-height: 1.65;
  text-align: left;
}

.dl-progress .dl-file-ico {
  display: inline-block;
  vertical-align: -2px;
}

/* ======================= 内联 SVG 尺寸约定 ======================= */
/* UI.icon() 输出的 SVG 只有 viewBox、无固定宽高，
   因此凡是以图标形式使用的位置，必须由容器或下列规则限定尺寸，
   否则内联 SVG 默认撑满父级宽度，会破坏排版。 */
.se-illus svg,
.pc-ico svg { width: 100%; height: 100%; display: block; }

.ext-tip-ico,
.dl-file-ico {
  width: 14px;
  height: 14px;
  flex: none;
  vertical-align: -2px;
  margin-right: 4px;
}

.img-fallback { background: var(--c-bg); }

/* ============================ 工具类 ============================ */
.u-flex { display: flex; align-items: center; }
.u-between { display: flex; align-items: center; justify-content: space-between; }
.u-gap-1 { gap: var(--sp-1); }
.u-gap-2 { gap: var(--sp-2); }
.u-gap-3 { gap: var(--sp-3); }
.u-wrap { flex-wrap: wrap; }
.u-mt-2 { margin-top: var(--sp-2); }
.u-mt-3 { margin-top: var(--sp-3); }
.u-mt-4 { margin-top: var(--sp-4); }
.u-mt-5 { margin-top: var(--sp-5); }
.u-mb-0 { margin-bottom: 0; }
.u-text-2 { color: var(--c-ink-2); }
.u-text-3 { color: var(--c-ink-3); }
.u-fs-xs { font-size: var(--font-xs); }
.u-fs-s { font-size: var(--font-s); }
.u-bold { font-weight: 600; }
.u-primary { color: var(--c-primary); }
.u-tech { color: var(--c-tech); }
.u-center { text-align: center; }
.u-hide { display: none !important; }

/* 正文两端对齐（仅在正文段落使用） */
.u-justify { text-align: justify; }

/* 多行截断 */
.clamp-1,
.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* 禁止页面滚动（弹层打开时挂在 body 上）
   注意：必须把 overflow 锁在 html，不能锁在 body。
   .tabbar 自 v2 起是"flex 尾部 + position:sticky;bottom:0"，
   一旦 body 自己成为滚动容器（overflow:hidden 会让另一轴变 auto），
   sticky 的吸附参照就变成 body 的滚动视口，而 body 高度 = 文档全高，
   吸附点被推到文档末尾，实测 index.html 二级菜单展开期间
   .tabbar rect.top 由 876 → 1517.03（可视区 932），底栏整体掉出视口；
   html 本就是根滚动容器，锁它不改变 sticky 的吸附参照，
   与 .tabbar 自身的 sticky 定位口径一致。
   · 现代内核用 :has 反查"body 被挂类"，无需改 JS；
   · 不支持 :has 的旧内核退回锁 body（行为与旧版一致），
     该场景下 sticky 会被 body 吸附，属已知降级，不影响功能可用性。 */
html:has(body.no-scroll) { overflow: hidden; }

@supports not selector(:has(*)) {
  body.no-scroll { overflow: hidden; }
}

/* 移动端（≤720px）滚动发生在 .app-body 内部（见上方「移动端壳层」段），
   弹层打开时 html 的锁定不再覆盖内容滚动，必须同步锁住 .app-body，
   否则弹层打开期间背景内容仍会滚动。 */
@media (max-width: 720px) {
  html:has(body.no-scroll) .app-body { overflow: hidden; }
}

/* ======================= 动效降级 ======================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 全站隐藏滚动条外观（保留滚动能力）=====
   原因：原型演示要求界面干净，后台侧边栏与内容区之间的竖向滚动条视觉干扰明显。
   范围：index.html 与 admin.html 均加载本文件，此处一处声明即全站（H5 前台 + PC 后台）生效。
   说明：仅隐藏滚动条外观；所有容器的 overflow / overflow-x / overflow-y 原值一律保持不变，
        滚轮、触控板、触摸滑动、键盘滚动（PgUp/PgDn、空格、方向键）均正常，
        iOS 惯性滚动依赖的 -webkit-overflow-scrolling: touch 也全部沿用原声明，未做删改。
   关于 !important：文件前部（原"细滚动条"段）已定义全局 6px ::-webkit-scrollbar，
        admin.css 的 .ad-nav 定义了 4px，h5.css 的 .news-scroll / .hs-chips / .act-chips /
        .mt-chips / .mt-formula-scroll 等也各自定义了自己的 ::-webkit-scrollbar 宽度，
        这些类选择器的权重高于本段通配符选择器，故必须用 !important 才能彻底覆盖，
        否则会残留 4—6px 的滚动条外观（本项目约定：使用 !important 必须注释原因）。
   注：不采用 scrollbar-gutter: stable 反向补偿，也无需补偿——隐藏的是滚动条外观，
        滚动容器的布局盒子不受影响。 */
html,
body {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* 旧 Edge / IE */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* 覆盖其余所有可能产生滚动条的容器（后台 .ad-nav / .ad-table-wrap / .ad-drawer-bd，
   H5 各横向 chip 行、公式滚动块，以及 base.css 的 .modal-bd 等）。
   统一用 display:none 彻底隐藏，不使用"半透明轨道"这类半遮方案。 */
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
