/* style.css - Legal Workbench, v4 design system "璃墨"
   =========================================================
   玻璃拟态 × 极简黑白灰 · 纯 CSS 换肤（零功能影响）
   - 类名与 v3 完全兼容，仅替换样式值
   - 统计数字：内联模块色经 filter:grayscale 变灰（保留语义层次）
   - 徽章：保留原 14 模块色（唯一彩色锚点，律师认色习惯不动）
   - 品牌 logo：内联蓝底经 filter:grayscale 去彩，融入黑白灰
   - 登录页双栏品牌区：.auth-wrap::before 伪元素实现（零 HTML 改动）
   ========================================================= */
:root {
  /* ---- 中性基底（黑白灰） ---- */
  --bg: #F2F3F5;
  --surface: rgba(255, 255, 255, .60);   /* 玻璃卡片 */
  --surface-2: rgba(17, 24, 39, .045);   /* 表头/悬停/次级底 */
  --surface-3: rgba(255, 255, 255, .85);
  --border: rgba(17, 24, 39, .07);
  --border-strong: rgba(17, 24, 39, .14);
  --text: #111827;                        /* 墨黑 */
  --text-2: #4B5563;
  --text-3: #9CA3AF;

  /* ---- 主色（墨黑极简） ---- */
  --primary: #111827;
  --primary-strong: #000000;
  --primary-soft: rgba(17, 24, 39, .06);
  --primary-line: rgba(17, 24, 39, .18);

  /* ---- 语义（黑白灰梯度：黑底白字最高警示 → 深灰 → 浅灰） ---- */
  --danger: #111827;
  --danger-soft: rgba(17, 24, 39, .08);
  --success: #374151;
  --success-soft: rgba(17, 24, 39, .05);
  --warning: #4B5563;
  --warning-soft: rgba(17, 24, 39, .07);
  --purple: #4B5563;
  --purple-soft: rgba(17, 24, 39, .06);
  --muted: #9CA3AF;
  --muted-soft: rgba(17, 24, 39, .05);

  /* ---- 圆角 / 阴影 / 焦点环 ---- */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --glass: blur(18px) saturate(1.5);
  --shadow-xs: 0 1px 0 rgba(255,255,255,.9) inset, 0 2px 10px rgba(17,24,39,.05);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.9) inset, 0 2px 10px rgba(17,24,39,.05);
  --shadow-md: 0 1px 0 rgba(255,255,255,.9) inset, 0 12px 32px rgba(17,24,39,.10);
  --shadow-lg: 0 1px 0 rgba(255,255,255,.9) inset, 0 24px 64px rgba(17,24,39,.16);
  --ring: 0 0 0 3px rgba(17,24,39,.10);

  /* ---- 布局 ---- */
  --sidebar-w: 240px;
  --topbar-h: 60px;

  /* ---- 字体 ---- */
  --font: "Inter", -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  /* 背景光斑：玻璃卡片透出的"世界" */
  background:
    radial-gradient(720px 460px at 85% -8%, rgba(148,163,184,.28), transparent 62%),
    radial-gradient(620px 420px at -8% 96%, rgba(203,213,225,.40), transparent 62%),
    radial-gradient(860px 560px at 55% 120%, rgba(148,163,184,.20), transparent 66%),
    #F2F3F5;
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
::selection { background: rgba(17, 24, 39, .14); }

/* 数字等宽：金额 / 日期 / 案号列对齐 */
.stat-num, .reminder-date, .fsz, table.list td, .detail-table td, .mat-table td {
  font-variant-numeric: tabular-nums;
}

/* 品牌 logo 去彩（内联蓝底 → 黑白灰），徽章保留彩色 */
.brand-logo, .auth-logo { filter: grayscale(1) contrast(1.05); }

/* thin scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(17,24,39,.18); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(17,24,39,.30); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: rgba(255, 255, 255, .55);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
  z-index: 40;
}
.icon-btn {
  display: none; background: none; border: none; color: var(--text); padding: 6px; border-radius: 10px;
  min-width: 32px; min-height: 32px;
}
.icon-btn:hover { background: var(--surface-2); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { border-radius: 12px; background: rgba(255,255,255,.7); padding: 2px; box-shadow: 0 4px 16px rgba(17,24,39,.12); }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: var(--primary);
  color: #fff; font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(17,24,39,.22);
}
.brand-name { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: .4px; }
.brand-sub { font-size: 12px; color: var(--text-3); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- buttons（玻璃 + 黑白极简） ---------- */
.btn {
  border: 1px solid var(--border-strong); background: rgba(255,255,255,.6); color: var(--text);
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  line-height: 1.4; min-height: 34px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all .18s ease;
}
.btn:hover { border-color: rgba(17,24,39,.35); background: rgba(255,255,255,.95); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(17,24,39,.22);
}
.btn.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; box-shadow: 0 8px 20px rgba(17,24,39,.28); }
.btn.primary:active { background: var(--primary-strong); transform: scale(.98); }
.btn.ghost { background: transparent; border-color: var(--border); box-shadow: none; backdrop-filter: none; }
.btn.ghost:hover { background: rgba(255,255,255,.8); border-color: var(--border-strong); color: var(--text); }
.btn.danger { color: var(--text-2); border-color: rgba(17,24,39,.14); background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); border-color: rgba(17,24,39,.4); color: var(--danger); }
.btn.sm { padding: 5px 11px; min-height: 28px; font-size: 13px; border-radius: 10px; }
.hidden { display: none !important; }

