/* ============================================================
   秉衡通 — 前端合规注入层（BHT-N005 · 2026-09-24）
   纯附加样式，不修改 dist 内任何既有样式文件。
   停用方式：URL 加 ?bhtc=0  或  localStorage.setItem('bht_compliance','off')
   ============================================================ */

/* ── 顶部定性横幅：显著位置声明系统性质（文档 表3）── */
#bhtc-banner {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  height: 30px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #8a5a00;
  color: #fff;
  font: 12px/1.4 -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: .2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  user-select: none;
}
#bhtc-banner .bhtc-tag {
  flex: 0 0 auto;
  background: #fff;
  color: #8a5a00;
  border-radius: 3px;
  padding: 1px 6px;
  font-weight: 700;
  font-size: 11px;
}
#bhtc-banner .bhtc-txt {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bhtc-banner .bhtc-more,
#bhtc-banner .bhtc-hide {
  flex: 0 0 auto;
  cursor: pointer;
  background: rgba(255, 255, 255, .16);
  border: none;
  color: #fff;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
}
#bhtc-banner .bhtc-more:hover,
#bhtc-banner .bhtc-hide:hover { background: rgba(255, 255, 255, .3); }

/* ── 横幅「详情」的展开说明条（BHT-N126）──
   原本「详情」打开的是用户端浮层面板；面板下线后就地展开这一条附加说明，
   内容仍是同一个 CFG.positioning.banner_detail。横幅本体（定性文案 / 收起 / 样式）未改动。 */
#bhtc-banner-detail {
  position: fixed !important;
  top: 30px; left: 0; right: 0;
  z-index: 2147482999;
  background: #6b4700;
  color: #fff;
  font: 12px/1.6 -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

/* 横幅展开时给页面让位
   ── BHT-N064 ─────────────────────────────────────────────────────
   这里除了 padding，还把**横幅占位高度**以 CSS 变量的形式暴露给应用层：
   页面里大量元素按 `min-height/height: 100vh` 计算，而 body 已被下推 30px，
   于是"视口高 100vh"与"实际可用高"差 30px —— 表现为**侧栏/面板底部的
   按钮（如"退出登录"）被挤出视口、点不到**（实测 rect bottom=918 > 视口 900）。
   应用层统一改用 `calc(100vh - var(--bhtc-banner-h, 0px))` 即可对齐。

   关键：横幅**关闭**时本变量不存在，应用层 `var(..., 0px)` 兜底 →
   计算结果与原来完全一致。故本注入层仍满足"纯附加 / 可整体删除 /
   默认不改变既有行为"三条硬约束。改横幅高度时同步改这里与上面的 height。
   ──────────────────────────────────────────────────────────────── */
body.bhtc-banner-on {
  padding-top: 30px !important;
  --bhtc-banner-h: 30px;
}

/* ── 全屏淡水印：AI 产物默认「参考稿·未生效」（文档 表3）── */
#bhtc-watermark {
  position: fixed !important;
  inset: 0;
  z-index: 2147482990;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='160'><text x='0' y='90' font-size='26' font-family='Microsoft YaHei,sans-serif' fill='%238a5a00' transform='rotate(-25 0 90)'>参考稿·未生效</text></svg>");
  background-repeat: repeat;
}

/* ── 导出确认弹窗（铁律「不替代」）──
   BHT-N126 视觉重做：圆角 / 间距 / 字号一律走 --bht-* 令牌（docs/24），主次按钮分明。
   🔴 **逻辑与留痕一句未改** —— 三要素文案、勾选解锁、确认说明写审计全在 JS 里。
   顺带补两处**原本没有样式**的类：.bhtc-meta（确认说明提示行）与
   .bhtc-es-*（电子签章区）—— 它们此前裸奔，也是"像 20 年前"的成因之一。 */
