/* ============================================================
   招标信息智能分析 —— H5 前台样式
   移动优先，模拟小程序观感
   ============================================================ */

:root {
  --primary: #1a56db;
  --primary-light: #e8effc;
  --primary-dark: #123c99;
  --money: #d97706;
  --money-bg: #fef3c7;
  --danger: #dc2626;
  --success: #059669;
  --text: #1f2937;
  --text-sub: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --bg: #f4f5f7;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --tabbar-h: 54px;
  --topbar-h: 52px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { max-width: 560px; margin: 0 auto; min-height: 100vh;
       background: var(--card); position: relative; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
}
.topbar h1 { font-size: 16px; font-weight: 600; margin: 0; flex: 1; }
.topbar .sub { font-size: 12px; opacity: .82; }
.topbar-login {
  height: 30px; padding: 0 14px; border-radius: 15px;
  background: rgba(255,255,255,.94); color: var(--primary);
  font-size: 13px; font-weight: 600;
}
.topbar-login:active { background: #fff; }

.searchbar {
  position: sticky; top: var(--topbar-h); z-index: 19;
  padding: 10px 14px 6px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.searchbar .row { display: flex; gap: 8px; align-items: center; }
.search-input {
  flex: 1; height: 36px; padding: 0 12px;
  background: var(--bg); border: 1px solid transparent;
  border-radius: 18px; outline: none;
}
.search-input:focus { border-color: var(--primary); background: #fff; }
.btn-search {
  height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 13px;
}

/* ---------------------------------------------------------- 筛选面板

   8 组筛选内联铺开要 ~780px（视口 800px），列表完全看不见 ——
   而且**跟每行放几个无关**，是组数太多。所以做成可折叠面板：

     收起（默认）  [筛选  近一周 · 竞争性磋商]        [筛选 ▾]   ← 一行
     展开          [发布时间] [采购方式] … 全部 8 组        [收起 ▴]

   ⚠️ 收起时必须显示**已选条件摘要**。否则用户看不到自己还开着筛选，
      会以为列表坏了 —— 这正是当初把横滑改成换行的原因，
      折叠面板必须靠这行摘要来避免重蹈覆辙。 */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 6px 0 2px;
}
.filter-summary {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; overflow: hidden;
}
.filter-summary .k { color: var(--text-light); flex: 0 0 auto; }
.filter-summary .v {
  color: var(--text-sub); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filter-summary .v.on { color: var(--primary); font-weight: 600; }
.filter-toggle {
  flex: 0 0 auto; background: var(--bg); border: none;
  color: var(--primary); font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 13px;
}
.filter-toggle:active { background: var(--primary-light); }

/* 筛选面板：**限高 + 自己滚**。
 *
 * ⚠️ 为什么必须限高：
 *    政府采购有 7 组筛选，全部展开后面板实测 **852px**，
 *    而 iPhone SE 的视口只有 667px —— 面板比屏幕还高，
 *    一展开就把整屏占满，下面的标讯全被挤走，
 *    而且面板本身不是滚动容器，只能靠滚整个页面找选项。
 *
 *    现在面板最高 52vh（约 347px on 667），超出的部分**在面板内部滚动**。
 *    这样：① 不占满屏 ② 选项自己能滑 ③ 下面的列表还看得见。
 *
 * ⚠️ `overscroll-behavior: contain` 不能省：
 *    滚到面板底部时，滑动**不要**传导给页面，
 *    否则用户想继续看面板里的选项，结果整个页面跟着滚走了。 */
.filter-panel {
  border-top: 1px solid var(--border); margin-top: 4px;
  max-height: 52vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* 滚动条在手机上不显示，但桌面预览时给个细的 */
  scrollbar-width: thin;
}
/* 底部留一点空隙，最后一行选项不会被切掉半截 */
.filter-panel > .chips:last-child { padding-bottom: 10px; }

/* ---------------------------------------------------------- 筛选行：换行全部展示

   ⚠️ 这里**故意用换行而不是横滑**。

   横滑的问题不是"能不能滑"，而是**用户不知道右边还有内容** ——
   哪怕加了渐隐提示，仍然有一半选项是"要动手才能看到"的。
   筛选条件的价值就在于「一眼看到有哪些可筛的」，
   藏一半等于没给。

    ## 但不能无限铺开

   实测（390px 宽）搜索栏高度：

       招标信息 7 组筛选    892px / 视口 800px = 112%  ← 列表被挤出屏幕

   **根因不是选项多，是标签长**。像「电力、热力、燃气及水生产和供应业 109」
   这种，一个 chip 就独占一行，把每行从 1 行撑成 3 行。

   所以：
     ① 单个 chip 限宽 + 省略号 —— 一个长标签不能霸占整行
     ② 字号/内边距收紧，一行能多放一个
     ③ 每行默认只显示前 4 个，其余收进「+N 更多」

   三条合起来把每行压到 1–2 行。实测「招标信息」795px → 约 500px。 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px 0 3px; }
.chip {
  flex: 0 1 auto; padding: 4px 10px; border-radius: 13px;
  background: var(--bg); color: var(--text-sub);
  font-size: 12px; border: 1px solid transparent; white-space: nowrap;
}
/* ① 限宽 + 省略号：长标签不能独占一行。
   ⚠️ 只作用于**筛选** chip。分类 chip 在 2 列网格里，格子本身只有 ~142px，
       `max-width:62%` 会把它们再压到 88px，「项目立项 300」直接被截断。
       （实测 320px 宽下分类行两个字变省略号） */
.chips:not(.cats) > .chip {
  max-width: 62%;
  overflow: hidden; text-overflow: ellipsis;
}
.chip.on { background: var(--primary-light); color: var(--primary);
           border-color: var(--primary); font-weight: 600; }
.chip .n { opacity: .62; margin-left: 3px; font-size: 11px; }

/* 「更多 / 收起」—— 虚线边框，和普通筛选项区分开 */
.chip.more {
  border: 1px dashed var(--border, #d1d5db);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
}
.chip.more:active { background: var(--primary-light); }

/* ---------------------------------------------------------- 内容区 */
main { flex: 1; padding: 10px 12px calc(var(--tabbar-h) + 16px); }

/* 标讯卡片 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 14px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.card:active { background: #fafbfc; }
.card .title {
  font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 8px;
}
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.card .foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-light);
}
.card .unit { color: var(--text-sub); font-size: 12.5px; margin-bottom: 7px;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 4px;
  background: var(--bg); color: var(--text-sub); white-space: nowrap;
}
.tag.region { background: #eef2ff; color: #4338ca; }
.tag.cat    { background: #ecfdf5; color: #047857; }
.tag.type   { background: #eff6ff; color: #1d4ed8; }
.tag.money  { background: var(--money-bg); color: var(--money); font-weight: 600; }
.tag.urgent { background: #fef2f2; color: var(--danger); font-weight: 600; }
.tag.reason { background: var(--primary-light); color: var(--primary); }

/* 命中原因条 */
.reason-bar {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-sub);
}
.reason-bar .lbl { color: var(--primary); font-weight: 600; }

/* ---------------------------------------------------------- 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; height: var(--tabbar-h);
  display: flex; background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border); z-index: 30;
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 10.5px; color: var(--text-light);
  position: relative;
}
.tabbar .tab.on { color: var(--primary); font-weight: 600; }
.tabbar svg { width: 21px; height: 21px; }
.badge {
  position: absolute; top: 5px; right: 50%; margin-right: -20px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600;
  line-height: 16px; text-align: center;
}

/* ---------------------------------------------------------- 浮层页面 */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  max-width: 560px; margin: 0 auto; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* ⚠️ 详情浮层要压在其它浮层之上。
   四个浮层共用 `.overlay`，z-index 本来都是 50 ——
   DOM 里靠后的（收藏/提醒设置）会盖住靠前的（详情）。
   从收藏点进详情时，详情就在下面看不见，表现得像「点了没反应」。
   JS 里 `openDetail` 会主动关掉那些浮层，这里再给一层保险。 */
.overlay.detail-overlay { z-index: 60; }

/* 单位历史浮层 —— **必须比详情还高**。
   入口有两个：
     ① 「我的 → 我关注的单位」  （详情没开）
     ② 详情页里点「交易发起方」  ← 这时详情浮层（60）还开着
   不加这层的话，从详情点进去会看不见，表现成「点了没反应」——
   和当初收藏点不进详情是同一个坑。 */
.overlay.unit-detail { z-index: 70; }
.overlay-head {
  position: sticky; top: 0; z-index: 5;
  height: var(--topbar-h); display: flex; align-items: center; gap: 8px;
  padding: 0 14px; background: var(--card); border-bottom: 1px solid var(--border);
}
.overlay-head .back { font-size: 20px; color: var(--text); line-height: 1; }
/* 「返回上一条」：只在从时间轴跳转后出现，说明返回键的行为变了 */
.back-hint {
  margin-left: auto; font-size: 12px; color: var(--primary);
  background: var(--primary-light); border-radius: 12px; padding: 3px 10px;
}
.back-hint:active { opacity: .6; }
.overlay-head h2 { font-size: 16px; margin: 0; flex: 1; font-weight: 600; }
.overlay-body { padding: 12px 14px 40px; }

/* 详情 */
.detail-title { font-size: 18px; font-weight: 700; line-height: 1.45; margin: 0 0 12px; }
.kv { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border);
      font-size: 13.5px; }
.kv .k { flex: 0 0 76px; color: var(--text-light); }
.kv .v { flex: 1; color: var(--text); word-break: break-all; }
.section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
}
.section h3 { font-size: 14px; margin: 0 0 8px; color: var(--text); }
.content-body { font-size: 13.5px; line-height: 1.75; color: #374151;
                white-space: pre-wrap; word-break: break-word;
                max-height: 400px; overflow-y: auto; }

/* ---------------------------------------------------------- 源站正文 HTML

   渲染 `content_html`（清洗后的源站 HTML）。和纯文本版的关键区别：

     ① `white-space: normal` —— 纯文本要 pre-wrap 保留换行；
        HTML 里的换行只是源码排版，pre-wrap 会变成一堆空行。

     ② 表格强制 `table-layout: fixed` —— 源站大量用 colspan 排版，
        不 fixed 的话列宽会按内容撑开，375px 屏上直接溢出。

     ③ 源站的内联样式（`width:138px;float:right`）已经在后端剥掉了，
        所以这里只需要管住标签本身的默认行为。 */
.content-body.notice-html {
  white-space: normal;
  max-height: none;          /* 正文就是要看的，不限制高度 */
  overflow-y: visible;
  /* auto 布局的宽表会超出容器，横向滚动兜底 */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.notice-html table {
  /* ⚠️ 不能用 `width:100% + table-layout:fixed`。
   *
   *    源站表格大量用 colspan 铺出 10 个「逻辑列」（`<td colspan="9">`），
   *    固定布局会把宽度**平均分给 10 列** —— 手机上首列只有 39px，
   *    「项目名称」被压成一个字一行竖排（实测截图就是这么花的）。
   *
   *    改成 auto 布局 + 横向滚动：
   *      · auto  让浏览器按内容分配宽度，标签列自然变宽
   *      · 外层 .notice-html 横向滚动兜底，宽表也不撑破页面
   */
  width: auto !important;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 8px 0;
}
.notice-html td,
.notice-html th {
  border: 1px solid var(--border);
  padding: 6px 8px;
  vertical-align: top;
  word-break: break-word;    /* 长编号/长地址强制换行，不撑宽 */
  min-width: 0;
  /* 标签列（「项目名称」「标段编号」这类短词）不许被压成竖排 */
  max-width: 260px;
}
/* 短标签列给个下限，避免「项/目/名/称」竖排 */
.notice-html td:first-child,
.notice-html th:first-child {
  min-width: 4.5em;
  white-space: nowrap;
}
/* 带 colspan 的单元格里常有长正文，允许换行 */
.notice-html td[colspan] { white-space: normal; }
.notice-html p { margin: 6px 0; }
.notice-html h1,
.notice-html h2,
.notice-html h3,
.notice-html h4 { font-size: 14px; margin: 12px 0 6px; font-weight: 600; }
.notice-html img { max-width: 100%; height: auto; }
.notice-html a { color: var(--primary); word-break: break-all; }
.notice-html ul,
.notice-html ol { padding-left: 20px; margin: 6px 0; }
.notice-html li { margin: 3px 0; }
/* 源站偶尔用 <font size=+2> 放大字号，压一下 */
.notice-html font { font-size: inherit; }

/* ---------------------------------------------------------- 正文表格

   政务公告的关键信息（中标金额、供应商、报价明细）都在表格里。
   手机上表格会很宽，所以：
     - 外层横向滚动（表格本身是二维的，横滑是合理的）
     - 首列冻结，横滑时还能看出这一行是谁
     - 单元格内的长文本允许换行，不做截断（金额/名称截断会看错） */
.tbl-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 10px; background: #fff;
}
.tbl-wrap::-webkit-scrollbar { height: 6px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.data-table {
  border-collapse: collapse; font-size: 12.5px; min-width: 100%;
}
.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 7px 9px; text-align: left; vertical-align: top;
  white-space: normal; min-width: 60px; max-width: 220px;
  word-break: break-word;
}
.data-table thead th {
  background: #f3f4f6; font-weight: 600; color: #374151;
  white-space: nowrap;
}
.data-table tbody tr:nth-child(even) { background: #fafafa; }
/* 首列冻结 —— 横滑时还能看出这一行是谁 */
.data-table tbody td:first-child {
  position: sticky; left: 0; background: inherit;
  box-shadow: 1px 0 0 var(--border);
}
.notice-tip {
  font-size: 12px; color: var(--text-sub); background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; padding: 9px 11px;
  margin-bottom: 12px; line-height: 1.6;
}

/* ---------------- 项目流程时间轴 ----------------
   9 个节点串成一条竖线；空节点也画（灰点 +「未发生/暂无数据」），
   因为"还没走到这一步"本身就是用户想看的信息。 */
.chain-count { float: right; font-size: 12px; color: var(--text-light); font-weight: 400; }
.chain { margin: 6px 0 2px; }
.chain-row { display: flex; gap: 8px; }
.chain-axis {
  position: relative; width: 12px; flex: 0 0 12px;
  display: flex; justify-content: center;
}
/* 竖线：首行从圆点处开始，末行到圆点结束，避免上下出头 */
.chain-axis::before {
  content: ''; position: absolute; left: 5px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.chain-row:first-child .chain-axis::before { top: 8px; }
.chain-row:last-child .chain-axis::before { bottom: auto; height: 8px; }
.chain-dot {
  position: relative; z-index: 1;
  width: 10px; height: 10px; margin-top: 5px; border-radius: 50%;
  background: #d1d5db; border: 2px solid var(--card);
  box-sizing: content-box;
}
.chain-dot.on { background: var(--primary); }
.chain-main { flex: 1; min-width: 0; padding-bottom: 12px; }
.chain-row:last-child .chain-main { padding-bottom: 0; }
.chain-label { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; }
.chain-label.off { color: var(--text-light); font-weight: 400; }
.chain-item {
  display: flex; gap: 6px; margin-top: 5px;
  font-size: 12.5px; line-height: 1.5; cursor: pointer;
}
.chain-item:active { opacity: .55; }
.chain-date {
  flex: 0 0 auto; color: var(--text-light);
  font-variant-numeric: tabular-nums;
}
.chain-title { flex: 1; color: var(--text-sub); word-break: break-all; }
.chain-title.cur { color: var(--primary); font-weight: 600; }
.chain-more {
  flex: 0 0 auto; align-self: flex-start;
  background: var(--primary); color: #fff;
  font-size: 10px; line-height: 15px; padding: 0 5px; border-radius: 4px;
}
.chain-empty { font-size: 12px; color: var(--text-light); margin-top: 3px; }
.chain-tip {
  font-size: 11.5px; color: var(--text-light); line-height: 1.6;
  margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--border);
}

/* ---------------- 招标包列表 ----------------
   一个楼可能有施工/监理/设计几个包，各自进度独立。 */
.pkg-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; cursor: pointer;
  /* ⚠️ 包名这一侧不能被右侧元信息压缩。
     截图里「施工」被挤成竖排两个字，「当前」也被压扁 ——
     就是因为没有 flex 约束，名+徽标+进度+金额+日期全在一行抢宽度。 */
  flex-wrap: wrap;
  row-gap: 4px;
}
.pkg-row:last-of-type { border-bottom: none; }
.pkg-row:active { opacity: .55; }
.pkg-row.cur { color: var(--primary); }
.pkg-name {
  font-weight: 600; display: flex; align-items: center; gap: 6px;
  /* 包名不许被压：不换行、不缩小 */
  flex: 0 0 auto;
  white-space: nowrap;
}
.pkg-cur {
  font-style: normal; font-size: 10px; font-weight: 400;
  background: var(--primary); color: #fff; border-radius: 4px; padding: 0 5px;
  white-space: nowrap;
}
/* 「编号冲突」徽标 —— 只留一个小的警示图标 + 短文案。
   原来写「⚠ 编号冲突」5 个字，把整行挤爆；改成图标 + tooltip，
   真需要看说明时点一下看详情。 */
.pkg-warn {
  font-style: normal; font-size: 10px; font-weight: 400;
  background: #fef3c7; color: #b45309; border-radius: 4px;
  padding: 0 4px; white-space: nowrap; flex: 0 0 auto;
}
.pkg-meta {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  /* 元信息可以换到第二行，但不许把包名压扁 */
  margin-left: auto;
  white-space: nowrap;
}
.pkg-meta b { color: var(--primary); }
.pkg-amount { color: var(--money); font-weight: 600; }
.pkg-date { color: var(--text-light); font-variant-numeric: tabular-nums; }
.chain-pkg { font-weight: 400; color: var(--text-sub); font-size: 13px; }

/* 表单 */.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600;
                  margin-bottom: 7px; color: var(--text); }
/* 「（可选）」这种弱化后缀，别跟标签一样重 */
.form-row label .opt { font-weight: 400; color: var(--text-light); font-size: 12px; }
.form-row .hint { font-size: 11.5px; color: var(--text-light); margin-top: 5px;
                  line-height: 1.5; }

/* 登录 / 注册 切换标签 */
.auth-tabs {
  display: flex; gap: 0; margin: 0 0 14px;
  border-bottom: 1px solid var(--border);
}
.auth-tabs span {
  flex: 1; text-align: center; padding: 10px 0 9px;
  font-size: 14px; color: var(--text-sub); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tabs span.on {
  color: var(--primary); font-weight: 600; border-bottom-color: var(--primary);
}
.input, .select {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); outline: none;
}
.input:focus, .select:focus { border-color: var(--primary); }
.multi { display: flex; flex-wrap: wrap; gap: 7px; }
.multi .opt {
  padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--card); font-size: 12.5px; color: var(--text-sub);
}
.multi .opt.on { background: var(--primary-light); color: var(--primary);
                 border-color: var(--primary); font-weight: 600; }