/* ---------- sidebar（玻璃） ---------- */
#sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w);
  background: rgba(255, 255, 255, .48);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-right: 1px solid rgba(255,255,255,.6);
  overflow-y: auto; z-index: 30; padding: 16px 12px 20px;
}
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  font-size: 12px; color: var(--text-3); letter-spacing: 1.8px; padding: 14px 12px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9.5px 12px; border-radius: 13px;
  color: var(--text-2); font-size: 14px; margin-bottom: 2px; position: relative;
  transition: all .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.75); color: var(--text); }
.nav-item:active { background: var(--primary-soft); }
.nav-item.active {
  background: var(--primary);
  color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(17,24,39,.22);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--primary); border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(17,24,39,.5);
}
.nav-badge {
  width: 24px; height: 24px; border-radius: 9px; color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 2px 8px rgba(17,24,39,.18);
}
.sidebar-foot { margin-top: 18px; padding: 14px 12px; border-top: 1px dashed var(--border-strong); }
.data-hint { font-size: 12px; color: var(--text-3); line-height: 1.9; }
#scrim { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.25); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 25; }

/* ---------- main ---------- */
#view { margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 30px) 30px 80px; min-height: 100vh; max-width: none; }
/* 内容限宽居中：大屏不再把列表/表单拉满整行，视觉更紧凑（主题不变，仅约束宽度） */
#view > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 800; line-height: 1.35; letter-spacing: -.3px; }
.page-sub { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- dashboard（玻璃统计卡 + 黑白数字） ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: rgba(255,255,255,.52); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius);
  padding: 19px 18px 17px; box-shadow: var(--shadow-sm); cursor: pointer;
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  transition: all .22s ease; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: var(--primary); opacity: 0; transition: opacity .2s ease;
}
.stat-card:hover { border-color: rgba(255,255,255,.95); transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 14px 38px rgba(17,24,39,.13); }
.stat-card:hover::after { opacity: 1; }
.stat-card:active { transform: translateY(-1px) scale(.99); }
.stat-num { font-size: 31px; font-weight: 800; line-height: 1.2; letter-spacing: -1px; filter: grayscale(1) contrast(1.05); }
.stat-label { font-size: 13px; color: var(--text-2); margin-top: 7px; line-height: 1.5; }
.dash-edit{position:absolute;right:10px;top:8px;border:0;background:rgba(17,24,39,.07);border-radius:7px;padding:3px 7px;color:var(--text-2);cursor:pointer;z-index:2}.dash-widget-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:18px;margin:0 0 22px}.dash-widget{position:relative;background:rgba(255,255,255,.58);border:1px solid var(--border);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow-sm)}.dash-widget-head{font-size:16px;font-weight:800;margin-bottom:16px;position:relative}.dash-bars{display:grid;gap:10px}.dash-bar-row{display:grid;grid-template-columns:150px 1fr 35px;align-items:center;gap:10px;font-size: 13px}.dash-bar-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dash-bar-row i{height:14px;background:rgba(17,24,39,.06);border-radius:4px;overflow:hidden}.dash-bar-row b{display:block;height:100%;border-radius:4px}.dash-bar-row em{font-style:normal;font-weight:700}.dash-table{width:100%;border-collapse:collapse;font-size: 13px}.dash-table th,.dash-table td{padding:8px 10px;border-bottom:1px solid var(--border);text-align:left}.dash-modal{width:min(900px,94vw);max-width:none}.dash-form{display:grid;grid-template-columns:2fr 1fr 2fr 90px 1fr 2fr;gap:10px;margin:16px 0}.dash-form label{font-size: 13px;color:var(--text-2)}.dash-form input,.dash-form select,.dash-filter input,.dash-filter select{display:block;width:100%;margin-top:5px;padding:9px;border:1px solid var(--border-strong);border-radius:8px;background:#fff}.dash-filter-title{font-weight:700;margin:12px 0 6px}.dash-filter{display:grid;grid-template-columns:1.4fr 1fr 2fr 38px;gap:8px;align-items:end}.dash-filter button{height:37px;border:1px solid var(--border);background:#fff;border-radius:8px}@media(max-width:900px){.dash-form{grid-template-columns:1fr 1fr}.dash-widget-grid{grid-template-columns:1fr}}
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.panel {
  background: rgba(255,255,255,.52); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
}
.panel-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; line-height: 1.4;
}
.panel-body { padding: 6px 0; }
.reminder-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; cursor: pointer; border-left: 4px solid transparent; transition: background .13s; }
.reminder-item:hover { background: rgba(255,255,255,.65); }
.reminder-item.ov { border-left-color: var(--danger); }
.reminder-item.today { border-left-color: var(--warning); }
.reminder-item.up { border-left-color: rgba(17,24,39,.25); }
.reminder-main { flex: 1; min-width: 0; }
.reminder-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.reminder-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }
.reminder-date { font-size: 13px; color: var(--text-3); flex: none; text-align: right; line-height: 1.5; }
.reminder-date .dnum { font-weight: 800; color: var(--text); }
.tag { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; line-height: 1.8; font-weight: 600; }
.tag.red { background: var(--danger); color: #fff; }
.tag.amber { background: rgba(17,24,39,.14); color: var(--text); font-weight: 700; }
.tag.green { background: rgba(17,24,39,.06); color: var(--success); }
.tag.blue { background: rgba(17,24,39,.10); color: var(--text); }
/* 列表彩色列：案件类型/我方身份/管辖机构/案由/阶段/进度 按值着色（柔和浅底深字风格） */
.cc-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 1.7; font-weight: 600; margin: 1px 3px 1px 0; white-space: nowrap; }
.empty { text-align: center; color: var(--text-3); padding: 44px 16px; font-size: 14px; line-height: 1.8; }

