@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');
/* ═══════════════════════════════════════════
   Design System — Legal SaaS Console
   Base: #0a0e17 | Surface: #131a2b | Card: #192033
   Accent: #2563eb (Blue) — legal trust & authority
   ═══════════════════════════════════════════ */
:root {
  --bg-root:    #0a0e17;
  --bg-card:    #131a2b;
  --bg-input:   #0d1321;
  --bg-hover:   #1a2340;
  --bg-elevated:#192033;
  --border:     #1e2d45;
  --border-focus: #2563eb;
  --text-bright:#e8edf5;
  --text:       #cdd6f4;
  --text-dim:   #6b7d99;
  --text-muted: #3a4a60;
  --accent:     #2563eb;
  --accent-glow: rgba(37,99,235,.25);
  --accent-dim:  rgba(37,99,235,.10);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,.12);
  --green:      #10b981;
  --green-dim:  rgba(16,185,129,.12);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,.12);
  --orange:     #f59e0b;
  --orange-dim: rgba(245,158,11,.12);
  --radius:     8px;
  --radius-lg:  12px;
  --font:       Inter, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono:       "JetBrains Mono", "Cascadia Code", "Fira Code", "SF Mono", monospace;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font); background: var(--bg-root); color: var(--text);
  line-height: 1.6; min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a3a55; }

/* ═══ HEADER ═══ */
.header {
  background: linear-gradient(180deg, #0f1a30 0%, #0d1524 100%);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(12px);
}
.header-logo { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: var(--text-bright); white-space: nowrap; }
.header-logo .hl { color: var(--accent); }
.header-badge { font-size: 10px; background: var(--accent); color: #0a0e17; padding: 2px 8px; border-radius: 10px; font-weight: 700; letter-spacing: .5px; }
.header-meta { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--text-dim); }
.header-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: dotPulse 2s infinite; }
@keyframes dotPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ═══ MAIN GRID ═══ */
.app-grid {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  min-height: calc(100vh - 57px);
  max-width: 1600px; margin: 0 auto;
}
/* ── 8/24 手机端走查：全站统一导航栏（Amazon console 补齐——汉堡包与其他 17 页同款） ── */
.site-nav{position:relative;z-index:200;width:100%;background:rgba(10,14,23,.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid rgba(255,255,255,.06)}
.nav-inner{max-width:1000px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;height:56px;padding:0 20px}
.nav-logo{display:flex;align-items:center;gap:8px;text-decoration:none;font-size:16px;font-weight:800;color:var(--text-bright);flex-shrink:0}
.nav-menu{display:flex;align-items:center;gap:24px}
.nav-link{text-decoration:none;font-size:13px;font-weight:500;color:var(--text-dim);transition:color .2s}
.nav-link:hover,.nav-link.active{color:var(--text-bright)}
.nav-burger{display:none;background:none;border:none;color:var(--text-dim);font-size:20px;cursor:pointer;padding:4px 8px}
@media(max-width:768px){
  .nav-burger{display:block}
  .nav-inner{position:relative}
  .nav-menu{display:none;position:absolute;top:56px;right:12px;flex-direction:column;align-items:flex-start;background:rgba(10,14,23,.97);border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:14px 18px;gap:14px;box-shadow:0 8px 24px rgba(0,0,0,.4);z-index:101}
  .nav-menu.open{display:flex}
}

/* ── Phase 2.11: Responsive Breakpoints ── */
/* >1024px: 三栏 (sidebar + workspace + dashboard) — default */
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: 200px 1fr; }
  .dashboard { display: none; }
  .dashboard.mobile-show { display: block; position: fixed; top:57px;right:0;bottom:0;width:300px;z-index:50;overflow-y:auto;box-shadow:-8px 0 24px rgba(0,0,0,.5); }
}
@media (max-width: 640px) {
  .app-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.mobile-show { display: flex; position: fixed; top:57px;left:0;bottom:0;width:200px;z-index:50;overflow-y:auto;box-shadow:8px 0 24px rgba(0,0,0,.5);flex-direction:column;padding:16px; }
  .workspace { padding: 12px 10px; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { justify-content: center; }
  textarea { min-height: 120px !important; }
  .header { padding: 10px 14px; gap: 8px; }
  .header-logo { font-size: 16px; }
  .type-grid { grid-template-columns: 1fr; }
  .poa-output { max-height: 320px; padding: 14px; font-size: 12px; }
  .case-panel { width: 100%; }
  /* 9/8 走查修复：手机端顶栏 header-meta 溢出把 📋 Cases 按钮挤出视口——隐藏次要状态信息，保证案例面板入口可见 */
  .hide-mobile { display: none; }
  .header-meta { gap: 6px; }
}

/* ═══ LEFT SIDEBAR ═══ */

/* ── Phase 1.2: 6-Card Unified System ── */
.dash-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; transition: all var(--transition);
}
/* ⑥ Empty Card — no data placeholders */
.empty-card {
  background: transparent; border: 2px dashed var(--border);
  border-radius: var(--radius-lg); padding: 40px 20px; text-align: center;
  color: var(--text-muted); font-size: 14px;
}
.empty-card .empty-icon { font-size: 36px; margin-bottom: 10px; opacity: .45; }
.empty-card .empty-title { font-size: 15px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }

