/* ============================================================
   南控物业台账系统 — 界面设计系统 v2
   设计方向：深蓝商务 × 金色点睛，国资运营工作台的质感
   核心：CSS 变量统一驱动颜色/间距/圆角/阴影/动效
   ============================================================ */

:root {
  /* —— 品牌主色（深蓝体系，延续既有品牌基因）—— */
  --brand-900: #14294d;
  --brand-800: #1b3560;
  --brand-700: #22406f;
  --brand-600: #2a4f8a;
  --brand-500: #35639f;
  --brand-400: #5b82b8;
  --brand-100: #e8eef7;
  --brand-050: #f2f6fb;

  /* —— 点缀色（金色）—— */
  --gold-600: #b88a2e;
  --gold-500: #c9a227;
  --gold-100: #fbf3dd;
  --gold-050: #fdf9ec;

  /* —— 中性色（微微偏蓝）—— */
  --ink-900: #1f2937;
  --ink-700: #374151;
  --ink-600: #4b5563;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --line-200: #e5e7eb;
  --line-100: #eef0f3;
  --bg-100: #f4f6f9;
  --bg-50: #f8fafc;

  /* —— 语义色 —— */
  --green: #1a9c6e;
  --green-bg: #e6f6ef;
  --red: #d64545;
  --red-bg: #fdecec;
  --orange: #d98a1f;
  --orange-bg: #fdf1e1;
  --purple: #8a5cf0;
  --purple-bg: #f1ebfd;
  --indigo: #4f46e5;
  --indigo-bg: #e9e8fb;
  --cyan: #0e7490;
  --cyan-bg: #e0f3f7;

  /* —— 圆角 —— */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* —— 阴影 —— */
  --shadow-xs: 0 1px 2px rgba(20, 41, 77, .05);
  --shadow-sm: 0 1px 3px rgba(20, 41, 77, .07), 0 1px 2px rgba(20, 41, 77, .04);
  --shadow-md: 0 4px 14px rgba(20, 41, 77, .08), 0 2px 4px rgba(20, 41, 77, .04);
  --shadow-lg: 0 12px 32px rgba(20, 41, 77, .16), 0 4px 10px rgba(20, 41, 77, .06);
  --shadow-brand: 0 4px 14px rgba(42, 79, 138, .28);

  /* —— 动效 —— */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-snap: cubic-bezier(.2, .8, .2, 1);

  --font-sans: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg-100);
  background-image:
    radial-gradient(1200px 500px at 100% -100px, rgba(42, 79, 138, .06), transparent 60%),
    radial-gradient(900px 400px at -100px 100%, rgba(184, 138, 46, .05), transparent 55%);
  background-attachment: fixed;
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ 顶栏 ============ */
.topbar {
  background: linear-gradient(115deg, var(--brand-900) 0%, var(--brand-700) 55%, var(--brand-600) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 58px;
  box-shadow: 0 2px 10px rgba(14, 26, 46, .28);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-right: 40px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding-left: 36px;
}
.brand::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  flex: none;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
}
.brand::after {
  content: "物业";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 26px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  pointer-events: none;
}

.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  color: #cdd8ea;
  text-decoration: none;
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;   /* 窄屏下不要被压扁：保持原宽，交给 .nav 横向滚动 */
  position: relative;
  transition: color .18s var(--ease-out), background .18s var(--ease-out);
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  font-weight: 600;
}
.nav-item.active::after {
  content: "";
  position: absolute;
  left: 15px; right: 15px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-500);
}

.user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; min-width: 0; }
#user-name {
  color: #e7edf6;
  /* 窗口很窄时优先压缩导航区；姓名只做省略号截断，不要竖排折行成一列 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.btn-logout {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background .18s var(--ease-out), border-color .18s;
}
.btn-logout:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255,255,255,.35); }

.nav-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px; height: 18px;
  line-height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  text-align: center;
  vertical-align: middle;
}

/* ============ 内容区 ============ */
.content { padding: 24px; max-width: 1440px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: tabIn .32s var(--ease-out); }
@keyframes tabIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 卡片（统计指标卡）============ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card {
  background: #fff;
  border: 1px solid var(--line-100);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-200);
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-600), var(--gold-500));
  opacity: 0;
  transition: opacity .22s var(--ease-out);
}
.card:hover::before { opacity: 1; }
.card .label {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 10px;
  letter-spacing: .2px;
}
.card .label .free-hint { font-size: 11px; color: var(--gold-600); margin-left: 4px; }
.card .value {
  font-size: 27px;
  font-weight: 700;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.card .unit { font-size: 13px; color: var(--ink-400); margin-left: 4px; font-weight: 400; }
/* R239：月租金双口径 —— 「统计口径」金色标签、「应收口径」灰色标签，下面一行规则小字。
   规则文案由后端拼（rent_rule_stats / rent_rule_receivable），前端只渲染，不各说各话。 */
.card .label .free-hint.alt { color: #6b7280; }
.card .rent-rule {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-400);
}

/* ============ 面板 ============ */
.panel {
  background: #fff;
  border: 1px solid var(--line-100);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
/* 口径说明条（2026-11-03）：放在表格上方，讲清这张表算不算内部合同。
   和 .panel 同宽同边距，视觉上属于同一块内容，不另起一个卡片。 */
.panel-note {
  margin: -6px 0 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #7a5b12;
  background: #fff9e8;
  border: 1px solid #f3e2b3;
  border-radius: var(--r-sm);
}
.panel-note b { color: #8a5a00; }
.panel h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--brand-800);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h3::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-600), var(--gold-500));
  flex: none;
}

/* ============ 工具栏 ============ */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar select,
.toolbar input {
  padding: 8px 12px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: #fff;
  color: var(--ink-700);
  transition: border-color .16s, box-shadow .16s;
  font-family: inherit;
}
.toolbar select:hover,
.toolbar input:hover { border-color: var(--brand-400); }
.toolbar select:focus,
.toolbar input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(42, 79, 138, .12);
}
.toolbar input[type=text] { min-width: 200px; }
.toolbar input[type=date],
.toolbar input[type=number],
.toolbar input[type=month] { color: var(--ink-700); }
/* 时间筛选组：作为整体换行，不拆散 */
.toolbar .filter-date-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.toolbar .filter-date-group .date-sep {
  color: var(--ink-500);
  font-size: 13px;
  margin: 0 2px;
}
/* 「按字段筛」前缀（2026-11-02）：这组控件常被当成"看历史时点"，
   实际只筛某一列的日期，状态/租金仍是今天的。前缀不参与伸缩，窄屏由 group 自己换行。 */
.toolbar .filter-date-group .date-field-label {
  color: var(--ink-500);
  font-size: 13px;
  flex: none;
  white-space: nowrap;
}
.toolbar .filter-date-group input[type=date] { min-width: 140px; }
.toolbar .hint { margin: 0; }

/* ============ 按钮 ============ */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-700);
  font-family: inherit;
  transition: background .16s var(--ease-out), border-color .16s, color .16s, box-shadow .16s;
}
.btn:hover { background: var(--bg-50); border-color: var(--brand-400); color: var(--brand-700); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  padding: 8px 18px;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--shadow-brand);
  transition: transform .16s var(--ease-out), box-shadow .16s, filter .16s;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(42, 79, 138, .34); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(42, 79, 138, .28); }

.btn-danger {
  padding: 5px 11px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: filter .16s;
}
.btn-danger:hover { filter: brightness(1.08); }

.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn-mini {
  padding: 3px 10px;
  font-size: 12px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--brand-700);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .16s, border-color .16s;
}
.btn-mini:hover { background: var(--brand-050); border-color: var(--brand-500); }

/* ============ 表格 ============ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--bg-50);
  text-align: left;
  padding: 11px 12px;
  border-bottom: 2px solid var(--line-200);
  color: var(--ink-600);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .2px;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-100);
  color: var(--ink-700);
}
.data-table tbody tr { transition: background .14s; }
.data-table tbody tr.prop-sum-row td.prop-sum-cell { border-bottom: 1px solid var(--line-200); }
.data-table tbody tr:hover td { background: var(--brand-050); }

.data-table .status-在租 { color: var(--red); font-weight: 600; }
.data-table .status-闲置 { color: var(--green); }
.data-table .status-认购 { color: var(--orange); }
.data-table .status-已售 { color: var(--purple); }
.data-table .status-自用 { color: var(--indigo); font-weight: 600; }
.data-table .status-出借 { color: var(--cyan); }

/* 紧凑卡片：用于卡片数量多的页面（如历史台账的状态卡片） */
.cards.cards-compact { gap: 10px; margin-bottom: 12px; }
.cards.cards-compact .card { padding: 10px 14px; border-radius: var(--r-md); }
.cards.cards-compact .card .label { font-size: 12px; margin-bottom: 2px; }
.cards.cards-compact .card .value { font-size: 17px; }
.cards.cards-compact .card::before { height: 2px; }

/* 台账可视框（类Excel） */
#tab-properties.active,
#tab-rights.active,
#tab-contracts.active,
#tab-history.active,
#tab-security.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 104px);
  min-height: 0;
}
#tab-properties.active > .toolbar,
#tab-rights.active > .toolbar,
#tab-contracts.active > .toolbar,
#tab-history.active > .toolbar,
#tab-security.active > .toolbar { flex-shrink: 0; }
#tab-properties.active > .panel,
#tab-rights.active > .panel,
#tab-contracts.active > .panel,
#tab-history.active > .panel,
#tab-security.active > .panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
#tab-rights.active > .cards,
#tab-history.active > .cards,
#tab-security.active > .cards { flex-shrink: 0; }
#tab-properties.active .table-scroll,
#tab-rights.active .table-scroll,
#tab-contracts.active .table-scroll,
#tab-history.active .table-scroll,
#tab-security.active .table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
}
#tab-properties.active .pagination,
#tab-rights.active .pagination,
#tab-contracts.active .pagination,
#tab-history.active .pagination,
#tab-security.active .pagination { flex-shrink: 0; }
#tab-history.active > .hint { flex-shrink: 0; }
#tab-history.active .toolbar { flex-wrap: wrap; row-gap: 6px; }

