/* ═══════════════════════════════════════════════════════════
   启贤案卷系统 — 共享样式
   Apple 风格：毛玻璃 · 系统字体 · 明暗双主题 · 克制精致
   ═══════════════════════════════════════════════════════════ */

/* ── 设计令牌：浅色模式（默认） ── */
:root {
  --bg:        #F7F5F0;
  --bg-warm:   radial-gradient(1500px 780px at 80% -14%, rgba(139,105,20,.14), transparent 64%), radial-gradient(900px 500px at 12% 108%, rgba(176,122,46,.06), transparent 60%), linear-gradient(180deg, #FBF9F5 0%, #F3F0E8 100%);
  /* 纸张细噪点（去色暖灰、固定低透明度，叠在背景渐变上成纸面质感） */
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.55 0 0 0 0 0.52 0 0 0 0 0.47 0 0 0 0.15 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --surface:   #FFFFFF;
  --surface2:  #F2F1EC;
  --surface3:  #EAE7DE;  /* 层级井第三档（2026-09-06 层级阶梯）：比 surface2 深一档的暖纸井 */
  --border:    #E8E4DA;
  --gold:      #8B6914;
  --on-gold:   #FFFFFF;  /* gold 底上的前景色（按钮文字） */
  --gold-dim:  rgba(139,105,20,.08);
  --gold-glow: rgba(139,105,20,.15);
  --blue:      #1A3A5C;
  --on-blue:   #FFFFFF;  /* blue 底上的前景色（按钮文字） */
  --blue-dim:  rgba(26,58,92,.08);
  --text:      #1D1D1F;
  --text-dim:  #56565C;
  --text-sub:  #636366;
  --hover:     #EFECE3;
  --muted:     #636366;
  --amber:     #8A5A1F;
  --on-amber:  #FFFFFF;  /* amber 底上的前景色（进行中徽章） */
  --amber-dim: rgba(176,122,46,.10);
  --emerald:   #2F6A43;
  --on-emerald: #FFFFFF;  /* emerald 底上的前景色 */
  --emerald-dim: rgba(61,130,88,.10);
  --cinnabar:  #B54535;
  --on-cinnabar: #FFFFFF;  /* cinnabar 底上的前景色 */
  --cinnabar-dim: rgba(181,69,53,.10);
  /* 案件类型标签「其他」中性灰 */
  --type-other-bg: #6E6E73;
  --on-type-other: #FFFFFF;
  /* 缺料清单 chip 调色板（浅色） */
  --miss-red-bg: #FDE8E8;
  --miss-red-fg: #C53030;
  --on-miss-red: #FFFFFF;  /* miss-red-fg 底上的前景色 */
  --miss-red-border: #FEB2B2;
  --miss-yellow-bg: #FEFCE8;
  --miss-yellow-fg: #92600A;
  --miss-yellow-border: #FDE68A;
  --miss-green-bg: #E6F4EA;
  --miss-green-fg: #1E7E34;
  --radius:    8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --blur-bg:   rgba(247,245,240,.78);
  /* 字号层级：4 级，每级 ≥1.15x */
  --text-xl:   1.375rem;
  --text-lg:   0.9375rem;
  --text-base: 0.8125rem;
  --text-sm:   0.6875rem;
  --card-border: #E3D6B9;  /* 卡片暖金灰描边（温润质感，区别于纯灰边框） */
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA0A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238A8F9E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

/* ── 设计令牌：暗色模式 ── */
[data-theme="dark"] {
  --bg:        #0D0D0F;
  --bg-warm:   radial-gradient(1400px 700px at 82% -14%, rgba(212,185,106,.10), transparent 64%), linear-gradient(180deg, #111113 0%, #0A0A0C 100%);
  --surface:   #1C1C1E;
  --surface2:  #28282A;
  --surface3:  #35353B;  /* 暗色同位上浮（越深越亮惯例） */
  --border:    #333338;
  --gold:      #D4B96A;
  --on-gold:   #1A1A1D;  /* gold 底上的前景色：浅金上配近黑，保证可读 */
  --gold-dim:  rgba(212,185,106,.12);
  --gold-glow: rgba(212,185,106,.18);
  --blue:      #7BADD8;
  --on-blue:   #1A1A1D;  /* 浅蓝底配近黑，保证可读 */
  --blue-dim:  rgba(123,173,216,.12);
  --text:      #F5F5F7;
  --text-dim:  #AEAEB2;
  --text-sub:  #98989D;
  --hover:     #1A1A1D;
  --card-border: #3B3B40;  /* 暗色卡片暖调描边 */
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8F9E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23A9ABB3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  --muted:     #98989D;
  --amber:     #D4A85A;
  --on-amber:  #1A1A1D;  /* 浅金底配近黑 */
  --amber-dim: rgba(212,168,90,.15);
  --emerald:   #5EAE83;
  --on-emerald: #1A1A1D;  /* 浅绿底配近黑 */
  --emerald-dim: rgba(94,174,131,.15);
  --cinnabar:  #E8827A;
  --on-cinnabar: #1A1A1D;  /* 浅红底配近黑 */
  --cinnabar-dim: rgba(212,107,90,.15);
  /* 案件类型标签「其他」中性灰（暗色） */
  --type-other-bg: #4A4A4E;
  --on-type-other: #F5F5F7;
  /* 缺料清单 chip 调色板（暗色：深底浅字） */
  --miss-red-bg: #3A2222;
  --miss-red-fg: #FCA5A5;
  --on-miss-red: #1A1A1D;  /* 浅红底配近黑 */
  --miss-red-border: #7F3D3D;
  --miss-yellow-bg: #3A3422;
  --miss-yellow-fg: #FDE68A;
  --miss-yellow-border: #7A6A2E;
  --miss-green-bg: #1E3328;
  --miss-green-fg: #86EFAC;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.5);
  --blur-bg:   rgba(28,28,30,.82);
}

/* ── 基础重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
/* 大字模式：根字号放大到 19px（约 1.2 倍，原 1.5 倍/24px 会把顶部 UI 撑太高）。
   全站字号已改用 rem，随根字号缩放；不再用 zoom（zoom 会整体放大布局导致横向溢出）。 */
html[data-font="large"] { font-size: 19px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  background-image: var(--paper-noise), var(--bg-warm);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 律所标识（宋体） ── */
.firm-name {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "SimSun", serif;
  font-weight: 700; letter-spacing: .06em;
}
/* 律所金色方章徽记 */
.firm-name::before {
  content: "启"; width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, var(--gold) 0%, #7E5A0F 100%);
  color: #fff; font-size: 0.875rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "SimSun", serif;
  box-shadow: 0 1px 4px var(--gold-glow);
  flex-shrink: 0;
}
/* 暗色下徽记固定深金渐变，白字全段对比 ≥5:1（dark --gold 是浅金，直接引用会拉低可读性） */
[data-theme="dark"] .firm-name::before {
  background: linear-gradient(135deg, #8B6914 0%, #6E5410 100%);
}
.firm-rule {
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(139,105,20,.3) 80px, transparent 80px);
  border: none;
  margin-top: 4px;
}

/* ── 顶部栏（毛玻璃） ── */
.header {
  position: relative; z-index: 50;
  background: var(--blur-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
}
.header h1 { font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; z-index: 1;
  background: linear-gradient(90deg, transparent 2%, var(--gold) 20%, var(--gold-dim) 55%, transparent 96%);
}
.header .user {
  font-size: 0.6875rem; color: var(--text-dim); white-space: nowrap;
  line-height: 1; padding: 3px 12px; border-radius: 999px;
  background: var(--hover); display: inline-flex; align-items: center; gap: 4px;
}
html[data-font="large"] .header .user {
  font-size: 0.625rem; padding: 2px 12px;
}
.header .nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.header .nav a {
  color: var(--text-dim); text-decoration: none;
  padding: 6px 10px; border-radius: var(--radius);
  font-size: 0.8125rem; white-space: nowrap;
  transition: all .2s ease;
}
.header .nav a:hover { color: var(--gold); background: var(--gold-dim); }

/* ── 主题切换按钮 ── */
.theme-toggle {
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: none; cursor: pointer;
  font-size: 1rem; line-height: 36px; text-align: center;
  display: flex; align-items: center; justify-content: center;
  transition: all .25s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--gold-dim); }
.theme-toggle:active { transform: scale(.9); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon {
  transition: transform .4s cubic-bezier(.4,0,.2,1), opacity .25s ease;
}
.theme-toggle.light .icon-moon { display: none; }
.theme-toggle.dark  .icon-sun  { display: none; }

/* 浮动主题按钮（登录/改密等无 header 的页面） */
.theme-toggle-fixed {
  position: fixed; top: 12px; right: 12px; z-index: 10;
  width: 44px; height: 44px; font-size: 1.25rem;
  background: var(--blur-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 50%;
}

/* ── 字体放大切换按钮 ── */
.font-toggle {
  height: 36px; padding: 0 12px; min-width: 36px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); cursor: pointer;
  font-size: 0.8125rem; font-weight: 600;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: all .25s ease;
  flex-shrink: 0;
}
.font-toggle:hover { background: var(--gold-dim); color: var(--gold); }
.font-toggle:active { transform: scale(.9); }
.font-toggle.large { color: var(--gold); background: var(--gold-dim); border-color: var(--gold); }

/* 浮动字体按钮（登录/改密等无 header 的页面） */
.font-toggle-fixed {
  position: fixed; top: 12px; right: 60px; z-index: 10;
  width: 44px; height: 44px; padding: 0;
  background: var(--blur-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 50%;
}

/* 移动端更多菜单 */
.header .more-btn {
  display: none; padding: 6px 10px; border: none; border-radius: var(--radius);
  background: none; font-size: 1rem; cursor: pointer; color: var(--text-dim);
}
.header .more-menu {
  display: none; position: absolute; top: 100%; right: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  flex-direction: column; min-width: 120px; padding: 4px; z-index: 100;
}
.header .more-menu a { display: block; padding: 10px 14px; color: var(--text); text-decoration: none; font-size: 0.8125rem; border-radius: 6px; }
.header .more-menu a:hover { background: var(--gold-dim); color: var(--gold); }
.header .more-menu.show { display: flex; }

@media (max-width: 600px) {
  .header h1 { display: none; }
  .header .nav .hide-mobile { display: none; }
  .header .more-btn { display: block; }
}

/* ── 标签栏 ── */
.main-tabs {
  display: flex; justify-content: center; gap: 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border); padding: 8px 16px;
}
.main-tab {
  text-align: center; padding: 7px 22px; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-dim); cursor: pointer;
  border-radius: var(--radius-pill); white-space: nowrap;
  transition: all .2s ease; user-select: none;
}
.main-tab:hover { color: var(--gold); background: var(--gold-dim); }
.main-tab:active { opacity: .7; }
.main-tab.active {
  color: var(--on-gold); font-weight: 600;
  background: linear-gradient(135deg, var(--gold) 0%, #7E5A0F 100%);
  box-shadow: 0 2px 10px var(--gold-glow);
}
[data-theme="dark"] .main-tab.active {
  background: linear-gradient(135deg, var(--gold) 0%, #A8893A 100%);
}
/* 窄屏：胶囊均分防溢出 */
@media (max-width: 600px) {
  .main-tabs { justify-content: stretch; gap: 4px; padding: 8px 8px; }
  .main-tab { flex: 1 1 0; min-width: 0; padding: 7px 6px; }
}

/* ── 搜索框 ── */
.search-bar {
  display: flex; gap: 6px; align-items: center;
  padding: 6px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.search-bar input {
  flex: 1; min-width: 0; padding: 10px 14px 10px 38px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-size: 0.9375rem; color: var(--text);
  background: var(--bg) var(--search-icon) no-repeat 12px center;
  background-size: 16px 16px;
  outline: none; -webkit-appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-bar input::placeholder { color: var(--text-sub); }
.search-bar input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

/* ── 仪表板 ── */
.dashboard {
  display: flex; gap: 8px; padding: 6px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.stat-card {
  flex: 1; min-width: 72px; text-align: center;
  padding: 12px 8px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface2) 100%);
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(139,105,20,.05);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity .25s ease;
}
.stat-card::after {
  content: ""; position: absolute; top: 10px; left: 10px; width: 3px; height: 16px;
  border-radius: 2px; background: var(--gold); opacity: .5;
  transition: opacity .25s ease;
}
.stat-card[data-filter="active"]::after { background: var(--blue); }
.stat-card[data-filter="done"]::after { background: var(--emerald); }
.stat-card[data-filter="new"]::after { background: var(--amber); }
.stat-card.active::after { opacity: 1; background: rgba(255,255,255,.9); }
[data-theme="dark"] .stat-card.active::after { background: rgba(26,26,29,.35); }
.stat-card:hover { border-color: var(--gold-dim); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat-card:active { transform: scale(.97); }
.stat-card.active {
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 46%),
    linear-gradient(135deg, var(--gold) 0%, #A0781F 52%, #7E5A0F 100%);
  border-color: var(--gold);
  box-shadow: 0 3px 18px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.14);
}
.stat-card.active::before { opacity: 1; background: rgba(255,255,255,.32); }
[data-theme="dark"] .stat-card.active {
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0) 46%),
    linear-gradient(135deg, var(--gold) 0%, #A8893A 100%);
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-card .stat-label { font-size: 0.6875rem; color: var(--text-dim); margin-top: 2px; font-weight: 500; }
.stat-card.active .stat-value,
.stat-card.active .stat-label { color: var(--on-gold); }

/* ── 工具栏 ── */
.toolbar {
  padding: 8px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* ── 子标签按钮 ── */
.subtabs { display: flex; gap: 4px; }
.subtab {
  padding: 5px 12px; border: none; border-radius: var(--radius);
  font-size: 0.6875rem; cursor: pointer; white-space: nowrap;
  background: var(--bg); color: var(--text-dim);
  transition: all .2s ease;
}
.subtab:hover { background: var(--gold-dim); color: var(--gold); }
.subtab:active { transform: scale(.96); }
.subtab.active { background: var(--gold); color: var(--on-gold); font-weight: 600; }

/* ── 布局切换（搜索框内） ── */
.search-bar .layout-toggle { display: flex; gap: 2px; flex-shrink: 0; }
.search-bar .layout-toggle button {
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.9375rem; cursor: pointer; line-height: 30px; text-align: center;
  background: var(--bg); color: var(--text-dim);
  transition: all .2s ease;
}
.search-bar .layout-toggle button:hover { background: var(--gold-dim); color: var(--gold); }
.search-bar .layout-toggle button.active {
  background: var(--gold-dim); color: var(--gold); border-color: var(--gold);
}

/* ── 顶部收起按钮 ── */
.search-bar .collapse-toggle {
  width: 32px; height: 32px; padding: 0; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem; cursor: pointer; line-height: 30px; text-align: center;
  background: var(--bg); color: var(--text-dim);
  transition: all .2s ease;
}
.search-bar .collapse-toggle:hover { background: var(--gold-dim); color: var(--gold); }
.search-bar .collapse-toggle:active { transform: scale(.9); }

/* ── 业务员筛选（搜索框内，仅当事人总览显示） ── */
.search-bar .staff-filter {
  height: 38px; padding: 0 30px 0 14px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 0.8125rem; color: var(--text);
  background: var(--bg) var(--select-arrow) no-repeat right 12px center;
  background-size: 12px 12px;
  outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.search-bar .staff-filter:hover { border-color: var(--gold); }
.search-bar .staff-filter:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

/* 顶部收起：只保留搜索框（dashboard 用 !important 因 tab 切换用内联 style 覆盖） */
html[data-top-collapsed="1"] .top-area .header,
html[data-top-collapsed="1"] .top-area .main-tabs,
html[data-top-collapsed="1"] .top-area .dashboard {
  display: none !important;
}

/* ── "只看我的" ── */
.toggle-mine {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.6875rem; color: var(--text-dim);
  cursor: pointer; user-select: none;
}
.toggle-mine input { width: 16px; height: 16px; accent-color: var(--gold); }

/* ── 统计栏 ── */
.stats { padding: 8px 16px; font-size: 0.6875rem; color: var(--text-dim); display: flex; gap: 12px; align-items: center; }
.stats .count { font-weight: 600; color: var(--text); }
.stats #caseCount { margin-left: auto; }

/* ── 5 步进度条 ── */
.progress-bar {
  display: flex; align-items: flex-start;
  margin-bottom: 10px; padding: 0 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;  /* 隐藏滚动条（Firefox） */
}
.progress-bar::-webkit-scrollbar { display: none; }  /* 隐藏滚动条（WebKit） */
.progress-bar .step {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex-shrink: 0;
}
.progress-bar .step .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all .3s ease;
}
.progress-bar .step.done .dot {
  background: var(--gold); border-color: var(--gold);
}
.progress-bar .step .lbl {
  font-size: 0.6875rem; color: var(--text-sub); white-space: nowrap;
  transition: color .3s ease;
}
.progress-bar .step.done .lbl { color: var(--gold); }
.progress-bar .step .step-date {
  font-size: 0.6875rem; font-weight: 500; color: var(--text-sub); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.progress-bar .step.done .step-date { color: var(--gold); font-weight: 600; }

/* 步骤连接器 */
.progress-bar .step-connector {
  flex: 1; height: 1.5px;
  background: var(--border);
  margin-top: 6px;
  position: relative;
  min-width: 8px;
}
.progress-bar .step-connector.has-gap {
  background: var(--gold);
  margin-top: 16px;  /* 为间隔文字留空间 */
}
.progress-bar .step-connector .gap-text {
  position: absolute;
  top: -15px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem; color: var(--text-sub);
  white-space: nowrap;
  background: var(--bg);
  padding: 1px 4px;
  border-radius: var(--radius-pill);
}

/* ── 进展备注（详情区） ── */
.progress-text {
  font-size: 0.8125rem; line-height: 1.7; color: var(--text-dim);
  white-space: pre-wrap; word-break: break-all;
  margin-top: 8px; padding-top: 0;
}

/* ── 结果区 ── */
.results { padding: 0 16px 24px; }

/* ── 卡片 ── */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 16px; margin-top: 10px;
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(139,105,20,.04), 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .25s ease, box-shadow .25s ease, transform .2s ease;
  cursor: pointer; user-select: none;
  touch-action: manipulation;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card.expanded {
  border-color: var(--gold);
  box-shadow: 0 2px 14px var(--gold-glow), var(--shadow-md);
  transform: none;
}
.card:active { transform: scale(.985); }
.card.expanded:active { transform: none; }

/* ── 状态标签 ── */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; line-height: 1;
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; flex: none; }
.tag-active  { background: var(--amber); color: var(--on-amber); border-color: color-mix(in srgb, var(--amber) 55%, transparent); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.tag-closed  { background: var(--emerald-dim); color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 35%, transparent); }
.tag-docs    { background: var(--cinnabar-dim); color: var(--cinnabar); border-color: color-mix(in srgb, var(--cinnabar) 35%, transparent); }
/* 「📜 文书」是材料类型 tag，非状态，去圆点避免与 emoji 重复 */
.tag-docs::before { content: none; }

/* ═══════════════════════════════════════════════════════════
   卡片分类标签行：法院受理 / 案件类型 / 案由
   法院=金色描边印章徽章（最显眼）· 类型=实心彩色胶囊 · 案由=中性灰低强调
   ═══════════════════════════════════════════════════════════ */
.card-badges {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 6px;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.6875rem; font-weight: 600; line-height: 1.55;
  padding: 1px 10px; border-radius: var(--radius-pill); white-space: nowrap;
}
.badge-court { background: var(--gold-dim); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.badge-type { border: 1px solid transparent; }
.type-traffic { background: var(--blue); color: var(--on-blue); }
.type-injury  { background: var(--amber); color: var(--on-amber); }
.type-other   { background: var(--type-other-bg); color: var(--on-type-other); }
.type-history { background: transparent; color: var(--text-dim); border: 1px dashed var(--border); }
.badge-cause  { background: var(--surface2); color: var(--text-sub); border: 1px solid var(--border); }

/* 开庭紧迫度移入标题行后：紧凑对齐当事人名字 */
.card .title .trial-badge { font-size: 0.75rem; padding: 1px 9px; line-height: 1.5; }

/* ── 卡片内容 ── */
.card .title { font-size: 0.9375rem; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .title > span:first-child { min-width: 0; }
.card .fields { display: grid; grid-template-columns: 1fr; gap: 4px; font-size: 0.8125rem; }
.card .fields .f { display: flex; align-items: baseline; }
.card .fields .f .label { color: var(--text-dim); flex-shrink: 0; }
.card .fields .f .value { color: var(--text); flex: 1; overflow-wrap: anywhere; word-break: break-word; }
.card .full { grid-column: 1 / -1; }
.card .expand-hint { font-size: 0.6875rem; color: var(--text-dim); margin-left: auto; transition: transform .25s ease; }
.card.expanded .expand-hint { transform: rotate(180deg); }
.card .detail { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }

/* ── 详情区分组 ── */
.field-group { margin-bottom: 10px; }
.field-group:last-child { margin-bottom: 0; }
.field-group-title {
  font-size: 0.75rem; font-weight: 600; color: var(--gold);
  margin-bottom: 6px; padding-bottom: 5px;
  border-bottom: none; position: relative;
  letter-spacing: .02em;
}
.field-group-title::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dim) 70%, transparent);
}
.field-group .fields {
  display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 0.8125rem;
}

/* ── 文书列表 ── */
.docs-section { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.docs-section .docs-title { font-size: 0.8125rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.docs-section .doc-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.8125rem; }
.docs-section .doc-item + .doc-item { border-top: 1px solid var(--border); }
.docs-section .doc-item .doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-section .doc-item .doc-size { color: var(--text-dim); font-size: 0.6875rem; white-space: nowrap; }
.docs-section .doc-item .doc-btn {
  padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.6875rem; text-decoration: none; color: var(--text-dim); background: var(--bg); white-space: nowrap;
  transition: all .2s ease;
}
.docs-section .doc-item .doc-btn.preview { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.docs-section .doc-item .doc-btn.preview:hover { opacity: .85; }
.docs-section .doc-loading, .docs-section .doc-empty { font-size: 0.6875rem; color: var(--text-dim); padding: 4px 0; }
.docs-section .doc-retry {
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}
.docs-section .doc-retry:hover { opacity: .8; }

/* ── 档案卡片 ── */
.archive-card { display: flex; align-items: center; gap: 12px; }
.archive-card .cabinet {
  font-size: 0.8125rem; font-weight: 600; color: var(--gold);
  background: var(--gold-dim); padding: 5px 14px; border-radius: var(--radius-pill);
  white-space: nowrap; min-width: 44px; text-align: center;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.archive-card .name { font-size: 0.9375rem; font-weight: 600; flex: 1; }
.archive-card .section { font-size: 0.75rem; padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; }
.archive-card .section::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.section-closed { background: var(--emerald-dim); color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 35%, transparent); }
.section-active { background: var(--amber-dim); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.section-archive { background: var(--blue-dim); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.section-injury { background: var(--cinnabar-dim); color: var(--cinnabar); border-color: color-mix(in srgb, var(--cinnabar) 35%, transparent); }
.archive-card .note { font-size: 0.75rem; color: var(--text-dim); }

@media (max-width: 480px) {
  .archive-card { flex-wrap: wrap; gap: 6px; }
  .archive-card .name { flex: 1 1 100%; order: -1; }
  .archive-card .cabinet { order: 1; }
  .archive-card .section { order: 2; }
  .archive-card .note { flex: 1 1 100%; }
}

/* ── 空态 / 加载 / 错误 ── */
.empty {
  text-align: center; padding: 56px 24px; color: var(--text-dim); font-size: 0.8125rem;
  border: 1px dashed var(--card-border); border-radius: var(--radius-lg);
}
.empty::before { content: "🔍"; display: block; font-size: 36px; margin-bottom: 12px; opacity: .55; }
.empty-error::before { content: none; }
.loading { text-align: center; padding: 40px; color: var(--text-dim); }
.loading::before { content: ""; display: block; width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 登录/表单卡片 ── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 44px 28px 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 50px rgba(139,105,20,.14), 0 8px 24px rgba(139,105,20,.08), var(--shadow-md);
  position: relative;
}
.auth-card::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.auth-card .icon { text-align: center; margin-bottom: 12px; }
.auth-card h1 { text-align: center; font-size: 1.25rem; font-weight: 700; margin-bottom: 2px; }
.auth-card .sub { text-align: center; font-size: 0.8125rem; color: var(--text-dim); margin-bottom: 24px; }
.auth-card .firm-rule { margin: 6px auto 20px; width: 80px; }
/* 登录页天秤徽标（原 login.html 内联样式提升为正式组件） */
.login-icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--gold-dim), transparent 72%);
  border: 1px solid var(--card-border);
}
.login-icon svg { width: 38px; height: 38px; }

/* ── 表单元素 ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: 4px; color: var(--text-dim); }
.form-group input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-size: 0.9375rem; color: var(--text); background: var(--bg); outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-group input::placeholder { color: var(--text-sub); }
.form-group input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

/* ── 按钮 ── */
.btn {
  display: inline-block; padding: 10px 20px; border: none; border-radius: var(--radius);
  font-size: 0.8125rem; font-weight: 500; cursor: pointer; text-align: center;
  text-decoration: none; transition: all .2s ease;
}
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--gold); color: var(--on-gold);
  border: none; border-radius: var(--radius-lg);
  font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  letter-spacing: .05em;
  transition: all .2s ease;
}
.btn-primary:hover { opacity: .92; box-shadow: 0 6px 18px var(--gold-glow); transform: translateY(-1px); }
.btn-primary:active { opacity: .8; transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-link { color: var(--gold); background: none; border: none; font-size: 0.8125rem; cursor: pointer; }
.btn-link:hover { opacity: .75; }

/* ── 消息 ── */
.msg { padding: 10px 14px; border-radius: var(--radius); font-size: 0.8125rem; margin-bottom: 16px; text-align: center; }
.msg-error { background: var(--cinnabar-dim); color: var(--cinnabar); }
.msg-success { background: var(--emerald-dim); color: var(--emerald); }

/* ── 复选框 ── */
.check-label { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-dim); margin-bottom: 20px; }
.check-label input { width: 17px; height: 17px; accent-color: var(--gold); }

/* ── 网格布局 ── */
/* 移动优先：默认两列（简单 1fr 写法，兼容微信 X5 内核；避免 minmax 在 481-648px 塌成单列） */
.results.layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.results.layout-grid .card { margin-top: 0; }
/* 桌面宽屏：自动多列 */
@media (min-width: 768px) {
  .results.layout-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
.results.layout-grid .card .fields { grid-template-columns: 1fr; font-size: 0.6875rem; gap: 2px 6px; }
.results.layout-grid .card .title { font-size: 0.8125rem; margin-bottom: 4px; }
.results.layout-grid .card.expanded { grid-column: 1 / -1; }

/* 网格折叠卡片 —— 进度条收小，避免拥挤 */
.results.layout-grid .card .progress-bar .step .lbl { font-size: 0.6875rem; }
.results.layout-grid .card .progress-bar .step .step-date { font-size: 0.5625rem; font-weight: 400; }
.results.layout-grid .card .progress-bar .step-connector .gap-text { font-size: 0.5rem; }
.results.layout-grid .card .progress-bar .step-connector.has-gap { margin-top: 14px; }
.results.layout-grid .card .progress-bar .step-connector .gap-text { top: -13px; }
/* 网格折叠卡片 —— 分类标签行与标题行开庭紧迫度收小 */
.results.layout-grid .card-badges { gap: 4px; margin: 0 0 4px; }
.results.layout-grid .badge { font-size: 0.5625rem; padding: 0 7px; }
.results.layout-grid .card .title .trial-badge { font-size: 0.625rem; padding: 0 7px; }
/* 网格展开卡片（全宽）—— 恢复大字号 */
.results.layout-grid .card.expanded .progress-bar .step .lbl { font-size: 0.6875rem; }
.results.layout-grid .card.expanded .progress-bar .step .step-date { font-size: 0.6875rem; font-weight: 500; }
.results.layout-grid .card.expanded .progress-bar .step-connector .gap-text { font-size: 0.625rem; }
.results.layout-grid .card.expanded .progress-bar .step-connector.has-gap { margin-top: 16px; }
.results.layout-grid .card.expanded .progress-bar .step-connector .gap-text { top: -15px; }
.results.layout-grid .card.expanded .fields { grid-template-columns: 1fr; font-size: 0.8125rem; gap: 4px 12px; }
.results.layout-grid .card.expanded .field-group .fields { grid-template-columns: 1fr; font-size: 0.8125rem; gap: 4px 12px; }
.results.layout-grid .card.expanded .title { font-size: 0.9375rem; margin-bottom: 6px; }

/* ── 扫描线动画 ── */
@keyframes scanLine {
  0% { border-color: var(--border); }
  50% { border-color: var(--gold); }
  100% { border-color: var(--border); }
}
.card.just-updated { animation: scanLine .6s ease; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 16px; right: 16px; z-index: 1000;
  padding: 14px; border-radius: var(--radius-lg);
  font-size: 0.8125rem; text-align: center;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast-success { background: var(--emerald-dim); color: var(--emerald); border-color: var(--emerald); }
.toast-error { background: var(--cinnabar-dim); color: var(--cinnabar); border-color: var(--cinnabar); }

/* ── 上传页专用 ── */
.dropzone {
  margin: 16px; padding: 40px 20px;
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  text-align: center; background: var(--surface); cursor: pointer;
  transition: all .25s ease;
}
.dropzone:hover { border-color: var(--gold); background: var(--gold-dim); }
.dropzone.dragover {
  border-color: var(--gold); background: var(--gold-dim);
  box-shadow: 0 0 0 4px var(--gold-dim), 0 0 24px var(--gold-glow);
}
.dropzone.dragover .icon { transform: translateY(-3px) scale(1.1); }
.dropzone .icon { font-size: 2.5rem; margin-bottom: 8px; transition: transform .25s ease; }
.dropzone .hint { font-size: 0.8125rem; color: var(--text-dim); }
.dropzone .hint strong { color: var(--gold); }
.dropzone input { display: none; }

.file-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 10px; box-shadow: var(--shadow-sm); transition: all .2s ease; }
.file-card:hover { border-color: var(--card-border); }
.file-card .fname { font-weight: 600; font-size: 0.8125rem; margin-bottom: 8px; }
.file-card .meta { font-size: 0.8125rem; color: var(--text-dim); margin-bottom: 4px; }
.file-card .match { font-size: 0.8125rem; padding: 7px 12px; border-radius: var(--radius); margin-top: 6px; border: 1px solid transparent; line-height: 1.5; }
.file-card .match.exact { background: var(--emerald-dim); color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 30%, transparent); }
.file-card .match.partial, .file-card .match.fuzzy { background: var(--amber-dim); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.file-card .match.no_match { background: var(--cinnabar-dim); color: var(--cinnabar); border-color: color-mix(in srgb, var(--cinnabar) 30%, transparent); }
.file-card .actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.file-card select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.8125rem; background: var(--bg); color: var(--text);
}

.btn-confirm { background: var(--gold); color: var(--on-gold); padding: 8px 16px; border: none; border-radius: var(--radius); font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: opacity .2s ease; }
.btn-confirm:hover { opacity: .85; }
.btn-skip { background: var(--bg); color: var(--text-dim); padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.8125rem; cursor: pointer; transition: all .2s ease; }
.btn-skip:hover { color: var(--text); }

.user-info {
  padding: 8px 16px; font-size: 0.8125rem;
  background: var(--gold-dim); color: var(--gold);
  border-bottom: 1px solid var(--border);
}

/* ── 预览页专用 ── */
.preview-toolbar {
  background: var(--surface); padding: 8px 12px; display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; flex-wrap: wrap; border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.preview-toolbar .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text); font-size: 0.8125rem; }
.preview-toolbar a { color: var(--text-dim); text-decoration: none; padding: 5px 10px; border-radius: var(--radius); font-size: 0.8125rem; white-space: nowrap; transition: all .2s ease; }
.preview-toolbar a:hover { color: var(--gold); background: var(--gold-dim); }
.preview-toolbar a.dl { background: var(--gold); color: var(--on-gold); }
.preview-toolbar a.dl:hover { opacity: .9; box-shadow: 0 2px 8px var(--gold-glow); }
.preview-toolbar .page-info { color: var(--text-dim); font-size: 0.75rem; white-space: nowrap; }

/* ── 手机适配 ── */
@media (max-width: 480px) {
  .dashboard { gap: 4px; padding: 8px 8px; }
  .stat-card { padding: 10px 4px; min-width: 56px; }
  .stat-card .stat-value { font-size: 1.125rem; }
  /* 字号下限锁 11px（2026-09-04 评审：9-10px 户外/中老年不可读） */
  .stat-card .stat-label { font-size: 0.6875rem; }
  .progress-bar .step .lbl { font-size: 0.6875rem; }
  .progress-bar .step .step-date { font-size: 0.6875rem; }
  .progress-bar .step .dot { width: 12px; height: 12px; }
  .progress-bar .step-connector { margin-top: 5px; min-width: 4px; }
  .progress-bar .step-connector.has-gap { margin-top: 14px; }
  .progress-bar .step-connector .gap-text { font-size: 0.6875rem; top: -14px; }
  /* 手机网格模式 —— 两栏卡片极窄：步骤标签同样锁 11px，日期隐藏（只留圆点+月份） */
  .results.layout-grid .card .progress-bar .step .lbl { font-size: 0.6875rem; }
  .results.layout-grid .card .progress-bar .step .step-date { display: none; }
  .results.layout-grid .card .progress-bar .step-connector .gap-text { font-size: 0.6875rem; }
  .results.layout-grid .card .progress-bar .step-connector.has-gap { margin-top: 14px; }
  .results.layout-grid .card .progress-bar .step-connector .gap-text { top: -13px; }
  /* 手机网格展开卡片（全宽）—— 与列表同字号 */
  .results.layout-grid .card.expanded .progress-bar .step .lbl { font-size: 0.6875rem; }
  .results.layout-grid .card.expanded .progress-bar .step .step-date { font-size: 0.6875rem; }
  .results.layout-grid .card.expanded .progress-bar .step-connector .gap-text { font-size: 0.6875rem; }
  .results.layout-grid .card.expanded .progress-bar .step-connector.has-gap { margin-top: 14px; }
  .results.layout-grid .card.expanded .progress-bar .step-connector .gap-text { top: -14px; }
  /* 收起钮触控区 44px */
  .search-bar .collapse-toggle { width: 44px; height: 44px; line-height: 42px; font-size: 1rem; }
  .card .fields { grid-template-columns: 1fr; }
  .field-group .fields { grid-template-columns: 1fr; }
  .results.layout-grid { grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 8px 24px; }
  .results.layout-grid .card { padding: 8px; min-width: 0; overflow: hidden; }
  .results.layout-grid .card .title { font-size: 0.6875rem; flex-wrap: wrap; margin-bottom: 3px; }
  .results.layout-grid .card .title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .results.layout-grid .card .tag { font-size: 0.5625rem; padding: 1px 4px; flex-shrink: 0; }
  .results.layout-grid .card .expand-hint { font-size: 0.5625rem; }
  .results.layout-grid .card .fields { font-size: 0.6875rem; gap: 4px 6px; }
  .results.layout-grid .card .fields .f { flex-direction: column; gap: 1px; }
  .results.layout-grid .card .fields .f .label { font-size: 0.625rem; line-height: 1.35; }
  .results.layout-grid .card .fields .f .value { word-break: break-word; overflow-wrap: anywhere; line-height: 1.4; }
  .results.layout-grid .card.expanded { grid-column: 1 / -1; }
  .results.layout-grid .card.expanded .title { font-size: 0.8125rem; }
  .results.layout-grid .card.expanded .fields { font-size: 0.8125rem; }
  .results.layout-grid .card.expanded .fields .f { flex-direction: row; }
}

/* ── 焦点可见（键盘导航无障碍） ── */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
input:focus-visible { outline: none; }

/* ── 当事人总览 ── */

/* 年份分组 */
.year-group { margin-bottom: 4px; }
.year-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; font-size: 1rem; font-weight: 700;
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "SimSun", serif;
  letter-spacing: .05em;
  position: sticky; top: var(--topbar-h, 98px); z-index: 5;
}
.year-header::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dim) 70%, transparent);
  opacity: .6;
}
.year-header:hover { background: var(--hover); }
.year-icon { font-size: 1rem; }
.year-count { font-size: 0.75rem; color: var(--muted); margin-left: auto; }
.year-toggle { font-size: 0.75rem; color: var(--muted); margin-left: 4px; }
.year-body { padding: 8px 12px; }

/* 当事人卡片（2026-09-06 层级阶梯 L1：--surface 白卡，与页面 --bg 拉开，代码对齐 DESIGN.md「surface=卡片」） */
.ov-card {
  background: var(--surface); border-radius: 8px; margin-bottom: 6px;
  border: 1px solid var(--border); overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .2s ease;
  touch-action: manipulation;
}
.ov-card:hover { border-color: var(--gold-dim); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ov-card:active { transform: scale(.985); }
.ov-card-simple {
  display: inline-flex; flex-direction: column; align-items: stretch;
  margin: 0 4px 4px 0; font-size: 0.8125rem; vertical-align: top;
  background: var(--surface); border: 1px solid var(--border);  /* L1 白卡（2026-09-06） */
  border-radius: 6px; overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .2s ease;
  touch-action: manipulation;
}
.ov-card-simple:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ov-card-simple:active { transform: scale(.985); }
/* 展开详情后撑满整行 + 金色高亮 */
.ov-card-simple.ov-card-expanded { display: flex; width: 100%; border-color: var(--gold); box-shadow: 0 2px 14px var(--gold-glow); }
.ov-card-simple.ov-card-expanded:hover { transform: none; }
.ov-card-simple.ov-card-expanded:active { transform: none; }
.ov-card-simple .ov-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; cursor: pointer;
}
.ov-card-simple .ov-summary:hover { background: var(--hover); }
.ov-card-simple .ov-client { font-weight: 600; }
.ov-card-simple .ov-staff { font-size: 0.75rem; color: var(--muted); }

/* 已结案卡片：正常不透明度（2026-09-01 用户反馈去掉蒙版——印章已标识状态，
   整卡半透明会让展开详情文字发灰难读） */
.ov-card.ov-card-closed { opacity: 1; }
.ov-card-simple.ov-card-closed {
  opacity: 1;
}
.ov-tag-closed {
  font-size: 0.6875rem; padding: 1px 6px; border-radius: 4px;
  background: var(--hover); color: var(--muted); white-space: nowrap;
}

/* ── 朱红「已结案」印章：结案 = 盖章归档，律所世界的真实动作 ──
   椭圆竖排圆章 + 印泥晕染 + 微微歪斜，营造「盖上去的」质感；
   只在真实结案时使用，手动软结案仍用上方灰 pill */
.stamp-closed {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 44px; padding: 0; flex-shrink: 0;
  border: 1.5px solid #A63A2B;
  border-radius: 50%;
  color: #A63A2B;
  font-family: "Noto Serif SC", "STSong", "Songti SC", "SimSun", serif;
  font-size: 0.6875rem; font-weight: 700; line-height: 1;
  writing-mode: vertical-rl; letter-spacing: .04em; text-indent: .04em;
  transform: rotate(-10deg);
  background:
    radial-gradient(circle at 40% 36%, rgba(166,58,43,.14), rgba(166,58,43,0) 55%),
    radial-gradient(circle at 62% 66%, rgba(166,58,43,.08), rgba(166,58,43,0) 46%);
  box-shadow: inset 0 0 0 1px rgba(166,58,43,.22);
  opacity: .95;
}
[data-theme="dark"] .stamp-closed {
  border-color: #D46B5A; color: #D46B5A;
  background:
    radial-gradient(circle at 40% 36%, rgba(212,107,90,.16), rgba(212,107,90,0) 55%),
    radial-gradient(circle at 62% 66%, rgba(212,107,90,.10), rgba(212,107,90,0) 46%);
  box-shadow: inset 0 0 0 1px rgba(212,107,90,.24);
}

.ov-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: pointer; gap: 8px; flex-wrap: wrap;
}
.ov-summary:hover { background: var(--hover); }
.ov-summary-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ov-summary-right { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; flex-shrink: 0; }
.ov-client { font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
.ov-staff { font-size: 0.75rem; color: var(--muted); }
.ov-status-icon { font-size: 0.875rem; }
.ov-status-text { color: var(--muted); max-width: 200px; min-width: 0; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片详情 */
.ov-detail { border-top: 1px solid var(--border); }
.ov-detail-inner { padding: 12px 14px; }
.ov-loading, .ov-error { padding: 16px; text-align: center; color: var(--muted); }
.ov-error { color: var(--cinnabar); }

/* 区块 */
.ov-section { margin-bottom: 14px; }
.ov-section-title {
  font-size: 0.8125rem; font-weight: 600; color: var(--muted);
  margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}

/* 案情选项 */
.ov-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; gap: 8px;
}
.ov-option label { font-size: 0.8125rem; }
.ov-toggle {
  display: flex; gap: 2px; background: var(--hover); border-radius: 6px; padding: 2px;
}
.ov-toggle button {
  padding: 4px 12px; border: none; background: transparent; color: var(--muted);
  font-size: 0.8125rem; border-radius: 5px; cursor: pointer;
}
.ov-toggle button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.1); }  /* L1 白卡上 active 丸与 hover 轨道拉开（2026-09-06） */