/* ═══ LEFT SIDEBAR ═══ */
.sidebar {
  background: var(--bg-elevated); border-right: 1px solid var(--border);
  padding: 20px 16px; display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.step-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); position: relative; align-items: flex-start; }
.step-item:hover { background: var(--bg-hover); }
.step-item.active { background: var(--accent-dim); border: 1px solid rgba(37,99,235,.25); }
.step-item.completed { opacity: .85; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; transition: all var(--transition);
  background: #1a2340; color: var(--text-dim); border: 1.5px solid var(--border);
}
.step-item.active .step-dot { background: var(--accent); color: #0a0e17; border-color: var(--accent); box-shadow: 0 0 16px var(--accent-glow); }
.step-item.completed .step-dot { background: var(--green); color: #0a0e17; border-color: var(--green); }
.step-info { flex: 1; min-width: 0; }
.step-title { font-size: 13px; font-weight: 600; color: var(--text-dim); transition: color var(--transition); }
.step-item.active .step-title { color: var(--accent); }
.step-item.completed .step-title { color: var(--green); }
.step-summary { font-size: 11px; color: #4a5568; margin-top: 2px; line-height: 1.4; display: none; }
.step-item.completed .step-summary { display: block; }
.step-item.active .step-summary { display: block; color: var(--text-dim); }
.step-connector { width: 1.5px; height: 8px; background: var(--border); margin-left: 16px; }
.step-item.completed + .step-connector { background: var(--green); }
.step-connector:last-child { display: none; }

/* ═══ MAIN WORKSPACE ═══ */
.workspace { padding: 24px 28px; overflow-y: auto; }
.workspace-panel { animation: panelIn .3s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.panel-header { margin-bottom: 20px; }
.panel-title { font-size: 20px; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.panel-subtitle { font-size: 13px; color: var(--text-dim); }

/* ── Phase 1.1: Step Progress Bar ── */
.step-progress {
  display: flex; align-items: center; gap: 0;
  padding: 0 0 20px 0; margin-bottom: 8px;
  user-select: none;
}
.step-progress .sp-step {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  flex-shrink: 0; transition: all var(--transition);
}
.step-progress .sp-step:hover .sp-label { color: var(--text); }
.sp-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--bg-card); color: var(--text-dim);
  border: 2px solid var(--border); transition: all .3s ease;
}
.sp-step.completed .sp-dot { background: var(--green); color: #fff; border-color: var(--green); }
.sp-step.active .sp-dot {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  animation: dotPulse 2s infinite;
}
.sp-step.locked .sp-dot { color: var(--text-muted); }
.sp-label { font-size: 13px; font-weight: 600; color: var(--text-dim); white-space: nowrap; transition: color var(--transition); }
.sp-step.completed .sp-label { color: var(--green); }
.sp-step.active .sp-label { color: var(--text-bright); }
.sp-step.locked .sp-label { color: var(--text-muted); }
.sp-connector {
  flex: 1; height: 2px; min-width: 20px; margin: 0 12px;
  background: var(--border); transition: background .4s ease;
}
.sp-connector.done { background: linear-gradient(90deg, var(--green), var(--accent)); }
/* Mobile: collapse to text indicator */
.step-progress-mobile {
  display: none; font-size: 13px; font-weight: 600; color: var(--text-dim);
  padding: 0 0 14px 0;
}
@media (max-width: 640px) {
  .step-progress { display: none; }
  .step-progress-mobile { display: block; }
}

/* ═══ MAIN WORKSPACE (continued) ═══ */

/* Input */
.input-area { position: relative; }
.input-area textarea {
  width: 100%; min-height: 180px; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; font-size: 14px; font-family: var(--mono);
  color: var(--text); line-height: 1.7; resize: vertical; transition: all var(--transition);
}
.input-area textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-area textarea::placeholder { color: #3a4a60; }
.input-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.input-chip {
  font-size: 11px; padding: 4px 10px; border-radius: 12px; cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); transition: all var(--transition); font-family: var(--font);
}
.input-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Phase 2.9: 4-Tier Button System ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); font-family: var(--font); white-space: nowrap; position: relative; overflow: hidden;
  text-decoration: none; line-height: 1.4;
}
/* ① Primary */
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled, .btn-primary.loading { background: #1e3050; color: #5a6a80; cursor: not-allowed; transform: none; box-shadow: none; pointer-events: none; }
.btn-primary.loading { pointer-events: none; }
.btn-primary.loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent);
  animation: btnShimmer 1.5s infinite;
}
@keyframes btnShimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
.btn-primary.pulse { animation: btnPulse 2s infinite; }
@keyframes btnPulse {
  0%,100% { box-shadow: 0 2px 12px var(--accent-glow); }
  50% { box-shadow: 0 2px 28px var(--accent-glow), 0 0 0 8px var(--accent-dim); }
}
/* ② Secondary */
.btn-secondary {
  background: var(--bg-input); color: var(--text); border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--text-bright); background: var(--bg-hover); }