/* 冻结列 */
.table-freeze { border-collapse: separate; border-spacing: 0; }
.data-table.table-freeze { width: max-content; min-width: 100%; }
.table-freeze th { white-space: normal; word-break: break-all; line-height: 1.3; }
.table-freeze td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-freeze thead th { position: sticky; top: 0; z-index: 4; background: var(--bg-50); }
.table-freeze thead th.freeze-col { z-index: 6; background: var(--bg-50); box-shadow: 2px 0 5px rgba(20,41,77,.07); }
.table-freeze tbody td.freeze-col { position: sticky; z-index: 3; background: #fff; box-shadow: 2px 0 5px rgba(20,41,77,.05); }
.table-freeze tr:hover td.freeze-col { background: var(--brand-050); }
.table-freeze td.cell-wrap { white-space: normal; word-break: break-all; line-height: 1.45; }
.table-freeze td.cell-bold { font-weight: 600; color: var(--brand-700); }
/* R244：已退租/已失效合同的「现租金」是退租时点租金（不随时间上涨），
   灰底斜体 + 悬停说明，避免在混排列表里被当成"现在还值这么多"。 */
.table-freeze td.cell-quit-rent {
  color: var(--ink-400);
  font-style: italic;
  background: #fafafa;
}
.table-freeze td.cell-check { text-align: center; font-weight: 700; color: var(--green); font-size: 15px; }

/* 台账右侧固定操作列 */
.table-freeze td.op-col {
  position: sticky; right: 0; z-index: 3;
  background: #fff; box-shadow: -2px 0 5px rgba(20,41,77,.05);
  min-width: 136px; max-width: 136px; text-align: center; white-space: nowrap;
}
.table-freeze thead th.op-col {
  position: sticky; right: 0; z-index: 7;
  background: var(--bg-50); box-shadow: -2px 0 5px rgba(20,41,77,.07);
  min-width: 136px; max-width: 136px;
}
.table-freeze tr:hover td.op-col { background: var(--brand-050); }
/* 台账行内「查看 / 操作」并排（2026-11-03）：列宽有限，收紧内边距并留出间隔 */
.table-freeze td.op-col .btn { padding: 4px 9px; }
.table-freeze td.op-col .btn + .btn { margin-left: 6px; }

/* ============ R193：合同「操作」浮层菜单 ============
   操作列由「档案 / 修改 / 删除」三个横排按钮合并成一个「操作 ▾」，
   菜单挂在 body 下用 fixed 定位 —— 放进单元格会被 .table-xscroll 的 overflow 裁掉。 */
.contract-op-btn { white-space: nowrap; padding-left: 10px; padding-right: 8px; }
.op-menu {
  position: fixed;
  z-index: 3000;
  min-width: 168px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-200);
  border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.op-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 20px;
  color: #1f2733;
  text-align: left;
  cursor: pointer;
}
.op-menu-item:hover { background: #f2f4f7; }
.op-menu-item:focus-visible { outline: 2px solid var(--brand-600, #4a6fdc); outline-offset: -2px; }
.op-menu-item.danger { color: #b3261e; }
.op-menu-item.danger:hover { background: #fdf1f0; }
.op-menu-hint { font-size: 11.5px; color: #98a2b3; }

.diff-row td { background: var(--gold-050); }

/* ============ 统计看板可视框（各公司统计 / 续租·出租·退租明细） ============ */
/* 高度设上下限：内容超出时在框内滚动，表头吸顶常驻，不撑长浏览器页面 */
.dash-table-scroll {
  max-height: max(240px, calc(100vh - 380px));
  min-height: 240px;
  overflow: auto;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
}
/* 折叠明细内的次级可视框：高度略小、无外框（由折叠面板提供边框） */
.dash-table-scroll.is-sub {
  max-height: max(220px, calc(100vh - 560px));
  min-height: 200px;
  border: none;
  border-radius: 0;
}
/* 可视框内表格统一用独立边框模型，否则吸顶表头的下边框会丢失 */
.dash-table-scroll > table {
  border-collapse: separate;
  border-spacing: 0;
}
/* 表头吸顶（含左上角冻结单元格），两种表格通用 */
.dash-table-scroll thead th {
  position: sticky; top: 0; z-index: 4; background: var(--bg-50);
  box-shadow: inset 0 -2px 0 var(--line-200);
}
.dash-table-scroll thead th.freeze-col { z-index: 6; }
/* 末行不重复描边 */
.dash-table-scroll tbody tr:last-child td { border-bottom: none; }

/* ============ 分页 ============ */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.pagination button, .pagination .pg-btn {
  padding: 6px 12px;
  border: 1px solid var(--line-200);
  background: #fff;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-600);
  font-family: inherit;
  transition: all .15s var(--ease-out);
}
.pagination button:hover, .pagination .pg-btn:hover { border-color: var(--brand-500); color: var(--brand-700); }
.pagination button.active, .pagination .pg-btn.active {
  background: var(--brand-600);
  color: #fff;
  border-color: var(--brand-600);
  box-shadow: var(--shadow-brand);
}
.pagination .pg-btn.disabled { color: var(--ink-400); cursor: not-allowed; background: var(--bg-50); }
.pagination .pg-ellipsis { color: var(--ink-400); padding: 0 4px; user-select: none; }
.pagination .pg-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-600); margin-left: 4px; }
.pagination .pg-jump-input {
  width: 56px; padding: 4px 6px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  font-size: 13px; text-align: center;
}
.pagination .pg-jump-input:focus { border-color: var(--brand-600); outline: none; }

/* ============ 弹窗 ============ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 26, 46, .5);
  backdrop-filter: blur(3px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 26px 28px;
  width: 620px;
  max-width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn .28s var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-box h3 {
  margin-bottom: 18px;
  color: var(--brand-800);
  font-size: 17px;
  font-weight: 600;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid label { display: block; font-size: 13px; color: var(--ink-600); margin-bottom: 5px; }
.form-grid input, .form-grid select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-700);
  transition: border-color .16s, box-shadow .16s;
}
.form-grid input:focus, .form-grid select:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(42, 79, 138, .12);
}
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

.modal-close-btn {
  position: absolute;
  top: 14px; right: 16px;
  width: 30px; height: 30px;
  border: none;
  background: var(--bg-50);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-500);
  transition: background .16s, color .16s;
}
.modal-close-btn:hover { background: var(--line-100); color: var(--ink-900); }

/* ============ 通用提示 ============ */
.hint { color: var(--ink-500); font-size: 13px; margin-bottom: 16px; }
.import-result {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-50);
  border: 1px solid var(--line-100);
  border-radius: var(--r-md);
  font-size: 14px;
  white-space: pre-wrap;
  display: none;
  line-height: 1.6;
}
.import-result.show { display: block; }

/* ============ 组织架构（公司树）============ */
.company-node {
  border: 1px solid var(--line-100);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.company-level2 { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.company-level2 .cname { font-weight: 600; font-size: 15px; color: var(--brand-800); flex: 1; }
.company-level3 { margin-left: 26px; border-left: 2px solid var(--line-200); padding-left: 16px; }
.company-node3 { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.company-node3 .cname { font-size: 13px; color: var(--ink-600); flex: 1; }

.prop-link { color: var(--brand-700); text-decoration: none; cursor: pointer; border-bottom: 1px dashed var(--brand-400); }
.prop-link:hover { color: var(--brand-500); border-bottom-style: solid; }

.archived-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px dashed var(--line-100);
  font-size: 13px;
}
.archived-item span:first-child { flex: 1; color: var(--ink-600); }

.bound-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.bound-item + .bound-item { border-top: 1px dashed var(--line-100); }
.bound-name { flex: 1; word-break: break-all; font-size: 13px; }

/* ============ 地图看板 ============ */
#map-container { border-radius: var(--r-md); }
#map-container .leaflet-popup-content-wrapper { border-radius: var(--r-md); }
#tab-map .toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#map-select-btn.btn-danger { padding: 8px 16px; font-size: 14px; background: var(--red); }
#map-export-btn { background: var(--green); }
#map-export-btn:hover { background: #178a60; filter: none; }
.map-search-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line-100); }
.map-search-item:hover { background: var(--brand-050); }

/* ===== 地图打点：蓝色发光光圈 + 状态色实心点（R256 2026-10-29）=====
   原来的点只有「实心圆 + 白边 + 一点阴影」，在地图底图上不够跳。
   现在分三层：
     .map-pin-glow  静态柔光（多层蓝色外发光，所有点都有，靠纯阴影实现，零动画开销）
     .map-pin-halo  脉冲光圈（只给聚合点 —— 上百个单点同时动画会拖慢渲染）
     .map-pin-core  实心点（径向渐变做高光，内圈保留状态色：在租红/闲置绿/混合橙）
   光圈统一蓝、内芯表状态：视觉上是一套设计，信息上不丢状态。 */
.map-pin-wrap {
  background: none !important; border: 0 !important;
  display: flex; align-items: center; justify-content: center;
}
.map-pin {
  position: relative; display: flex; align-items: center; justify-content: center;
  --pin: #7f8c8d;
}
.map-pin-core {
  position: relative; z-index: 2; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%,
              rgba(255,255,255,.95) 0%, var(--pin) 46%, var(--pin) 100%);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.92),
              0 2px 5px rgba(2,32,71,.45),
              inset 0 -1px 3px rgba(0,0,0,.20);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: -.2px;
  display: flex; align-items: center; justify-content: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.50);
}
.map-pin-glow {
  position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 8px 3px rgba(59,130,246,.55),
              0 0 18px 7px rgba(59,130,246,.22);
}
.map-pin-halo {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgba(96,165,250,.75);
  animation: mapPinPulse 2.4s cubic-bezier(.22,.61,.36,1) infinite;
}
@keyframes mapPinPulse {
  0%   { transform: scale(.85); opacity: .90; }
  75%  { transform: scale(2.10); opacity: 0; }
  100% { transform: scale(2.10); opacity: 0; }
}
/* 尊重系统的「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  .map-pin-halo { animation: none; opacity: 0; }
}
.map-search-item:last-child { border-bottom: none; }
.dash-toggle { color: var(--brand-500); font-size: 12px; user-select: none; }
.dash-toggle:hover { color: var(--orange); }

/* ============ 公司树形多选下拉 ============ */
.company-tree-select { position: relative; display: inline-block; min-width: 220px; }
.company-tree-select .cts-trigger {
  padding: 8px 12px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-tree-select .cts-trigger .cts-arrow { margin-left: auto; color: var(--ink-400); transition: transform .15s; }
.company-tree-select.open .cts-trigger .cts-arrow { transform: rotate(180deg); }
.company-tree-select .cts-panel {
  position: absolute; top: 100%; left: 0; z-index: 1000; margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 260px; max-width: 360px;
  display: none; overflow: hidden;
}
.company-tree-select.open .cts-panel { display: block; }
.cts-panel .cts-search { padding: 8px 10px; border-bottom: 1px solid var(--line-100); }
.cts-panel .cts-search input {
  width: 100%; box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.cts-panel .cts-search input:focus { border-color: var(--brand-500); }
.cts-panel .cts-list { max-height: 300px; overflow-y: auto; }
.cts-panel .cts-group { border-bottom: 1px solid var(--line-100); }
.cts-panel .cts-group:last-child { border-bottom: none; }
.cts-group .cts-parent {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; cursor: pointer; font-size: 14px;
  font-weight: 600; color: var(--brand-800); user-select: none;
}
.cts-group .cts-parent:hover { background: var(--brand-050); }
.cts-group .cts-parent .cts-expand { color: var(--ink-400); font-size: 12px; width: 12px; transition: transform .15s; }
.cts-group .cts-parent .cts-expand.expanded { transform: rotate(90deg); }
/* 折叠态「名下三级已选」角标（2026-11-02）
   父行复选框只代表「本部」、不联动三级，所以一组折叠之后，里面选了几家
   完全看不见。集团层面接着勾别的二级企业时，会把上一家的三级一起带上 ——
   这个角标就是补这个洞：只要折叠着、名下还有选中项，就必须看得见。
   有角标时右侧不再显示「N 家三级」，避免窄屏把公司名挤成两行。 */
.cts-group .cts-parent .cts-sub-mark {
  display: inline-flex; align-items: center; flex: none;
  padding: 1px 7px; margin-left: 2px;
  font-size: 11.5px; font-weight: 500; line-height: 1.65;
  color: #b45309; background: #fff7e6; border: 1px solid #fbdba7;
  border-radius: 999px; white-space: nowrap;
}
.cts-group .cts-parent .cts-sub-count {
  margin-left: auto; color: var(--ink-400); font-size: 12px; font-weight: 400;
}
/* 面板最窄 260px，公司名一长就容易被角标挤成两行 —— 手机上把角标收小一号。
   只动字号和内边距，文案不改（「已选 3 家三级」是必须看懂的）。 */
@media (max-width: 768px) {
  .cts-group .cts-parent .cts-sub-mark { font-size: 10.5px; padding: 0 5px; margin-left: 0; }
}
.cts-group .cts-children { padding: 0 10px 8px 28px; display: none; }
.cts-group .cts-children.open { display: block; }
.cts-children label {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; font-size: 13px; cursor: pointer;
  border-radius: var(--r-sm); color: var(--ink-700);
}
.cts-children label:hover { background: var(--brand-050); }
.cts-panel .cts-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--line-100);
  display: flex; gap: 8px; align-items: center;
  position: sticky; bottom: 0; background: #fff;
}
.cts-panel .cts-footer .cts-select-all { margin-right: auto; }

/* ============ 通用多选下拉（扁平复选，复用 cts-* 骨架）============ */
.company-tree-select.multi-select { min-width: 132px; }
.company-tree-select.multi-select .cts-trigger .cts-text.has-value {
  font-weight: 600; color: var(--brand-700);
}
.multi-select .cts-panel {
  min-width: 170px;
  max-width: min(280px, calc(100vw - 28px));
}
.multi-select .cts-list { max-height: 260px; padding: 4px; }
.ms-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; font-size: 13px; cursor: pointer;
  border-radius: var(--r-sm); color: var(--ink-700);
}
.ms-item:hover { background: var(--brand-050); }
.ms-item input { margin: 0; cursor: pointer; flex: none; }
.ms-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 智能经营分析助手 ============ */
.ai-chat-panel {
  border: 1px solid var(--brand-100);
  background: linear-gradient(180deg, #fff 0%, var(--brand-050) 100%);
}
.ai-chat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.ai-chat-header h3 { margin-bottom: 0; color: var(--brand-800); }
.ai-chat-header h3::before { display: none; }
.ai-chat-hint {
  font-size: 12px;
  color: var(--gold-600);
  background: var(--gold-050);
  border: 1px solid var(--gold-100);
  padding: 4px 12px;
  border-radius: 20px;
}
.ai-chat-body {
  height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-100);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}