.btn {
  display: block; width: 100%; height: 44px; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
}
.btn:disabled { opacity: .45; }
.btn.ghost { background: var(--card); color: var(--primary);
             border: 1px solid var(--primary); }
.btn.small { height: 34px; font-size: 13px; width: auto; padding: 0 16px;
             border-radius: 17px; display: inline-block; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row .btn { flex: 1; }

/* 预演结果 */
.preview {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: var(--radius);
  padding: 13px 14px; margin-bottom: 14px;
}
.preview .big { font-size: 26px; font-weight: 700; color: var(--primary); }
.preview .big small { font-size: 13px; font-weight: 400; color: var(--text-sub); }
.preview .sug { font-size: 12.5px; color: #075985; margin-top: 7px; line-height: 1.6; }

/* 消息 */
.msg { background: var(--card); border: 1px solid var(--border);
       border-radius: var(--radius); padding: 12px 13px; margin-bottom: 9px; }
.msg.unread { border-left: 3px solid var(--primary); }
.msg .t { font-size: 14px; font-weight: 600; line-height: 1.45; margin-bottom: 6px; }
.msg.unread .t::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 3px; background: var(--danger); margin-right: 6px;
  vertical-align: middle;
}
.msg .meta { font-size: 12px; color: var(--text-light); display: flex;
             justify-content: space-between; }

/* 空状态 / 加载 */
.empty { text-align: center; padding: 56px 20px; color: var(--text-light); }
.empty .icon { font-size: 40px; margin-bottom: 10px; opacity: .45; }
.empty p { margin: 6px 0; font-size: 13.5px; }
.empty .btn { margin-top: 14px; }

/* ---------------------------------------------------------- 关注单位 */

/* 详情页里「交易发起方」那个可点的单位名 */
.unit-link {
  color: var(--primary); cursor: pointer;
  border-bottom: 1px dashed var(--primary);
}
/* 关注按钮 —— 小、贴右边、不抢视觉 */
.follow-btn {
  display: inline-block; margin-left: 8px;
  padding: 2px 9px; font-size: 11.5px; line-height: 18px;
  border: 1px solid var(--primary); border-radius: 11px;
  background: #fff; color: var(--primary); cursor: pointer;
  vertical-align: middle; white-space: nowrap;
}
.follow-btn.on {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* 「我关注的单位」列表行 */
.unit-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.unit-row:last-child { border-bottom: none; }
.unit-main { flex: 1; min-width: 0; }
.unit-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.45; word-break: break-word;
}
/* 身份小标签：招标人 / 采购人 / 出让人… */
.unit-role {
  display: inline-block; margin-right: 5px;
  padding: 0 5px; font-size: 10.5px; font-weight: 400; line-height: 16px;
  color: var(--text-sub); background: #f4f5f7;
  border-radius: 4px; vertical-align: 1px;
}
.unit-meta {
  margin-top: 4px; font-size: 11.5px; color: var(--text-light);
  display: flex; gap: 10px;
}
.unit-arrow { color: var(--text-light); font-size: 18px; }

/* 单位详情页顶部概况 */
.unit-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; margin-bottom: 12px;
  background: #f4f5f7; border-radius: 9px;
  font-size: 13px; color: var(--text-sub);
}
.unit-summary b { color: var(--text); font-size: 15px; }