.btn-secondary:active { background: var(--accent-dim); }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
/* ③ Danger — irreversible actions */
.btn-danger {
  background: var(--red); color: #fff;
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(239,68,68,.3); }
.btn-danger:active { transform: translateY(0); }
.btn-danger:disabled { opacity: .4; cursor: not-allowed; transform: none; }
/* ④ Ghost — navigation / utility */
.btn-ghost {
  background: transparent; color: var(--text-dim); border: none; padding: 8px 12px; font-size: 12px;
}
.btn-ghost:hover { color: var(--text-bright); background: var(--bg-hover); }
.btn-ghost:active { color: var(--accent); }
/* Layout helpers */
.btn-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.btn-sm { padding: 6px 14px; font-size: 11px; }

/* Type Grid */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.type-card {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; transition: all var(--transition);
}
.type-card:hover { border-color: var(--accent); background: var(--bg-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.type-card.selected { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 0 3px var(--accent-glow); }
.type-card .tc-name { font-weight: 600; font-size: 13px; color: var(--text-bright); margin-bottom: 4px; }
.type-card .tc-expect { font-size: 11px; color: var(--text-dim); }

/* Question Items */
.q-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; transition: border-color var(--transition);
}
.q-item:focus-within { border-color: var(--accent); }
.q-item .q-num { font-weight: 700; color: var(--accent); font-size: 11px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.q-item .q-text { font-size: 14px; color: var(--text-bright); margin-bottom: 10px; }
.q-item input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-size: 13px; font-family: var(--font); color: var(--text);
  transition: border-color var(--transition);
}
.q-item input:focus { outline: none; border-color: var(--accent); }
.q-item input::placeholder { color: #3a4a60; }

/* ═══ RIGHT DASHBOARD ═══ */
.dashboard {
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  padding: 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
.dashboard-header { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); font-weight: 700; margin-bottom: 2px; }
.dash-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; transition: all var(--transition);
}
.dash-card.pulse-once { animation: dashPulse .6s ease; }
@keyframes dashPulse { 0%{box-shadow:0 0 0 0 var(--accent-glow)} 50%{box-shadow:0 0 0 6px transparent} 100%{box-shadow:none} }
.dash-card .dash-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 6px; font-weight: 700; }
.dash-card .dash-value { font-size: 20px; font-weight: 800; color: var(--text-bright); }
.dash-card .dash-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.dash-risk { display: flex; align-items: center; gap: 8px; }
.dash-risk-indicator {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex-shrink: 0;
}
.dash-risk-indicator.high { background: var(--red-dim); color: var(--red); box-shadow: 0 0 16px rgba(231,76,60,.3); }
.dash-risk-indicator.medium { background: var(--orange-dim); color: var(--orange); box-shadow: 0 0 16px rgba(243,156,18,.3); }
.dash-risk-indicator.low { background: var(--green-dim); color: var(--green); box-shadow: 0 0 16px rgba(46,204,113,.3); }
.dash-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-tag {
  font-size: 10px; padding: 3px 8px; border-radius: 10px; font-weight: 600;
  background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(91,155,213,.2);
}
.dash-tag.warn { background: var(--red-dim); color: var(--red); border-color: rgba(231,76,60,.2); }
.dash-timeline { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.dash-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 12px; }
.dash-stat-row span:first-child { color: var(--text-dim); }
.dash-stat-row span:last-child { font-weight: 600; color: var(--text-bright); font-family: var(--mono); }
.dash-bar { height: 4px; background: #1a2340; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.dash-bar-fill { height: 100%; border-radius: 2px; transition: width .6s ease; }
.dash-bar-fill.good { background: var(--green); }
.dash-bar-fill.warn { background: var(--orange); }
.dash-bar-fill.bad { background: var(--red); }

/* ═══ ALERTS & TAGS ═══ */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.alert-warn { background: var(--orange-dim); border-left: 3px solid var(--orange); color: #f5c362; }
.alert-danger { background: var(--red-dim); border-left: 3px solid var(--red); color: #f08080; }
.alert-info { background: var(--blue-dim); border-left: 3px solid var(--blue); color: #8ab8e0; }
.alert-success { background: var(--green-dim); border-left: 3px solid var(--green); color: #6ddb9e; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-red { background: var(--red-dim); color: var(--red); }
.tag-orange { background: var(--orange-dim); color: var(--orange); }
.tag-green { background: var(--green-dim); color: var(--green); }
.tag-blue { background: var(--blue-dim); color: var(--blue); }

/* ═══ POA OUTPUT ═══ */
.poa-tabs { display: flex; gap: 0; margin-bottom: 0; }
.poa-tab {
  background: transparent; color: var(--text-dim); border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all var(--transition);
}
.poa-tab:hover { color: var(--text); background: var(--bg-hover); }
.poa-tab.active { background: #0d1117; color: var(--accent); border-color: var(--border); }
.poa-output {
  background: #0d1117; color: #c9d1d9; border-radius: var(--radius-lg); padding: 24px;
  font-family: var(--mono); font-size: 13px; line-height: 1.8; white-space: pre-wrap;
  max-height: 520px; overflow-y: auto; position: relative; border: 1px solid var(--border);
}
.poa-output .pending { color: #f0a040; background: rgba(240,160,64,.12); padding: 1px 4px; border-radius: 3px; }
.poa-copy-btn {
  position: sticky; top: 0; float: right; background: rgba(255,255,255,.06); color: var(--text-dim);
  border: 1px solid rgba(255,255,255,.1); border-radius: 6px; padding: 6px 14px;
  font-size: 11px; cursor: pointer; font-family: var(--font); z-index: 5;
  transition: all var(--transition);
}
.poa-copy-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }

/* ═══ METER ═══ */
.meter { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.meter-bar { flex: 1; height: 8px; background: #1a2340; border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }
.meter-fill.good { background: var(--green); }
.meter-fill.warn { background: var(--orange); }
.meter-fill.bad { background: var(--red); }
.meter-label { font-size: 12px; font-weight: 600; color: var(--text-dim); min-width: 48px; }

/* ═══ LIST ═══ */
.info-list { list-style: none; padding: 0; }
.info-list li { padding: 6px 0; font-size: 12px; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,.03); display: flex; align-items: flex-start; gap: 8px; }
.info-list li:last-child { border-bottom: none; }

/* ── Phase 2.5: Skeleton Loading ── */
.skeleton-box {
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
}
/* [REDLINE-APPROVED:骨架屏占位条宽度为 UI 样式数字（loading 动画视觉比例），非数据/政策断言] */
.skel-row { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: skelShimmer 1.8s ease-in-out infinite; }
.skel-row:nth-child(1) { width: 65%; } /* [REDLINE-APPROVED:骨架屏占位宽度 UI 样式数字非断言] */
.skel-row:nth-child(2) { width: 82%; }
.skel-row:nth-child(3) { width: 45%; } /* [REDLINE-APPROVED:骨架屏占位宽度 UI 样式数字非断言] */
.skel-row:nth-child(4) { width: 70%; height: 36px; border-radius: 8px; } /* [REDLINE-APPROVED:骨架屏占位宽度 UI 样式数字非断言] */
@keyframes skelShimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skel-phase {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px;
}
.skel-phase .skel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: dotPulse 1.5s infinite; }
.skel-phase .skel-text { color: var(--text-dim); }
.skel-phase.done .skel-dot { background: var(--green); animation: none; }
.skel-phase.done .skel-text { color: var(--text-muted); }
/* Keep old spinner for backward compat */
.loading-block { text-align: center; padding: 32px 16px; color: var(--text-dim); }
.spinner-ring { display: inline-block; width: 28px; height: 28px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 10px; font-size: 13px; }

.hidden { display: none !important; }

/* ═══ PDF Ghost DOM — full reset, inherits nothing from dark theme ═══ */
.ghost-dom, .ghost-dom * {
  margin: 0; padding: 0; border: 0; outline: 0;
  font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif !important;
  font-weight: 400; font-style: normal;
  text-decoration: none !important;
  color: #1a1a1a !important;
  background: #ffffff;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}
.ghost-dom u, .ghost-dom ins,
.ghost-dom [style*="underline"],
.ghost-dom [style*="text-decoration"] {
  text-decoration: none !important;
}
.ghost-dom {
  position: fixed; left: -9999px; top: 0; z-index: -1;
  width: 210mm; font-size: 10.5pt; line-height: 1.5;
  color: #1a1a1a; background: #ffffff;
}
.ghost-page {
  width: 210mm; padding: 15mm 16mm;
  page-break-after: always;
  position: relative; /* 9/8 E复检 ⚠️：offsetTop 归页——防断裂标题对齐第 2 页起生效（无 position 时 offsetParent=容器，累计高度错位） */
  color: #1a1a1a; background: #ffffff;
}
.ghost-page:last-child { page-break-after: auto; }
.ghost-page h2 {
  font-size: 17pt; font-weight: 700; margin: 0 0 10px; display: block;
  color: #1a3a5c; background: transparent;
  border-bottom: 2.5px solid #2563eb; padding-bottom: 8px;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.ghost-page h3 {
  font-size: 11pt; font-weight: 700; margin: 18px 0 10px; display: block;
  color: #1a3a5c; background: #f0f5ff;
  padding: 8px 12px; border-left: 4px solid #2563eb;
  border-radius: 0 4px 4px 0;
  text-decoration: none;
}
.ghost-page p {
  font-size: 10.5pt; margin-bottom: 8px; line-height: 1.55; display: block;
  color: #1a1a1a; background: transparent;
}
.ghost-page li { font-size: 10.5pt; margin-bottom: 5px; line-height: 1.5; color: #1a1a1a; background: transparent; }
/* 9/8 排版批③：手绘 bullet 统一——原生 list-style 跨浏览器渲染不一致（⚫ 判例），列表缩进对齐 */
.ghost-page ul { list-style: none; padding-left: 6px; margin: 6px 0 14px; }
.ghost-page strong, .ghost-page b { font-weight: 700; color: #1a1a1a; background: transparent; }
/* 9/8 排版批②：元数据独立背景框——与正文大标题视觉分隔 */
.ghost-page .ghost-meta {
  font-size: 8pt; color: #666;
  padding: 8px 12px; margin-bottom: 18px;
  background: #f6f8fa; border: 1px solid #e5e7eb; border-radius: 4px;
}
.ghost-page .ghost-section { margin-bottom: 0; }

/* Evidence list card — clean bordered box */
.ghost-page .ghost-evidence-list {
  margin: 18px 0; padding: 10px 14px;
  border: 1px solid #d0d7de; border-radius: 6px;
  background: #fafbfc;
}
.ghost-page .ghost-evidence-list h4 {
  font-size: 10.5pt; font-weight: 700; margin: 0 0 8px;
  color: #1a3a5c;
}
.ghost-page .ghost-evidence-list li {
  font-size: 10pt; color: #2a2a2a; margin-bottom: 3px;
  list-style: disc;
}

/* ═══ FILE UPLOAD ═══ */
.evidence-locker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; min-height: 40px; align-items: center; }
.evidence-locker:empty::after { content: '📎 Drop files here or click the attach button next to each question'; color: #3a4a60; font-size: 12px; }
.ev-file-thumb {
  position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-input); flex-shrink: 0; cursor: pointer;
  transition: border-color var(--transition);
}
.ev-file-thumb:hover { border-color: var(--accent); }
.ev-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ev-file-thumb .ev-file-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 24px; color: var(--text-dim); }
.ev-file-thumb .ev-file-badge {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.7);
  color: #fff; font-size: 8px; padding: 2px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev-file-thumb .ev-file-remove {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity var(--transition);
}
.ev-file-thumb:hover .ev-file-remove { opacity: 1; }
.ev-file-thumb .ev-file-ocr { position: absolute; bottom: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity var(--transition); }
.ev-file-thumb:hover .ev-file-ocr { opacity: 1; }
.upload-btn { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 11px; color: var(--text-dim); padding: 4px 8px; border: 1px dashed var(--border); border-radius: 6px; transition: all var(--transition); }
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.upload-btn input[type=file] { display: none; }
.drag-overlay {
  position: fixed; inset: 0; background: rgba(10,14,23,.85); z-index: 200;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  border: 3px dashed var(--accent); margin: 16px; border-radius: 16px; pointer-events: none; opacity: 0; transition: opacity .2s;
}
.drag-overlay.active { opacity: 1; }
.drag-overlay .drag-icon { font-size: 48px; }
.drag-overlay .drag-text { font-size: 18px; color: var(--accent); font-weight: 700; }

/* ═══ CASE PANEL ═══ */
.case-panel {
  position: fixed; top: 57px; right: 0; bottom: 0; width: 380px; z-index: 90;
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .3s ease;
  display: flex; flex-direction: column; overflow: hidden;
}
.case-panel.open { transform: translateX(0); }
.case-panel-header {
  padding: 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.case-panel-title { font-size: 15px; font-weight: 700; color: var(--text-bright); flex: 1; }
.case-panel-close { background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; }
.case-panel-close:hover { color: var(--text); }
.case-list { flex: 1; overflow-y: auto; padding: 8px; }
.case-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: all var(--transition);
}
.case-item:hover { border-color: var(--accent); }
.case-item .ci-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.case-item .ci-id { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.case-item .ci-date { font-size: 10px; color: var(--text-dim); }
.case-item .ci-type { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.case-item .ci-meta { font-size: 10px; color: var(--text-dim); display: flex; gap: 12px; }
.case-status { font-size: 9px; padding: 2px 7px; border-radius: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.case-status.draft { background: var(--blue-dim); color: var(--blue); }
.case-status.approved { background: var(--green-dim); color: var(--green); }
.case-status.rejected { background: var(--red-dim); color: var(--red); }
.case-stats { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 11px; }
.case-stat { text-align: center; flex: 1; }
.case-stat .cs-val { font-size: 18px; font-weight: 800; color: var(--text-bright); }
.case-stat .cs-lbl { color: var(--text-dim); margin-top: 2px; }
.save-btn { margin-left: auto; }

/* ═══ SHAKE ANIMATION ═══ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* ═══ ONBOARDING BAR ═══ */
.onboarding-bar {
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(16,185,129,.08));
  border: 1px solid rgba(37,99,235,.2); border-radius: var(--radius);
  margin: 0 16px 16px 16px; position: relative;
}
.onboarding-content { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.onboarding-text { font-size: 12px; color: var(--text-dim); flex: 1; line-height: 1.5; }
.onboarding-text b { color: var(--text-bright); }
.onboarding-text-desktop { display: inline; }
.onboarding-text-mobile { display: none; }
.onboarding-dismiss {
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 16px;
  background: transparent; color: var(--text-dim); font-size: 11px;
  cursor: pointer; font-family: var(--font); white-space: nowrap; transition: all .2s;
}
.onboarding-dismiss:hover { border-color: var(--accent); color: var(--text-bright); }

/* Desktop: dismiss button sits to the right of content inside flex row */
@media (min-width: 641px) {
  .onboarding-bar { display: flex; align-items: center; }
  .onboarding-content { flex: 1; padding-right: 0; }
  .onboarding-dismiss { flex-shrink: 0; margin-right: 12px; }
}

/* Mobile: vertical step list, dismiss button pinned top-right */
@media (max-width: 640px) {
  .onboarding-bar { margin: 0 12px 12px 12px; padding: 0; }
  .onboarding-content {
    display: block !important;
    padding: 14px 80px 14px 16px !important;
  }
  .onboarding-text-desktop { display: none !important; }
  .onboarding-text-mobile {
    display: block !important;
    font-size: 12px; line-height: 1.7;
  }
  .onboarding-text-mobile b { color: var(--text-bright); }
  .onboarding-dismiss {
    position: absolute !important; top: 12px !important; right: 12px !important;
    z-index: 5 !important; margin: 0 !important;
    font-size: 10px; padding: 3px 10px;
  }
}

/* ═══ MOBILE TOGGLES ═══ */
.mobile-toggle { display: none; background: transparent; border: 1px solid var(--border); color: var(--text-dim); border-radius: var(--radius); padding: 6px 12px; font-size: 12px; cursor: pointer; }
@media (max-width: 768px) {
  .workspace { padding: 16px 14px; }
  /* 8/24 横向对比定案：移动端淘汰固定抽屉——导航=流内步骤进度条（TikTok/Etsy 同款模式）。
     抽屉家族（☰/◫ + mobile-show 类）全部退役：没有按钮可点就没有点击失效，没有固定
     定位就没有渲染变量。核心信息全在工作区面板内。 */
  .mobile-toggle { display: none; }
  .app-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.mobile-show { display: none; }
  .dashboard { display: none; }
  .dashboard.mobile-show { display: none; }
  .header-meta { display: none; }
  /* 流内步骤筹码复活（原 640 块把它藏了给抽屉让路——抽屉已退役，筹码即导航） */
  .step-progress { display: flex; flex-wrap: wrap; }
  .step-progress-mobile { display: none; }
}