/* ---------- list ---------- */
.search-box {
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 14px; width: 230px;
  background: rgba(255,255,255,.65); transition: all .15s; box-shadow: none; min-height: 34px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.search-box::placeholder { color: var(--text-3); }
.search-box:hover { border-color: rgba(17,24,39,.22); }
.search-box:focus { outline: none; border-color: rgba(17,24,39,.4); background: #fff; box-shadow: var(--ring); }
.filter-select {
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px;
  background: rgba(255,255,255,.65); min-height: 34px; font-size: 14px; color: var(--text);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: all .15s; max-width: 170px;
}
.filter-select:hover { border-color: rgba(17,24,39,.22); }
.filter-select:focus { outline: none; border-color: rgba(17,24,39,.4); box-shadow: var(--ring); }
.pagination-bar {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  flex-wrap: wrap; padding: 10px 4px 6px; font-size: 14px; color: var(--text-2);
}
.pg-info b { color: var(--text); font-weight: 700; }
.pg-size { min-height: 32px; padding: 6px 8px; max-width: none; }
.pg-btns { display: flex; align-items: center; gap: 5px; }
.pg-nav { min-width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.pg-nav:disabled { opacity: .4; pointer-events: none; }
.pg-num {
  min-width: 30px; height: 30px; padding: 0 7px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: rgba(255,255,255,.65); color: var(--text); font-size: 13px;
  cursor: pointer; transition: all .12s;
}
.pg-num:hover { border-color: rgba(17,24,39,.35); background: #fff; }
.pg-num.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pg-ell { color: var(--text-3); padding: 0 3px; }
.table-wrap {
  background: rgba(255,255,255,.52); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: auto; resize: both; min-width: 320px; min-height: 180px; max-height: calc(100vh - 320px);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
}
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th {
  text-align: center; font-size: 13px; color: var(--text-2); font-weight: 700;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(17,24,39,.03);
  white-space: nowrap; letter-spacing: .2px; line-height: 1.5;
}
table.list th:first-child { border-top-left-radius: var(--radius); }
table.list th:last-child { border-top-right-radius: var(--radius); }
table.list td {
  text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px;
  vertical-align: middle; white-space: nowrap; line-height: 1.5;
}
table.list th + th, table.list td + td { border-left: 1px solid var(--border); }
table.list tbody tr:last-child td { border-bottom: none; }
/* 表头置顶：表格纵向滚动时表头始终可见（top:0 相对 .table-wrap 滚动容器） */
.table-wrap table.list thead th {
  position: sticky; top: 0; z-index: 7; background: #f4f5f7;
}
/* 冻结列表头（左上角交叉处）需压过冻结列与表头本身 */
.table-wrap table.list thead th.wb-frozen { z-index: 8; background: #f4f5f7; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover td { background: rgba(255,255,255,.7); cursor: pointer; }
table.list tbody tr:active td { background: var(--primary-soft); }
/* 列头筛选：倒三角按钮 + 下拉浮层 */
th.has-filter { position: relative; }
.th-filter {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 5px; padding: 0; width: 18px; height: 18px; border: none; background: none;
  cursor: pointer; vertical-align: -2px; border-radius: 5px; transition: background .12s;
}
.th-filter::after {
  content: ""; display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--text-3);
}
.th-filter:hover { background: var(--primary-soft); }
.th-filter.active { background: var(--primary-soft); }
.th-filter.active::after { border-top-color: var(--primary); }
/* 计算字段表头徽标（ƒ）：标记带计算逻辑的列，点击查看生成公式 */
.th-calc {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
  font-size: 11px; font-weight: 700; font-style: italic; line-height: 1;
  color: var(--primary); background: var(--primary-soft);
  border-radius: 5px; cursor: pointer; vertical-align: -2px;
  user-select: none; transition: background .12s, color .12s;
}
.th-calc:hover { background: var(--primary); color: #fff; }
.calc-pop {
  position: fixed; z-index: 320; max-width: 360px;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 10px 12px; display: none;
}
.calc-pop.show { display: block; }
.calc-pop-title { font-size: 12px; color: var(--text-3); margin-bottom: 6px; font-weight: 600; }
.calc-pop-body { font-size: 13px; color: var(--text); line-height: 1.6; }
.filter-pop {
  position: fixed; z-index: 300; min-width: 190px; max-width: 320px;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 8px;
}
.filter-pop .pop-input, .filter-pop .pop-select { width: 210px; max-width: 60vw; }
.filter-pop .pop-select { max-width: none; }
/* 列宽自适应：按舒适宽度分配（带上下限），总宽超出容器时出现横向滚动条；
   超宽单元格省略号截断，悬停浮层看全文（见 app.js data-full） */
.table-wrap table.list.compress { table-layout: fixed; }
.table-wrap table.list.compress th,
.table-wrap table.list.compress td { overflow: hidden; }
.table-wrap table.list.compress td {
  white-space: nowrap; text-overflow: ellipsis; vertical-align: middle;
}
.table-wrap table.list.compress td.col-ops,
.table-wrap table.list.compress td.col-files { white-space: nowrap; }

/* 列宽 / 行高 手动拖拽调整 */
.table-wrap table.list th { position: relative; }
.col-resize {
  position: absolute; top: 0; right: -4px; width: 9px; height: 100%;
  cursor: col-resize; z-index: 6;
}
.col-resize:hover, .col-resize.active { background: var(--primary); opacity: .4; }
td.row-anchor { position: relative; }
.row-resize {
  position: absolute; left: 0; right: 0; bottom: -4px; height: 9px;
  cursor: row-resize; z-index: 5;
}
.row-resize:hover, .row-resize.active { background: var(--primary); opacity: .4; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
body.row-resizing, body.row-resizing * { cursor: row-resize !important; user-select: none; }

/* 粘性横向滚动条：停在视口底部，无需先滚到表格底部即可左右滑动。
   表格自身的横向滚动条被隐藏，以这条常驻滚动条作为唯一的左右滑动控件。 */
.table-wrap.hscroll { scrollbar-width: none; -ms-overflow-style: none; }
.table-wrap.hscroll::-webkit-scrollbar { width: 10px; height: 0; }
.table-wrap.hscroll::-webkit-scrollbar-thumb { background: rgba(17,24,39,.22); border-radius: 6px; }
.table-wrap.hscroll::-webkit-scrollbar-track { background: rgba(17,24,39,.04); }
.hscroll-track {
  position: sticky; bottom: 0; z-index: 22;
  height: 18px; margin: 8px 0 0;
  overflow-x: auto; overflow-y: hidden;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 -8px 22px rgba(17,24,39,.10);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hscroll-track::-webkit-scrollbar { height: 11px; }
.hscroll-track::-webkit-scrollbar-thumb { background: rgba(17,24,39,.30); border: 2px solid transparent; background-clip: content-box; border-radius: 6px; }
.hscroll-track::-webkit-scrollbar-thumb:hover { background: rgba(17,24,39,.45); border: 2px solid transparent; background-clip: content-box; }
.hscroll-inner { height: 1px; }
.row-op { display: flex; gap: 4px; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; padding: 5px 9px; border-radius: 9px; transition: all .13s; }
.link-btn:hover { background: var(--primary-soft); }
.link-btn:active { transform: scale(.95); }
.link-btn.danger { color: var(--text-2); }
.link-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 关联列预览（保全提醒 / 工作记录 等） ---------- */
.rel-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rel-cell .rel-link { display: inline-block; }
.rel-preview { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rel-item {
  display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; line-height: 1.5; color: var(--text-2); text-decoration: none; cursor: pointer;
  border-radius: 6px; padding: 0 6px; margin-left: -6px; transition: background .12s, color .12s;
}
.rel-item:hover { background: var(--primary-soft); color: var(--primary); }
.rel-item.rel-more { color: var(--text-3); cursor: default; }
.rel-item.rel-more:hover { background: none; color: var(--text-3); }

/* ---------- 列表内附件文件名链接（fileList） ---------- */
.jd-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.jd-files { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-link {
  display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; line-height: 1.5; color: var(--danger); text-decoration: none; cursor: pointer;
  border-radius: 6px; padding: 0 6px; margin-left: -6px; transition: background .12s, color .12s;
}
.file-link:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 关联记录详情卡片 ---------- */
.rel-card-modal { max-width: 460px; }
.rel-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rel-card-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.rel-card-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rc-row { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.rc-row:last-child { border-bottom: none; }
.rc-label { flex: none; width: 88px; font-size: 13px; color: var(--text-3); line-height: 1.6; }
.rc-val { flex: 1; min-width: 0; font-size: 13px; color: var(--text); line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- form ---------- */
.form-card {
  background: rgba(255,255,255,.52); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 27px; margin-bottom: 20px;
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
}
.form-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px 22px; }
.f-item { display: flex; flex-direction: column; gap: 7px; }
.f-item.full { grid-column: 1 / -1; }
.f-label { font-size: 14px; color: var(--text-2); font-weight: 600; line-height: 1.5; }
.f-label-emph { color: #D92D20; font-weight: 800; }
.f-label .req { color: var(--text); }
.f-item input[type="text"], .f-item input[type="date"], .f-item input[type="number"], .f-item select, .f-item textarea {
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 13px; background: rgba(255,255,255,.75); width: 100%;
  transition: all .15s; box-shadow: none; line-height: 1.5;
}
.f-item input::placeholder { color: var(--text-3); }
.f-item input:hover, .f-item select:hover, .f-item textarea:hover { border-color: rgba(17,24,39,.22); }
.f-item textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
.f-item input:focus, .f-item select:focus, .f-item textarea:focus {
  outline: none; border-color: rgba(17,24,39,.4); background: #fff; box-shadow: var(--ring);
}
.f-label-expire { font-size: 16px; font-weight: 800; color: #D92D20; }
.f-item .expire-input { border-color: rgba(217,45,32,.55); font-weight: 800; color: #D92D20; font-size: 16px; background: rgba(217,45,32,.05); }
.field-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.f-check { display: flex; align-items: center; gap: 9px; padding-top: 27px; }
.f-check input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }
.person-box { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 14px; background: rgba(255,255,255,.4); display: flex; flex-direction: column; gap: 10px; }
.person-box .p-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person-box .p-row .wide { grid-column: 1 / -1; }
.person-box input { border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; width: 100%; background: rgba(255,255,255,.75); transition: all .15s; }
.person-box input:focus { outline: none; border-color: rgba(17,24,39,.4); box-shadow: var(--ring); }
.p-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: rgba(255,255,255,.8); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-xs); }
.p-card + .p-card { margin-top: 10px; }
.p-card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 10px; }
.add-person-btn {
  border: 1.5px dashed var(--border-strong); background: rgba(255,255,255,.6); color: var(--text-2);
  border-radius: 13px; padding: 9px 14px; font-size: 14px; width: 100%; cursor: pointer; transition: all .15s; line-height: 1.5;
}
.add-person-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.party-src { border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 7px 9px; font-size: 13px; color: var(--text-2); background: rgba(255,255,255,.75); }
.party-src:focus { outline: none; border-color: rgba(17,24,39,.4); box-shadow: var(--ring); }

/* party multi-select modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17,24,39,.20); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
  width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto; padding: 24px 26px;
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h4 { font-size: 16px; font-weight: 800; margin-bottom: 8px; line-height: 1.4; }
.modal-hint { font-size: 13px; color: var(--text-2); margin-bottom: 14px; line-height: 1.6; }
.party-options { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.party-opt {
  display: flex; align-items: center; gap: 11px; border: 1px solid var(--border);
  border-radius: 13px; padding: 11px 13px; cursor: pointer; background: rgba(255,255,255,.6); transition: all .13s;
}
.party-opt:hover { background: rgba(255,255,255,.9); border-color: var(--border-strong); }
.party-opt:active { background: var(--primary-soft); }
.party-opt input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; cursor: pointer; }
.po-name { font-size: 14px; font-weight: 600; min-width: 84px; flex: none; line-height: 1.5; }
.po-sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; }

/* 表格设置：列顺序调整弹窗 */
.colsetup-modal { max-width: 460px; }
.colsetup-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-height: 50vh; overflow-y: auto; }
.colsetup-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px;
  background: rgba(255,255,255,.6); transition: all .13s;
}
.colsetup-row:hover { background: rgba(255,255,255,.92); }
.cs-drag { color: var(--text-3); cursor: grab; flex: none; font-size: 15px; user-select: none; touch-action: none; padding: 2px 4px; }
.cs-drag:hover { color: var(--text); }
.cs-drag:active { cursor: grabbing; }
.cs-name { flex: 1; font-size: 14px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-name em { font-style: normal; color: var(--text-3); font-size: 12px; }
.cs-name.is-ops { color: var(--text-2); }
.cs-up, .cs-down { flex: none; min-width: 34px; }
.colsetup-row .btn:disabled { opacity: .35; cursor: default; }
.colsetup-row.dragging { background: var(--primary-soft); border-color: var(--primary); box-shadow: 0 8px 20px rgba(17,24,39,.18); opacity: .92; }
body.col-dragging, body.col-dragging * { cursor: grabbing !important; user-select: none; }

/* attach groups */
.attach-card { margin-bottom: 20px; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 22px; text-align: center;
  color: var(--text-3); font-size: 14px; cursor: pointer; background: rgba(255,255,255,.4); transition: all .18s; line-height: 1.6;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.dropzone:hover, .dropzone.drag { border-color: rgba(17,24,39,.4); background: rgba(255,255,255,.75); color: var(--text); }
.chips-box { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.file-chip {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.6);
  border: 1px solid var(--border); border-radius: 13px; padding: 9px 13px;
  font-size: 14px; line-height: 1.5; transition: all .13s;
  width: 100%;
}
.file-chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.file-chip .fn {
  flex: 1; min-width: 0;
  color: var(--danger); font-size: 14px;
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
  line-height: 1.5;
}
.file-chip .fsz { color: var(--text-3); font-size: 13px; flex: none; margin-left: 4px; }
.file-chip .dl { color: var(--primary); background: none; border: none; font-size: 13px; padding: 4px 7px; border-radius: 7px; flex: none; }
.file-chip .dl:hover { background: var(--primary-soft); }
.file-chip .rm { color: var(--text-2); background: none; border: none; font-size: 15px; padding: 4px 7px; border-radius: 7px; flex: none; }
.file-chip .rm:hover { background: var(--danger-soft); color: var(--danger); }
.attach-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto; gap: 10px;
  align-items: center; background: rgba(255,255,255,.5); border: 1px solid var(--border); border-radius: 13px; padding: 12px; margin-bottom: 10px;
}
.attach-row select, .attach-row input { border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 8px 9px; width: 100%; background: rgba(255,255,255,.75); }
.row-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row-field-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; line-height: 1.4; }
.flash-card { animation: flashCard 1.6s ease; }
@keyframes flashCard { 0%, 60% { box-shadow: 0 0 0 3px rgba(186,117,23,.45); } 100% { box-shadow: none; } }
.row-file { display: flex; align-items: center; gap: 6px; }
.row-file .lbl { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.row-file-slot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 8px 11px;
  background: rgba(255,255,255,.6); cursor: pointer; min-height: 36px; grid-column: 1 / -1; transition: all .15s;
}
.row-file-slot:hover { border-color: var(--primary); background: rgba(255,255,255,.9); }
.row-file-slot .slot-label { color: var(--text-3); font-size: 13px; flex: none; font-weight: 500; }
.row-file-slot .ph { color: var(--text-3); font-size: 13px; }
.row-file-slot .fn { flex: 1; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--danger); }
.add-row-btn { border: 1.5px dashed var(--border-strong); background: none; color: var(--text-2); border-radius: 13px; padding: 9px 14px; font-size: 14px; width: 100%; transition: all .15s; line-height: 1.5; }
.add-row-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(90px);
  background: rgba(17,24,39,.92); color: #fff; padding: 11px 22px; border-radius: var(--radius);
  font-size: 14px; opacity: 0; transition: all .28s cubic-bezier(.2, .9, .3, 1.2); z-index: 100;
  box-shadow: var(--shadow-lg); max-width: 90vw; backdrop-filter: blur(6px); line-height: 1.6;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* mobile */
@media (max-width: 860px) {
  .icon-btn { display: block; }
  #sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 268px; box-shadow: none; }
  #sidebar.open { transform: translateX(0); box-shadow: 0 0 30px rgba(17,24,39,.18); }
  #scrim.show { display: block; }
  #view { margin-left: 0; padding: calc(var(--topbar-h) + 16px) 14px 56px; }
  .top-actions .btn { padding: 6px 11px; min-height: 30px; font-size: 13px; }
  .brand-name { font-size: 15px; }
  .search-box { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}

/* ================= team edition: auth / members / owner / materials ================= */
.user-box { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.user-name { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.5; }
.user-role { font-size: 12px; color: var(--text-2); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
@media (max-width: 860px) { .user-box .user-name, .user-box .user-role { display: none; } }

/* ================= preservation: sealed-off row + card-head toggle ================= */
table.list tbody tr.sealed-off td {
  background: rgba(17,24,39,.03);
  color: var(--text-3);
}
table.list tbody tr.sealed-off td:first-child { border-left: 3px solid var(--text-3); }
table.list tbody tr.sealed-off:hover td { background: var(--muted-soft); }
table.list tbody tr.sealed-off:active td { background: var(--muted-soft); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.card-head-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; line-height: 1.5;
  padding: 5px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: rgba(255,255,255,.6);
  transition: all .15s ease;
}
.card-head-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.card-head-toggle input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; cursor: pointer; }
.card-head-toggle:has(input:checked) { border-color: var(--primary); color: var(--text); background: var(--primary-soft); font-weight: 500; }

/* ================= multi-select dropdown (owner-lawyer / general) ================= */
.mselect { position: relative; min-width: 260px; max-width: 100%; }
.mselect-toggle {
  width: 100%; min-height: 38px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: rgba(255,255,255,.6); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 5px 10px 5px 12px; cursor: pointer; text-align: left;
  transition: all .15s ease; box-shadow: none;
}
.mselect-toggle:hover { border-color: rgba(17,24,39,.22); }
.mselect-toggle:focus-visible { outline: none; border-color: rgba(17,24,39,.4); box-shadow: var(--ring); }
.mselect-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; align-items: center; line-height: 1.4; }
.mselect-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-soft); color: var(--text);
  border-radius: 8px; padding: 2px 4px 2px 8px; font-size: 13px; font-weight: 500;
}
.mselect-x {
  background: transparent; border: none; color: var(--text-2); font-size: 15px; line-height: 1;
  padding: 2px 4px; border-radius: 4px; cursor: pointer;
}
.mselect-x:hover { background: rgba(17,24,39,.10); }
.mselect-placeholder { color: var(--text-3); font-size: 14px; padding: 4px 0; }
.mselect-arrow { color: var(--text-3); font-size: 13px; margin-left: auto; padding-left: 4px; transition: transform .15s ease; }
.mselect-toggle[aria-expanded="true"] .mselect-arrow { transform: rotate(180deg); }
.mselect-pop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.85); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  max-height: 260px; overflow-y: auto;
}
.mselect-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 9px; cursor: pointer;
  font-size: 14px; color: var(--text); line-height: 1.5;
  transition: background .12s ease;
}
.mselect-opt:hover { background: var(--surface-2); }
.mselect-opt input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; cursor: pointer; flex: none; }
.mselect-opt span { flex: 1; min-width: 0; }
.mselect-empty { padding: 10px 12px; color: var(--text-3); font-size: 14px; text-align: center; }

/* 生成文书下拉菜单（单份生成 / 批量生成） */
.docgen { position: relative; }
.docgen-caret { display: inline-block; font-size: 11px; margin-left: 2px; opacity: .7; }
.docgen-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 236px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(17,24,39,.18);
  text-align: left;
}
.docgen-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  border: 0; background: transparent; border-radius: 8px;
  font-size: 14px; color: var(--text); cursor: pointer;
}
.docgen-item:hover { background: var(--surface-2); }