/* 材料清单 */
.ov-mat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px solid var(--border); gap: 8px;
}
.ov-mat-row:last-child { border-bottom: none; }
.ov-mat-label { font-size: 0.8125rem; flex: 1; min-width: 0; }
.ov-mat-status { display: flex; gap: 2px; background: var(--hover); border-radius: 6px; padding: 2px; flex-shrink: 0; }
.ov-mat-status button {
  padding: 3px 10px; border: none; background: transparent; color: var(--muted);
  font-size: 0.8125rem; border-radius: 6px; cursor: pointer; min-width: 30px; min-height: 28px;
}
.ov-mat-status button.active[data-val="have"] { background: var(--emerald-dim); color: var(--emerald); font-weight: 600; }
.ov-mat-status button.active[data-val="missing"] { background: var(--amber-dim); color: var(--amber); font-weight: 600; }
.ov-mat-status button.active[data-val="not_applicable"] { background: var(--hover); color: var(--muted); font-weight: 600; }

/* 材料行高亮 */
.ov-mat-missing .ov-mat-label { color: var(--cinnabar); }
.ov-mat-have .ov-mat-label { color: var(--emerald); }
.ov-mat-na { opacity: 0.45; }
.ov-mat-na .ov-mat-label { text-decoration: line-through; }

