:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --info: #0ea5e9;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.3; }
p { margin: 0 0 10px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 12px; word-break: break-all; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- 登录页 */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(14, 165, 233, 0.16), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}
.brand-title { font-size: 18px; font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 6px; background: #eef2f8; padding: 4px; border-radius: 10px; margin: 18px 0; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px;
}
.tabs button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px rgba(15,23,42,.08); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: #334155; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; outline: none; background: #fff;
  font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 16px;
  background: var(--primary); color: #fff; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f8fafc; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.danger { background: var(--danger); }

.form-msg { margin-top: 12px; font-size: 13px; min-height: 18px; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--ok); }

.demo-hint {
  margin-top: 18px; padding: 10px 12px; background: #f8fafc;
  border: 1px dashed var(--line); border-radius: 10px; font-size: 12px; color: var(--muted);
}

/* ---------------------------------------------------------------- 框架 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.topbar .brand-mark { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
.topbar .brand-title { font-size: 15px; }
.topbar .spacer { flex: 1; }
.nav-link { color: var(--muted); font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.nav-link:hover { background: #eef2f8; text-decoration: none; }
.nav-link.active { color: var(--primary); background: #eff6ff; font-weight: 600; }

.page { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; }
.page-narrow { max-width: 980px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: 0 2px 10px rgba(15,23,42,.04);
}
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; }
.card-title h3 { margin: 0; font-size: 16px; }
.card-sub { font-size: 12px; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 16px 12px 40px; }
  .topbar-inner { padding: 10px 12px; }
}

/* ---------------------------------------------------------------- 上传 */
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 30px 20px;
  text-align: center; cursor: pointer; background: #f8fafc; transition: .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #eff6ff; }
.dropzone .dz-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.dropzone .dz-title { font-weight: 600; margin-bottom: 4px; }