/* 一览表浏览增强：悬停全文浮层 + 行内展开 */
.tt-pop {
  position: fixed; z-index: 120; max-width: 460px; max-height: 340px; overflow: auto;
  background: #fff; border: 1px solid rgba(17,24,39,.15); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(17,24,39,.16); padding: 10px 14px;
  font-size: 14px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap; word-break: break-all; user-select: text;
  display: none;
}
.tt-pop.show { display: block; }
.exp-row td {
  background: rgba(255,255,255,.62) !important; padding: 14px 18px !important;
  white-space: normal !important; overflow: visible !important;
}
.exp-grid { display: grid; grid-template-columns: auto 1fr; gap: 7px 20px; font-size: 14px; line-height: 1.75; max-width: 920px; }
.exp-grid .ek { color: var(--text-3); font-weight: 500; white-space: nowrap; }
.exp-grid .ev { color: var(--text); white-space: pre-wrap; word-break: break-all; min-width: 0; }

/* 进度多选 chips（stageMultiSelect） */
.stage-multi { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-ck {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  border: 1.5px solid var(--border-strong); border-radius: 20px; font-size: 14px;
  cursor: pointer; background: rgba(255,255,255,.72); user-select: none; transition: all .13s;
}
.stage-ck:hover { border-color: rgba(17,24,39,.3); }
.stage-ck:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--text); font-weight: 500; }
.stage-ck input { display: none; }
.stage-ck span { line-height: 1.4; }