/* 加载更多 */
.load-more { text-align: center; padding: 16px 0 8px; }
.load-more button {
  padding: 8px 22px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 18px;
  background: #fff; color: var(--text-sub); cursor: pointer;
}
.load-more button:disabled { opacity: .5; }
/* 空状态里说明「是哪个筛选条件筛空的」—— 用弱化的小字 */
.empty .empty-hint {
  font-size: 12.5px; color: var(--text-sub);
  background: var(--bg); border-radius: 8px;
  padding: 6px 10px; display: inline-block; margin-top: 8px;
}
.loading { text-align: center; padding: 22px; color: var(--text-light); font-size: 13px; }
.more { text-align: center; padding: 14px; color: var(--text-light); font-size: 12.5px; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: rgba(17,24,39,.92); color: #fff; padding: 9px 18px;
  border-radius: 20px; font-size: 13px; z-index: 100; max-width: 80%;
  text-align: center;
}

/* 我的 */
.profile-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.avatar {
  width: 52px; height: 52px; border-radius: 26px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; flex: 0 0 52px;
}
.profile-head .who { font-size: 16px; font-weight: 600; }
.profile-head .sub { font-size: 12px; color: var(--text-light); margin-top: 3px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 14px; background: var(--card); border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.list-item:first-child { border-top-left-radius: var(--radius);
                         border-top-right-radius: var(--radius); }
.list-item:last-child { border-bottom: none;
                        border-bottom-left-radius: var(--radius);
                        border-bottom-right-radius: var(--radius); }
.list-item .val { color: var(--text-light); font-size: 13px; }
.list-wrap { border: 1px solid var(--border); border-radius: var(--radius);
             margin-bottom: 12px; overflow: hidden; }

/* ---------------------------------------------------------- 收藏 / 优先级 */
.foot-right { display: flex; align-items: center; }
.star {
  font-size: 19px; line-height: 1; color: var(--text-light);
  padding: 2px 4px; border-radius: 6px;
}
.star.on { color: #f59e0b; }
.star:active { background: var(--bg); }
.tag.prio { background: #f5f3ff; color: #6d28d9; }

/* ---------------------------------------------------------- 项目阶段导航 */

/* ⚠️ 分类行是**主导航**，必须一眼看全 —— 不能横滑藏起来。

   为什么固定 **2×2**（而不是一行铺开或 flex-wrap）：

   1. flex-wrap 按内容宽度排，4 个胶囊排成「3+1」——
      第二行孤零零一个，看着像没排好。
   2. 一行铺开在窄屏放不下；而且**宽屏也放不下**：
      容器最大 536px（`body{max-width:560}` 减去内边距），
      4 列舒适排布需要 4×140 + 3×7 = 581px。
      实测 517px 容器下每格 124px，而「招标信息 1084」要 126px ——
      只剩 2px 余量，数字一涨（1084 → 10000+）就截断。

   恒定 2×2 的代价是多占一行（约 44px），换来的是：
     - 任何宽度下都不截断
     - 手机上不用横滑也能看全
     - 桌面端和手机端行为一致，可预期
     - 将来分类变多（接第二个省变 8 个）自动变 4 行，仍然整齐 */
.chips.cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  overflow-x: visible;
  padding-bottom: 2px;
}
.chips.cats .chip.cat {
  display: flex; align-items: center; justify-content: center;
  min-width: 0;                 /* 允许收缩，否则长名字撑破格子 */
  overflow: hidden; text-overflow: ellipsis;
}
.chip.cat {
  flex: 0 0 auto;
  background: #eef2ff; color: #4338ca;
  border: 1px solid #e0e7ff;
  font-weight: 600;
}
.chip.cat.on { background: #4338ca; color: #fff; border-color: #4338ca; }
.chip.cat.on .n { background: rgba(255,255,255,.25); color: #fff; }
.chip.cat .n { background: rgba(67,56,202,.12); color: #4338ca; }
.tag.stage { background: #eef2ff; color: #4338ca; }

/* ---------------------------------------------------------- 底部弹出选择（纠错） */
.sheet-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(17, 24, 39, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 4px 0 calc(env(safe-area-inset-bottom, 0px) + 14px);
  max-height: 80vh; overflow-y: auto;
  animation: sheetUp .18s ease-out;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; }
                     to { transform: translateY(0); opacity: 1; } }
.sheet-head {
  font-size: 15px; font-weight: 600; text-align: center;
  padding: 15px 16px 10px; color: var(--text);
}
.sheet-body { padding: 0 14px; }
.sheet-hint {
  font-size: 12.5px; color: var(--text-sub); line-height: 1.6;
  margin: 0 0 12px; text-align: center;
}
.opt-btn {
  display: block; width: 100%; padding: 14px 12px; margin-bottom: 8px;
  border-radius: 10px; background: var(--primary-light); color: var(--primary);
  font-size: 14px; font-weight: 600; text-align: center;
}
.opt-btn:active { opacity: .75; }
.opt-btn:disabled { opacity: .45; }
.opt-btn.ghost {
  background: var(--card); color: var(--text-sub);
  border: 1px solid var(--border);
}
.opt-btn.plain {
  background: none; color: var(--text-light); font-weight: 400;
  margin-top: 2px;
}

/* 设置页里的范围滑块 */
input[type="range"] {
  -webkit-appearance: none; height: 28px; background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px; background: var(--border);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 10px;
  background: var(--primary); margin-top: -7.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
input[type="time"] { text-align: center; }

/* 包金额前的「预算」小标 —— 成交价不标，预算才标。
   两种量纲不能混着显示，否则用户会以为这个包花了 850 万。 */
.pkg-budget {
  font-style: normal;
  font-size: 10px;
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 3px;
  margin-right: 3px;
}

/* ---------------------------------------------------------- 单位身份 tab
   一家公司可能同时是交易发起方 / 中标人 / 代理机构，三种身份各一套历史。
   只有一个身份时前端不渲染这一栏。 */
.unit-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.unit-tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  font-size: 13px; color: var(--text-light);
}
.unit-tab .n {
  font-size: 11px; color: var(--text-light);
}
.unit-tab.on {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}
.unit-tab.on .n { color: rgba(255,255,255,.8); }

/* 详情页「中标人」可能是多个（按标段），每个一行 */
.winner-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.winner-line:last-child { margin-bottom: 0; }
.winner-role, .winner-pkg {
  font-style: normal; font-size: 10px;
  color: var(--text-light);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0 3px;
}
.winner-role { color: var(--primary); border-color: currentColor; }

/* 多值块（中标人可能多家）—— 不用 .kv 两栏，整块纵向排 */
.kv-block {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.kv-block-title {
  color: var(--text-light);
  margin-bottom: 6px;
}
.kv-block .winner-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 0;
}
/* 多中标人时按钮压小一点，否则一行放不下 */
.kv-block .follow-btn {
  padding: 2px 8px; font-size: 11.5px;
}

/* 「预算/中标金额」这种长标签，76px 放不下会换行 —— 稍微放宽 */
.kv .k { min-width: 76px; }

/* ---------------------------------------------------------- 单位历史的筛选条
   两排：标段类型（总承包/施工/监理/设计…）+ 菜单分类（工程招标/政府采购…）。
   和主列表的 .chips 视觉一致，但更紧凑 —— 单位页是二级页面。 */
.unit-filter {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.unit-filter + .unit-filter { border-bottom: none; padding-top: 0; margin-top: -4px; }
.uf-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-sub);
  white-space: nowrap;
}
.uf-chip .n { font-size: 11px; color: var(--text-light); }
.uf-chip.on {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.uf-chip.on .n { color: rgba(255,255,255,.8); }

/* ---------------------------------------------------------- 明细表 → 竖排
   源站的「一条记录 × 多属性」表格（品目号/品目名称/采购标的/服务范围…）
   在 390px 屏上 8 列只剩 48px/列，长文本被压成一个字一行。

   JS 的 `layoutNoticeTables()` 把这类表换成 .kv-table（竖排「标签：值」），
   真正的网格表（行数 ≥3）保留横向滚动。 */
.kv-table {
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}
/* ⚠️ 用 grid 而不是 flex。
 *
 *    flex 版：.k { flex: 0 0 5.2em; white-space: nowrap } ——
 *    「中标（成交）金额」「是否价格扣除」这种长标签会**撑出 5.2em**，
 *    把值列推歪，同一个卡片里值列左边界参差不齐。
 *
 *    grid 用固定轨道：标签列永远 6em，长了就换行，值列左边界永远对齐。 */
.kvx {
  display: grid;
  grid-template-columns: 6.6em 1fr;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.65;
}
.kvx:last-child { border-bottom: none; }
.kvx .k {
  color: var(--text-light);
  word-break: break-word;
}
.kvx .v {
  min-width: 0;
  word-break: break-word;
  color: var(--text);
}
/* 多行记录的间隔线（一行里有多个属性时，组与组之间加重一点） */
.kv-sep {
  height: 6px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* 网格表（行多）保留横向滚动，但每列给下限，避免被压成竖排字 */
.notice-html td,
.notice-html th {
  min-width: 4.5em;
}

/* ============================================================ 单位画像
 *
 * 用户点「交易发起方」看到的那几块：
 *   所属集团（集团归并结果）
 *   招投标概况（公告数/金额/地区/行业/标段）
 *   合作过的中标单位
 *   常用代理机构
 *   工商信息（明确标注「需接数据源」）
 *
 * 放在单位浮层里、公告列表**上面** —— 用户点进来第一眼
 * 应该看到「这家单位什么情况」，而不是继续看一屏公告。
 */
.profile-group {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #eef4ff;
  border-radius: 10px;
  border: 1px solid #d8e6ff;
}
.pg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.pg-label { font-size: 12px; color: var(--text-light); }
.pg-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.pg-n { font-size: 12px; color: var(--text-light); }
.pg-toggle { font-size: 12px; color: var(--primary); margin-left: auto; }
.pg-members { margin-top: 8px; border-top: 1px dashed #cfdcf5; padding-top: 8px; }
.pg-member {
  font-size: 12.5px; color: var(--text); padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,.03);
  cursor: pointer;
}
.pg-member:last-child { border-bottom: none; }
.pg-more { font-size: 12px; color: var(--text-light); padding-top: 6px; }

.profile-card {
  margin: 0 0 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.pc-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 10px; padding-left: 8px;
  border-left: 3px solid var(--primary);
  line-height: 1.2;
}
.pc-grid { display: flex; flex-wrap: wrap; gap: 8px 0; }
.pc-item { flex: 0 0 25%; text-align: center; }
.pc-item .pc-n { font-size: 16px; font-weight: 700; color: var(--text); }
.pc-item .pc-k { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }
.pc-range {
  font-size: 11.5px; color: var(--text-light);
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.pc-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.pc-row-k { font-size: 12px; color: var(--text-light); flex: 0 0 32px; }
.pc-tag {
  font-size: 11.5px; color: var(--text);
  background: #f4f6fa; border-radius: 4px; padding: 2px 7px;
}

.pc-rank {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.pc-rank:last-child { border-bottom: none; }
.pc-rank-i {
  flex: 0 0 18px; font-size: 11px; color: var(--text-light); text-align: center;
}
.pc-rank-n {
  flex: 1; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.pc-rank-n:active { color: var(--primary); }
.pc-rank-c { flex: 0 0 auto; font-size: 12px; color: var(--text-light); }

.pc-missing { background: #fafbfc; }
.pc-miss-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.pc-miss-item:last-of-type { border-bottom: none; }
.pc-miss-k { flex: 0 0 84px; font-size: 12.5px; color: var(--text); }
.pc-miss-v { font-size: 12px; color: var(--text-light); }
.pc-miss-note {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-light); line-height: 1.6;
}


/* ---- 工商信息：复制公司名去官方搜 ----
 *
 * 不做数据接入，但把公司名**复制好**并告诉用户去哪儿粘。
 * 比跳个空白页有用 —— gsxt 会把 URL 参数丢掉。
 */
.pc-miss-brief {
  font-size: 12.5px; color: var(--text-light); line-height: 1.7;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.pc-miss-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; color: #8a6d3b; background: #fdf6e3;
  border-radius: 4px;
}

.pc-copy-box {
  margin-top: 10px; padding: 10px 12px;
  background: #f7f9fc; border: 1px dashed #cdd8e8; border-radius: 8px;
}
.pc-copy-name {
  font-size: 13.5px; color: var(--text); font-weight: 600;
  line-height: 1.5; word-break: break-all;
  -webkit-user-select: text; user-select: text;
}
.pc-copy-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 9px; flex-wrap: wrap;
}
.pc-copy-btn {
  flex: 0 0 auto;
  padding: 6px 14px; font-size: 12.5px;
  color: #fff; background: var(--primary);
  border: none; border-radius: 6px;
}
.pc-copy-btn:active { opacity: .8; }
.pc-copy-link {
  font-size: 12.5px; color: var(--primary);
}
.pc-copy-hint {
  margin-top: 9px; font-size: 11.5px; color: var(--text-light); line-height: 1.6;
}
.pc-copy-note {
  margin-top: 4px; font-size: 11px; color: #b07d3b; line-height: 1.6;
}


/* 复制按钮改成 <a> 之后要显式去掉下划线、居中 */
a.pc-copy-btn {
  display: inline-block;
  text-decoration: none;
  line-height: 1.5;
}


/* ---- 微信内置浏览器提示 ----
 *
 * 官方站的滑块验证在微信里点不动（用户实测），
 * 所以微信内不自动跳转，改为引导「用系统浏览器打开」。
 */
.pc-wechat-warn {
  margin-top: 10px; padding: 11px 12px;
  background: #fff8e6; border: 1px solid #ffe0a3; border-radius: 8px;
}
.pcw-title {
  font-size: 13.5px; font-weight: 600; color: #a86a00; margin-bottom: 6px;
}
.pcw-body {
  font-size: 12.5px; color: var(--text); line-height: 1.7;
}
.pcw-steps {
  margin: 8px 0 10px; padding-left: 20px;
  font-size: 12.5px; color: var(--text); line-height: 1.9;
}
.pcw-steps b { color: var(--primary); }

a.pc-copy-btn, button.pc-copy-btn {
  display: inline-block; text-decoration: none; line-height: 1.5;
  padding: 6px 14px; font-size: 12.5px;
  color: #fff; background: var(--primary);
  border: none; border-radius: 6px;
}
button.pc-copy-btn.ghost {
  color: var(--primary); background: #fff;
  border: 1px solid var(--primary);
}
button.pc-copy-btn:active { opacity: .8; }

      /* ================= 项目分析报告 =================
       *
       * 结构：封面指标条 → AI 状态区 → 五个章节 → 免责
       * 风格和其他浮层一致（白卡片 + 主色标题条）
       */

      .report-overlay .overlay-body { padding-bottom: 40px; }

      /* ---- 加载中 ---- */
      .rp-loading {
        padding: 60px 20px; text-align: center; color: var(--text-sub);
        font-size: 13px; line-height: 1.9;
      }
      .rp-spinner {
        width: 26px; height: 26px; margin: 0 auto 14px;
        border: 3px solid var(--border);
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: rp-spin .9s linear infinite;
      }
      @keyframes rp-spin { to { transform: rotate(360deg); } }
      .rp-loading-hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }

      /* ---- 封面指标条 ---- */
      .rp-hero {
        margin: 0 0 12px; padding: 16px;
        background: linear-gradient(135deg, #eef4ff, #f7faff);
        border-radius: 10px;
      }
      .rp-hero-title {
        font-size: 16px; font-weight: 700; color: var(--text);
        line-height: 1.4; word-break: break-all;
      }
      .rp-hero-sub {
        font-size: 12px; color: var(--primary); margin-top: 4px;
      }
      .rp-hero-grid {
        display: grid; grid-template-columns: repeat(4, 1fr);
        gap: 6px; margin-top: 12px;
      }
      .rp-hero-item { text-align: center; }
      .rp-hero-item b {
        display: block; font-size: 15px; color: var(--text);
        font-weight: 700; line-height: 1.3;
      }
      .rp-hero-item span {
        display: block; font-size: 10.5px; color: var(--text-light);
        margin-top: 2px;
      }

      /* ---- AI 生成按钮 ---- */
      .rp-ai-cta {
        margin-bottom: 12px; padding: 14px;
        background: #fff; border: 1px dashed var(--primary);
        border-radius: 10px;
      }
      .rp-ai-cta-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
      .rp-ai-cta-body {
        font-size: 12.5px; color: var(--text-sub); line-height: 1.7;
        margin-bottom: 10px;
      }
      .rp-ai-cta-limit {
        font-size: 11px; color: var(--text-light);
        margin-top: 8px; text-align: center;
      }

      /* ---- AI 失败 / 未配置 ---- */
      .rp-ai-warn {
        margin-bottom: 12px; padding: 12px 14px;
        background: #fff8e6; border: 1px solid #ffe0a3; border-radius: 10px;
      }
      .rp-ai-warn-title {
        font-size: 13px; font-weight: 600; color: #a86a00; margin-bottom: 5px;
      }
      .rp-ai-warn-body {
        font-size: 12px; color: var(--text-sub); line-height: 1.7;
        margin-bottom: 8px; word-break: break-all;
      }

      /* ---- 校验问题（模型编造）---- */
      .rp-issues {
        margin-bottom: 12px; padding: 12px 14px;
        background: #fff1f0; border: 1px solid #ffccc7; border-radius: 10px;
      }
      .rp-issues-title {
        font-size: 12.5px; font-weight: 600; color: var(--danger);
        margin-bottom: 6px;
      }
      .rp-issue {
        font-size: 12px; color: var(--text-sub); line-height: 1.7;
        padding-left: 12px; position: relative;
      }
      .rp-issue::before {
        content: '·'; position: absolute; left: 3px; color: var(--danger);
      }

      /* ---- 通用卡片 ---- */
      .rp-card {
        margin-bottom: 12px; padding: 14px;
        background: #fff; border-radius: 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,.05);
      }
      .rp-title {
        font-size: 14px; font-weight: 700; color: var(--text);
        padding-left: 9px; position: relative; margin-bottom: 10px;
      }
      .rp-title::before {
        content: ''; position: absolute; left: 0; top: 3px;
        width: 3px; height: 14px; background: var(--primary);
        border-radius: 2px;
      }
      .rp-sub {
        font-size: 12px; color: var(--text-light);
        margin: 12px 0 6px;
      }
      .rp-sub:first-of-type { margin-top: 4px; }
      .rp-text {
        font-size: 13px; color: var(--text-sub); line-height: 1.85;
        white-space: pre-wrap;
      }
      .rp-empty {
        font-size: 12px; color: var(--text-light);
        padding: 8px 0; line-height: 1.7;
      }

      /* ---- 结论先行 ---- */
      .rp-verdict {
        background: linear-gradient(135deg, #f0f7ff, #fff);
        border: 1px solid #d6e6ff;
      }
      .rp-verdict-text {
        font-size: 14px; color: var(--text); line-height: 1.8;
        font-weight: 600; margin-bottom: 10px;
      }
      .rp-highlight {
        font-size: 13px; color: var(--text-sub); line-height: 1.8;
        padding-left: 24px; position: relative; margin-top: 7px;
      }
      .rp-dot {
        position: absolute; left: 0; top: 2px;
        width: 17px; height: 17px; border-radius: 50%;
        background: var(--primary); color: #fff;
        font-size: 10px; line-height: 17px; text-align: center;
      }

      /* ---- 事实卡 ---- */
      .rp-kv {
        display: flex; gap: 10px; padding: 7px 0;
        border-bottom: 1px solid #f2f4f7; font-size: 12.5px;
      }
      .rp-kv:last-child { border-bottom: none; }
      .rp-k { flex: 0 0 84px; color: var(--text-light); }
      .rp-v {
        flex: 1; color: var(--text); line-height: 1.6;
        word-break: break-all;
      }
      .rp-v.warn { color: #b07d3b; }

      /* ---- 金额分档条形 ---- */
      .rp-bar {
        display: flex; align-items: center; gap: 8px;
        margin-bottom: 6px; font-size: 12px;
      }
      .rp-bar-k { flex: 0 0 76px; color: var(--text-sub); }
      .rp-bar-track {
        flex: 1; height: 8px; background: #f0f2f5;
        border-radius: 4px; overflow: hidden;
      }
      .rp-bar-fill {
        display: block; height: 100%; background: var(--primary);
        border-radius: 4px; transition: width .3s;
      }
      .rp-bar-n { flex: 0 0 26px; text-align: right; color: var(--text-light); }

      /* ---- 标签 ---- */
      .rp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
      .rp-tag {
        font-size: 12px; color: var(--text-sub);
        background: #f5f7fa; border-radius: 5px;
        padding: 4px 9px;
      }
      .rp-tag i {
        font-style: normal; color: var(--primary);
        font-weight: 600; margin-left: 2px;
      }

      /* ---- 排行榜 ---- */
      .rp-rank {
        display: flex; align-items: center; gap: 8px;
        padding: 7px 0; border-bottom: 1px solid #f7f8fa;
        font-size: 12.5px;
      }
      .rp-rank:last-child { border-bottom: none; }
      .rp-rank-i {
        flex: 0 0 16px; color: var(--text-light);
        font-size: 11px; text-align: center;
      }
      .rp-rank-n {
        flex: 1; color: var(--text); line-height: 1.5;
        word-break: break-all;
      }
      .rp-rank-c { flex: 0 0 auto; color: var(--primary); font-size: 12px; }

      /* ---- 一行统计 ---- */
      .rp-inline {
        display: flex; flex-wrap: wrap; gap: 14px;
        font-size: 12px; color: var(--text-sub); padding: 4px 0;
      }
      .rp-inline b { color: var(--text); }

      /* ---- 同类项目 ---- */
      .rp-basis {
        font-size: 11.5px; color: var(--text-light);
        background: #f5f7fa; border-radius: 5px;
        padding: 5px 9px; margin-bottom: 9px;
      }
      .rp-comp {
        padding: 9px 0; border-bottom: 1px solid #f2f4f7;
      }
      .rp-comp:last-child { border-bottom: none; }
      .rp-comp-t {
        font-size: 12.5px; color: var(--text); line-height: 1.55;
        margin-bottom: 4px;
      }
      .rp-comp-m {
        display: flex; flex-wrap: wrap; gap: 10px;
        font-size: 11.5px; color: var(--text-light);
      }
      .rp-comp-m b { color: var(--primary); }

      /* ---- 风险 ---- */
      .rp-risk {
        font-size: 12.5px; color: var(--text-sub); line-height: 1.8;
        padding-left: 14px; position: relative; margin-bottom: 6px;
      }
      .rp-risk::before {
        content: '!'; position: absolute; left: 0; top: 1px;
        width: 12px; height: 12px; border-radius: 50%;
        background: #ffb020; color: #fff;
        font-size: 9px; line-height: 12px; text-align: center;
      }

      /* ---- 缺口 ---- */
      .rp-gaps {
        background: #fffbf2; border: 1px solid #ffeccc;
      }
      .rp-gap {
        font-size: 12px; color: var(--text-sub); line-height: 1.8;
        padding-left: 14px; position: relative;
      }
      .rp-gap::before {
        content: '·'; position: absolute; left: 4px; color: #c99a4a;
      }

      /* ---- 页脚 ---- */
      .rp-footer {
        padding: 14px 4px 0;
        font-size: 11px; color: var(--text-light); line-height: 1.9;
      }
      .rp-disclaimer {
        margin-top: 10px; padding-top: 10px;
        border-top: 1px solid var(--border);
        line-height: 1.8; color: #9aa3af;
      }

      /* ================= 生成进度层 ================= */

      .rp-progress {
        position: absolute; inset: 0; z-index: 20;
        background: rgba(255, 255, 255, .92);
        display: flex; align-items: center; justify-content: center;
        padding: 20px;
      }
      .rp-progress-box {
        width: 100%; max-width: 300px;
        background: #fff; border-radius: 14px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
        padding: 28px 22px 20px; text-align: center;
      }
      .rp-spinner.big {
        width: 40px; height: 40px; border-width: 4px; margin-bottom: 18px;
      }
      .rp-progress-title {
        font-size: 15px; font-weight: 700; color: var(--text);
        margin-bottom: 8px;
      }
      .rp-progress-phase {
        font-size: 12.5px; color: var(--text-sub);
        line-height: 1.6; min-height: 20px; margin-bottom: 16px;
      }
      .rp-progress-bar {
        height: 6px; background: #eef1f5; border-radius: 3px;
        overflow: hidden; margin-bottom: 12px;
      }
      .rp-progress-bar span {
        display: block; height: 100%;
        background: linear-gradient(90deg, var(--primary), #5b9bff);
        border-radius: 3px;
        transition: width .9s ease-out;
      }
      .rp-progress-elapsed {
        font-size: 11.5px; color: var(--text-light);
      }
      .rp-progress-elapsed b { color: var(--primary); }
      .rp-progress-cancel {
        margin-top: 16px; width: 100%;
        padding: 9px; font-size: 12.5px;
        color: var(--text-sub); background: #f5f7fa;
        border: none; border-radius: 8px;
      }
      .rp-progress-cancel:active { opacity: .75; }

      /* ================= 报告库 ================= */

      .rl-stats {
        display: flex; gap: 8px; margin-bottom: 14px;
      }
      .rl-stat {
        flex: 1; text-align: center;
        background: #f7f9fc; border-radius: 9px; padding: 10px 4px;
      }
      .rl-stat b {
        display: block; font-size: 16px; color: var(--primary);
        font-weight: 700;
      }
      .rl-stat span {
        display: block; font-size: 10.5px; color: var(--text-light);
        margin-top: 2px;
      }
      .rl-empty {
        padding: 50px 20px; text-align: center;
        font-size: 13px; color: var(--text-light); line-height: 1.9;
      }
      .rl-item {
        background: #fff; border-radius: 10px;
        padding: 13px 14px; margin-bottom: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
      }
      .rl-item-head {
        display: flex; align-items: center; justify-content: space-between;
        margin-bottom: 8px;
      }
      .rl-badge {
        font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
        background: #eef7ee; color: #2f8f4e;
      }
      .rl-badge.failed { background: #fff1f0; color: var(--danger); }
      .rl-badge.disabled { background: #f5f7fa; color: var(--text-light); }
      .rl-time { font-size: 11px; color: var(--text-light); }
      .rl-title {
        font-size: 13px; color: var(--text); line-height: 1.55;
        font-weight: 600; margin-bottom: 4px;
      }
      .rl-owner {
        font-size: 11.5px; color: var(--text-sub); margin-bottom: 6px;
      }
      .rl-verdict {
        font-size: 12px; color: var(--text-sub); line-height: 1.7;
        background: #f7f9fc; border-radius: 6px;
        padding: 7px 10px; margin-bottom: 7px;
      }
      .rl-meta {
        display: flex; flex-wrap: wrap; gap: 10px;
        font-size: 10.5px; color: var(--text-light);
      }
      .rl-warn { color: #c98a1a; }


      /* ================= 报告类浮层的层级 =================
       *
       * ⚠️ 踩过的坑：`.overlay` 默认 z-index 是 50，
       *    而 `.overlay.detail-overlay` 是 60、`.overlay.unit-detail` 是 70。
       *
       *    报告浮层是从详情浮层点出来的，如果自己只拿默认的 50，
       *    就会被详情浮层（60）压住 —— 表现是「点了按钮什么都没发生」，
       *    实际报告已经渲染好了，只是藏在下面。
       *
       *    E2E 当时只断言了 DOM 存在（`!!document.querySelector(...)`），
       *    没断言视觉层级，所以全部通过 —— 这类 bug 只有截图能抓到。
       *
       *    报告要比所有内容浮层都高（但低于 .toast 的 100）。
       */
      .overlay.report-overlay,
      .overlay.report-lib { z-index: 80; }


/* ================= 单位画像：可点击 chip + 金额明细 ================= */

.pc-tag-click {
  cursor: pointer;
  transition: background .15s, color .15s;
}

.pc-tag-click:active {
  opacity: .7;
}

.pc-tag-click.on {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.pc-k-sub {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
}

/* 已筛选提示 */
.pc-row-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.pc-tag-clear {
  font-size: 12px;
  color: var(--danger);
  background: #fef2f2;
  padding: 4px 12px;
  border-radius: 6px;
  flex-shrink: 0;
}

.pc-hint-text {
  font-size: 12px;
  color: var(--text-light);
}

.pc-hint-text b {
  color: var(--primary);
  margin: 0 3px;
}

/* 金额明细 */
.pc-amt {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pc-amt-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.pc-amt-cov {
  flex: 1;
  font-size: 11.5px;
  color: var(--text-light);
  font-weight: 400;
}

.pc-amt-toggle {
  font-size: 12px;
  color: var(--primary);
  font-weight: 400;
}

.pc-amt-body {
  margin-top: 12px;
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px 14px;
}

.pc-amt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--text-sub);
}

.pc-amt-row b {
  color: var(--text);
  font-weight: 600;
}

.pc-amt-c {
  font-style: normal;
  color: var(--text-light);
  font-size: 11px;
  margin-left: 4px;
}

.pc-amt-sec {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.pc-amt-sec-k {
  font-size: 11.5px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.pc-amt-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.7;
}