/* 发票行展开箭头 */
.ov-mat-expand {
  flex-shrink: 0;
  border: none; background: var(--blue); color: var(--on-blue);
  border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600;
  line-height: 1; cursor: pointer; padding: 5px 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  transition: background .15s ease;
}
.ov-mat-expand:hover { background: var(--blue-dim); color: var(--blue); }
.ov-mat-expand:active { transform: scale(.95); }

/* 发票统计内联面板 */
.ov-invoice-stats {
  margin: 4px 0 8px; padding: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ov-stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ov-stats-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.ov-stats-date { font-size: 0.6875rem; color: var(--muted); }

.ov-stats-total { font-size: 1.625rem; font-weight: 700; color: var(--gold); letter-spacing: -.5px; }
.ov-stats-total-label { font-size: 0.6875rem; color: var(--muted); margin-bottom: 10px; }

.ov-stats-warning {
  margin-top: 8px; padding: 8px 10px; font-size: 0.75rem;
  background: var(--amber-dim); color: var(--amber);
  border-radius: var(--radius);
}

.ov-stats-section { margin-top: 12px; }
.ov-stats-section-title { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }

.ov-stats-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 0.75rem;
}
.ov-stats-row:last-child { border-bottom: none; }
.ov-stats-date { flex-shrink: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-stats-inst { flex: 1; min-width: 0; color: var(--text-dim); overflow-wrap: anywhere; }
.ov-stats-amt { flex-shrink: 0; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ov-stats-count { flex-shrink: 0; font-size: 0.6875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-stats-date-group { margin-top: 8px; font-size: 0.6875rem; font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ov-stats-row-sub { padding-left: 12px; }

.ov-badge {
  flex-shrink: 0; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: 0.6875rem; font-weight: 600; line-height: 1.5;
}
.ov-badge-otp { background: var(--blue-dim); color: var(--blue); }
.ov-badge-emg { background: var(--amber-dim); color: var(--amber); }
.ov-badge-inp { background: var(--cinnabar-dim); color: var(--cinnabar); }
.ov-badge-nonmed { background: var(--hover); color: var(--muted); }

.ov-stats-row-nonmed { opacity: .85; }

.ov-stats-footer {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 0.6875rem; color: var(--muted); line-height: 1.6;
}
.ov-stats-empty { padding: 10px 0; font-size: 0.8125rem; color: var(--muted); }
.ov-stats-empty[role="button"] { cursor: pointer; color: var(--cinnabar); }
.ov-stats-empty[role="button"]:hover { color: var(--gold); }
.ov-stats-hint { font-size: 0.6875rem; color: var(--text-sub); margin-top: 4px; }
.ov-stats-loading { padding: 10px 0; font-size: 0.8125rem; color: var(--muted); }

.ov-stats-actions { display: flex; gap: 8px; margin-top: 12px; }
.ov-stats-btn {
  flex: 1; padding: 7px 8px; font-size: 0.75rem; font-weight: 600;
  color: var(--gold); background: var(--gold-dim);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
}
.ov-stats-btn:active { transform: scale(.98); }
.ov-stats-btn:disabled { opacity: .5; cursor: default; }
.ov-stats-btn-warn { color: var(--amber); background: var(--amber-dim); }

/* 病历清单 / 交叉校验（复用 ov-stats 体系）
   2026-09-06 层级阶梯 L2：补齐面板感，与同级发票统计面板（--surface2+border+radius）完全同构 */
.ov-medical-stats {
  margin: 0 12px 12px; padding: 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
}
.ov-stats-row-pay { align-items: center; gap: 6px; }
.ov-pay-group { display: inline-flex; gap: 4px; }
.ov-pay-btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: var(--radius); padding: 2px 8px;
  font-size: 0.75rem; cursor: pointer;
}
.ov-pay-btn.active { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.ov-stats-row-cross { align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-badge-warn { background: var(--amber); color: var(--on-amber); font-weight: 600; }
.ov-badge-bad { background: var(--cinnabar); color: var(--on-cinnabar); font-weight: 600; }
.ov-stats-btn-mini { flex: 0 0 auto; font-size: 0.6875rem; padding: 2px 8px; }
.ov-stats-btn-done { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }

/* 缺料提示汇总块（L2 井）；待办项=浮起的白纸条（L4），已跟进=沉回井底（2026-09-06 层级阶梯） */
.ov-missing-checks { margin: 0 0 8px; padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 4px; }
.ov-missing-confirm .ov-mc-label { color: var(--amber); }
.ov-missing-exempted { opacity: .5; }
.ov-missing-exempted .ov-mc-label { text-decoration: line-through; }
.ov-missing-exempted { opacity: .6; }

/* ── 缺料提示两行卡片式（2026-08-30 重设计：上行信息/下行按钮，文字不再被按钮挤压）
   2026-09-06 层级阶梯：待办卡白纸条化（修掉 followed 态 surface2-on-surface2 同色 bug） ── */
.ov-missing-card {
  padding: 9px 10px; background: var(--surface); border-radius: var(--radius);
}
.ov-missing-card:last-child { border-bottom: none; }
.ov-missing-card.ov-missing-followed { background: transparent; }
.ov-mc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-mc-label { font-weight: 700; font-size: 0.9375rem; color: var(--text); }
.ov-mc-msg { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; line-height: 1.6; }
.ov-mc-actions {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
  margin-top: 8px;
}
.ov-mc-actions .ov-stats-btn-mini { font-size: 0.75rem; padding: 3px 10px; }
.ov-followup-date { margin-left: auto; font-size: 0.75rem; color: var(--emerald); white-space: nowrap; }
.ov-badge-done { background: var(--emerald); color: var(--on-emerald); }

/* 病历清单材料分类（急诊/诊断证明/复查/住院类完整度标记） */
.ov-stats-kinds { flex-wrap: wrap; gap: 4px 12px; }
.ov-kind-mark { font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.ov-kind-ok { color: var(--emerald); }
.ov-kind-miss { color: var(--muted); }

/* 病历清单分类标题（中性色带 + 右侧计数徽章，2026-08-21 统一中性色不再区分 6 色） */
.ov-kind-group { margin-top: 14px; }
.ov-kind-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 0.8125rem; font-weight: 700; color: var(--text);
  padding: 1px 0 7px 10px; margin-bottom: 2px;
  border-left: 2px solid var(--muted);
}
.ov-kind-label { min-width: 0; }
.ov-kind-count {
  flex-shrink: 0; font-size: 0.6875rem; font-weight: 600;
  padding: 1px 8px; border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
  background: var(--hover); color: var(--muted);
}

/* 案情备注 */
.ov-notes {
  width: 100%; min-height: 80px; padding: 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.875rem; background: var(--bg); color: var(--text);
  resize: vertical; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  line-height: 1.5; box-sizing: border-box;
}
.ov-notes:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

/* 编辑栏 */
.ov-edit-bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 6px; }
.ov-btn-edit {
  padding: 4px 10px; border: 1px solid var(--gold); background: var(--bg);
  color: var(--gold); border-radius: 5px; font-size: 0.75rem; cursor: pointer;
}
.ov-btn-edit:hover { background: var(--gold); color: var(--on-gold); }
.ov-btn-cancel {
  padding: 6px 16px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-sub); border-radius: 6px; font-size: 0.8125rem; cursor: pointer;
}
.ov-btn-cancel:hover { border-color: var(--gold); color: var(--gold); }

/* 保存按钮 */
.ov-actions { margin-top: 12px; text-align: right; }
.ov-btn-save {
  padding: 7px 22px; border: none; background: var(--gold);
  color: var(--on-gold); border-radius: 6px; font-size: 0.875rem; font-weight: 600; cursor: pointer;
}
.ov-btn-save:hover { opacity: .88; }

/* 只读模式：按钮和文本框不可交互 */
.ov-detail-inner.readonly .ov-toggle button,
.ov-detail-inner.readonly .ov-mat-status button {
  pointer-events: none; opacity: 0.65;
}
.ov-detail-inner.readonly .ov-notes {
  background: var(--hover); pointer-events: none; resize: none;
}
/* 手动标记结案 */
.ov-option-closed { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.ov-option-closed label { color: var(--gold); font-weight: 600; }
.ov-option-closed .ov-toggle button.active[data-val="1"] {
  background: var(--emerald-dim); color: var(--emerald); font-weight: 600;
}  /* 已结案=绿色 */
.ov-option-closed .ov-toggle button.active[data-val="0"] {
  background: var(--amber-dim); color: var(--amber); font-weight: 600;
}  /* 进行中=黄色 */

/* ── 顶部操作栏 ── */
.ov-top-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: var(--hover);
  border-radius: 10px 10px 0 0;
  margin-bottom: 2px;
}
.ov-top-bar-label { font-size: 0.75rem; color: var(--muted); }
.ov-top-bar-actions { display: flex; gap: 8px; align-items: center; }
.ov-top-bar-actions .ov-btn-edit,
.ov-top-bar-actions .ov-btn-cancel,
.ov-top-bar-actions .ov-btn-save { font-size: 0.75rem; }

/* ── 标签栏 ── */
.ov-tab-bar {
  display: flex; border-bottom: 2px solid var(--border); margin-bottom: 12px;
}
.ov-tab-btn {
  flex: 1; padding: 8px 6px; border: none; background: transparent;
  font-size: 0.8125rem; font-weight: 500; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  text-align: center; white-space: nowrap;
}
.ov-tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }

/* 编辑态切换 */
.ov-detail-inner.readonly .ov-btn-cancel { display: none; }
.ov-detail-inner.readonly .ov-btn-save { display: none; }
.ov-detail-inner:not(.readonly) .ov-btn-edit { display: none; }
.ov-tab-content { }

/* 案件详情表单 */
.case-section { margin-bottom: 10px; }
.case-section-title {
  font-size: 0.75rem; font-weight: 600; color: var(--gold); letter-spacing: 0.02em;
  padding-bottom: 4px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.case-field { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; padding: 1px 0; }
.case-label {
  font-size: 0.75rem; color: var(--muted); white-space: nowrap; min-width: fit-content;
}
.case-label::after { content: "："; }
/* 纯文本值（替代旧的 input/textarea 只读模式） */
.case-value {
  font-size: 0.8125rem; color: var(--text); line-height: 1.5;
  word-break: break-all; flex: 1; min-width: 0;
}
.case-value .case-empty { color: var(--muted); font-style: italic; }
/* 字段为空但有提示说明（如"手写认定书识别困难，请查看原件"） */
.case-value .case-hint {
  color: var(--amber);
  font-size: 0.75rem;
  background: var(--amber-dim);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  line-height: 1.4;
}
/* 案件详情最下方的结案提示条 */
.case-hint-note {
  font-size: 0.8125rem;
  color: var(--amber);
  background: var(--amber-dim);
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
}
/* 案情备注 textarea：只读=纯文本，编辑=输入框 */
.case-textarea {
  font-family: inherit;
}
.case-textarea[readonly] {
  background: transparent; border: none; padding: 0;
  font-size: 0.8125rem; color: var(--text); line-height: 1.5;
  resize: none; width: 100%; box-sizing: border-box;
  overflow: visible; white-space: pre-wrap; min-height: auto;
}
.case-textarea:not([readonly]) {
  width: 100%; box-sizing: border-box; padding: 7px 10px;
  border: 1px solid var(--gold); border-radius: 6px; font-size: 0.875rem;
  background: var(--bg); color: var(--text); outline: none;
  resize: vertical; min-height: 80px;
}
/* 可编辑输入框（如「理赔人员及电话」）：只读=纯文本，编辑=输入框 */
.case-input {
  font-family: inherit;
}
.case-input[readonly] {
  background: transparent; border: none; padding: 0;
  font-size: 0.8125rem; color: var(--text); line-height: 1.5;
  width: 100%; box-sizing: border-box;
}
.case-input:not([readonly]) {
  width: 100%; box-sizing: border-box; padding: 6px 10px;
  border: 1px solid var(--gold); border-radius: 6px; font-size: 0.875rem;
  background: var(--bg); color: var(--text); outline: none;
}
.case-input::placeholder { color: var(--muted); font-style: italic; }
.case-input:not([readonly]):focus,
.case-textarea:not([readonly]):focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim);
}

/* 逐项编辑：可编辑字段 + 同行保存按钮 */
.case-field.case-field-edit { align-items: center; }
.case-field-edit .case-input { flex: 1; min-width: 0; width: auto; }
.case-field-edit-block { display: flex; align-items: flex-start; gap: 6px; }
.case-field-edit-block .case-textarea { flex: 1; min-width: 0; width: auto; }
.ov-inline-save {
  flex-shrink: 0; padding: 3px 12px; font-size: 0.75rem; font-weight: 600;
  color: var(--on-gold); background: var(--gold); border: none; border-radius: 5px; cursor: pointer;
  white-space: nowrap;
}
.ov-inline-save:active { transform: scale(.97); }

/* 材料清单标题右侧编辑按钮 */
.ov-section-title-bar { display: flex; align-items: center; justify-content: space-between; }
.ov-section-actions { display: flex; gap: 6px; align-items: center; }
.ov-mini-btn {
  padding: 2px 10px; font-size: 0.6875rem; font-weight: 600;
  border-radius: 5px; cursor: pointer; white-space: nowrap;
}
.ov-mini-btn-edit { color: var(--gold); background: var(--bg); border: 1px solid var(--gold); }
.ov-mini-btn-save { color: var(--on-gold); background: var(--gold); border: 1px solid var(--gold); }
.ov-mini-btn:active { transform: scale(.96); }

/* 移动端适配 */
@media (max-width: 480px) {
  .year-header { font-size: 0.8125rem; padding: 8px 10px; }
  .ov-card-simple { font-size: 0.75rem; }
  .ov-card-simple .ov-summary { padding: 4px 8px; }
  .ov-summary { padding: 8px 10px; }
  .ov-client { font-size: 0.8125rem; }
  .ov-status-text { max-width: 46vw; min-width: 0; font-size: 0.75rem; }
  .ov-option label { font-size: 0.75rem; }
  .ov-toggle button { padding: 4px 12px; font-size: 0.75rem; min-height: 44px; }
  .ov-mat-label { font-size: 0.75rem; }
  .ov-mat-status button { padding: 0 10px; font-size: 0.6875rem; min-height: 36px; }
  .ov-notes { font-size: 0.8125rem; min-height: 60px; }
  /* 手机端字段垂直排列 + 字号放大（详情字段可读） */
  .case-field { flex-direction: column; gap: 1px; margin-bottom: 4px; }
  /* 可编辑字段在移动端保持横向：保存按钮在同行右侧 */
  .case-field.case-field-edit { flex-direction: row; align-items: center; }
  .case-field.case-field-edit .case-label { flex-shrink: 0; }
  .case-label { font-size: 0.8125rem; }
  .case-value { font-size: 0.9375rem; }
  /* 触控目标 ≥44px（移动端高频点击） */
  .ov-tab-btn { min-height: 44px; }
  .ov-btn-edit, .ov-btn-cancel, .ov-btn-save, .ov-btn-secondary { min-height: 44px; }
  .ov-mat-expand { min-height: 44px; padding: 6px 14px; }
  /* 触控目标 ≥44px：待补/缺料行内小按钮、刷新按钮（移动端高频点击） */
  .ov-mini-btn, .ov-stats-btn-mini { min-height: 44px; min-width: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; }
  .ov-mat-status button { min-height: 44px; }
  .refresh-btn { width: 44px; height: 44px; line-height: 44px; }
  .search-bar { flex-wrap: wrap; }
  .search-bar .layout-toggle button, .search-bar .collapse-toggle { width: 44px; height: 44px; line-height: 44px; }
  .search-bar .staff-filter { height: 44px; }
}

/* ── 复查跟踪标签 ── */
.review-context {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0 4px;
}
.review-ctx-item {
  font-size: var(--text-base);
  color: var(--text-dim);
}
.review-ctx-item strong {
  color: var(--text);
  font-weight: 600;
}

/* 出院后复查情况：登记编辑器与提示语各占一整行（2026-09-05 重排，不再与状态行横排交错） */
.manual-review-editor {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.manual-review-editor .next-review-input { flex: 0 1 220px; }
/* review-hint 为 section 直下块级元素，天然占整行（原 flex-basis 规则随结构重组失效已删） */

/* 2026-09-05 评审清理：.review-node-* 整族与 .review-empty-hint 已无对应 DOM（旧节点编辑器残骸），删除 */

.review-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-sub);
  font-size: var(--text-base);
}