/* ================= auth（玻璃双栏，纯 CSS 伪元素品牌区） ================= */
.auth-wrap {
  min-height: calc(100vh - var(--topbar-h) - 40px);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  align-items: stretch; padding: 30px 16px; position: relative;
}
/* 左栏品牌区：光斑背景 + 天平徽记（background 多图层，零 HTML 改动） */
.auth-wrap::before {
  content: "";
  background-image:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="140" height="140"><path d="M8 16h32M24 16v16M15 16v9M33 16v9" stroke="%23111827" stroke-width="3.5" stroke-linecap="round" fill="none"/><circle cx="15" cy="31" r="5.5" fill="none" stroke="%23111827" stroke-width="3"/><circle cx="33" cy="31" r="5.5" fill="none" stroke="%23111827" stroke-width="3"/><path d="M17 40h14" stroke="%23111827" stroke-width="3.5" stroke-linecap="round"/></svg>'),
    radial-gradient(560px 360px at 85% 10%, rgba(148,163,184,.28), transparent 62%),
    radial-gradient(460px 320px at 5% 95%, rgba(203,213,225,.40), transparent 62%);
  background-position: 30% 40%, 85% 10%, 5% 95%;
  background-repeat: no-repeat;
  background-size: 140px 140px, auto, auto;
  border-radius: var(--radius-lg);
  margin-right: 20px;
  opacity: .9;
}
/* 右栏登录玻璃卡 */
.auth-card {
  background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
  padding: 44px 46px; width: 100%; max-width: 440px; text-align: center;
  justify-self: center; align-self: center;
}
.auth-logo { margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 4px; line-height: 1.4; }
.auth-sub { font-size: 14px; color: var(--text-2); margin-bottom: 28px; line-height: 1.6; }
.auth-field { text-align: left; margin-bottom: 16px; }
.auth-field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 600; }
.auth-field input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 11px 13px;
  background: rgba(255,255,255,.75); transition: all .15s;
}
.auth-field input::placeholder { color: var(--text-3); }
.auth-field input:hover { border-color: rgba(17,24,39,.22); }
.auth-field input:focus { outline: none; border-color: rgba(17,24,39,.4); background: #fff; box-shadow: var(--ring); }
.auth-btn { width: 100%; margin-top: 6px; min-height: 46px; font-size: 15px; border-radius: var(--radius-sm); letter-spacing: 3px; }
.auth-alt { margin-top: 18px; font-size: 14px; line-height: 1.6; }
.auth-err { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 18px; line-height: 1.5; }
.auth-hint { margin-top: 16px; font-size: 13px; color: var(--text-3); border-top: 1px dashed var(--border-strong); padding-top: 14px; line-height: 1.8; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; padding: 20px 12px; }
  .auth-wrap::before { display: none; }
  .auth-card { max-width: 100%; padding: 34px 28px; }
}