#bhtc-mask {
  position: fixed !important;
  inset: 0;
  z-index: 2147483030;
  background: rgba(12, 16, 22, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#bhtc-mask.bhtc-open { display: flex; }
#bhtc-dialog {
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 84vh;
  overflow: auto;
  background: var(--bht-card);
  border: 1px solid var(--bht-line);
  border-radius: var(--bht-radius);
  padding: var(--bht-sp-5);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  font-size: var(--bht-fs-body);
  line-height: 1.7;
  font-family: var(--bht-font);
  color: var(--bht-ink);
}
#bhtc-dialog h4 { margin: 0 0 12px; font-size: var(--bht-fs-title); color: var(--bht-gold); }
#bhtc-dialog .bhtc-warn {
  background: var(--bht-warn-l);
  border: 1px solid var(--bht-warn);
  border-radius: var(--bht-radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: var(--bht-fs-sm);
  line-height: 1.8;
}
#bhtc-dialog .bhtc-meta {
  font-size: var(--bht-fs-sm);
  color: var(--bht-ink-2);
  margin: 10px 0 6px;
}
#bhtc-dialog label {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 10px 0; cursor: pointer;
  font-size: var(--bht-fs-sm);
}
#bhtc-dialog textarea {
  width: 100%; box-sizing: border-box; min-height: 64px;
  border: 1px solid var(--bht-line-2); border-radius: var(--bht-radius);
  padding: 8px 10px; font-size: var(--bht-fs-sm);
  background: var(--bht-card); color: var(--bht-ink); resize: vertical;
}
#bhtc-dialog .bhtc-esign {
  margin-top: 10px; padding: 10px 12px;
  border: 1px dashed var(--bht-line-2);
  border-radius: var(--bht-radius);
}
#bhtc-dialog .bhtc-es-l {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--bht-fs-sm); cursor: pointer;
}
#bhtc-dialog .bhtc-es-in {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  border: 1px solid var(--bht-line-2); border-radius: var(--bht-radius);
  padding: 6px 8px; font-size: var(--bht-fs-sm);
  background: var(--bht-card); color: var(--bht-ink);
}
#bhtc-dialog .bhtc-es-tip {
  font-size: var(--bht-fs-xs); color: var(--bht-ink-3);
  margin-top: 6px; line-height: 1.7;
}
#bhtc-dialog .bhtc-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
#bhtc-dialog button {
  cursor: pointer; border-radius: var(--bht-radius); padding: 8px 18px;
  font-size: var(--bht-fs-sm);
  border: 1px solid var(--bht-line-2);
  background: var(--bht-card); color: var(--bht-ink);
}
#bhtc-dialog button.bhtc-ok { background: var(--bht-brand); border-color: var(--bht-brand); color: #fff; }
#bhtc-dialog button.bhtc-ok[disabled] {
  background: var(--bht-line-2); border-color: var(--bht-line-2);
  color: var(--bht-ink-3); cursor: not-allowed;
}