/* 复查跟踪：住院期间列表 */
.review-hospital-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.review-hospital-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.review-hop-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.review-hop-date {
  /* 2026-09-05 评审：11px（--text-sm）是 detector tiny-text ×7 实锤的正文级小字，升 13px */
  font-size: var(--text-base);
  color: var(--text-dim);
}
.review-hop-days {
  color: var(--gold);
  font-weight: 500;
}

/* 复查跟踪：下次复查时间编辑（2026-09-05 重排：日期框+保存按钮同行，说明/快捷按钮跨全行） */
.next-review-editor {
  display: grid;
  /* 第二列 1fr：note/quick 跨两列时按全宽算，快捷按钮可正常 wrap（max-content 轨道会被撑爆溢出） */
  grid-template-columns: max-content 1fr;
  grid-template-areas:
    "input  actions"
    "note   note"
    "quick  quick";
  align-items: center;
  gap: 8px 12px;
  padding: 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.next-review-editor .next-review-input { grid-area: input; width: 220px; }  /* 固定宽：与「出院后复查情况」的日期框等宽对齐 */
.next-review-editor .review-anchor-note { grid-area: note; }
.next-review-editor .next-review-quick { grid-area: quick; }
.next-review-editor .next-review-actions { grid-area: actions; }
.next-review-input {
  width: 100%;
  max-width: 220px;
  font-size: var(--text-base);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.next-review-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.review-quick-btn {
  font-size: var(--text-base);  /* 2026-09-05 评审：11px 太小且是高频控件，升 13px */
  padding: 6px 12px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.review-quick-btn:hover {
  background: var(--gold);
  color: var(--on-gold);
}
.review-quick-btn:disabled {
  /* 过期快捷按钮（2026-09-05）：目标日期在过去，禁用防一键产出过期标记 */
  background: var(--surface2);
  color: var(--text-sub);
  cursor: not-allowed;
  opacity: .7;
}
.next-review-actions {
  padding-top: 2px;
}
.next-review-actions .ov-btn-save {
  font-size: var(--text-sm);
  padding: 6px 14px;
}

/* ── 下次复查 hero（2026-09-05 评审新增）：标记日期升为主展示，编辑表单退为第二态 ──
   衬线大日期呼应「已标记的复查时间」时代的案卷气质（rfs-main 的延续），
   chip 语义色与日历 badge 对齐：逾期朱红 / 7 天内琥珀 / 更远不配 chip */
.ov-btn-secondary {
  font-size: var(--text-sm);
  padding: 6px 14px;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ov-btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.ov-btn-secondary:disabled { opacity: .6; cursor: wait; }
.review-btn-postpone { color: var(--cinnabar); border-color: var(--cinnabar-dim); }
.review-btn-postpone:hover { border-color: var(--cinnabar); background: var(--cinnabar-dim); color: var(--cinnabar); }
.review-hero {
  margin-top: 8px; padding: 12px 14px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
}
.review-hero-main {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.review-hero-date {
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "SimSun", serif;
  font-weight: 700; font-size: 1.375rem; color: var(--text); letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.review-chip {
  font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  white-space: nowrap;
}
.review-chip.overdue { background: var(--cinnabar-dim); color: var(--cinnabar); }
.review-chip.soon { background: var(--amber-dim); color: var(--amber); }
.review-hero-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 保存按钮 in-flight 态（2026-09-05 评审：防双击双 POST） */
.ov-btn-save:disabled { opacity: .6; cursor: wait; }

/* 「+ 登记一次已复查」渐进披露入口（2026-09-05 评审：手动登记降级为次级路径） */
.manual-review-toggle { margin-top: 8px; }

/* 住院期间基础 meta（2026-09-05 评审：原「复查基准」section 降级并入） */
.review-base-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: var(--text-base); color: var(--text-dim);
  padding: 2px 0 8px;
}

/* 桌面限宽（2026-09-05 评审）：1440+ 下 220px 输入框孤悬约 1900px 空盒左上角，收束构图 */
@media (min-width: 901px) {
  .ov-tab-review { max-width: 860px; margin: 0 auto; }
}

/* case-select 输入框 */
.case-select {
  width: 100%;
  font-size: var(--text-base);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.case-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); outline: none; }

[data-theme="dark"] .case-select {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* ── 减动 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── 案件总览 · 待补材料面板（2026-08-20 新增；2026-08-21 待补材料独立为主标签）── */
#panelOverview, #panelMissing { padding-top: 10px; }
.ov-missing-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 16px; flex-wrap: wrap; }
.ov-miss-filter { padding: 5px 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.8125rem; }
.ov-miss-stat { font-size: 0.8125rem; color: var(--muted); margin-left: auto; }
.ov-miss-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ov-miss-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); color: var(--muted); font-weight: 600; white-space: nowrap; }
.ov-miss-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ov-miss-table tbody tr { cursor: pointer; }
.ov-miss-table tbody tr:hover { background: var(--hover); }
.ov-miss-client { font-weight: 600; white-space: nowrap; }
.ov-miss-staff { white-space: nowrap; color: var(--muted); }
.ov-miss-tags { line-height: 1.9; }
.ov-miss-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.75rem; margin-right: 5px; white-space: nowrap; }
.ov-miss-tag.red { background: var(--miss-red-bg); color: var(--miss-red-fg); border: 1px solid var(--miss-red-border); }
.ov-miss-tag.yellow { background: var(--miss-yellow-bg); color: var(--miss-yellow-fg); border: 1px solid var(--miss-yellow-border); }
.ov-miss-closed { opacity: .55; }
.ov-miss-closed .ov-miss-tag { filter: saturate(.5); }
.ov-miss-none { color: var(--muted); }
.ov-tag-active { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.75rem; background: var(--miss-green-bg); color: var(--miss-green-fg); white-space: nowrap; }

/* 待补材料：紧凑卡片网格（每当事人一张小卡，总览扫视） */
.ov-miss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.ov-miss-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease;
}
.ov-miss-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--gold); }
.ov-miss-grid-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.ov-miss-grid-tags { display: flex; flex-wrap: wrap; gap: 4px; line-height: 1.7; }
.ov-miss-grid-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.6875rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 5px; margin-top: 2px;
}
/* 待补卡就地展开：横跨整行，内部展示材料跟踪详情 */
.ov-miss-card.ov-miss-expanded { grid-column: 1 / -1; }
.ov-miss-detail { margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 8px; min-width: 0; }
.ov-miss-detail .ov-detail-inner { width: 100%; min-width: 0; }