/* ================= owner / materials ================= */
.owner-card { border-left: 4px solid var(--primary); position: relative; z-index: 10; }
/* form-card 的 backdrop-filter 会创建独立 stacking context，导致内部下拉(z-index:50)无法盖过后续卡片；
   提升 owner-card 自身层级，保证律师多选/商务下拉展开时不被遮挡 */
.owner-grid { display: flex; flex-wrap: wrap; gap: 10px 34px; }
.owner-item { display: flex; align-items: center; gap: 9px; }
.owner-label { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.owner-val { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.5; }
.owner-link { margin-top: 12px; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.owner-actions { margin-top: 13px; display: flex; gap: 9px; }
.owner-edit { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; border-top: 1px dashed var(--border-strong); padding-top: 15px; }
.owner-edit select { min-width: 190px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; background: rgba(255,255,255,.75); }
.owner-edit .owner-label { display: block; margin-bottom: 4px; }

.chk-my { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); white-space: nowrap; line-height: 1.5; }
.chk-my input { width: 16px; height: 16px; accent-color: var(--primary); }

.materials-box { margin-top: 2px; }
.mat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mat-table th { text-align: left; font-weight: 600; color: var(--text-2); padding: 7px 8px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.5; }
.mat-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); line-height: 1.6; }
.mat-table input[type="text"] { width: 100%; box-sizing: border-box; border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 6px 9px; background: rgba(255,255,255,.75); }
.mat-table input[type="text"]:focus { outline: none; border-color: rgba(17,24,39,.4); box-shadow: var(--ring); }
.mat-ck { text-align: center; width: 90px; }
.mat-ck input { width: 17px; height: 17px; accent-color: var(--primary); }