/* ── 知情同意弹窗（BHT-N011）── */
#bhtc-consent-mask {
  position: fixed !important;
  inset: 0;
  z-index: 2147483040;
  background: rgba(0, 0, 0, .5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
#bhtc-consent-mask.bhtc-open { display: flex; }

#bhtc-consent {
  width: 560px;
  max-width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--bht-radius);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .35);
  font: 13px/1.7 -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #1f2328;
  overflow: hidden;
  animation: bhtc-pop .18s ease-out;
}
@keyframes bhtc-pop {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.bhtc-c-head { padding: 16px 20px 10px; border-bottom: 1px solid #eee; }
.bhtc-c-title { font-size: 16px; font-weight: 700; color: #8a5a00; }
.bhtc-c-ver { font-size: 11px; color: #999; margin-top: 4px; }

.bhtc-c-law {
  padding: 8px 20px;
  background: #fbf7ef;
  font-size: 11px;
  color: #8a6a20;
  border-bottom: 1px solid #f0e6d2;
}

.bhtc-c-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 20px 16px;
  -webkit-overflow-scrolling: touch;
}
.bhtc-c-sec { margin-bottom: 14px; }
.bhtc-c-sec-t { font-weight: 700; color: #333; margin-bottom: 4px; }
.bhtc-c-sec-b { color: #555; font-size: 12.5px; }
.bhtc-c-sec-b b { color: #8a5a00; }

/* 阅读倒计时提示（BHT-N021：替代原来的 alert，勾选框期间禁用） */
.bhtc-c-readtip {
  padding: 6px 20px 2px;
  font-size: 11.5px;
  color: #a06b00;
}
.bhtc-c-readtip.bhtc-c-ok { color: #2e7d32; }

.bhtc-c-checks {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
}
.bhtc-c-ck {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0 !important;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.6;
}
.bhtc-c-ck input { margin-top: 3px; flex: 0 0 auto; }
.bhtc-c-ck-sens {
  padding: 8px 10px;
  background: #fff8e6;
  border: 1px solid #f0d090;
  border-radius: 8px;
  margin-top: 10px !important;
}
.bhtc-c-ck-tag {
  font-size: 10px;
  color: #a06b00;
  background: #fff;
  border: 1px solid #e8c98a;
  border-radius: 3px;
  padding: 0 5px;
  margin-left: auto;
  flex: 0 0 auto;
  align-self: center;
}

.bhtc-c-acts {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid #eee;
}
.bhtc-c-btn {
  cursor: pointer;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
}
.bhtc-c-btn.bhtc-c-ok { background: #8a5a00; border-color: #8a5a00; color: #fff; }
.bhtc-c-btn.bhtc-c-ok[disabled] { background: #ccc; border-color: #ccc; cursor: not-allowed; }

.bhtc-c-tip {
  padding: 0 20px 14px;
  font-size: 11px;
  color: #999;
}

/* 页面级受理状态条（BHT-N034：位置最稳的注入点） */
#bhtc-queue-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 16px;
  padding: 10px 14px;
  background: #EAF1FC;  /* 硬禁①：渐变只允许品牌标识一处 → 纯色（= --bht-brand-soft） */
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  font: 12.5px/1.6 -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
}
.bhtc-qb-title { font-weight: 600; color: #0a5adb; margin-right: 4px; }
.bhtc-qb-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--bht-radius);
  font-size: 12px;
}

/* 受理流程条 chip：设计层 .bht-tag.bht-tag（0,2,0）以 --bht-r-pill:99px 压过注入层单类
   规则（0,1,0），故此处用 ID 提权到 (1,1,0) 确定性取胜，且不依赖加载源序（§4.4⑧） */
#bhtc-queue-bar .bhtc-qb-chip { border-radius: var(--bht-radius); }
.bhtc-qb-acts { margin-left: auto; display: flex; gap: 6px; }
.bhtc-qb-acts .bhtc-btn { font-size: 12px; padding: 4px 10px; }

/* 案件卡片上注入的受理流程（BHT-N034：功能不藏在浮层里） */
.bhtc-card-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dbe3ee;
}
.bhtc-ctag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--bht-radius);
  font-size: 11.5px;
  font-weight: 500;
  background: #eef3fb;
  color: #35506e;
}
.bhtc-ctag-pending_acceptance   { background: #fff3e0; color: #a35b00; }
.bhtc-ctag-reviewing            { background: #fff8e1; color: #8a6100; }
.bhtc-ctag-accepted_noexaminer  { background: #e8f1ff; color: #0a5adb; }
.bhtc-ctag-accepted_ready       { background: #e8f7ee; color: #1b7a3d; }
.bhtc-ctag-in_progress          { background: #eefbf1; color: #1b7a3d; }
.bhtc-ctag-refused              { background: #fdecea; color: #b3261e; }
.bhtc-cnext {
  font-size: 11.5px;
  color: #7b879a;
  margin-top: 5px;
  line-height: 1.5;
}
.bhtc-cacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.bhtc-cacts .bhtc-btn {
  font-size: 12px;
  padding: 4px 10px;
}

@media (max-width: 480px) {
  #bhtc-banner .bhtc-txt { font-size: 11px; }
}