/* ═══════════════════════════════════════════════════════════
   材料与复查：顶部统计条 + 需复查区块（方案A 升级 2026-08-27）
   ═══════════════════════════════════════════════════════════ */
.ov-mr-overview {
  display: flex; gap: 10px; padding: 6px 16px 0;
}
.ov-mr-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; box-shadow: var(--shadow-sm); min-width: 0;
}
.ov-mr-num { font-size: 1.375rem; font-weight: 700; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
#ovMrReviewStat .ov-mr-num { color: var(--miss-red-fg); }
#ovMrOverdueStat .ov-mr-num { color: var(--miss-red-fg); }
.ov-mr-label { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
/* 统计卡可点击过滤（2026-08-30）：active 金边金底，与 dashboard stat-card.active 一致 */
.ov-mr-stat { cursor: pointer; user-select: none; }
.ov-mr-stat:hover { border-color: var(--gold); }
.ov-mr-stat.active { border-color: var(--gold); background: var(--gold-dim); box-shadow: 0 1px 4px var(--gold-glow); }
.ov-mr-stat.active .ov-mr-num, .ov-mr-stat.active .ov-mr-label { color: var(--gold); }
.ov-mr-stat:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 需复查区块（缺料网格上方） */
/* （2026-08-30 已清理：需复查单行卡清单移除，统一进缺料网格——展开横跨由 .ov-miss-expanded 承担） */

/* ═══════════════════════════════════════════════════════════
   开庭紧迫度 · 加载重试 · 刷新按钮（2026-08-21 新增）
   ═══════════════════════════════════════════════════════════ */

/* ── 开庭紧迫度 badge（卡片独立强调行，第一视觉） ── */
.trial-badge {
  display: inline-block; font-size: 0.8125rem; font-weight: 700;
  padding: 2px 11px; border-radius: 999px; line-height: 1.65;
  white-space: nowrap;
}
.trial-badge.critical { background: var(--miss-red-fg); color: var(--on-miss-red); border: 1px solid var(--miss-red-fg); }
.trial-badge.soon    { background: var(--miss-yellow-bg); color: var(--miss-yellow-fg); border: 1px solid var(--miss-yellow-border); }
.trial-badge.normal  { background: var(--blue-dim); color: var(--blue); border: 1px solid transparent; }
.trial-badge.past    { background: var(--surface2); color: var(--text-sub); border: 1px solid var(--border); }
.trial-badge.uncertain { background: var(--surface2); color: var(--text-sub); border: 1px dashed var(--border); font-weight: 600; }
[data-theme="dark"] .trial-badge.critical { background: var(--miss-red-fg); color: var(--miss-red-bg); border-color: var(--miss-red-border); }

/* ── 复查紧迫度 badge（2026-08-29 与开庭同级）：逾期朱红 / 临近琥珀 ── */
.review-badge {
  display: inline-block; font-size: 0.8125rem; font-weight: 700;
  padding: 2px 11px; border-radius: 999px; line-height: 1.65;
  white-space: nowrap;
}
.review-badge.overdue { background: var(--cinnabar-dim); color: var(--cinnabar); border: 1px solid var(--cinnabar); }
.review-badge.soon    { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber); }
[data-theme="dark"] .review-badge.overdue { color: var(--cinnabar); background: var(--cinnabar-dim); }
[data-theme="dark"] .review-badge.soon    { color: var(--amber); background: var(--amber-dim); }
.card .title .review-badge { font-size: 0.75rem; padding: 1px 9px; line-height: 1.5; }
.results.layout-grid .card .title .review-badge { font-size: 0.625rem; padding: 0 7px; }

/* ── 开庭紧迫度摘要条（案件面板顶部：「今日 / 7 天内 / 30 天内」） ── */
.trial-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 6px 16px 8px; font-size: 0.75rem; color: var(--text-sub);
}
.trial-summary .ts-label { font-weight: 600; color: var(--gold); margin-right: 2px; }
.trial-summary .ts-item {
  padding: 2px 10px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--surface2); border: 1px solid var(--border);
  transition: all .15s ease;
}
.trial-summary .ts-item:hover { border-color: var(--gold); color: var(--gold); }
.trial-summary .ts-item.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); font-weight: 600; }
.trial-summary .ts-item b { font-weight: 700; }
.trial-summary .ts-clear { margin-left: auto; color: var(--cinnabar); cursor: pointer; }
.trial-summary .ts-clear:hover { text-decoration: underline; }
/* 本周待办段（2026-08-29）：分隔线 + 复查/缺料 pill 语义色 */
.trial-summary .ts-divider { width: 1px; height: 14px; background: var(--border); margin: 0 4px; }
.trial-summary .ts-item.ts-item-review:hover,
.trial-summary .ts-item.ts-item-review.active { border-color: var(--amber); color: var(--amber); }
.trial-summary .ts-item.ts-item-review.active { background: var(--amber-dim); }
.trial-summary .ts-item.ts-item-overdue { color: var(--cinnabar); border-color: var(--cinnabar-dim); }
.trial-summary .ts-item.ts-item-overdue:hover,
.trial-summary .ts-item.ts-item-overdue.active { border-color: var(--cinnabar); background: var(--cinnabar-dim); }