.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table th { text-align: left; width: 150px; color: var(--text-2); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; line-height: 1.7; }
.detail-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); color: var(--text); line-height: 1.7; }
.ro-file { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--border); }
.ro-file .fn { flex: 1; font-size: 14px; line-height: 1.5; color: var(--danger); }

.role-cell { display: flex; gap: 12px; }
.role-ck { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); white-space: nowrap; line-height: 1.5; }
.role-ck input { width: 15px; height: 15px; accent-color: var(--primary); }

/* ================= section tabs ================= */
.filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: -10px 0 18px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.section-tab {
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.72);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.section-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.section-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 5px 14px rgba(24,95,165,.22);
}
.group-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
}
.group-bar-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.group-tab {
  border: 1px dashed var(--border-strong);
  background: rgba(255,255,255,.55);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.group-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.group-tab.active {
  background: #f4f0e6;
  border-color: var(--primary);
  border-style: solid;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(24,95,165,.14);
}
.group-edit {
  font-size: 12px;
  margin-left: 6px;
  opacity: .65;
  cursor: pointer;
}
.group-tab:hover .group-edit { opacity: 1; }
.section-edit {
  font-size: 12px;
  margin-left: 6px;
  opacity: .65;
  cursor: pointer;
}
.section-tab:hover .section-edit { opacity: 1; }
.group-cond {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.group-cond select,
.group-cond input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 14px;
  background: #fff;
  color: var(--text-1);
}
.group-cond select { min-width: 132px; }
.group-cond input { flex: 1; min-width: 120px; }
.f-item[hidden] { display: none; }

/* ================= 无障碍：尊重系统减弱动效 ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .stat-card:hover, .btn:hover, .btn.primary:hover { transform: none; }
}
.dash-data-modal{width:96vw;max-width:none;height:92vh;max-height:92vh;display:flex;flex-direction:column;padding:0;overflow:hidden}.dash-data-modal .table-wrap{margin:0 18px 18px;flex:1;overflow:auto;border-radius:10px}.dash-data-modal table{min-width:1500px}.dash-data-modal th{position:sticky;top:0;z-index:2;background:#f7f7f5;white-space:nowrap}.dash-data-modal td{max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-detail-title{display:flex;align-items:center;justify-content:space-between;padding:18px 22px 8px}.dash-detail-title h4{margin:0 0 3px}.dash-detail-title small{color:var(--text-3)}.dash-detail-title>div:last-child{display:flex;align-items:center;gap:12px}.dash-detail-x{border:0;background:transparent;font-size:30px;line-height:1;cursor:pointer;color:var(--text-2)}.dash-detail-search{padding:8px 18px 14px}.dash-detail-search input{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:9px;padding:12px 14px;font-size: 15px;background:#f7f7f6}.dash-row-check{width:18px;height:18px;accent-color:#35a873;cursor:pointer}.dash-file-chip{display:inline-block;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:6px;background:#f0f2f4;color:#23364d;padding:5px 8px;margin:2px;cursor:pointer}.dash-file-chip:before{content:"📄 "}.dash-file-chip:disabled{cursor:default;opacity:.72}
.dash-data-table{width:100%;border-collapse:collapse;font-size: 14px}
.dash-data-table th,.dash-data-table td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap;max-width:300px;overflow:hidden;text-overflow:ellipsis}
.dash-data-table th{position:sticky;top:0;background:#f8fafc;color:var(--muted);z-index:1}

/* ---------- 表单文件库 ---------- */
.filelib-search{display:flex;gap:10px;align-items:center;padding:4px 2px 16px}
.filelib-search .search-box{width:320px;max-width:100%}
.filelib-group{margin-bottom:18px;background:#fff;border:1px solid var(--line);border-radius:var(--radius,12px);overflow:hidden}
.filelib-group-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line);background:rgba(0,0,0,.02)}
.filelib-group-title{font-size:15px;font-weight:800;color:var(--text);text-decoration:none}
.filelib-group-title:hover{color:var(--primary)}
.filelib-items{display:flex;flex-direction:column;padding:6px 0}
.filelib-item{display:flex;align-items:center;gap:12px;padding:7px 16px;min-width:0}
.filelib-item:hover{background:var(--primary-soft, rgba(32,62,93,.05))}
.filelib-item .file-link{flex:none;max-width:46%;font-size:13px;margin-left:0}
.filelib-group-tag{flex:none;font-size:11px;color:var(--text-3);background:var(--muted-soft, #f1f0ec);border-radius:6px;padding:2px 8px;white-space:nowrap}
.filelib-rec{flex:1;min-width:0;font-size:12px;color:var(--text-2);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.filelib-rec:hover{color:var(--primary)}