.ai-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border-bottom-right-radius: 3px;
  box-shadow: var(--shadow-brand);
}
.ai-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: var(--ink-900);
  border: 1px solid var(--line-100);
  border-bottom-left-radius: 3px;
  box-shadow: var(--shadow-xs);
}
.ai-msg-bot ul, .ai-msg-bot ol { margin: 6px 0 6px 18px; }
.ai-msg-bot strong { color: var(--brand-700); }
.ai-loading { color: var(--ink-400); font-style: italic; }
.ai-chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.ai-chat-input-row textarea {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 52px;
  transition: border-color .16s, box-shadow .16s;
}
.ai-chat-input-row textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(42,79,138,.12); }
.ai-chat-input-row button {
  padding: 10px 26px;
  border: none;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  height: 52px;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: var(--shadow-brand);
  transition: filter .16s, box-shadow .16s;
}
.ai-chat-input-row button:hover { filter: brightness(1.06); }
.ai-chat-input-row button:disabled { background: #b7c6dd; cursor: not-allowed; box-shadow: none; }
.ai-chat-foot { font-size: 12px; color: var(--ink-400); margin-top: 10px; }

/* ============ 图表容器 ============ */
[id$="-chart"] { width: 100%; }

/* ============ 滚动条（全局美化）============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c9d2df;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #aab6c9; background-clip: content-box; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .topbar { padding: 0 14px; }
  .brand { margin-right: 18px; }
  .content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-box { width: 100%; }
}

/* ============ 安全中心 ============ */
.sec-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.sec-lv-critical { background: #FCEBEB; color: #791F1F; border: 1px solid #F09595; }
.sec-lv-high { background: #FAECE7; color: #712B13; border: 1px solid #F0997B; }
.sec-lv-medium { background: #FAEEDA; color: #633806; border: 1px solid #EF9F27; }
.sec-lv-low { background: #E6F1FB; color: #0C447C; border: 1px solid #85B7EB; }
.sec-lv-info { background: #F1EFE8; color: #444441; border: 1px solid #B4B2A9; }
#sec-cards { margin-bottom: 10px; }
#sec-cards .card.lv-critical::before { background: #A32D2D; }
#sec-cards .card.lv-high::before { background: #D85A30; }
#sec-cards .card.lv-medium::before { background: #BA7517; }
#sec-table td:nth-child(6) { max-width: 320px; }
#sec-last-run { color: #888; font-size: 12px; }
#sec-table .sec-detail-cell { cursor: pointer; color: #2A4F8A; }
#sec-table .sec-detail-cell:hover { text-decoration: underline; }
#sec-table .sec-ops { white-space: nowrap; }
#sec-table .sec-ops .btn { margin-right: 4px; }

/* ============ 安全事件详情弹窗 ============ */
.sec-detail-box { width: 780px; }
.sec-detail { font-size: 13px; color: #333; }
.sec-kv { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.sec-kv th {
  width: 88px;
  text-align: left;
  font-weight: 500;
  color: #666;
  padding: 5px 10px 5px 0;
  vertical-align: top;
  white-space: nowrap;
}
.sec-kv td { padding: 5px 0; vertical-align: top; word-break: break-all; }
.sec-block { margin-bottom: 15px; }
.sec-block h4 {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-800);
  padding-left: 9px;
  border-left: 3px solid var(--brand-800);
  line-height: 1.35;
}
.sec-text { line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.sec-actions { margin: 0; padding-left: 22px; line-height: 1.8; }
.sec-actions li { margin-bottom: 3px; }
.sec-pre {
  background: #F7F8FA;
  border: 1px solid var(--line-200);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 280px;
  overflow: auto;
  color: #2b2b2b;
}
.sec-hint { color: #888; font-size: 12px; line-height: 1.6; margin-top: 4px; }
.sec-hint-warn {
  color: #8a5a00;
  background: #FFF8E6;
  border: 1px solid #F0D9A0;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 0 8px;
}

/* ============ 评估报告（2026-10-20）============ */
/* 与其他表格页同一套布局：根规则必须写，否则页面高度失控、分页跑到屏幕外 */
#tab-appraisal.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 104px);
  min-height: 0;
}
#tab-appraisal.active > .toolbar { flex-shrink: 0; flex-wrap: wrap; row-gap: 6px; }
#tab-appraisal.active > .panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
#tab-appraisal.active .table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
}
#tab-appraisal.active .pagination { flex-shrink: 0; }
#appraisal-table td.num, #appraisal-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 复核弹窗：左预览 右表单 */
.ap-detail-box { max-width: 1180px; width: 94vw; }
/* 标题是「报告详情 · 文件名」，文件名动辄三四十字，要是不留右边距会顶到右上角的叉 */
.ap-detail-box > h3 { padding-right: 44px; }
.ap-detail-wrap {
  display: flex;
  gap: 14px;
  height: calc(100vh - 250px);
  min-height: 420px;
}
.ap-preview {
  flex: 1 1 56%;
  min-width: 0;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #f5f5f5;
}
.ap-form { flex: 1 1 44%; min-width: 0; overflow: auto; padding-right: 4px; }
.ap-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.ap-row label { flex: 0 0 118px; font-size: 13px; color: #555; text-align: right; }
.ap-row input, .ap-row select { flex: 1; min-width: 0; }
.ap-row.ap-strong label { color: #b8860b; font-weight: 600; }
.ap-row.ap-strong input { border-color: #e0c97f; background: #fffdf3; }
.ap-group { border: 1px solid var(--line-200); border-radius: var(--r-md); padding: 8px 10px; margin: 8px 0; }
.ap-group-title { font-size: 12px; color: #888; margin-bottom: 6px; }
.ap-warn { background: #fff4d6; border: 1px solid #f0d9a0; color: #8a6d3b; border-radius: var(--r-md);
           padding: 7px 10px; font-size: 12px; margin: 8px 0; display: none; }
.ap-meta { font-size: 12px; color: #999; margin-top: 8px; line-height: 1.7; }

/* 绑定弹窗 */
.ap-link-box { max-width: 920px; width: 92vw; }
.ap-cand-wrap {
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  height: 320px;
}
.ap-cand-head {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; border-bottom: 1px solid var(--line-200); flex-shrink: 0;
  font-size: 13px;
}
.ap-cand-list { flex: 1; overflow: auto; padding: 4px 0; }
.ap-cand-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; font-size: 13px; cursor: pointer;
}
.ap-cand-item:hover { background: #f7f9fc; }
.ap-cand-item .c-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-cand-item .c-company { color: #888; font-size: 12px; }
.ap-cand-item .c-tag { font-size: 11px; color: #27ae60; }
.ap-linked { font-size: 12px; color: #666; max-height: 90px; overflow: auto; }
.ap-linked .ap-lk { display: inline-flex; align-items: center; gap: 4px; margin: 2px 8px 2px 0;
                    background: #eef4ff; border: 1px solid #d5e3ff; border-radius: 10px; padding: 1px 8px; }
.ap-linked .ap-lk button { border: 0; background: transparent; color: #c0392b; cursor: pointer; font-size: 12px; }
.ap-state-pending { color: #b8860b; }
.ap-state-parsed  { color: #27ae60; }
.ap-state-manual  { color: #2980b9; }
.ap-state-failed  { color: #c0392b; }
/* R256 P3-3：人工复核徽标。与状态并列显示（「已识别 人工」），
   因为这两件事现在分开记了：状态说明报告怎么来的，徽标说明人动过。
   以前把 parse_status 改成 manual 顶替，等于用「已复核」抹掉「已识别」。 */
.ap-edited { display: inline-block; margin-left: 4px; padding: 0 5px;
             font-size: 11px; line-height: 16px; border-radius: 8px;
             color: #fff; background: #2980b9; vertical-align: 1px; cursor: help; }
/* R256：列表静默刷新时的"正在更新"提示。
   原实现每次刷新都先把数据行清成一行「加载中…」，60 多行时整块数据消失几百毫秒，
   看起来就是"列表闪一下不见了"。现在保留旧内容，用半透明表示在更新：
   既没有空白帧，也不会让人把旧数据当成最新结果。 */
#appraisal-table tbody.ap-loading { opacity: .5; pointer-events: none; }
#appraisal-table tbody { transition: opacity .12s ease; }
.ap-day-expired { color: #c0392b; font-weight: 600; }
.ap-day-urgent  { color: #d35400; font-weight: 600; }
.ap-day-soon    { color: #b8860b; }

/* ============ 全局上传进度（2026-10-20）============ */
/* 浮在右下角：大文件上传几十秒，没有进度用户会以为卡死反复重传 */
.up-progress {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 320px;
  background: #fff;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  padding: 12px 14px;
  z-index: 3000;
}
.up-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
.up-pct { flex-shrink: 0; color: #2980b9; font-variant-numeric: tabular-nums; font-weight: 600; }
.up-track { height: 6px; background: #eef1f5; border-radius: 3px; overflow: hidden; }
.up-fill { height: 100%; width: 0; background: #2980b9; border-radius: 3px; transition: width .18s ease; }
.up-sub { font-size: 12px; color: #888; margin-top: 7px; min-height: 15px; }
.up-progress.up-done .up-fill { background: #27ae60; }
.up-progress.up-error .up-fill { background: #c0392b; }
.up-progress.up-error .up-pct { color: #c0392b; }
/* 上传中状态（列表里的标签） */
.ap-state-uploading { color: #2980b9; }
/* 进度条上的取消按钮：只在传输中可见，完成后隐藏（历史定稿时不该还能点） */
.up-cancel {
  flex-shrink: 0;
  border: 1px solid #e0c4c4;
  background: #fff5f5;
  color: #c0392b;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 18px;
}
.up-cancel:hover { background: #ffe9e9; }
.up-progress.up-done .up-cancel,
.up-progress.up-error .up-cancel { display: none; }

/* 复核弹窗里的物业明细表（2026-10-20） */
/* 一份报告常对应多个物业，明细必须能在复核时一眼看全，否则没法核对单价/月租金 */
.ap-items {
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  margin-top: 10px;
  overflow: hidden;
}
.ap-items-head {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 12px; background: #f7f9fc;
  border-bottom: 1px solid var(--line-200);
  font-size: 13px; color: #333;
}
.ap-items .table-scroll { border: 0; border-radius: 0; overflow: auto; }
.ap-items table { font-size: 13px; }
.ap-items td.num, .ap-items th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 有备注（多为自动修正/OCR 存疑）的行标黄，提醒人工看一眼 */
.ap-items tr.ap-fixed td { background: #fffdf3; }
.ap-items tr.ap-fixed td:last-child { color: #b8860b; font-size: 12px; }
/* 明细展开时，上面的预览/表单区让出高度 */
.ap-detail-wrap.has-items { height: calc(100vh - 470px); min-height: 260px; }

/* 明细行内编辑 */
.ap-items .ap-cell-in {
  width: 100%; box-sizing: border-box;
  border: 1px solid #7fb1e0; border-radius: 3px;
  padding: 1px 4px; font-size: 13px; font-family: inherit;
}
.ap-items .ap-cell-in.num { text-align: right; }
.ap-items tr.ap-editing td { background: #f0f7ff; }

/* 评估报告列表：长文本列固定宽度并自动换行（2026-10-20） */
/* 报告编号/估价对象动辄三四十字，nowrap 会把整行撑得很宽、后面列全被挤出屏幕 */
#appraisal-table td.ap-wrap {
  white-space: normal;
  word-break: break-all;
  line-height: 1.5;
  vertical-align: top;
}

/* 明细子行：紧跟在报告行下面，直接展示该报告的每个物业 */
#appraisal-table tr.ap-item-row > td {
  background: #f8fafc;
  padding: 0 !important;
  border-top: 0;
}
.ap-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 26px;
  font-size: 13px;
  border-top: 1px dashed #e3e8ef;
}
.ap-sub-seq { width: 22px; flex-shrink: 0; color: #9aa4b2; text-align: right; }
.ap-sub-name { flex: 1 1 240px; min-width: 0; color: #333; }
.ap-sub-usage { width: 54px; flex-shrink: 0; color: #666; }
.ap-sub-num { width: 88px; flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ap-sub-remark { flex: 1 1 150px; min-width: 0; color: #b8860b; font-size: 12px;
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-sub-ops { flex-shrink: 0; }
.ap-sub .ap-cell-in { width: 100%; box-sizing: border-box; border: 1px solid #7fb1e0;
                      border-radius: 3px; padding: 1px 4px; font-size: 12px; font-family: inherit; }
.ap-sub .ap-cell-in.num { text-align: right; }
.ap-sub-name .ap-cell-in { width: 100%; }
.ap-sub-fixed .ap-sub-remark { color: #b8860b; }

/* 展开/折叠三角（评估报告明细、用户管理三级公司） */
.ap-arrow, .co-arrow {
  display: inline-block;
  width: 13px;
  cursor: pointer;
  color: #2980b9;
  user-select: none;
  font-size: 12px;
  line-height: 1;
}
.ap-arrow:hover, .co-arrow:hover { color: #1a5d8f; }
/* 评估报告列表的展开箭头（2026-10-27）：从报告编号列挪到评估公司列，
   并放大到 20px 见方 —— 原来 12px 太小，一行十几行里根本点不准。
   只改 .ap-arrow，不动 .co-arrow（那是公司树在用的，尺寸不能跟着变）。 */
.ap-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 4px;
  font-size: 16px;
  margin-right: 2px;
  transition: background .15s, color .15s;
}
.ap-arrow:hover { background: #eaf3fb; color: #1a5d8f; }
/* 箭头 + 公司名同一行：flex 保证箭头不被长公司名挤走，clamp 依旧两行截断 */
.ap-ac-cell { display: flex; align-items: flex-start; gap: 2px; }
.ap-ac-cell .ap-clamp2 { flex: 1 1 auto; min-width: 0; max-width: none; }
.co-arrow { margin-right: 2px; }
.co-arrow-none { cursor: default; color: transparent; }
/* 二级公司后面的三级公司数量徽标 */
.co-count {
  display: inline-block;
  min-width: 15px;
  text-align: center;
  background: #eef4ff;
  color: #2980b9;
  border-radius: 8px;
  font-size: 11px;
  padding: 0 5px;
  margin-left: 5px;
  vertical-align: 1px;
}

/* ============ 修正：明细子行撑破表格导致列错位（2026-10-20）============
   原因：子行用 `display:flex` + `flex:1 1 240px`，宽度由内容撑开，
   长物业名会把整张表拉宽，右边「状态 / 操作」列被挤走，表头与内容对不上。
   改法：
     1) 表格用 table-layout:fixed —— 列宽严格按 thead 的 width 分配，内容不再撑宽表格；
     2) 子行改 grid，弹性列用 minmax(0,1fr)（不写 0 的话下限是内容宽度，照样会撑破）；
     3) 所有子单元格 min-width:0 + 单行省略。 */

#appraisal-table { table-layout: fixed; min-width: 1360px; width: 100%; }

/* 固定布局下，长文本必须允许在格内换行，否则会溢出到相邻列 */
#appraisal-table td.ap-wrap { overflow-wrap: break-word; word-break: break-all; }

.ap-sub {
  display: grid;
  grid-template-columns:
    28px                        /* 序号 */
    minmax(0, 1fr)              /* 物业名（弹性，可压缩） */
    58px                        /* 用途 */
    92px                        /* 面积 */
    82px                        /* 单价 */
    104px                       /* 月租金 */
    minmax(0, 170px)            /* 备注（可压缩） */
    168px;                      /* 操作 */
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 26px;
  font-size: 13px;
  border-top: 1px dashed #e3e8ef;
}
.ap-sub > * { min-width: 0; }
.ap-sub-seq { color: #9aa4b2; text-align: right; }
.ap-sub-name,
.ap-sub-usage,
.ap-sub-remark {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap-sub-name { color: #333; }
.ap-sub-usage { color: #666; }
.ap-sub-remark { color: #b8860b; font-size: 12px; }
.ap-sub-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-sub-ops { white-space: nowrap; }
.ap-sub .ap-cell-in { width: 100%; box-sizing: border-box; border: 1px solid #7fb1e0;
                      border-radius: 3px; padding: 1px 4px; font-size: 12px; font-family: inherit; }
.ap-sub .ap-cell-in.num { text-align: right; }

/* 固定布局下，所有单元格必须能换行，否则文字会溢出压到相邻列上 */
#appraisal-table td,
#appraisal-table th {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 金额/天数列保持单行右对齐，换行反而看不清 */
#appraisal-table td.num { white-space: nowrap; }

/* 明细子行（真实 td 版）—— 与主表列严格对齐，不再自成一套列宽 */
#appraisal-table tr.ap-item-row > td {
  background: #f8fafc;
  border-top: 1px dashed #e3e8ef;
  font-size: 13px;
  padding: 4px 8px !important;
  vertical-align: middle;
}
#appraisal-table tr.ap-item-fixed > td { background: #fffdf3; }

.ap-cell-seq { text-align: center; color: #9aa4b2; }
.ap-cell-mid { color: #666; }
.ap-cell-remark {
  color: #b8860b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* R295（2026-11-13）：备注放开可编辑后，输入框别继承备注格的黄褐色——
   那个颜色是「这行被自动修正过」的视觉标记，套在自己正在打的字上会误读成"内容有问题" */
.ap-cell-remark .ap-cell-in {
  color: #1f2329;
  font-size: 13px;
}
/* R296：备注是可长可短的多行文本，用 textarea 随内容长高。
   单行 input 只能横向滚动，改「OCR原值 xx，修正为 yy」这种句子会看不全、删错半句。
   高度由 JS 按 scrollHeight 算（max-height 与 AP_REMARK_MAX_H 保持一致），
   所以禁用拖拽把手、未超高时不出滚动条。 */
.ap-cell-remark textarea.ap-remark-in {
  display: block;
  resize: none;
  overflow: hidden;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.45;
  padding: 2px 4px;
}
.ap-cell-ops { white-space: nowrap; }
.ap-cell-ops .btn, .ap-cell-ops .btn-danger { padding: 1px 6px; font-size: 12px; }

/* 行内编辑的输入框：撑满单元格但不超过 */
#appraisal-table .ap-cell-in {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #7fb1e0;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 12px;
  font-family: inherit;
}
#appraisal-table .ap-cell-in.num { text-align: right; }

/* 所属公司列（2026-10-20）—— 表格从 11 列变 12 列，min-width 同步加宽 */
#appraisal-table { min-width: 1540px; }
.ap-cell-co { font-size: 12px; line-height: 1.6; }
/* 所属公司（2026-10-27）：公司全称二十多字，原来 nowrap + 省略号等于永远看不全，
   而这一列恰恰是"这份报告算谁的"的依据。改成允许折行（最多两行，超出省略），
   列宽从 180px 收到 140px —— 一句话换两行，比一行截断更有用。 */
.ap-co-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 112px;
  white-space: normal;
  word-break: break-all;
  vertical-align: middle;
  line-height: 1.45;
}
.ap-co-none { color: #bbb; }

/* 评估公司列（2026-10-27）：机构全称同样二十多字，两行截断。
   ⚠️ clamp 必须套在 td 里的 span 上：直接给 td 设 display:-webkit-box
   会把 table-cell 变成普通块，整张表的列对齐立刻散架。 */
.ap-cell-ac { font-size: 12px; line-height: 1.45; }
.ap-clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 120px;
  white-space: normal;      /* ⚠️ .table-freeze td 上是 nowrap，不显式覆盖就不会换行 */
  word-break: break-all;
}
.ap-co-btn { padding: 0 5px; font-size: 11px; line-height: 17px; margin-left: 4px; }

/* 催缴管理（2026-10-20） */
.co-block { border: 1px solid var(--line-200); border-radius: var(--r-md);
            padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.co-title { font-weight: 600; color: #333; margin-bottom: 10px; font-size: 14px; }
/* R144：滞纳金计算口径小标签（试算结果标题旁 / 催缴单记录里） */
.co-round-tag { display: inline-block; margin-left: 8px; padding: 1px 8px;
  border: 1px solid #b9d4ea; border-radius: 10px; background: #eef6fc;
  color: #2980b9; font-size: 12px; font-weight: 400; vertical-align: middle; }
.co-contract-info { font-size: 13px; color: #555; line-height: 1.7;
                    background: #f8fafc; padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; }
.co-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.co-grid-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-grid label { display: flex; flex-direction: column; gap: 3px;
                 font-size: 12px; color: #666; }
.co-grid input, .co-grid select { padding: 4px 6px; font-size: 13px; }
.co-checks { display: flex; align-items: center; gap: 18px; margin-top: 10px;
             font-size: 13px; color: #555; flex-wrap: wrap; }
.co-checks label { display: flex; align-items: center; gap: 5px; }
.co-ok { color: #27ae60; font-size: 12px; }
.co-no { color: #c0392b; font-size: 12px; }
.co-sum { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline;
          background: #f7f9fc; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px;
          font-size: 13px; color: #555; }
.co-sum b { color: #2980b9; }
.co-total b { color: #c0392b; font-size: 16px; }
.co-warn { color: #b8860b; }

/* 催缴管理页：表格不许被长文本撑破（2026-10-20）
   现象：选合同表格里物业名动辄三四十字，加上表头宽是"百分比+px"混用又没 fixed，
   浏览器按内容撑宽表格，整块跑出可视区。
   修法：table-layout:fixed 让列宽严格按表头比例分配，内容在格内换行。 */
#tab-collection .data-table {
  table-layout: fixed;
  width: 100%;
}
#tab-collection .data-table th,
#tab-collection .data-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
/* 勾选框列不换行，窄一点也无所谓 */
#tab-collection .data-table th:first-child,
#tab-collection .data-table td:first-child {
  text-align: center;
  word-break: normal;
}
/* 参数列只有"已配/未配"两个字，别换行 */
#tab-collection .data-table .co-ok,
#tab-collection .data-table .co-no { white-space: nowrap; }
/* 操作列按钮挤不下就换行排 */
#tab-collection .data-table td .btn,
#tab-collection .data-table td .btn-danger {
  margin-bottom: 2px;
}

/* 催缴页兜底：工具栏项多时换行，别把整页顶宽 */
#tab-collection .toolbar { flex-wrap: wrap; row-gap: 8px; }
#tab-collection .toolbar input[type="text"] { min-width: 200px; max-width: 320px; }
/* 表格容器双向滚动（内容再宽也只在框内滚，不外溢） */
#tab-collection .table-scroll { overflow: auto; }
/* 三个输入区在小屏自动降列 */
@media (max-width: 1100px) {
  .co-grid, .co-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .co-grid, .co-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* 催缴页兜底：工具栏项多时换行，别把整页顶宽 */
#tab-collection .toolbar { flex-wrap: wrap; row-gap: 8px; }
#tab-collection .toolbar input[type="text"] { min-width: 200px; max-width: 320px; }
/* 表格容器双向滚动（内容再宽也只在框内滚，不外溢） */
#tab-collection .table-scroll { overflow: auto; }
/* 三个输入区在小屏自动降列 */
@media (max-width: 1100px) {
  .co-grid, .co-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .co-grid, .co-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* 上次缴费判定（预缴/按时/逾期） */
.co-judge {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-size: 13px; margin: -4px 0 10px;
}
.co-j-early { color: #27ae60; }
.co-j-ok    { color: #2980b9; }
.co-j-late  { color: #c0392b; }

/* 上次缴费判定（预缴/按时/逾期） */
.co-judge {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-size: 13px; margin: -4px 0 10px;
}
.co-j-early { color: #27ae60; }
.co-j-ok    { color: #2980b9; }
.co-j-late  { color: #c0392b; }

/* ============ 修复：表单里的复选框被 width:100% 撑满 ============
   `.form-grid input { width: 100% }` 是给文本框用的，但复选框也被命中，
   结果复选框占满整行，后面的文字被挤到下一行：
   「可租」的文字掉到框下面，「可售」整个塌到最左边。
   这里把 checkbox/radio 的宽度还原成 auto，并把「标签 + 选项」做成一行。 */
.form-grid input[type="checkbox"],
.form-grid input[type="radio"] {
  width: auto;
  height: 16px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  accent-color: var(--brand-600);
  cursor: pointer;
  flex: 0 0 auto;
}
.form-grid input[type="checkbox"]:focus,
.form-grid input[type="radio"]:focus { box-shadow: none; }

/* 复选行：标题在上，选项在下，高度与普通输入框对齐，保证两列不错位 */
.form-check-row {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 38px;
}
.form-check-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  color: var(--ink-700);
  cursor: pointer;
  white-space: nowrap;
}

/* ============ 顶部导航：常用栏目 + 更多（2026-10-21）============
   部门经理权限下栏目有 18 个，横向排不下、后半截看不见。
   默认只显示「常用栏目」，其余收进「更多」，点开后换行铺满。 */
#nav { flex-wrap: wrap; row-gap: 4px; min-width: 0; }
#nav > .nav-item.nav-hidden { display: none; }
#nav.expanded > .nav-item.nav-hidden { display: inline-flex; }

/* ============ 导航分组分隔线（R18 ②，2026-10-25）============
   14 个栏目混排时找不到想要的，按「日常高频 / 周期专项 / 角色相关」分三段，
   段与段之间用 1px 竖线隔开。要点：
   · 必须是独立元素且 flex:none —— 用 <hr> 或给 nav-item 加 border-left 都不行：
     <hr> 在 flex 里会当可伸缩块撑开，border 会跟着 item 一起被「更多」隐藏规则影响，
     切断正好落在分组边界时会出现「两条线贴在一起」或「线在行首」。
   · JS 的 applyNavFav（宽度截断）会把这条线的宽度一起算进去，见 app.js；
     它两侧只要有任一侧没有栏目，就自己加 .nav-hidden 藏起来。 */
.nav-sep {
  flex: 0 0 1px;
  width: 1px;
  height: 18px;
  align-self: center;
  margin: 0 6px;
  background: rgba(255, 255, 255, .22);
  border-radius: 1px;
  pointer-events: none;   /* 只是装饰，别抢点击 */
}
/* 两种隐藏要分开，别合并 —— 它们在不同屏幕下含义不同：
   · .nav-hidden = 被「更多」按宽度截断了  → 桌面藏，手机（抽屉里不做宽度截断）要显示回来
   · .nav-off    = 结构上没意义（左侧或右侧没有任何有权限的栏目）→ 两端都藏 */
#nav > .nav-sep.nav-hidden { display: none; }
#nav > .nav-sep.nav-off { display: none; }

/* R24 ①：待审常驻入口（2026-10-25）
   在 #nav **之外**、固定宽度、永不参与「更多」折叠 —— 它要解决的就是
   「审批人不在台账页时看不到待审角标」。所以不能继承 .nav-item 的 nav-hidden 行为，
   样式也刻意独立写，不复用 .nav-more（那个是浅灰底，红/金才有"有活要干"的提示力）。 */
.nav-todo {
  flex: none;                 /* 不被 #nav 挤扁 */
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 4px 0 8px;
  padding: 6px 12px;
  background: rgba(240, 180, 41, .16);
  border: 1px solid rgba(240, 180, 41, .55);
  color: #ffe6ab;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-todo:hover { background: rgba(240, 180, 41, .3); color: #fff; }
/* 有待审时转红：这才是「有事要做」的视觉优先级 */
.nav-todo.has-pending {
  background: rgba(231, 76, 60, .22);
  border-color: rgba(231, 76, 60, .78);
  color: #ffd9d4;
}
.nav-todo .nav-badge { margin-left: 0; }
/* 0 条时数字**保留**（审批人要能确认"真的没有待办"，而不是"看不出来"），
   但压成半透明灰底，不跟真正待审抢注意力。 */
.nav-todo .nav-badge.zero { background: rgba(255, 255, 255, .2); color: #e6ecf5; }

/* 「更多 N / ⚙」已移出 #nav，固定在身份信息左侧，位置恒定不随栏目收放跳动 */
.nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px 0 10px;
  flex: none;                /* 不被 nav 挤扁 */
  align-self: center;
}
.nav-more, .nav-config {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #cdd8ea;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.nav-more:hover, .nav-config:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.nav-caret { font-size: 10px; opacity: .8; }
.nav-config { padding: 6px 9px; }

/* 栏目设置弹窗里的勾选项 */
.nav-config-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
}
.nav-config-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--ink-700);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.nav-config-item:hover { background: var(--bg-100, #f5f7fa); }
.nav-config-item input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; padding: 0;
  border: 0; accent-color: var(--brand-600); cursor: pointer;
}

/* ============ 标题栏高度自适应 + 展开换行（2026-10-21）============
   原来 .topbar 写死 height:58px，导航展开换行后第二行溢出到栏外、被下方内容盖住。
   改成 min-height，让内容自然把栏撑高。 */
.topbar {
  height: auto;
  min-height: 58px;
  padding-top: 6px;
  padding-bottom: 6px;
  align-items: center;
}
/* 导航不再横向滚动截断，交给 JS 按宽度决定收几个，展开时换行 */
.nav { overflow-x: visible; flex-wrap: wrap; row-gap: 4px; align-content: center; }

/* ============ 显示详细数据（不折叠万元 / 万㎡，2026-10-21）============
   统计看板 / 经营分析顶部勾选后，金额与面积都显示完整数值并保留两位小数。
   数字变长后列宽会被撑开，所以：
   · 数值与单位之间用不换行空格，只会在单元格内整体换行，不会把数字和「元」拆两行；
   · 纯数字表按内容自适应列宽（auto layout），外层容器负责横向滚动；
   · 卡片里的值字号降一档，避免长数字溢出卡片。 */
.detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-600);
  cursor: pointer;
  white-space: nowrap;
  padding: 0 2px;
}
.detail-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  border: 0;
  accent-color: var(--brand-600);
  cursor: pointer;
}

/* 表格横向滚动容器（经营分析的明细表在面板里，需要自己包一层） */
.table-xscroll { overflow-x: auto; }

/* ============ 变更日志：手机端筛选收起（R28 ③，2026-10-25）============
   桌面端这层盒子必须是 display:contents —— 与台账 .prop-filter-bar 同一坑：
   若保持 block，整个包裹层会变成 .toolbar 里的**一个** flex 项，里面的下拉
   不再参与 toolbar 的换行/gap 规则，桌面筛选栏整体走形。
   开关按钮桌面端不出现（手机端才需要"默认收起"）。 */
.log-filter-bar { display: contents; }
.log-filter-toggle { display: none; }

/* 卡片：长数字降字号，超宽时允许断行 */
body.detail-num .card .value { font-size: 16px; word-break: break-all; }

/* 纯数字列不折行，表格按内容定宽 */
body.detail-num #company-stats-table th,
body.detail-num #company-stats-table td,
body.detail-num #analysis-draft-table th,
body.detail-num #analysis-draft-table td { white-space: nowrap; }

/* ============ 表单必填校验反馈（2026-10-21）============
   必填项在表头打 *（静态表单写在 HTML 里，动态表单用 reqLabel() 生成）；
   校验不通过时给输入框加红边，配合 reqFields() 的聚焦 + 汇总提示。 */
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: #d9534f !important;
  box-shadow: 0 0 0 3px rgba(217, 83, 79, .14);
  background: #fffafa;
}
/* 星号统一颜色，避免只在个别表单里好看 */
.form-grid label .hint { color: #999; font-size: 12px; }

/* ============ 评估报告预览控制条（2026-10-23，2026-10-27 改造）============
   预览内容从「iframe 套整份 PDF」换成「滚动容器 + 逐页图片」，
   所以 .ap-preview 保持纵向 flex（控制条在上、滚动区撑满剩余高度），
   但撑满高度的对象从 iframe 换成了 .ap-pv-scroll。 */
.ap-preview { display: flex; flex-direction: column; position: relative; }
/* position:relative 是给放大浮层（.ap-zoom, inset:0）做定位基准的，
   配合上面的 overflow:hidden，浮层正好裁在预览区里，不会盖住右边的表单 */
.ap-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #fff;
  border-bottom: 1px solid var(--line-200);
  font-size: 12px;
  color: #666;
  flex: 0 0 auto;
}
.ap-preview-bar .ap-pv-info { margin-right: auto; }

/* --- 逐页图片容器（2026-10-27）---
   为什么不是 iframe：PDF 即使线性化，浏览器也得先拿到交叉引用表才能画第一页，
   10 页 3.9MB 在 6Mbps 上要 5 秒；而现在首屏只等第 1 页那 300KB。
   背景用浅灰，让白色纸面对比出来，观感与浏览器自带 PDF 阅读器一致。 */
.ap-pv-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #e8eaed;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}
.ap-pv-pages { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ap-pv-page {
  width: 100%;
  max-width: 860px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  position: relative;
  box-sizing: border-box;
}
.ap-pv-page img { display: block; width: 100%; height: auto; border: 0; touch-action: pan-y; }
/* touch-action: pan-y —— 手机上是"手指上下滑动翻页"，不是"点在图上就放大"，
   所以要明确让浏览器接管竖直方向的滚动手势 */
/* 图片还在路上：浅灰底 + 右上角页码，让人知道这块是"还没到"而不是"空白页" */
.ap-pv-page img.ap-pv-loading { background: #fbfbfb; }
/* 占位块：图还没到时先用上一页的比例撑出高度，滚动条不会来回跳 */
.ap-pv-ph {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa3ad;
  font-size: 12px;
  background: #fbfbfb;
}
.ap-pv-no {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, .42);
  color: #fff;
  font-size: 11px;
  line-height: 1.6;
  padding: 0 6px;
  border-radius: 8px;
  pointer-events: none;
  user-select: none;
}
.ap-pv-retry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  color: #b04a4a;
  font-size: 12px;
  background: #fff6f6;
  border: 1px dashed #e0b4b4;
  box-sizing: border-box;
  cursor: pointer;
}

/* --- 放大浮层（2026-10-27）---
   为什么就地放大而不是开新标签：复核时要"一边看放大图、一边看右边字段表"，
   新标签会把整个表单挡住，来回切窗口根本没法对数字。
   所以浮层只覆盖左侧预览区（父级 .ap-preview 的 overflow:hidden 正好裁住它）。
   深色底是为了让白纸页面突出，和看图软件的习惯一致。 */
.ap-zoom {
  position: absolute;
  inset: 0;
  background: #24262b;
  overflow: hidden;
  z-index: 6;
  cursor: grab;
  touch-action: none;          /* 触摸时不让页面跟着滚，交给拖动逻辑 */
}
.ap-zoom.dragging { cursor: grabbing; }
.ap-zoom img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.ap-zoom-bar {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  background: rgba(255, 255, 255, .92);
  border-radius: 6px;
  padding: 3px 6px;
}
.ap-zoom-hint { font-size: 11px; color: #666; margin-right: 2px; }

/* 复核弹窗去掉毛玻璃与入场动画（2026-10-24 加，2026-10-27 起属"历史保留"）。
   当初的病因：`.modal` 上的 backdrop-filter 会给整个遮罩建一个合成层，
   Chrome 在这种层里渲染 PDF 插件会失败，画面上只剩一片灰（同类问题：父级有
   transform / filter / will-change 时，iframe 内的插件内容会消失）。
   现在预览已改成逐页 <img>，理论上不再受影响；但这条规则零成本，且哪天又要在
   弹窗里嵌 PDF 就会立刻复发，所以留着 —— 只做减法，不加 transform/will-change。 */
#appraisal-detail-modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#appraisal-detail-modal .modal-box { animation: none; }
.btn-xs {
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #d5d9e0;
  border-radius: 4px;
  background: #fff;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
}
.btn-xs:hover { background: #f2f6ff; border-color: var(--brand-600, #3a6df0); color: var(--brand-600, #3a6df0); }
.btn-xs[disabled] { opacity: .45; cursor: default; background: #fafafa; color: #999; border-color: #e2e2e2; }

/* ============ 手机端简化视图（2026-10-23）============
   目标：手机上不再硬挤 40 列宽表。
   · 台账页 ≤768px 换成卡片（只留 状态/名称/公司项目/面积/月租金/租户/租期/合同号）
   · 顶部导航收成抽屉（右上角 ☰），筛选控件默认收起
   断点用 matchMedia(768px)，与 app.js 的 isMobileView() 保持一致 —— 改这里要同步改那边。 */

/* 桌面端一律隐藏 */
.nav-toggle { display: none; }
.mobile-only { display: none; }
.prop-cards { display: none; }

/* 产权 / 合同 / 履历 / 评估四张表的手机卡片容器（2026-11-02）
   为什么需要它：这四张表都是 .table-freeze，冻结列宽度合计 410~435px
   （台账 340px 已是极限），在 375px 屏上左右固定区相加就超过屏宽，
   中间可滚动区变成负数 —— 表现为「横滑时内容只在缝隙里闪一下」。
   桌面端这里恒为 display:none，不占位、不建 DOM（JS 里也用 isMobileView() 拦了）。 */
.m-card-list { display: none; }

/* 卡片里的通用小件（四张表共用，与台账 .pc-* 同一套视觉） */
.pc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pc-tag {
  font-size: 11.5px; line-height: 18px; padding: 1px 7px; border-radius: 9px;
  background: #f2f5fa; color: #5b6b82; white-space: nowrap;
}
.pc-tag.t-contract { background: #eef4ff; color: #2b5fa8; }
.pc-tag.t-status-on { background: #fdecec; color: #c0392b; }
.pc-tag.t-status-off { background: #eef0f3; color: #6b7280; }
.pc-actions {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f2f5;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
}
.pc-actions .btn, .pc-actions .btn-primary, .pc-actions .btn-danger {
  flex: none; padding: 5px 12px; font-size: 13px;
}

/* 筛选容器：桌面端必须 `display: contents`
   —— 否则这个 div 会变成 toolbar 里的**一个** flex 项，里面 6 个下拉 + 日期组
   不再按 toolbar 的 gap/换行规则排列，桌面端布局会整体走形。
   contents 让子元素直接参与父级 flex 布局，等于"这个包裹层不存在"。 */
.prop-filter-bar { display: contents; }

/* --- 卡片本体（容器在桌面隐藏，样式随容器生效）--- */
.pc-summary {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-size: 12.5px; color: #5b6b82;
  background: #f4f7fc; border: 1px solid #e3eaf5;
  border-radius: 8px; padding: 8px 11px; margin-bottom: 10px;
}
.pc-summary b { color: #1e3c72; font-size: 13.5px; font-weight: 700; }

.prop-card, .m-card {
  background: #fff;
  border: 1px solid var(--line-200, #e3e8ef);
  border-radius: 10px;
  padding: 12px 13px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.prop-card.pc-alert, .m-card.pc-alert { border-color: #f0b4b4; }

.pc-head { display: flex; align-items: flex-start; gap: 8px; }
.pc-name {
  font-size: 15px; font-weight: 700; line-height: 1.4;
  color: #16233a; word-break: break-word;
}
.pc-sub { font-size: 12px; color: #7a8699; margin-top: 3px; word-break: break-all; }

.pc-badge {
  flex: none; font-size: 11.5px; line-height: 18px; padding: 1px 8px;
  border-radius: 10px; background: #f1f2f6; color: #555; font-weight: 600;
  white-space: nowrap;
}
.pc-badge[data-st="在租"] { background: #fdecec; color: #c0392b; }
.pc-badge[data-st="闲置"] { background: #e9f7ef; color: #1e8449; }
.pc-badge[data-st="认购"] { background: #fef4e7; color: #b9770e; }
.pc-badge[data-st="已售"] { background: #f1eafb; color: #6c3483; }
.pc-badge[data-st="自用"] { background: #e8ebfb; color: #2e3f9e; }
.pc-badge[data-st="出借"] { background: #e6f6f8; color: #117a8b; }

.pc-nums {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: #f7f9fc; border-radius: 8px;
  padding: 8px 10px; margin: 10px 0 6px;
}
.pc-num span { display: block; font-size: 11px; color: #8894a8; margin-bottom: 2px; }
.pc-num b { font-size: 14px; font-weight: 700; color: #1f2b3d; }

.pc-row { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; color: #333; }
.pc-row > span { flex: none; width: 44px; color: #8894a8; font-size: 12px; line-height: 19px; }
.pc-row > b { font-weight: 500; line-height: 1.5; word-break: break-all; }
.pc-term { font-style: normal; margin-left: 6px; color: #b9770e; font-size: 12px; }

.pc-warn {
  margin-top: 7px; font-size: 12px; color: #a33;
  background: #fdecec; border-radius: 6px; padding: 4px 8px;
}
.pc-foot {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f2f5;
  display: flex; justify-content: flex-end;
}
.pc-empty { text-align: center; color: #98a2b3; font-size: 13px; padding: 28px 0; }

@media (max-width: 768px) {
  /* --- 顶栏 + 导航抽屉 --- */
  .topbar { padding: 0 12px; height: 54px; gap: 8px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none; padding: 0;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff; border-radius: 8px;
    font-size: 17px; line-height: 1; cursor: pointer;
    font-family: inherit;
  }
  .brand { margin-right: auto; font-size: 15px; padding-left: 30px; }
  .brand::before, .brand::after { width: 22px; height: 22px; }
  .brand::after { width: 22px; font-size: 10px; letter-spacing: .5px; }
  .nav-tools { display: none; }
  /* 手机上 #nav 是抽屉（.nav-tools 都藏了），待审入口留在顶栏里保持可见：
     审批人用手机也要能看到「有东西要审」。文字压短、只留 badge 的大小。 */
  .nav-todo { margin: 0 2px 0 0; padding: 5px 8px; font-size: 12px; }
  .user-info #user-name { display: none; }

  #nav {
    display: none;
    position: fixed; top: 54px; left: 0; right: 0;
    max-height: calc(100vh - 54px); overflow-y: auto;
    flex-direction: column; flex-wrap: nowrap; gap: 2px;
    padding: 8px 12px 16px;
    background: linear-gradient(160deg, var(--brand-900), var(--brand-700));
    box-shadow: 0 12px 28px rgba(8, 16, 32, .4);
    z-index: 60;
  }
  body.nav-open #nav { display: flex; }
  /* 抽屉里把「有权限」的栏目全部展开；无权限项是内联 display:none，不受影响 */
  #nav > .nav-item.nav-hidden { display: flex; }
  #nav > .nav-item {
    width: 100%; justify-content: flex-start;
    padding: 11px 12px; border-radius: 8px; font-size: 15px;
  }
  /* 抽屉是竖排（flex-direction:column），竖线在这个方向没有意义 → 转成横线分隔。
     不换行、不撑破：width:100% + flex:none，高度固定 1px。
     ⚠️ 抽屉打开/关闭时 #nav 是 display:none，量不到宽度，所以桌面那套「按宽度切断」
     在这里没意义；栏目被 CSS 重新显示（见上面 .nav-item.nav-hidden 的规则），
     分隔线也要跟着显示回来，只有「结构上没意义」(.nav-off) 的才继续藏。 */
  #nav > .nav-sep {
    flex: none;
    width: 100%;
    height: 1px;
    margin: 6px 0;
    background: rgba(255, 255, 255, .18);
  }
  #nav > .nav-sep.nav-hidden { display: block; }
  #nav > .nav-sep.nav-off { display: none; }

  .content { padding: 12px; }
  .panel { padding: 12px; border-radius: 10px; }

  /* --- 台账页：表格 → 卡片 --- */
  #tab-properties .table-scroll { display: none; }
  .prop-cards { display: block; }
  .mobile-only { display: inline-flex; }

  /* --- 产权 / 合同 / 履历 / 评估：表格 → 卡片（2026-11-02）---
     这四张表的冻结列合计 410~435px，比台账（340px）还宽，
     手机上横滑基本看不到右侧内容。断点与台账一致，改这里要同步改 app.js 的 MOBILE_MQ。 */
  #tab-rights .table-scroll,
  #tab-contracts .table-scroll,
  #tab-history .table-scroll,
  #tab-appraisal .table-scroll { display: none; }
  .m-card-list { display: block; }

  /* 筛选：默认收起；展开后每项占满一行（order 让搜索框排在最前） */
  #prop-toolbar > #filter-keyword { order: 1; flex: 1 1 100%; }
  #prop-toolbar > .prop-filter-bar { order: 3; }
  #prop-toolbar > .btn-primary,
  #prop-toolbar > .btn { order: 4; }
  #prop-toolbar > .prop-filter-toggle { order: 2; }
  .prop-filter-bar { display: none; width: 100%; flex-direction: column; gap: 8px; }
  #prop-toolbar.filters-open .prop-filter-bar { display: flex; }
  .prop-filter-bar > * { width: 100%; }
  .prop-filter-bar .filter-date-group { width: 100%; flex-wrap: wrap; gap: 6px; }
  .prop-filter-bar .filter-date-group > select,
  .prop-filter-bar .filter-date-group > input { flex: 1 1 28%; min-width: 0; }
  /* 多选下拉面板铺满，避免溢出到屏幕外 */
  .cts-panel { left: 0; right: 0; min-width: 0; }

  /* 分页：手机上按钮换行排，跳转框太挤先隐藏 */
  .pagination { flex-wrap: wrap; gap: 6px; }
  .pg-jump { display: none; }
}

/* ============ 物业详情弹窗（手机端卡片点进来，2026-10-23）============
   卡片只放关键字段，这里给完整信息；字段顺序与桌面表格一致（PROP_COLS），
   空值统一折叠到末尾，避免一进来先看到一屏「—」。 */
.prop-card { cursor: pointer; }
.prop-card:active { background: #fafcff; }
.pc-go {
  margin-left: auto; flex: none;
  color: #c3cbd8; font-size: 20px; line-height: 1; padding-left: 6px;
}

/* 详情改成两列板式后 560px 太挤（每列 ~250px），跟信息修改弹窗（680px）取齐 */
.prop-detail-box { width: 660px; }
.pd-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eef1f5;
}
.pd-sub { font-size: 12.5px; color: #7a8699; }
/* 详情板式对齐「信息修改」表单（2026-11-03）：
   两列网格、label 在上、值用只读框呈现，扫视时列对齐比一行一条紧凑得多 */
.prop-detail { max-height: 58vh; overflow-y: auto; display: grid;
  grid-template-columns: 1fr 1fr; gap: 12px 18px; align-content: start; }
.prop-detail > .pd-head,
.prop-detail > #pd-related,
.prop-detail > .pd-more { grid-column: 1 / -1; }
.pd-row { display: block; padding: 0; border-bottom: 0; font-size: 13px; }
.pd-k { display: block; color: #8894a8; font-size: 13px; margin-bottom: 4px; }
.pd-v { color: #1f2b3d; word-break: break-all; line-height: 1.5;
  font-size: 14px; padding: 8px 11px; min-height: 36px;
  border: 1px solid #e6ebf2; border-radius: 6px; background: #fafbfd; }
.pd-empty .pd-v { color: #b9c1cd; background: #fcfcfd; }

/* 变更日志里的物业名：做成链接样式，点击跳台账（用 span + 事件委托，不用 <a href="javascript:">） */
.prop-jump {
  color: #2a4f8a; cursor: pointer;
  border-bottom: 1px dashed currentColor; line-height: 1.2;
}
.prop-jump:hover { color: #1b3560; border-bottom-style: solid; }

/* 变更日志里的物业名：最多两行，超出省略号，完整名称在 title 上（悬停可看）。
   为什么套一层 span 而不是直接在 td 上 clamp：-webkit-line-clamp 要求 display:-webkit-box，
   套在 td 上会把它从 table-cell 变成块级，整列对齐就乱了。 */
.pd-name-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.45;
  text-align: left;
  max-width: 230px;
  border-bottom: 0;      /* 两行时下划线会跟着整体走，看着像分隔线，去掉 */
}
.pd-name-clamp:hover { text-decoration: underline; text-underline-offset: 2px; }

/* 详情里的「操作」下拉：向上弹，避免被弹窗底边裁掉 */
.pd-op-wrap { position: relative; display: inline-flex; }
.pd-op-menu {
  display: none; position: absolute; right: 0; bottom: calc(100% + 6px);
  min-width: 150px; background: #fff; border: 1px solid #e3e9f2;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 42, 85, .14);
  padding: 6px; z-index: 30;
}
.pd-op-menu.show { display: block; }
.pd-op-item {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; font-size: 13px; color: #1f2b3d; border-radius: 6px;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.pd-op-item:hover { background: #f1f5fb; }
.pd-more {
  margin: 10px 0 4px; font-size: 12px; color: #8894a8;
  background: #f6f8fb; border-radius: 6px; padding: 6px 9px;
}

/* ====== 「查看」里的关联情况：合同 / 原件 / 评估报告（2026-11-03）====== */
.pd-related-box {
  margin: 0 0 12px; padding: 10px 12px;
  background: #f8fafd; border: 1px solid #e8eef7; border-radius: 8px;
}
.pd-rel-title { font-size: 13px; font-weight: 600; color: #1f2b3d; margin-bottom: 8px; }
.pd-rel-sec { margin-bottom: 9px; }
.pd-rel-sec:last-child { margin-bottom: 0; }
.pd-rel-label { font-size: 12.5px; color: #55627a; margin-bottom: 4px; }
.pd-rel-ok { color: #1f8a4c; font-weight: 600; }
.pd-rel-no { color: #b8860b; }
.pd-rel-warn { color: #c0392b; }
.pd-rel-dim { color: #8894a8; font-size: 12px; }
.pd-rel-tag {
  font-size: 11px; color: #55627a; background: #eef2f8;
  border-radius: 3px; padding: 0 5px;
}
.pd-rel-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed #eef1f5;
}
.pd-rel-row:last-child { border-bottom: 0; }
.pd-rel-empty { font-size: 12px; color: #a3adbd; padding: 2px 0; }
.pd-rel-loading { font-size: 12px; color: #8894a8; padding: 6px 0; }

/* ====== R268 补录「实际发生日期」弹窗（2026-11-03）====== */
.eff-impact {
  margin-top: 10px; padding: 10px 12px;
  background: #f7f9fd; border: 1px solid #e6ebf2; border-radius: 6px;
  font-size: 12.5px; color: #44506a; line-height: 1.7;
}
.eff-impact-title { font-weight: 600; color: #1f2b3d; margin-bottom: 6px; }
.eff-impact-list { margin: 0; padding-left: 18px; }
.eff-impact-list li { margin-bottom: 5px; }
.eff-impact-list li:last-child { margin-bottom: 0; }
.eff-direct { color: #c0392b; }
.eff-warn {
  margin: 8px 0; padding: 8px 10px;
  background: #fff8e6; border: 1px solid #f0d9a8; border-radius: 6px;
  font-size: 12.5px; color: #8a5a00; line-height: 1.6;
}

/* ====== R272「从档案选择」弹窗布局修复（2026-11-04）====== */
/* 问题：.table-scroll 只在几个 tab 下有滚动样式，弹窗里没有 → 表格撑高容器，
   底部「关闭」被挤出弹窗、压在最后一行上；「选用」用 .btn（padding 8/16）在 70px 列里竖排成两字。
   修法：容器改 flex 列，列表区自己滚，按钮固定在底部不参与压缩。 */
.pick-arc-box {
  width: 880px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;          /* 覆盖 .modal-box 的 overflow-y:auto，改由列表区滚 */
}
.pick-arc-box > *:not(.pick-arc-list) { flex: 0 0 auto; }
.pick-arc-list {
  flex: 1 1 auto;
  min-height: 0;             /* 关键：不加这行 flex 子项不会收缩，滚动条不出现 */
  overflow: auto;
}
.pick-arc-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-200);
  text-align: right;
}
.pick-arc-use { white-space: nowrap; }

/* ====== R269 日期框粘贴成功/失败的反馈（2026-11-03）====== */
/* 绿框 = 认出来了并已转成标准格式；红框 = 没认出来（配合 alert 说明能写哪些） */
input.date-just-set {
  box-shadow: 0 0 0 2px #8fd19e;
  border-color: #8fd19e;
  transition: box-shadow .15s ease, border-color .15s ease;
}
input.date-paste-fail {
  box-shadow: 0 0 0 2px #f0a8a8;
  border-color: #f0a8a8;
}

/* ====== R270 桌面端日期框改为文本型（2026-11-03）====== */
/* 右侧留出 30px 给日历图标；图标是背景图不是元素，点击位置由 JS 判断 */
input.dt-text {
  background-image: url(/img/calendar.svg);
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 15px 15px;
  padding-right: 30px;
  cursor: text;
}
input.dt-text::placeholder { color: #b6bdc9; }
input.dt-text.dt-bad {
  box-shadow: 0 0 0 2px #f0a8a8;
  border-color: #f0a8a8;
}
/* R285：日期框非法时同容器提交按钮禁用（原来清空字段，现在保留+禁提交） */
button.dt-blocked {
  opacity: 0.45;
  cursor: not-allowed;
}
/* R292：不能只靠灰按钮——按钮上方常驻一行红字说明原因（手机看不到 title） */
.dt-block-tip {
  color: #c0392b;
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 6px;
  text-align: right;
}
/* R287：产权「自动绑定」结果条（原来只有 alert，点掉才开始刷新列表，等于两次等待） */
.bind-note {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.65;
}
.bind-note.ok { background: #eaf7ee; color: #1e7b3c; border: 1px solid #b7e2c4; }
.bind-note.warn { background: #fff7e6; color: #8a5b00; border: 1px solid #f0d9a8; }
.bind-note.bad { background: #fdecec; color: #a3271f; border: 1px solid #f2bcb8; }
.bind-note-sub { font-size: 12px; opacity: 0.85; }
/* R288：产权「绑定物业」列折叠提示（一条产权绑上千个物业时不能全渲染） */
.bound-more {
  margin-top: 3px;
  font-size: 12px;
  color: #6b7280;
}
.bound-more button {
  background: none;
  border: none;
  padding: 0;
  margin: 0 2px;
  font-size: 12px;
  color: #2980b9;
  cursor: pointer;
  text-decoration: underline;
}
/* 筛选栏：文本框默认 min-width 200px，日期框要窄一些，否则时间筛选会挤成一排 */
.toolbar input.dt-text {
  min-width: 140px;
  color: var(--ink-700);
}

/* R271 手机端也走同一套：图标区加宽到手指好点的尺寸，避免误点进输入区 */
@media (max-width: 768px) {
  input.dt-text {
    background-position: right 11px center;
    background-size: 16px 16px;
    padding-right: 36px;
  }
}

@media (max-width: 768px) {
  /* 原来 变更日志 / 临期提醒 / 应收租金 / 数据校验 / 用户 / 审核 等页的表格
     没有横向滚动容器，宽表会把整个页面撑开（内容跑到可视框外）。
     这些表格已在 index.html 里包上 .table-xscroll；这里让列宽不再被压扁，
     改由容器内部横向滑动。 */
  .table-xscroll { -webkit-overflow-scrolling: touch; }
  .table-xscroll > .data-table { min-width: 560px; }

  /* 弹窗铺满窄屏，避免左右留白过多、内容被压缩 */
  .modal { padding: 10px; }
  .modal-box { padding: 16px 16px 14px; max-height: 92vh; border-radius: 12px; }
  .prop-detail-box { width: 100%; }
  .prop-detail { grid-template-columns: 1fr; gap: 10px; }
  .pd-row { display: block; }
  .prop-detail { max-height: 60vh; }
}

/* ============ 解析进度（2026-10-24）============
   评估报告上传完后，解析在后台线程跑（OCR 20 页约 2 分钟）。
   原来只有「解析中…」三个字，用户不知道是在跑还是卡了。
   进度来自 GET /api/appraisal/detail 的 parse_pct / parse_stage，前端 2 秒轮询一次。
   复用上传浮层的 .up-* 样式，只抬高位置，避免和上传条叠在一起。 */
.pp-progress { bottom: 104px; }
.pp-progress .up-fill { background: #b8860b; }      /* 解析中用琥珀色，与上传的蓝色区分 */
.pp-progress.up-done .up-fill { background: #27ae60; }
.pp-progress.up-error .up-fill { background: #c0392b; }

/* 列表里的迷你进度条：解析中的行直接显示跑到哪，不用点进去 */
.ap-mini {
  display: block; height: 4px; margin-top: 4px;
  background: #eef1f5; border-radius: 2px; overflow: hidden;
}
.ap-mini > i {
  display: block; height: 100%; background: #b8860b;
  border-radius: 2px; transition: width .3s ease;
}

/* ============ 去化跟进台（#qr-modal，2026-10-25 R26）============
   把「新增出租·选物业」从选择器升级成跟进台：顶部一眼看压力，行内看闲置多久。
   颜色全部取现有语义变量（--green/--orange/--red 及对应底色），不引新色板。 */
.qr-overview {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 10px; padding: 8px 12px;
  font-size: 13px; color: var(--ink-700);
  background: var(--brand-050); border: 1px solid var(--line-200);
  border-radius: var(--r-sm);
}
.qr-overview b { font-weight: 600; color: var(--brand-700); }

/* R28：行内物业名从内联样式提到这里 —— 手机端要改成「最多两行后省略」，
   内联的 white-space:nowrap 会把媒体查询压住，只能靠 !important，不如直接提出来。 */
.qr-name {
  font-size: 14px; color: #1f2937;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qr-overview-note {
  font-size: 12px; color: var(--ink-400);
  padding-left: 10px; border-left: 1px solid var(--line-200);
}

/* 闲置时长徽标：<30 天（绿）/ 30–90 天（橙）/ >90 天（红）/ 算不出（灰） */
.qr-idle {
  display: inline-block; flex: none;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.5; white-space: nowrap;
  border: 1px solid transparent;
}
.qr-idle-cool { color: var(--green);  background: var(--green-bg);  border-color: rgba(26,156,110,.25); }
.qr-idle-warm { color: var(--orange); background: var(--orange-bg); border-color: rgba(217,138,31,.28); }
.qr-idle-hot  { color: var(--red);    background: var(--red-bg);    border-color: rgba(214,69,69,.28); }
.qr-idle-na   { color: var(--ink-400); background: var(--bg-100);    border-color: var(--line-200); }

/* ============ 手机端专项（R28，2026-10-25）============
   今天上的三样东西（去化跟进台 / 顶栏待审 / 日志筛选）都只在桌面宽度看过。
   这里全部放在文件末尾：媒体查询不加特异性，靠"最后出现"压过上面各段的基础规则。
   ⚠️ 断点必须与 app.js 的 MOBILE_MQ（max-width:768px）一致。 */

@media (max-width: 768px) {
  /* --- ② 顶栏待审：54px 顶栏里已有 ☰ + 品牌 + 退出，再加「待审」两个字会把品牌挤到换行。
         压成纯数字角标（数字必显，0 也显），点击热区不缩：min-width 34 / padding 4+7。 --- */
  .nav-todo { margin: 0; padding: 4px 7px; min-width: 34px; justify-content: center; }
  #nav-todo-text { display: none; }
  .nav-todo .nav-badge { margin: 0; }

  /* --- ③ 变更日志筛选：默认收起（与台账 togglePropFilters 同一套），
         展开后每项占满一行，不再是一排被压扁的控件。 --- */
  #tab-logs .log-filter-toggle { display: inline-flex; align-items: center; justify-content: center; }
  #tab-logs > .toolbar > .log-filter-bar { display: none; width: 100%; flex-direction: column; gap: 8px; }
  #tab-logs.filters-open > .toolbar > .log-filter-bar { display: flex; }
  #tab-logs > .toolbar > .log-filter-bar > * { width: 100%; }
  #tab-logs > .toolbar > .log-filter-bar .filter-date-group { width: 100%; flex-wrap: wrap; gap: 6px; }
  #tab-logs > .toolbar > .log-filter-bar .filter-date-group > input { flex: 1 1 40%; min-width: 0; }
  /* 首屏只留「筛选 / 导出当前筛选」两个动作，各占一半宽，点得到 */
  #tab-logs > .toolbar > .btn,
  #tab-logs > .toolbar > .btn-danger { flex: 1 1 44%; margin-left: 0; }
  #log-filter-hint { width: 100%; }

  /* 极窄屏（320，iPhone SE 一代）兜底：个别下拉写死了宽度（#history-scope 实测 312px），
     加上页面内边距就顶出 4px。这里统一不让工具栏里的控件超过容器宽。 */
  .toolbar > select, .toolbar > input, #history-scope { max-width: 100%; min-width: 0; }

  /* --- ④ 宽表之外的隐藏溢出源：工具栏里的「日期组」是一个不可拆的 flex 项，
         合同页实测 449px，在 390 屏直接把页面撑到 461（表格本身有 .table-scroll 没漏）。
         窄屏让日期组自己换行，输入框等分，不再整块顶出去。 --- */
  .toolbar .filter-date-group { flex-wrap: wrap; width: 100%; }
  .toolbar .filter-date-group > select,
  .toolbar .filter-date-group > input { flex: 1 1 40%; min-width: 0; }
  .toolbar .filter-date-group > .date-sep { flex: none; }
  /* 合同页/日志页的日期组带一个"时间字段"下拉：让它独占一行，
     起止两个日期各占一半、中间的「至」居中 —— 否则 flex 换行会把「至」甩在行尾成孤儿。 */
  #tab-contracts .filter-date-group,
  #tab-logs .filter-date-group {
    /* minmax(0,1fr) 而不是 1fr：日期框有自己的最小宽度，320px 屏上 1fr 会顶出 1px */
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; width: 100%;
  }
  #tab-contracts .filter-date-group > select,
  #tab-logs .filter-date-group > select { grid-column: 1 / -1; width: 100%; min-width: 0; }
  #tab-contracts .filter-date-group > .date-sep,
  #tab-logs .filter-date-group > .date-sep { justify-self: center; align-self: center; }

  /* --- ① 去化跟进台 #qr-modal：内联 width:720px 在 390 屏只能靠 max-width:96vw 硬裁，
         概览那一行还会把长尾说明挤成碎块。这里改满宽 + 概览竖排（一行一个数）。 --- */
  #qr-modal .modal-box { width: 100% !important; max-width: 100% !important; padding: 14px 14px 12px; }
  /* 概览：不改成竖排（竖排 4 行 198px，比原来更占地方），只压字号/间距让它自然换行，
     长尾说明（"另有 N 条未显示""N 条缺上次租赁结束日"）用 flex-basis:100% 独占一行。 */
  #qr-modal .qr-overview { gap: 3px 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.5; }
  #qr-modal .qr-overview-note { flex: 1 1 100%; padding-left: 0; border-left: 0; font-size: 11.5px; }
  /* 公司下拉内联 min-width:170px、关键词框 min-width:200px：窄屏两个并排会顶出去 */
  #qr-modal #qr-company { min-width: 0 !important; width: 100%; }
  #qr-modal #qr-keyword { min-width: 0; width: 100%; }
  /* 列表给底部的「取消」留位置，避免 360px 高的列表把操作区顶出弹窗可视范围 */
  #qr-modal #qr-list { max-height: 46vh !important; }
  /* 手机上行宽只有 170px 时，一行截断会把"哪一间"截掉一半 —— 改成最多两行再省略 */
  #qr-modal .qr-name {
    white-space: normal; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-height: 1.35;
  }
  #qr-modal #qr-count { white-space: normal; }
}


/* ============ R42：新增物业「按状态分段」的合同信息区 ============
   四套合同字段（在租/认购/已售/出借）各写一份在 #f-contract-slot 里，由 app.js
   按状态把对应那一套 append 进去，其余三套用 remove() 摘出文档 ——
   所以「闲置 / 自用」时合同区元素数真的是 0，不是 display:none（R42 验收第 1 条）。
   沿用 R30 ② 的 display:contents 手法：挂上去时字段照旧参与 .form-grid 的两列网格，
   不多包一层盒子，桌面布局与改动前一致（与日志页 .log-filter-bar 同一手法）。
   ⚠️ .ct-section 不带 .show 时是 display:none：JS 没接管（脚本报错/未加载）时
      也不会露出半截表单，退化成改动前的行为。 */
#f-contract-slot { display: contents; }
.ct-section { display: none; }
.ct-section.show { display: contents; }
.ct-title {
  grid-column: 1 / -1;
  margin: 2px 0 -4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-200);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
}

/* 手机端（≤768px，与 app.js 的 MOBILE_MQ 同一阈值）：不再用 contents 摊进两列网格，
   整块块级堆叠 = 单列，避免任何 grid 折叠把弹窗撑宽（R42 验收第 5 条）。 */
@media (max-width: 768px) {
  .ct-section.show { display: block; }
  .ct-title { margin: 2px 0 4px; }
}

/* ============ R64：待出租清单窗格 ============ */
#vacant-modal .modal-box { max-height: 88vh; overflow: auto; }
.vacant-seg { margin-top: 12px; }
.vacant-seg-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-700);
  padding: 6px 0;
}
.vacant-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  background: var(--brand-50, #eef3fb); color: var(--brand-700);
  font-size: 12px; font-weight: 600;
}
.batch-rent-preview {
  margin: 10px 0 4px; padding: 10px 12px;
  background: #f7f9fc; border: 1px solid var(--line-200); border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.7;
}
/* R79：每段底部的「已显示前 N 条 + 加载更多」
   margin-top:8px 而不是靠 .hint 自带间距——.hint 在别的窗格里是行内小字，
   单独放在这一行里会顶到表格边框上。 */
.vacant-more-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; flex-wrap: wrap;
}
.vacant-more-row:empty { display: none; }
.vacant-more-row .hint { margin: 0; }

/* ============ R91：按合同批量退租 ============ */
#batch-quit-modal .modal-box { max-height: 90vh; overflow: auto; }
#bq-toolbar { flex-wrap: wrap; gap: 8px; }
/* 成员表可能很长（实测一份合同挂 328 个物业），限高 + 内部滚动，
   不靠撑高窗格 —— 撑高会把「提交」按钮顶出屏幕。 */
#bq-table-wrap { max-height: 280px; overflow: auto; }
#bq-table td, #bq-table th { white-space: nowrap; }
/* 结果 toast：右下角挂 4 秒，显示「已退租 N 个，流水号 XXX」。
   用 alert 会被下一次点击顶掉，而流水号是事后查账要用的，得能看清。 */
.bq-toast {
  position: fixed; right: 20px; bottom: 24px; z-index: 9999;
  max-width: 420px; padding: 12px 16px;
  background: #1f2d3d; color: #fff; font-size: 13px; line-height: 1.6;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.28);
  white-space: pre-wrap; word-break: break-all;
  opacity: 1; transition: opacity .5s ease;
}
.bq-toast.out { opacity: 0; }

/* 手机端（≤768px，与 app.js 的 MOBILE_MQ 同一阈值）：窗格单列堆叠、不横向滚动。
   表格本身已在 .table-scroll 里（列宽不够时容器内部横向滑），不允许把整个页面撑宽。 */
@media (max-width: 768px) {
  #vacant-modal .modal-box { width: 100% !important; max-height: 92vh; }
  #vacant-toolbar { flex-wrap: wrap; }
  .vacant-seg-head { flex-wrap: wrap; }
  .batch-rent-preview { font-size: 12px; }
  /* R91：390px 下窗格单列、成员表内部横滑，不允许把页面撑宽 */
  #batch-quit-modal .modal-box { width: 100% !important; max-height: 94vh; }
  #bq-toolbar { flex-direction: column; align-items: stretch; }
  #bq-toolbar input, #bq-toolbar .btn { width: 100%; }
  #bq-table-wrap { max-height: 40vh; }
  .bq-toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* ============ R95：沙箱（测试空间）模式 ============ */
/* 顶栏切换按钮。正常模式 = 次要 ghost（比「退出」更弱，不抢主操作）；
   沙箱模式 = 金色实底（顶栏已有 gold 元素，协调且醒目——人容易忘了自己在沙箱里）。 */
.sandbox-toggle {
  background: transparent;
  color: rgba(255, 255, 255, .82);
  border: 1px dashed rgba(255, 255, 255, .38);
  padding: 5px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 10px;
  white-space: nowrap;
  transition: background .18s var(--ease-out), border-color .18s, color .18s;
}
.sandbox-toggle:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.sandbox-toggle.in-sandbox {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: #1f2a3d;
  border: 1px solid var(--gold-600);
  font-weight: 700;
}
.sandbox-toggle.in-sandbox:hover { filter: brightness(1.06); }

/* 常驻横幅：淡紫提示「你在练习环境」。刻意不用红色（红色 = 出错）。
   放在 sticky 顶栏之后的普通文档流，不遮挡、不悬浮。 */
.sandbox-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 24px;
  background: #f3effe;
  color: #55389e;
  border-bottom: 1px solid #d9ccf5;
  font-size: 13px;
  line-height: 1.5;
}
.sandbox-banner-icon { flex: none; font-size: 15px; line-height: 1.4; }
.sandbox-banner-text b { color: #46298c; }
/* R254（F1）：沙箱横幅第二行，说明「没有集团终审」这条隔离限制。
   比主文案弱一档（小一号、透明度略低），避免和「与正式数据隔离」抢注意力。 */
.sandbox-banner-note {
  font-size: 12px;
  line-height: 1.45;
  color: #6b4fa8;
  opacity: .92;
}
/* R101：横幅改成「图标 + 正文块」，正文块里再放进度行与面板 */
.sandbox-banner-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sandbox-progress-line {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px;
  background: #fff; color: #55389e;
  border: 1px solid #c9b8f0; border-radius: 999px;
  font-size: 12px; line-height: 1.6; cursor: pointer;
}
.sandbox-progress-line:hover { background: #f6f2ff; border-color: #a98fe0; }
.sandbox-progress-line.all-done { background: #eaf7ee; border-color: #9ed4ae; color: #1f6b3a; }
.sandbox-progress-caret { font-size: 10px; transition: transform .15s ease; }
.sandbox-progress-line.open .sandbox-progress-caret { transform: rotate(180deg); }
.sandbox-progress-panel {
  background: #fff; border: 1px solid #d9ccf5; border-radius: 8px;
  padding: 10px 12px; margin-top: 2px;
  box-shadow: 0 4px 14px rgba(85, 56, 158, .08);
}
.sandbox-progress-list { list-style: none; margin: 0 0 8px; padding: 0; }
.sandbox-progress-item {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 5px 0; border-bottom: 1px dashed #eee;
  font-size: 12.5px; color: #444;
}
.sandbox-progress-item:last-child { border-bottom: none; }
.sandbox-progress-mark { flex: none; width: 14px; color: #b0a3c9; }
.sandbox-progress-item.found .sandbox-progress-mark { color: #1f8f4e; font-weight: 700; }
.sandbox-progress-name { flex: 1 1 auto; min-width: 0; }
.sandbox-progress-state { flex: none; font-size: 11.5px; color: #999; }
.sandbox-progress-item.found .sandbox-progress-state { color: #1f8f4e; }
.sandbox-progress-hint {
  flex: 1 1 100%; margin: 2px 0 0 22px;
  color: #666; font-size: 12px; line-height: 1.6;
}

/* 首次进入的 loading 遮罩（复用 .modal 骨架） */
.sandbox-loading-box { text-align: center; padding: 34px 40px; }
.sandbox-loading-box p { margin: 14px 0 0; color: var(--ink-700, #333); font-size: 14px; }
.sandbox-loading-spinner {
  width: 34px; height: 34px;
  margin: 0 auto;
  border: 3px solid #d9ccf5;
  border-top-color: #7c5cd6;
  border-radius: 50%;
  animation: sandbox-spin .8s linear infinite;
}
@keyframes sandbox-spin { to { transform: rotate(360deg); } }

/* 轻量提示条（首次进入完成后的「N 条练习物业」引导）。右上角，5s 自动消失。 */
.sandbox-note {
  position: fixed;
  top: 70px;
  right: 18px;
  z-index: 90;
  max-width: 380px;
  background: #f3effe;
  color: #46298c;
  border: 1px solid #c9b8f0;
  border-left: 4px solid #7c5cd6;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 6px 22px rgba(70, 41, 140, .18);
  animation: sandbox-note-in .22s var(--ease-out);
}
@keyframes sandbox-note-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 768px) {
  /* R95：390px 下横幅换行不撑破、按钮缩小不挤掉用户名 */
  .sandbox-banner { padding: 7px 12px; font-size: 12px; gap: 6px; }
  /* R101：390px 下面板占满、清单单列，不撑破 */
  .sandbox-progress-panel { padding: 8px 9px; }
  .sandbox-progress-hint { margin-left: 0; }
  .sandbox-toggle { padding: 4px 8px; font-size: 11px; margin-right: 6px; }
  .sandbox-note { left: 12px; right: 12px; top: 104px; max-width: none; }
}

/* ============ R103：批量设置入账时间 · 选择模式 ============ */
/* 平时行内只有「操作」按钮；进入选择模式后同一单元格换成勾选方格，一次只放一个控件 */
.table-freeze td.op-col .prop-sel,
.table-freeze thead th.op-col #prop-sel-all {
  width: 16px; height: 16px; vertical-align: middle; cursor: pointer; accent-color: var(--brand-600, #4a6fdc);
}

/* ============ R118：导航「先压缩再折叠」· 紧凑态 ============ */
/* 挂在 .topbar（#nav 的父级）上，由 applyNavFav() 三段式切换：正常 → 紧凑 → 折叠进「更多」。
   4 字栏目 86px → 68px（padding 7/15→6/8、字号 14→13、gap 2→0、品牌右距收窄）。
   不改任何栏目文字（产品决策）；.nav-item 的 flex-shrink:0 与 .nav 横滚保持不动。 */
.topbar.nav-compact .nav { gap: 0; }
.topbar.nav-compact .nav-item { padding: 6px 8px; font-size: 13px; }
.topbar.nav-compact .brand { margin-right: 14px; }
.topbar.nav-compact .nav-item.active::after { left: 8px; right: 8px; }

/* ============ R112：评估报告 · 绑定状态列 ============ */
.ap-unbound-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  background: #fdecea; color: #c0392b; border: 1px solid #f5b7b1;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
/* 2026-10-27 R185：绑定列改成显示物业名称（不再只写"已绑 N 个"），
   名称动辄十几字，限两行、超出末尾省略，完整清单放 title。
   ⚠️ `.table-freeze td` 是 nowrap，必须显式 white-space:normal 才会换行。 */
.ap-bound-txt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #7f8c8d;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-all;
  cursor: default;
}

/* 2026-10-27 R186：物业台账「评估单价」按对应评估报告是否失效着色。
   过期 = 红、有效期内 = 绿；没绑报告 / 报告没写有效期 → 不上色
   （后端 appraisal_expired 是 true/false/null 三态，别把 null 当"有效"染成绿色）。 */
.ap-price-valid { color: #1e8e3e; font-weight: 600; }
.ap-price-expired { color: #c0392b; font-weight: 600; }

/* 2026-10-27 R188：用户账号按「层级 → 公司」分组收纳。
   组标题整行可点（tr 上的 data-act），默认收起，只显示每家多少人。 */
.user-group-row td {
  background: #f4f8fc;
  cursor: pointer;
  user-select: none;
  padding: 7px 10px;
  border-top: 1px solid var(--line-200);
}
.user-group-row:hover td { background: #e9f2fb; }
.user-group-row .ug-arrow { display: inline-block; width: 14px; color: #2980b9; font-size: 13px; }
.user-group-row .ug-name { font-weight: 600; color: #1f2d3d; }
.user-group-row .ug-count { margin-left: 8px; color: #7f8c8d; font-size: 12px; }
/* 三级公司缩进一层，让层级一眼看出来 */
.user-group-row.lv2 td { padding-left: 28px; }
.user-group-row.lv2 .ug-name { font-weight: 500; }
.user-row.lv2 td:first-child { padding-left: 34px; }

/* 2026-10-27 R189：用户账号组内再按「角色」分一层（公司 → 角色 → 人）。
   角色行比公司行更浅一档底色、再缩进一层，避免两层标题看起来一样高。 */
.user-role-row td {
  background: #fbfcfe;
  cursor: pointer;
  user-select: none;
  padding: 6px 10px 6px 26px;
  border-top: 1px solid #eef3f8;
}
.user-role-row:hover td { background: #f0f7fd; }
.user-role-row .ug-arrow { display: inline-block; width: 14px; color: #5b8fbf; font-size: 12px; }
.user-role-row .ug-role { color: #34495e; font-size: 13px; }
.user-role-row .ug-count { margin-left: 8px; color: #95a5a6; font-size: 12px; }
/* 三级公司下的角色行再往右一档 */
.user-role-row.lv2 td { padding-left: 46px; }
/* 人：三级缩进（公司是二级时） */
.user-row.lv3 td:first-child { padding-left: 62px; }

/* ============ 维护公告横幅（2026-10-28 R198）============
   固定在底部：不遮挡顶栏与表格，任何滚动位置都能看到。 */
.maint-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5000;
  padding: 10px 18px;
  background: #b45309;
  color: #fff;
  font-size: 13.5px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .18);
}
.maint-banner b { margin-right: 8px; font-weight: 600; }

/* ============ R199：合同「关联物业已不存在」标注 ============
   拆分/删除后遗留的历史合同，物业名后挂一个可点的小徽章。
   只提示不拦截：这类合同本身是已退租的历史账，数据不改。 */
.tag-warn {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #f5d8ae;
  border-radius: 999px;
  background: #fff4e5;
  color: #b45309;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
}
.tag-warn:hover { background: #ffe9cc; }

/* 2026-10-28 R251：待审记录已提交「撤回申请」时，操作列显示这枚静态标签。
   用灰调而不是彩色：它表示"正在等，什么都不用做"，不是待办也不是告警。 */
.tag-withdrawing {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border: 1px solid var(--line-200);
  border-radius: 999px;
  background: #f4f5f7;
  color: var(--ink-400);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

/* ============================================================
   2026-10-28 R225：全局数据助手（可拖动机器人 + 会话框）
   位置由 JS 写内联 left/top，这里只负责外观与层级。
   ============================================================ */
.ai-bot-wrap { position: fixed; z-index: 900; }

.ai-bot {
  position: relative;
  width: 168px; height: 168px; padding: 0; border: 0; background: transparent;
  cursor: grab; touch-action: none; outline: none;
  filter: drop-shadow(0 6px 14px rgba(31, 53, 96, 0.18));
  transition: transform .18s ease, filter .18s ease;
}
.ai-bot:hover { transform: translateY(-2px) scale(1.04); filter: drop-shadow(0 10px 20px rgba(31, 53, 96, 0.26)); }
.ai-bot:active { cursor: grabbing; }
.ai-bot.is-dragging { cursor: grabbing; transition: none; }
.ai-bot img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.ai-bot::after {
  content: ""; position: absolute; right: 12px; bottom: 16px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--green); border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(26, 156, 110, .55); animation: aiBotPulse 2.4s ease-out infinite;
}
@keyframes aiBotPulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 156, 110, .5); }
  70% { box-shadow: 0 0 0 9px rgba(26, 156, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 156, 110, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-bot::after { animation: none; }
  .ai-bot { transition: none; }
}

.ai-bot-panel[hidden] { display: none !important; }
.ai-bot-panel {
  position: absolute; width: 372px;
  /* R247：原来是 min(540px, 100vh-32px) —— 上下各只留 16px，展开预绑定后整块内容超出就被裁掉。
     现在留出上下各 48px 的余量，且高度由内部滚动区承担（见 .ai-bot-scroll）。 */
  max-height: min(600px, calc(100vh - 96px));
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line-200); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(20, 41, 77, .22);
  overflow: hidden;
}

/* R247：对话 + 按钮 + 对账 + 预绑定共用一个滚动区，输入行固定在底部。
   原来只让 .ai-bot-body 自己滚（max-height:400px），按钮/表单不参与滚动，
   面板又是 overflow:hidden —— 一展开预绑定，输入框和发送键就被裁在可视区外。 */
.ai-bot-scroll {
  flex: 1 1 auto; min-height: 120px; max-height: none;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}

.ai-bot-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(180deg, var(--brand-050), #fff);
  border-bottom: 1px solid var(--line-100);
}
.ai-bot-avatar { width: 34px; height: 34px; object-fit: contain; flex: none; }
.ai-bot-title { display: flex; flex-direction: column; line-height: 1.3; }
.ai-bot-title b { font-size: 14px; color: var(--brand-800); }
.ai-bot-title span { font-size: 11px; color: var(--ink-400); }
.ai-bot-close {
  width: 26px; height: 26px; border: 1px solid var(--line-200); background: #fff;
  border-radius: 8px; color: var(--ink-500); font-size: 17px; line-height: 1;
  cursor: pointer; padding: 0;
}
.ai-bot-close:hover { background: var(--bg-100); color: var(--ink-700); }

/* R247：不再自己滚（改由外层 .ai-bot-scroll 统一滚），否则会出现两层滚动条，
   而且按钮/表单在外面滚不到。这里只负责排版。 */
.ai-bot-body {
  flex: none; min-height: 0; max-height: none; overflow: visible;
  padding: 14px; background: var(--bg-50); display: flex; flex-direction: column; gap: 10px;
}

.ai-bot-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; background: #fff; }
.ai-bot-quick button {
  border: 1px solid var(--brand-100); background: var(--brand-050); color: var(--brand-700);
  font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.ai-bot-quick button:hover { background: var(--brand-100); }

.ai-bot-input-row { display: flex; gap: 8px; padding: 10px 14px; background: #fff; align-items: flex-end; }
.ai-bot-input-row textarea {
  flex: 1; resize: none; border: 1px solid var(--line-200); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; line-height: 1.5; outline: none;
}
.ai-bot-input-row textarea:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(53, 99, 159, .1); }
.ai-bot-input-row button {
  flex: none; height: 36px; padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--brand-700); color: #fff; font-size: 13px; cursor: pointer;
}
.ai-bot-input-row button:hover { background: var(--brand-600); }
.ai-bot-input-row button:disabled { opacity: .55; cursor: default; }

.ai-bot-foot {
  padding: 8px 14px 12px; font-size: 11px; color: var(--ink-400); line-height: 1.5;
  background: #fff; border-top: 1px dashed var(--line-100);
}

@media (max-width: 768px) {
  .ai-bot { width: 112px; height: 112px; }
  .ai-bot-panel {
    position: fixed; left: 8px !important; right: 8px; top: auto; bottom: 8px;
    width: auto; max-height: 78vh;
  }
  .ai-bot-scroll { min-height: 0; }   /* R247：手机也走统一滚动区，面板高度交给 78vh */
}

/* ============================================================
   2026-10-28 R227：历史台账「曾用名」徽标
   历史月份显示的是**当时的名字**，与今天不同名时挂这个徽标，
   hover 出现在的名字。金色系，不抢主色调，也不会被误认为操作按钮。
   ============================================================ */
.name-asof {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  font-size: 10px; line-height: 16px; font-weight: normal;
  border-radius: 4px; background: var(--gold-100); color: var(--gold-600);
  border: 1px solid rgba(184, 138, 46, .28);
  vertical-align: middle; cursor: help; white-space: nowrap;
}

/* ============================================================
   2026-10-28 R229：数据助手 —— 工具条 / 对账表单 / 对账结果表
   ============================================================ */
.ai-bot-tools { display: flex; gap: 8px; padding: 0; background: #fff; flex-wrap: wrap; }
.ai-bot-tool {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--brand-100); border-radius: 8px;
  background: #fff; color: var(--brand-700);
}
.ai-bot-tool:hover { background: var(--brand-050); border-color: var(--brand-400); }
.ai-bot-dl-ico { color: var(--gold-600); font-weight: bold; }

.ai-bot-recon { padding: 10px 14px 0; background: #fff; }
.ai-bot-recon-row { display: flex; gap: 6px; align-items: center; }
.ai-bot-recon-row select,
.ai-bot-recon-row input {
  flex: 1; min-width: 0; height: 30px; font-size: 12px; padding: 0 6px;
  border: 1px solid var(--line-200); border-radius: 7px; font-family: inherit;
}
.ai-bot-recon-row button {
  flex: none; height: 30px; padding: 0 12px; font-size: 12px; border: 0;
  border-radius: 7px; background: var(--brand-700); color: #fff; cursor: pointer;
}
.ai-bot-recon-row button:hover { background: var(--brand-600); }
.ai-bot-recon-hint { margin-top: 6px; font-size: 11px; color: var(--ink-400); line-height: 1.5; }

.bot-rep { font-size: 12px; }
.bot-rep-h { font-weight: 500; color: var(--brand-800); margin-bottom: 6px; }
.bot-rep-sub { margin: 10px 0 4px; font-size: 11px; color: var(--ink-500); }
.bot-rep-t { width: 100%; border-collapse: collapse; font-size: 11px; }
.bot-rep-t th {
  background: var(--brand-050); color: var(--brand-700); font-weight: 500;
  padding: 4px 5px; border: 1px solid var(--line-200); text-align: center; white-space: nowrap;
}
.bot-rep-t td {
  padding: 4px 5px; border: 1px solid var(--line-100); text-align: center;
  word-break: break-all; line-height: 1.4;
}
.bot-rep-t tr:nth-child(even) td { background: #fafbfd; }
.bot-rep-ok { margin-top: 8px; padding: 6px 8px; background: var(--green-bg); color: var(--green);
  border-radius: 6px; font-size: 11px; }
.bot-rep-note {
  margin-top: 8px; font-size: 11px; color: var(--ink-500);
  background: var(--bg-100); border-radius: 6px; padding: 6px 8px; line-height: 1.5;
}
.ai-bot-dl {
  margin-top: 10px; width: 100%; height: 32px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--brand-400); border-radius: 8px;
  background: var(--brand-050); color: var(--brand-700);
}
.ai-bot-dl:hover { background: var(--brand-100); }

/* 2026-10-28 R231：评估预绑定面板（复用对账区的表格样式） */
.ai-bot-bind { padding: 10px 14px 0; background: #fff; }
.ai-bot-bind-result { margin-top: 8px; }


/* ============================================================
   2026-10-28 R232：功能按钮按需显示（默认全隐藏）
   只有 AI 本轮真的调用了对应工具，后端才在 /chat 里返回 buttons，
   前端据此把按钮放出来。快捷提问三按钮已整块删除，空间留给对话。
   ============================================================ */
.ai-bot-actions { padding: 10px 14px 0; background: #fff; }
.ai-bot-actions-tip {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 11px; color: var(--ink-400); margin-bottom: 6px; line-height: 1.4;
}
.ai-bot-actions-tip #ai-bot-actions-tip-text { flex: 1; min-width: 0; }
.ai-bot-actions-x {
  flex: none; width: 18px; height: 18px; padding: 0; line-height: 1;
  font-size: 14px; color: var(--ink-400); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
}
.ai-bot-actions-x:hover { color: var(--ink-700); border-color: var(--line-200); background: var(--bg-100); }

/* display 会压过 hidden 属性，这两条是保命的（.ai-bot-panel 就栽过一次） */
.ai-bot-actions[hidden] { display: none !important; }
.ai-bot-tool[hidden] { display: none !important; }

/* R247：这里原本是 @media(max-width:768px){ .ai-bot-body { max-height: 52vh } }。
   现在对话区由外层 .ai-bot-scroll 统一滚，再给 .ai-bot-body 限高会出现
   「body 被 52vh 切断、溢出内容不参与父级 scrollHeight」→ 手机上滚不到下面的内容。
   手机的高度上限交给 .ai-bot-panel 的 max-height: 78vh，这里不要再给 body 限高。 */

/* ============ 导出台账下拉 + 自定义字段弹窗（2026-11-02）============
   三档：系统台账（写进 xlsm 模板）/ 全量 / 自定义（勾列，习惯按账号记）。
   下拉用 absolute + z-index，避免被表格区域裁掉；点空白处由 JS 收起。 */
.exp-wrap { position: relative; display: inline-block; }
.exp-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
  min-width: 250px; background: #fff; border: 1px solid #e3e8ef;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
  padding: 4px;
}
.exp-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13.5px;
  color: #1f2b3d; cursor: pointer; line-height: 1.4;
}
.exp-item:hover { background: #f2f6ff; }
.exp-item small { display: block; color: #8894a8; font-size: 11.5px; margin-top: 2px; }

.exp-box { width: 620px; max-width: calc(100vw - 40px); }
.exp-fields { max-height: 52vh; overflow-y: auto; margin: 10px 0; }
.exp-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.exp-check { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.exp-check input { margin-top: 2px; flex: none; }
.exp-check span { color: #333; line-height: 1.4; word-break: break-word; }
@media (max-width: 768px) {
  .exp-checks { grid-template-columns: 1fr; }
  .exp-box { width: calc(100vw - 24px); }
}

/* ============ 导出进度弹窗（2026-11-02）============
   系统台账现场生成几十张租控表，几秒内没反馈会被当成"没点上"。
   进度条两种形态：条纹 indeterminate（生成阶段，不编百分比）
   + 实心 determinate（接收阶段，按 Content-Length 真算）。 */
.exp-prog-box { width: 460px; max-width: calc(100vw - 32px); }
.exp-prog-box h3 { margin: 0 0 6px; font-size: 16px; }
.exp-prog-stage { margin: 0 0 14px; font-size: 13.5px; color: #475467; line-height: 1.5; word-break: break-all; }
.exp-prog-track { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.exp-prog-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #2f6bff, #5b8dff);
  transition: width .25s ease;
}
.exp-prog-fill.indeterminate {
  width: 34% !important;
  animation: expProgSlide 1.15s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes expProgSlide {
  0%   { transform: translateX(-105%); }
  100% { transform: translateX(305%); }
}
.exp-prog-fill.done  { background: #27ae60; }
.exp-prog-fill.error { background: #c0392b; }
.exp-prog-meta {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 9px 0 0; font-size: 12.5px; color: #8894a8;
}
.exp-prog-note { margin: 6px 0 0; font-size: 12.5px; color: #8894a8; line-height: 1.5; }
.exp-prog-note:empty { display: none; }
@media (max-width: 768px) {
  .exp-prog-box { width: calc(100vw - 24px); padding: 22px 20px; }
  .exp-prog-meta { flex-direction: column; gap: 3px; }
}

/* ====== R275 合同编号「自动生成」按钮 ====== */
.cngen-wrap { display: flex; align-items: center; gap: 6px; }
.cngen-wrap > input { flex: 1 1 0; width: auto; min-width: 0; }   /* .form-grid input 是 width:100%，不改会把按钮挤出去 */
.cngen-btn { flex: 0 0 auto; white-space: nowrap; padding: 4px 10px; }
/* 生成成功闪一下绿框，和日期粘贴一致的反馈语言 */
input.cn-just-set {
  box-shadow: 0 0 0 2px #8fd19e;
  border-color: #8fd19e;
  transition: box-shadow .15s ease, border-color .15s ease;
}

/* ====== R309（2026-11-20）ICP 备案号悬挂 ======
   工信部要求：网站底部展示备案编号，并链接至备案管理系统（https://beian.mit.gov.cn/）。
   放**静态**位置（内容流末尾），不用 position:fixed —— 固定会遮挡表格分页和底部按钮，
   而备案只要求"页面底部可见"，滚动到底即可。
   登录页（login.html）是另一套内联样式，那边用 absolute 定位，见该文件。 */
.site-footer {
  max-width: 1440px;          /* 与 .content 同宽，视觉上跟内容区对齐 */
  margin: 0 auto;
  padding: 4px 24px 28px;
  text-align: center;
  font-size: 12px;
  line-height: 1.9;
  color: #9aa3b2;
}
.site-footer a {
  color: #9aa3b2;
  text-decoration: none;
}
.site-footer a:hover {
  color: #2a4f8a;
  text-decoration: underline;
}