/* ── 复查提示语（2026-09-05 评审改造：原 rfs-hint/rfs-* 随「已标记的复查时间」块退役，
   提示语类改名 review-hint。衬线日期仪式感由 .review-hero-date 延续；
   中文仿斜体是合成斜体排版瑕疵且锚点注记承载关键语义，去斜体、升 13px） ── */
.review-hint, .review-anchor-note {
  margin-top: 4px; font-size: 0.8125rem; color: var(--muted);
  line-height: 1.5;
}
.review-anchor-note { margin: 4px 0 6px; }

/* ── 缺料催办（2026-08-29）：已催办行降调 + 催办日期 + 话术按钮 ── */
.ov-missing-card.ov-missing-followed .ov-mc-label { color: var(--text-sub); }
.ov-missing-card.ov-missing-followed .ov-badge-bad { background: var(--surface2); color: var(--text-sub); }
.ov-followup-date { font-size: 0.75rem; color: var(--emerald); white-space: nowrap; }
.ov-stats-btn.ov-btn-followed { color: var(--text-sub); }

/* ── 加载失败（可点击重试） ── */
.load-error {
  text-align: center; padding: 48px 20px; color: var(--cinnabar);
  font-size: 0.8125rem; cursor: pointer; user-select: none;
}
.load-error:hover { color: var(--gold); }