.file-chip {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.file-chip .spacer { flex: 1; }

.path-steps { display: flex; gap: 12px; margin-top: 14px; }
.path-step {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff; font-size: 12px; color: var(--muted);
}
.path-step strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 2px; }
.path-step.running { border-color: var(--primary); background: #eff6ff; }
.path-step.done { border-color: #86efac; background: #f0fdf4; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 结果 */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.danger .value { color: var(--danger); }
.kpi.warn .value { color: var(--warn); }
.kpi.ok .value { color: var(--ok); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eef2f8; color: #475569;
}
.badge.high { background: #fee2e2; color: #b91c1c; }
.badge.medium { background: #fef3c7; color: #b45309; }
.badge.low { background: #dbeafe; color: #1d4ed8; }
.badge.none { background: #dcfce7; color: #15803d; }
.badge.unknown { background: #f1f5f9; color: #64748b; }

.gauge-wrap { display: flex; align-items: center; gap: 18px; }
.gauge {
  --p: 0;
  width: 108px; height: 108px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--gauge-color, #2563eb) calc(var(--p) * 1%), #e2e8f0 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.gauge::after {
  content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #fff;
}
.gauge span { position: relative; z-index: 1; font-size: 22px; font-weight: 700; }
.gauge-meta .big { font-size: 20px; font-weight: 700; }

.alert {
  border-radius: 12px; padding: 14px 16px; border: 1px solid;
  font-size: 13px; margin-bottom: 12px;
}
.alert.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.feature-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.feature-row:last-child { border-bottom: 0; }
.feature-row .fname { width: 130px; flex: none; font-size: 13px; }
.feature-row .fbar { flex: 1; height: 8px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.feature-row .fbar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.feature-row .fbar i.ai { background: var(--danger); }
.feature-row .fbar i.human { background: var(--ok); }
.feature-row .fval { width: 220px; flex: none; font-size: 12px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: #f1f5f9; color: #475569; font-size: 12px;
}
.chip.hit { background: #fee2e2; color: #b91c1c; }

.cat-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.cat-item .cat-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.cat-item h4 { margin: 0; font-size: 14px; }
.cat-score { font-weight: 700; color: var(--danger); }
.snippet { color: var(--muted); font-size: 12px; background: #f8fafc; border-radius: 8px; padding: 6px 10px; margin-top: 6px; }

.law-item {
  border-left: 3px solid var(--primary); padding: 8px 0 8px 12px; margin-bottom: 14px;
}
.law-item .law-head { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.law-item .law-body { font-size: 13px; color: #334155; }
.law-item .law-apply { font-size: 12px; color: var(--muted); margin-top: 4px; }

.steps { counter-reset: step; margin: 0; padding: 0; list-style: none; }
.steps li {
  position: relative; padding: 0 0 12px 30px; font-size: 13px; color: #334155;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.phase-title { font-weight: 700; font-size: 13px; margin: 14px 0 8px; color: var(--ink); }
.phase-title:first-child { margin-top: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #f8fafc; }
tr:hover td { background: #fafcff; }

.history-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
  cursor: pointer; transition: .12s;
}
.history-item:hover { border-color: #bfdbfe; background: #f8fbff; }
.history-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.evidence-box {
  background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 16px;
  font-family: "Cascadia Code", Consolas, monospace; font-size: 12px;
  word-break: break-all; line-height: 1.8;
}
.evidence-box .k { color: #7dd3fc; }
.evidence-box .v { color: #f8fafc; }

.verify-list { margin: 0; padding: 0; list-style: none; }
.verify-list li {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
  border-bottom: 1px dashed var(--line); font-size: 13px;
}
.verify-list li:last-child { border-bottom: 0; }
.verify-list .ok-mark { color: var(--ok); font-weight: 700; }
.verify-list .fail-mark { color: var(--danger); font-weight: 700; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.right { margin-left: auto; }

/* ---------------------------------------------------------------- 管理后台 */
.admin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.chart-box { position: relative; width: 100%; height: 220px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; }
.bar-row .bar-label { width: 110px; flex: none; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-track { flex: 1; height: 8px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.bar-row .bar-track i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 999px; }
.bar-row .bar-value { width: 34px; text-align: right; color: var(--muted); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--danger); }

.log-level { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.log-level.info { background: #dbeafe; color: #1d4ed8; }
.log-level.warn { background: #fef3c7; color: #b45309; }
.log-level.error { background: #fee2e2; color: #b91c1c; }

/* ---------------------------------------------------------------- 证据报告 */
.report-page { max-width: 860px; margin: 0 auto; padding: 30px 24px 60px; }
.report-head { border-bottom: 3px double #0f172a; padding-bottom: 14px; margin-bottom: 20px; }
.report-head h1 { font-size: 22px; letter-spacing: 1px; }
.report-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.report-table th, .report-table td { border: 1px solid #cbd5e1; padding: 8px 10px; white-space: normal; }
.report-table th { width: 130px; background: #f1f5f9; text-align: left; color: #334155; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid #cbd5e1; }
}

/* ---------------------------------------------------------------- 综合结论卡 */
.verdict {
  position: relative;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ok);
  border-radius: 18px;
  padding: 24px 26px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}
.verdict::after {
  content: "";
  position: absolute; right: -60px; top: -80px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.1), transparent 68%);
  pointer-events: none;
}
.verdict-high { border-left-color: var(--danger); }
.verdict-high::after { background: radial-gradient(circle, rgba(220, 38, 38, 0.12), transparent 68%); }
.verdict-medium { border-left-color: var(--warn); }
.verdict-medium::after { background: radial-gradient(circle, rgba(217, 119, 6, 0.12), transparent 68%); }

.verdict-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.verdict-tag {
  font-size: 11px; letter-spacing: 0.14em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 6px;
}
.verdict-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.verdict-title b { font-size: 26px; letter-spacing: -0.01em; color: var(--ink); }
.verdict-high .verdict-title b { color: #b91c1c; }
.verdict-medium .verdict-title b { color: #b45309; }
.verdict-low .verdict-title b { color: #047857; }
.verdict-title span {
  font-size: 12px; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace;
  background: #f1f5f9; padding: 2px 9px; border-radius: 999px;
}
.verdict-headline { font-size: 14px; color: #334155; margin-top: 4px; }
.verdict-score { text-align: center; flex: none; }
.v-ring {
  --p: 0;
  width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), #e2e8f0 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.verdict-high .v-ring { background: conic-gradient(var(--danger) calc(var(--p) * 1%), #e2e8f0 0); }
.verdict-medium .v-ring { background: conic-gradient(var(--warn) calc(var(--p) * 1%), #e2e8f0 0); }
.v-ring::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.v-ring span { position: relative; z-index: 1; font-size: 20px; font-weight: 700; }
.verdict-conf { font-size: 11px; color: var(--muted); margin-top: 6px; }
.verdict-summary {
  font-size: 13px; color: #334155; margin: 14px 0 18px;
  padding: 11px 14px; border-radius: 12px; background: #f8fafc;
  border: 1px dashed var(--line); line-height: 1.8;
}
.verdict-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 900px) { .verdict-body { grid-template-columns: 1fr; } }

.v-basis {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed var(--line);
}
.v-basis:last-child { border-bottom: 0; }
.v-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.v-dot.high { background: var(--danger); }
.v-dot.medium { background: var(--warn); }
.v-dot.low { background: var(--ok); }
.v-dot.unknown { background: #94a3b8; }
.v-basis-main { flex: 1; min-width: 0; }
.v-basis-name { font-size: 13px; font-weight: 600; }
.v-basis-detail { font-size: 11.5px; color: var(--muted); }
.v-basis-value {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 14px; font-weight: 700; color: var(--ink); flex: none;
}

.v-actions li { font-size: 12.5px; padding-bottom: 9px; }
.v-timeline { position: relative; padding-left: 18px; }
.v-timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 8px;
  width: 2px; background: var(--line);
}
.v-tl { position: relative; padding: 0 0 12px 4px; }
.v-tl:last-child { padding-bottom: 0; }
.v-tl-dot {
  position: absolute; left: -18px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid var(--ok);
}
.v-tl.skip .v-tl-dot { border-color: #cbd5e1; }
.v-tl.next .v-tl-dot { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.v-tl-title { font-size: 12.5px; font-weight: 600; }
.v-tl-detail { font-size: 11.5px; color: var(--muted); }

/* 可展开的次要信息（处置时间线） */
.v-more { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.v-more summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: #475569;
  cursor: pointer; list-style: none; user-select: none;
}
.v-more summary::-webkit-details-marker { display: none; }
.v-more summary::after {
  content: "▾"; font-size: 10px; color: var(--muted); transition: transform .15s;
}
.v-more summary:hover { color: var(--primary); }
.v-more[open] summary::after { transform: rotate(180deg); }
.v-more[open] summary { margin-bottom: 12px; }
.verdict-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); line-height: 1.7;
}

.brand-home { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-home:hover { text-decoration: none; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 6px 10px; }
  .topbar-inner .spacer { display: none; }
  .topbar .brand-title { max-width: 46vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .nav-link { display: inline-flex; font-size: 12px; padding: 3px 7px; }
  .topbar .muted.small { margin-left: auto; }
}

/* ---------------------------------------------------------------- 手机端适配 */
@media (max-width: 640px) {
  html, body { font-size: 13.5px; }
  .page { padding: 14px 10px 44px; }
  .card { padding: 14px; border-radius: 12px; }
  .card-title { flex-wrap: wrap; gap: 6px; }
  .topbar-inner { padding: 9px 12px; }
  .topbar .badge { display: none; }
  .topbar .brand-title { font-size: 13px; }
  .dropzone { padding: 22px 12px; }
  .file-chip { flex-wrap: wrap; }
  .path-steps { flex-direction: column; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .btn { flex: 1 1 auto; }
  .gauge-wrap { flex-direction: column; align-items: flex-start; gap: 12px; }
  .feature-row { flex-wrap: wrap; gap: 6px; }
  .feature-row .fname { width: 100%; }
  .feature-row .fval { width: 100%; }
  .verdict { padding: 15px 14px; }
  .verdict-head { gap: 10px; }
  .verdict-title b { font-size: 22px; }
  .v-ring { width: 72px; height: 72px; }
  .v-ring span { font-size: 16px; }
  .v-ring::after { inset: 7px; }
  .v-basis-value { font-size: 13px; }
  .report-table th, .report-table td { padding: 6px 8px; font-size: 12px; }
  .report-table th { width: 92px; }
  .alert { padding: 12px; }
  .field input, .field textarea, .field select { font-size: 16px; }
  .table-wrap table { min-width: 560px; }
  .chart-box { height: 190px; }
  .btn { min-height: 40px; }

  /* 手机端登录页 */
  .auth-wrap { padding: 12px; align-items: flex-start; padding-top: 24px; }
  .auth-card { padding: 24px 18px; max-width: 100%; border-radius: 16px; }
  .brand { gap: 10px; }
  .brand-mark { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
  .brand-title { font-size: 16px; }
  .brand-sub { font-size: 11px; }
  .tabs { margin: 14px 0; }
  .field input { font-size: 16px; min-height: 44px; }
  .btn.block { min-height: 46px; font-size: 15px; }

  /* 弹窗移动端 */
  .modal-content { margin: 10px; max-width: 100% !important; max-height: 94vh; }
  .modal-body { padding: 14px; }
  .transcript-text { max-height: 50vh; }
}

/* ---------------------------------------------------------------- 弹窗组件 */
.modal { position: fixed; inset: 0; z-index: 1000; }
.modal.hidden { display: none; }
.modal-mask {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.modal-content {
  position: relative; z-index: 1;
  margin: 48px auto; max-width: 720px;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
  overflow: hidden; max-height: calc(100vh - 96px); display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.field-label { display: block; font-size: 13px; margin-bottom: 6px; color: #334155; font-weight: 600; }

.transcript-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.transcript-text {
  width: 100%; min-height: 200px; max-height: 55vh;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #f8fafc; font-size: 13.5px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-all; overflow-y: auto;
  font-family: inherit; resize: vertical;
}

.action-cell { white-space: nowrap; display: flex; gap: 4px; flex-wrap: wrap; }
.action-cell .btn { white-space: nowrap; }

/* 弹窗表单控件 */
.modal-body input,
.modal-body textarea {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fff;
}
.modal-body input:focus,
.modal-body textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* 底部固定音频播放条 */
.audio-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(15, 23, 42, .10);
}
.audio-bar.hidden { display: none; }
.audio-bar #audio-bar-name { flex: none; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-bar #admin-audio { flex: 1; min-width: 0; height: 40px; }
body.has-audio-bar { padding-bottom: 78px; }

@media (max-width: 640px) {
  .audio-bar { flex-wrap: wrap; gap: 8px; }
  .audio-bar #audio-bar-name { max-width: 100%; }
  .audio-bar #admin-audio { width: 100%; flex: 1 1 100%; }
  body.has-audio-bar { padding-bottom: 118px; }
}

/* ================================================================ 工作台 */
.ws-page { padding-top: 18px; }

/* 顶部介绍区 */
.ws-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 24px;
  padding: 30px 34px; border-radius: 20px;
  color: #f8fafc;
  background: linear-gradient(120deg, #0b1e46 0%, #14306b 46%, #1d4ed8 100%);
  box-shadow: 0 16px 40px rgba(16, 42, 99, .22);
}
.ws-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 240px at 88% 8%, rgba(56, 189, 248, .28), transparent 70%);
}
.ws-hero-main { position: relative; z-index: 1; max-width: 720px; }
.ws-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .22em;
  color: #93c5fd; margin-bottom: 10px;
}
.ws-hero h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.25; color: #fff; letter-spacing: -.01em; }
.ws-hero p { margin: 0; font-size: 13.5px; line-height: 1.8; color: #cbd5e1; }
.ws-stats { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.ws-stat {
  min-width: 108px; padding: 10px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
}
.ws-stat b { display: block; font-size: 22px; line-height: 1.15; color: #fff; }
.ws-stat span { font-size: 11.5px; color: #bfdbfe; }

.ws-hero-art { position: absolute; right: -50px; top: -70px; width: 340px; height: 340px; z-index: 0; }
.ws-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(147, 197, 253, .26); }
.ws-r1 { inset: 0; }
.ws-r2 { inset: 48px; }
.ws-r3 { inset: 96px; }
.ws-wave {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: #60a5fa;
  box-shadow: 0 0 0 10px rgba(96, 165, 250, .16), 0 0 0 26px rgba(96, 165, 250, .08);
}

/* 主体栅格 */
.ws-grid {
  display: grid; align-items: stretch; gap: 16px; margin-top: 16px;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
@media (max-width: 1000px) { .ws-grid { grid-template-columns: minmax(0, 1fr); } }

.ws-step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.ws-step-no {
  flex: none; width: 34px; height: 34px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .28);
}
.ws-step-head h3 { margin: 0 0 3px; font-size: 16px; }

/* 上传区 */
.ws-page .dropzone {
  border-radius: 16px; padding: 32px 20px;
  background: linear-gradient(180deg, #f8fbff, #f1f6ff);
  border-color: #c7d7f5;
}
.ws-page .dropzone:hover,
.ws-page .dropzone.dragover {
  border-color: #2563eb; background: #eef5ff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, .10);
}
.ws-page .dz-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: #2563eb; background: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .16);
}
.ws-page .dz-title { font-size: 14.5px; margin-bottom: 6px; }

/* 转写输入 */
.ws-field { margin-top: 14px; }
.ws-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ws-field-head label { font-size: 13px; font-weight: 600; color: #334155; }
.ws-optional {
  font-size: 11.5px; color: var(--muted);
  background: #f1f5f9; border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.ws-field textarea {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 13.5px; line-height: 1.75; font-family: inherit;
  color: var(--ink); background: #fff; resize: vertical;
}
.ws-field textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

/* 操作按钮 */
.ws-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ws-actions-note { margin-left: auto; }
.btn.ws-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 8px 18px rgba(37, 99, 235, .28); }
.btn.ws-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); }

/* 双路径进度 */
.ws-page .path-steps { margin-top: 16px; }
.ws-page .path-step { position: relative; padding-left: 28px; border-radius: 12px; }
.ws-page .path-step::before {
  content: ""; position: absolute; left: 13px; top: 16px;
  width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1;
}
.ws-page .path-step.running::before { background: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.ws-page .path-step.done::before { background: #16a34a; }

/* 历史记录 */
.ws-count {
  font-size: 11.5px; color: #475569; background: #eef2f8;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

/* 右列：记录卡自适应撑满 + 使用提示卡 */
.ws-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-side .card + .card { margin-top: 0; }
.ws-side .ws-history { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 320px; }
.ws-history-list {
  flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px;
  max-height: 560px; overflow-y: auto; padding-right: 2px;
}

/* 空状态 */
.ws-empty {
  flex: 1 1 auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  padding: 28px 18px; text-align: center;
}
.ws-empty-ico {
  width: 56px; height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: #2563eb; background: #eff6ff; box-shadow: inset 0 0 0 1px #dbeafe;
}
.ws-empty b { font-size: 14px; font-weight: 600; color: var(--ink); }
.ws-empty p { margin: 0; max-width: 250px; font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.ws-empty .btn { margin-top: 4px; }

/* 记录较少时填补卡片留白 */
.ws-history-hint {
  margin-top: auto;
  padding: 14px 16px; border-radius: 14px;
  border: 1px dashed #dbe3f0; background: #f8fbff;
  font-size: 12px; line-height: 1.7; color: var(--muted);
}
.ws-history-hint b { display: block; font-size: 12.5px; color: #334155; margin-bottom: 2px; }

/* 使用提示卡 */
.ws-tips { background: linear-gradient(180deg, #fbfdff, #f3f8ff); }
.ws-tips-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px;
}
.ws-tips-head::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.ws-tips-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.ws-tips-list li { font-size: 12px; line-height: 1.65; color: var(--muted); }
.ws-tips-list b { display: block; font-size: 12.5px; font-weight: 600; color: #334155; }
.ws-page .history-item {
  flex: 0 0 auto;
  align-items: flex-start; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px; border-radius: 14px; background: #fff;
  border-left: 3px solid #e2e8f0;
}
.ws-page .history-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
  border-color: #bfdbfe;
}
.ws-page .history-item .name { flex: 1 1 100%; white-space: normal; }
.ws-page .history-item:has(.badge.high) { border-left-color: #ef4444; }
.ws-page .history-item:has(.badge.medium) { border-left-color: #f59e0b; }
.ws-page .history-item:has(.badge.low) { border-left-color: #3b82f6; }
.ws-page .history-item:has(.badge.none) { border-left-color: #10b981; }

/* 手机端 */
@media (max-width: 640px) {
  .ws-hero { padding: 22px 18px; border-radius: 16px; }
  .ws-hero h1 { font-size: 21px; }
  .ws-hero p { font-size: 12.5px; }
  .ws-hero-art { display: none; }
  .ws-stats { gap: 8px; margin-top: 16px; }
  .ws-stat { flex: 1 1 calc(50% - 8px); min-width: 0; padding: 9px 12px; }
  .ws-stat b { font-size: 18px; }
  .ws-actions-note { margin-left: 0; width: 100%; }
  .ws-actions .btn { flex: 1 1 auto; }
  .ws-history-list { max-height: none; }
  .ws-page .dropzone { padding: 24px 14px; }
  .ws-step-head { gap: 10px; }
}

/* ================================================================ 后台 · 手机端适配 */
@media (max-width: 640px) {
  /* 概览工具条：标题一行，按钮另起一行 */
  .toolbar > h2 { font-size: 18px; }
  .toolbar .right { width: 100%; margin-left: 0; }
  .toolbar .right > .btn { flex: 1 1 auto; }
  .toolbar .right > #refresh-hint { flex: 1 1 100%; }

  /* KPI 保持两列，避免卡片过高 */
  #kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #kpi-grid .kpi { padding: 12px 13px; }
  #kpi-grid .kpi .value { font-size: 22px; }

  /* 图表高度 */
  .chart-box { height: 180px; }

  /* 高发诈骗类型 / 系统状态 条形行 */
  .bar-row { gap: 8px; font-size: 11.5px; }
  .bar-row .bar-label {
    width: 92px; font-size: 11.5px; line-height: 1.35;
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  .bar-row .bar-value { width: 26px; font-size: 11.5px; }

  /* 表格改为卡片式，避免横向滚动 */
  .table-wrap { overflow-x: visible; }
  .table-wrap table { min-width: 0; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    display: block; margin-bottom: 10px; padding: 12px;
    border: 1px solid var(--line); border-radius: 12px;
    background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  }
  .table-wrap tbody tr:last-child { margin-bottom: 0; }
  .table-wrap tbody tr:hover td { background: transparent; }
  .table-wrap tbody td {
    display: flex; align-items: baseline; gap: 10px;
    padding: 3px 0; border: 0; white-space: normal; font-size: 12.5px;
  }
  .table-wrap tbody td::before {
    content: ""; flex: 0 0 66px;
    color: var(--muted); font-size: 11.5px;
  }
  .table-wrap tbody td[colspan] { display: block; }
  .table-wrap tbody td[colspan]::before { display: none; }

  /* 各表字段名 */
  #recent-table td:nth-child(1)::before { content: "ID"; }
  #recent-table td:nth-child(2)::before { content: "文件"; }
  #recent-table td:nth-child(3)::before { content: "AI 概率"; }
  #recent-table td:nth-child(4)::before { content: "AI 判定"; }
  #recent-table td:nth-child(5)::before { content: "诈骗评分"; }
  #recent-table td:nth-child(6)::before { content: "风险等级"; }
  #recent-table td:nth-child(7)::before { content: "时间"; }
  #users-table td:nth-child(1)::before { content: "ID"; }
  #users-table td:nth-child(2)::before { content: "用户名"; }
  #users-table td:nth-child(3)::before { content: "角色"; }
  #users-table td:nth-child(4)::before { content: "状态"; }
  #users-table td:nth-child(5)::before { content: "分析次数"; }
  #users-table td:nth-child(6)::before { content: "注册时间"; }
  #users-table td:nth-child(7)::before { content: "最近登录"; }
  #logs-table td:nth-child(1)::before { content: "时间"; }
  #logs-table td:nth-child(2)::before { content: "级别"; }
  #logs-table td:nth-child(3)::before { content: "用户"; }
  #logs-table td:nth-child(4)::before { content: "动作"; }
  #logs-table td:nth-child(5)::before { content: "IP"; }
  #logs-table td:nth-child(6)::before { content: "详情"; }

  /* 操作列：单独一行，按钮等分且不撑满整屏 */
  #recent-table td:last-child:not([colspan]) {
    display: block; margin-top: 8px; padding-top: 10px;
    border-top: 1px dashed var(--line);
  }
  #recent-table td:last-child:not([colspan])::before { display: none; }
  #users-table td.action-cell:not([colspan]) {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 8px; padding-top: 10px;
    border-top: 1px dashed var(--line);
  }
  #users-table td.action-cell:not([colspan])::before { display: none; }
  .table-wrap tbody td:last-child .action-cell {
    display: flex; flex-wrap: wrap; gap: 8px;
  }
  .table-wrap tbody td:last-child .action-cell .btn,
  #users-table td.action-cell .btn {
    flex: 1 1 0; min-width: 0; min-height: 36px;
    padding: 6px 8px; font-size: 12.5px;
  }

  /* 弹窗按钮不撑满整屏 */
  .modal-actions { gap: 8px; }
  .modal-actions .btn { flex: 1 1 0; }
  .modal-head { gap: 8px; }
  .modal-head h3 { font-size: 14px; }
}