/* ── 总览面板工具栏（刷新入口，右对齐） ── */
.ov-toolbar { display: flex; justify-content: flex-end; align-items: center; padding: 4px 16px 6px; }

/* ── 刷新按钮（各面板统计栏 / 工具栏） ── */
.refresh-btn {
  width: 26px; height: 26px; padding: 0; margin-left: 4px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text-dim); cursor: pointer;
  font-size: 0.8125rem; line-height: 24px; text-align: center;
  transition: all .2s ease;
}
.refresh-btn:hover { background: var(--gold-dim); color: var(--gold); border-color: var(--gold); }
.refresh-btn:active { transform: scale(.9); }

/* ── 复查日历视图（2026-08-30 纯手动登记统筹） ── */
.calendar-group-title {
  padding: 10px 16px 4px; font-size: 0.8125rem; font-weight: 700; color: var(--text-dim);
}
.calendar-group-title b { color: var(--gold); }

/* 月历格子（2026-08-30 复查日历） */
.cal-nav {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 2px 10px; font-size: 0.9375rem;
}
.cal-nav-btn {
  padding: 4px 12px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--surface2); border: 1px solid var(--border); font-size: 0.75rem;
}
.cal-nav-btn:hover { border-color: var(--gold); color: var(--gold); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 14px;
}
.cal-dow {
  text-align: center; font-size: 0.6875rem; font-weight: 600; color: var(--muted);
  padding: 4px 0;
}
.cal-cell {
  min-height: 64px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 5px; overflow: hidden;
}
.cal-cell.empty { background: var(--bg); border-color: transparent; visibility: hidden; }
.cal-cell.today { border-color: var(--gold); border-width: 1.5px; }
.cal-cell.has-mark { background: var(--gold-dim); border-color: var(--gold); }
.cal-day { font-size: 0.75rem; font-weight: 600; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-day { color: var(--gold); }
.cal-person {
  font-size: 0.6875rem; color: var(--text); background: var(--amber-dim); color: var(--amber);
  border-radius: 4px; padding: 0 4px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-person.more { background: transparent; color: var(--text-sub); }
[data-theme="dark"] .cal-cell.has-mark { background: var(--amber-dim); }
[data-theme="dark"] .cal-person { background: rgba(212,168,90,.18); color: var(--amber); }
.calendar-back {
  margin-left: 12px; font-size: 0.75rem; font-weight: 400; color: var(--blue);
  cursor: pointer; user-select: none;
}
.calendar-back:hover { text-decoration: underline; }

/* ── 复查日历行式清单（2026-08-30 极简版：按月分组） ── */
.cal-wrap { padding: 8px 16px 16px; }
.cal-head {
  font-size: 0.9375rem; font-weight: 700; color: var(--text);
  padding: 4px 0 10px; display: flex; align-items: center;
}
.cal-month {
  font-size: 0.8125rem; font-weight: 700; color: var(--gold);
  padding: 10px 0 6px; border-bottom: 1px solid var(--border);
}
.cal-rows { display: flex; flex-direction: column; }
.cal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 4px; border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.cal-row:last-child { border-bottom: none; }
.cal-client { font-weight: 600; min-width: 6em; }
.cal-staff { color: var(--muted); font-size: 0.8125rem; }
.cal-count { margin-left: auto; color: var(--text-sub); font-size: 0.8125rem; }

/* ── 立案跟踪面板（2026-09-02 卡片重构：紧凑双行 + 左色条 + 天数严重度色阶）── */
.ft-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px 2px; max-width: 1400px; margin: 0 auto;
}
.ft-stats .stat-card { flex: 1 1 150px; min-width: 140px; cursor: pointer; }

/* 卡片主体：紧凑双行；左色条按主类别着色（一眼识别问题类型） */
.ft-item { position: relative; padding: 10px 14px 10px 18px; }
.ft-item::before {
  content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px;
  width: 3px; border-radius: 2px; background: var(--border);
}
.ft-k-payment_unchecked::before { background: var(--cinnabar); }
.ft-k-notify_mediation::before  { background: var(--blue); }
.ft-k-overdue::before           { background: var(--amber); }
.ft-k-stalled::before           { background: var(--muted); opacity: .55; }
.ft-item.ft-done::before { background: var(--border); }

.ft-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ft-client {
  font-weight: 700; font-size: 1rem; color: var(--text);
  cursor: pointer; border-bottom: 1px dashed transparent; line-height: 1.4;
}
.ft-client:hover { color: var(--gold); border-bottom-color: var(--gold); }
.ft-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.ft-badge-pay   { background: var(--cinnabar-dim); color: var(--cinnabar); }
.ft-badge-med   { background: var(--blue-dim);     color: var(--blue); }
.ft-badge-over  { background: var(--amber-dim);    color: var(--amber); }
.ft-badge-stall { background: var(--hover);        color: var(--muted); }
.ft-meta { margin-left: auto; color: var(--text-dim); font-size: 0.75rem; }

/* 内容行：说明 + 按钮同行两端对齐（卡高砍半） */
.ft-row { margin-top: 5px; display: flex; align-items: center; gap: 12px; }
.ft-labels { flex: 1; display: grid; gap: 3px; min-width: 0; }
.ft-label { color: var(--text-sub); font-size: 0.875rem; line-height: 1.5; }
.ft-label .ft-days { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ft-label .ft-days-hot  { color: var(--cinnabar); }
.ft-label .ft-days-warm { color: var(--amber); }
[data-theme="dark"] .ft-label .ft-days-hot  { color: #E07B6D; }
[data-theme="dark"] .ft-label .ft-days-warm { color: #D9A45B; }

/* 动作按钮：金 dim 底主按钮，hover 金实底（主要动作不再像次要操作） */
.ft-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.ft-actions .ft-btn {
  margin: 0; padding: 8px 14px; min-height: 40px;
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 8px; cursor: pointer; transition: background .12s, color .12s;
}
.ft-actions .ft-btn:hover { background: var(--gold); color: var(--on-gold); }
.ft-actions .ft-btn:active { transform: scale(.97); }
.ft-actions .ft-marked { opacity: .62; border-style: dashed; background: var(--surface2); color: var(--text-sub); }
[data-theme="dark"] .ft-actions .ft-btn {
  color: #E3B96D; background: rgba(227,185,109,.10);
  border-color: rgba(227,185,109,.38);
}
[data-theme="dark"] .ft-actions .ft-btn:hover { color: #1A1A1D; }
[data-theme="dark"] .ft-actions .ft-marked { opacity: .55; }
@media (pointer: coarse) { .ft-actions .ft-btn { min-height: 44px; } }

/* 已处理沉底：整体淡化（左色条同步变灰） */
.ft-item.ft-done { opacity: .68; }
[data-theme="dark"] .ft-item.ft-done { opacity: .55; }
.ft-badge-off { opacity: .55; text-decoration: line-through; }

/* 立案跟踪：类别提示条（点统计卡过滤时显示该类收录条件，2026-09-01） */
.ft-tip {
  max-width: 1400px; margin: 2px auto 0; padding: 6px 16px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 0.8125rem; color: var(--text-sub); line-height: 1.6;
}
.ft-tip .ov-badge { flex: none; font-size: 0.6875rem; }

/* 立案跟踪：已处理沉底（2026-09-01） */
.ft-sep { margin: 14px 0 8px; padding: 6px 12px; font-size: 0.8125rem; color: var(--text-dim); border-top: 1px dashed var(--border); }
.ft-item.ft-done { opacity: .68; }
[data-theme="dark"] .ft-item.ft-done { opacity: .55; }
.ft-badge-off { opacity: .55; text-decoration: line-through; }

/* 立案跟踪：卡片网格模式（2026-09-02，仿诉讼案件 grid；☰/⊞ 切换，偏好存 localStorage） */
.ft-layout-toggle { display: inline-flex; gap: 2px; margin-left: 8px; vertical-align: middle; }
.ft-layout-toggle button {
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.9375rem; cursor: pointer; line-height: 30px; text-align: center;
  background: var(--bg); color: var(--text-dim);
  transition: all .2s ease;
}
.ft-layout-toggle button:hover { background: var(--gold-dim); color: var(--gold); }
.ft-layout-toggle button.active { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }

#filingResults.ft-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px; align-items: stretch;
}
#filingResults.ft-grid > .empty, #filingResults.ft-grid > .loading,
#filingResults.ft-grid > .load-error { grid-column: 1 / -1; }
#filingResults.ft-grid .card { height: 100%; display: flex; }
#filingResults.ft-grid .ft-item { flex: 1; display: flex; flex-direction: column; }
#filingResults.ft-grid .ft-row { flex-direction: column; align-items: stretch; gap: 8px; }
#filingResults.ft-grid .ft-actions { justify-content: flex-end; }
#filingResults.ft-grid .ft-meta { margin-left: 0; flex-basis: 100%; order: 9; line-height: 1.5; }

/* ── 手机端详情排版优化（2026-09-03）：短字段两列网格，减少竖向滚动 ── */
@media (max-width: 600px) {
  /* 诉讼案件详情字段：label 在上 value 在下的两列格子 */
  .card .fields, .field-group .fields {
    grid-template-columns: 1fr 1fr; gap: 4px 14px;
  }
  .card .fields .f { flex-direction: column; align-items: flex-start; gap: 0; }
  .card .fields .f .label { white-space: normal; }

  /* 总览详情/肇事方字段：两列网格（标题、可编辑字段、复查块跨全行） */
  .case-section { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; }
  .case-section > .case-section-title { grid-column: 1 / -1; }
  .case-section > .case-field-edit,
  .case-section > .review-context,
  .case-section > .review-hospital-list,
  .case-section > .review-empty { grid-column: 1 / -1; }

  /* 住院医院词条：两列网格（原单列竖排一长条） */
  .review-hospital-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .review-hospital-item { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; }

  /* 复查跟踪 tab 整体退出两列网格（2026-09-05）：编辑器/状态块是整行内容，
     不是短字段——留在网格里会被撕成左右两半（用户反馈「左边一个右边一个」）。
     恢复自然块级纵向流，住院词条列表的两列网格单独保留。 */
  .ov-tab-review .case-section { display: block; }

  /* 复查跟踪触控/输入工学（2026-09-05 评审 P1）：
     快捷按钮是批量核对的核心控件，实高超 44px 铁律；
     日期框 13px 在 iPhone 聚焦会触发视口自动放大（iOS 对 <16px 输入框强制缩放） */
  .review-quick-btn { min-height: 44px; }
  .ov-tab-review .next-review-input { font-size: 16px; }
}

/* ── 手机详情字段：词条与内容强区分（2026-09-03）── */
@media (max-width: 600px) {
  /* 词条（label）：小号浅灰说明文字 */
  .card .fields .f .label,
  .case-section .case-label {
    font-size: 0.6875rem; color: var(--text-dim); font-weight: 400;
    letter-spacing: 0.02em;
  }
  .case-section .case-label::after { content: ""; }  /* 上下结构下冒号冗余，去掉 */
  /* 内容（value）：提大加重，成为视觉主体 */
  .card .fields .f .value,
  .case-section .case-value {
    font-size: 0.9375rem; font-weight: 600; color: var(--text); line-height: 1.45;
  }
  /* 空值占位与提示不加重（它们不是内容） */
  .card .fields .f .value .case-empty,
  .case-section .case-value .case-empty { font-weight: 400; font-size: 0.8125rem; }
  .case-section .case-value .case-hint { font-weight: 400; font-size: 0.75rem; }
  .card .fields .f .value .case-hint { font-weight: 400; font-size: 0.75rem; }
}

/* 病历清单原图入口（2026-09-03） */
.ov-stats-view-btn { margin-left: auto; flex-shrink: 0; font-size: 0.6875rem; padding: 3px 8px; }

/* 「▸ 看病历」深定位金边脉冲（2026-09-06）：滚到缺料处后短暂高亮帮业务员锁定位置 */
@keyframes ovDeepLocate {
  0%, 55% { box-shadow: 0 0 0 3px var(--gold-glow); }
  100%    { box-shadow: 0 0 0 3px transparent; }
}
.ov-deep-locate { animation: ovDeepLocate 1.9s ease forwards; border-radius: var(--radius); }
.ov-stats-stay-head .ov-badge { flex-shrink: 0; }
.ov-stats-missing {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 6px;
  background: var(--cinnabar-dim); border-radius: var(--radius);
}
.ov-stats-missing-sub { font-size: 0.75rem; color: var(--text-dim); }

/* 住院次容器：纵向块（2026-09-03 重构补充，防止多条记录横向挤压成竖字）。
   分组靠灰底 + 标题加粗区分，不用侧边粗色条（AI 风格侧标，且蓝色突兀于金色体系）。
   2026-09-06 层级阶梯 L3：--surface3 深井（病历清单面板内再深一档） */
.ov-stats-stay {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; margin: 6px 0;
  background: var(--surface3); border-radius: var(--radius);
}
.ov-stats-stay-head { flex-wrap: wrap; gap: 8px; align-items: baseline; }
.ov-stats-stay-head .ov-stats-inst { font-weight: 700; font-size: 0.875rem; color: var(--text); }
/* 深井上 --muted 暗色值对比不足，升半档（2026-09-06） */
.ov-stats-stay-head .ov-stats-date, .ov-stats-stay-head .ov-stats-count { color: var(--text-dim); }
.ov-stats-stay .ov-stats-row-sub { flex-wrap: wrap; gap: 6px; align-items: center; }
.ov-stats-sub-list { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.ov-stats-stay > .ov-stats-row { border-bottom: none; }  /* 井内靠 gap 与白卡分隔，发丝线在深井上不可见（2026-09-06） */

/* ── 层级阶梯 L4（2026-09-06）：展开明细=浮在深井上的白纸条，移动端 600px 既有表现升为全端。
   收起态的三件套标记行（.ov-stats-row-sub.ov-stats-kinds）不在 sub-list 内，自动保持透明 ── */
.ov-stats-sub-list .ov-stats-row-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; margin: 0 0 6px;
}
.ov-stats-sub-list .ov-stats-row-sub:last-child { margin-bottom: 0; }

/* 手机端住院记录行重排（2026-09-03）：医院名独占一行，杜绝竖排一字行 */
@media (max-width: 600px) {
  .ov-stats-stay .ov-stats-row-sub .ov-stats-inst {
    order: -1; flex-basis: 100%;
    font-weight: 600; font-size: 0.875rem; color: var(--text); white-space: normal;
  }
  .ov-stats-stay .ov-stats-row-sub .ov-stats-view-btn { margin-left: auto; }
}

/* 手机端住院材料条目卡片化（2026-09-03 用户反馈医院名竖排）：背景/描边/圆角已上移为全端 L4，此处仅留布局 */
@media (max-width: 600px) {
  .ov-stats-sub-list .ov-stats-row-sub {
    position: relative;
    padding: 8px 74px 8px 10px;
  }
  .ov-stats-sub-list .ov-stats-inst {
    order: -1; flex-basis: 100%;
    font-weight: 700; font-size: 0.9375rem;
    color: var(--text); white-space: normal; line-height: 1.4;
  }
  .ov-stats-sub-list .ov-stats-view-btn {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%); margin: 0;
  }
}

/* 手机端住院次头部上下堆叠（2026-09-03 用户反馈：横排一行太挤、日期没上下排） */
@media (max-width: 600px) {
  .ov-stats-stay-head {
    display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: baseline;
  }
  .ov-stats-stay-head .ov-stats-inst {
    font-weight: 700; font-size: 0.9375rem; color: var(--text);
  }
  .ov-stats-stay-head .ov-stats-date {
    order: 3; flex-basis: 100%;
    color: var(--text-sub); font-size: 0.8125rem;
  }
  .ov-stats-stay-head .ov-stats-amt { order: 4; color: var(--text-sub); }
  .ov-stats-stay-head .ov-stats-count { order: 5; color: var(--text-sub); }
}

/* 台账更新时间：与各面板计数行并列（2026-09-04 用户要求，替换被统计卡挡住的仪表板标签） */
.ledger-fresh { font-size: 0.75rem; color: var(--text-dim); margin-left: 10px; }
@media (max-width: 480px) { .ledger-fresh { font-size: 0.6875rem; margin-left: 6px; } }

/* ── polish/layout 收尾（2026-09-04 评审落地）── */
/* 空态变体：无缺料用 ✅，不与默认 🔍 重复 */
.empty.empty-ok::before { content: "✅"; opacity: .8; }
/* 立案跟踪占位当事人名降权（"待确认串档"等工作占位） */
.ft-client.ft-client-ph { color: var(--text-dim); font-weight: 600; }
/* 总览详情固定身份条（2026-09-04 bug 修复版）：滚动出摘要行后才浮现，挂 body 直下 */
.ov-fixed-identity {
  position: fixed; top: var(--topbar-h, 0px); left: 0; right: 0; z-index: 9;
  display: none; align-items: baseline; gap: 8px;
  padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.ov-fixed-identity.show { display: flex; }
.ov-fixed-name { font-weight: 700; font-size: 0.9375rem; color: var(--text); }
.ov-fixed-meta { font-size: 0.75rem; color: var(--text-dim); }
.ov-fixed-close {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 0.75rem; color: var(--gold); padding: 2px 4px;
}

/* 住院次折叠（2026-09-04）：头部可点、明细默认隐藏。
   按钮 2026-09-05 统一：与材料清单发票/病历材料的展开按钮（.ov-mat-expand）同款实心蓝胶囊。
   旧「描边方块 + rotate(90deg)」段已删——rotate 对文字按钮会把「收起」二字转歪 90 度。 */
.ov-stats-stay-head { cursor: pointer; position: relative; }
.ov-stats-stay-head:hover .ov-stats-inst { color: var(--gold); }
.ov-stay-arrow {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--blue); color: var(--on-blue);
  border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600;
  line-height: 1; padding: 5px 12px;
  transition: background .15s ease, color .15s ease;
}
.ov-stats-stay-head:hover .ov-stay-arrow { background: var(--blue-dim); color: var(--blue); }
@media (max-width: 600px) {
  .ov-stay-arrow { right: 10px; }
  .ov-stats-stay-head { padding-right: 78px; }
}
