:root {
  --navy: #0b2545;
  --navy-2: #12385c;
  --ink: #14263a;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e4eaf2;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --primary: #0f62a8;
  --primary-dark: #0b4a80;
  --primary-soft: #e8f2fb;
  --red: #d92d20;
  --red-soft: #fef2f2;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --blue: #1d4ed8;
  --blue-soft: #eef2ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 37, 62, 0.05), 0 8px 24px -16px rgba(15, 37, 62, 0.25);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
.mini-record, .record-row, .kb-item, .icon-btn { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: 0.01em; }
p { margin: 0; }
.hidden { display: none !important; }
.photo-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 3; }
.photo-file-offscreen { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; position: fixed; inset: 0 auto 0 0; z-index: 40;
  background: linear-gradient(180deg, #0b2545 0%, #123a5e 62%, #0f2f4e 100%);
  color: #cfe1f1; display: flex; flex-direction: column; padding: 20px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: rgba(125, 211, 252, 0.12); display: grid; place-items: center; border: 1px solid rgba(125, 211, 252, 0.25); }
.brand-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 0.06em; }
.brand-sub { font-size: 11px; color: #8fb3d1; letter-spacing: 0.08em; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  color: #b9d2e7; font-size: 14px; position: relative; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: rgba(125, 211, 252, 0.14); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #38bdf8; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-count { margin-left: auto; background: #f59e0b; color: #3b2200; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.09); padding: 14px 10px 0; font-size: 11.5px; color: #8fb3d1; }
.ai-status { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: #d7e8f6; }
.sidebar-foot .dot { background: #94a3b8; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2); }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }

.main { flex: 1; min-width: 0; margin-left: 236px; }
.topbar {
  height: 66px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 17px; font-weight: 650; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.view { padding: 26px 30px 90px; max-width: 1400px; margin: 0 auto; }
.loading { padding: 80px 0; text-align: center; color: var(--faint); }

/* ---------- 通用组件 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; scroll-margin-top: 84px; }
.card > *, .grid-2 > *, .grid-2-even > *, .detail-grid > *, .inspect-grid > *, .kb-layout > *, .settings-grid > * { min-width: 0; }
.banner a { white-space: nowrap; }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 17px; height: 17px; color: var(--primary); }
.section-title { font-size: 15px; font-weight: 650; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--primary); }
.detail-head a.small { white-space: nowrap; align-items: center; }
.detail-head a.small svg { width: 14px; height: 14px; flex: 0 0 14px; }
.photo-empty svg { width: 38px; height: 38px; color: #b9c9d9; }
.source-status a svg { width: 13px; height: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent;
  border-radius: 9px; padding: 8px 14px; font-size: 13.5px; font-weight: 550; background: #fff;
  color: var(--ink); transition: all 0.15s; white-space: nowrap; line-height: 1.4;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px -6px rgba(15, 98, 168, 0.8); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); border-color: #d3e6f7; }
.btn-soft:hover { background: #dcecf9; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { background: #f6f9fc; color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b42318; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #116932; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-lg { padding: 11px 18px; font-size: 14.5px; border-radius: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap; border: 1px solid transparent;
}
.badge-major { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.badge-minor { background: var(--amber-soft); color: var(--amber); border-color: #fde68a; }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: #dbe3ff; }
.badge-green { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #fde68a; }
.badge-gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-outline { background: #fff; color: var(--muted); border-color: var(--line); }
.badge-verify { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-replaced { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; text-decoration: line-through; }
.badge-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-pending { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.st-doing { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.st-review { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.st-closed { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 99px;
  padding: 5px 13px; font-size: 12.5px; transition: all 0.15s;
}
.chip:hover { border-color: #b9d5ee; color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.field { margin-bottom: 16px; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.label .req { color: var(--red); }
.input, .textarea, .select {
  width: 100%; border: 1px solid #d8e2ee; border-radius: 9px; padding: 9px 12px; background: #fff;
  outline: none; transition: border 0.15s, box-shadow 0.15s; font-size: 13.5px;
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.65; }
.input:focus, .textarea:focus, .select:focus { border-color: #7fb4dd; box-shadow: 0 0 0 3px rgba(15, 98, 168, 0.1); }
.input::placeholder, .textarea::placeholder { color: #a7b6c7; }
.hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.6; }
.banner svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.banner-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.banner-info { background: #eff6ff; border: 1px solid #dbeafe; color: #1e40af; }
.banner-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ---------- 概览 ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px;
  background: radial-gradient(1100px 380px at 88% -40%, rgba(56, 189, 248, 0.35), transparent 60%),
    linear-gradient(135deg, #0b2545 0%, #123a5e 55%, #0e4a73 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  box-shadow: 0 18px 40px -28px rgba(11, 37, 69, 0.9);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(125, 211, 252, 0.25); box-shadow: 0 0 0 60px rgba(125, 211, 252, 0.05), 0 0 0 120px rgba(125, 211, 252, 0.04);
}
.hero h2 { font-size: 23px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 8px; }
.hero p { color: #b9d6ec; font-size: 13px; max-width: 620px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.hero .btn-primary { background: #fff; color: var(--primary-dark); box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.6); }
.hero .btn-primary:hover { background: #eaf4fd; }
.hero .btn-ghost { border-color: rgba(255, 255, 255, 0.35); color: #e2f0fb; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.hero-note { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11.5px; color: #9fc3de; position: relative; z-index: 1; }
.hero-note svg { width: 14px; height: 14px; }
.hero-side { display: flex; gap: 26px; text-align: center; position: relative; z-index: 1; }
.hero-kpi b { display: block; font-size: 28px; font-weight: 700; line-height: 1.2; }
.hero-kpi span { font-size: 11.5px; color: #9fc3de; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.stat-card { padding: 16px 18px; position: relative; overflow: hidden; }
.stat-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.25; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--faint); margin-left: 4px; }
.stat-hint { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.stat-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon svg { width: 17px; height: 17px; }
.stat-card.red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat-card.amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-card.green .stat-icon { background: var(--green-soft); color: var(--green); }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 16px; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }

.bar-row { display: grid; grid-template-columns: 78px 1fr 46px; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 12.5px; }
.bar { height: 8px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.bar.major > i { background: linear-gradient(90deg, #ef4444, #d92d20); }
.bar.minor > i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.mini-record { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid #eef2f7; align-items: center; transition: background 0.15s; }
.mini-record:last-child { border-bottom: 0; }
.mini-record:hover { background: #f8fbfe; }
.mini-record .grow { min-width: 0; }
.mini-title { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta { font-size: 11.5px; color: var(--faint); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 排查 ---------- */
.inspect-grid { display: grid; grid-template-columns: 392px minmax(0, 1fr); gap: 18px; align-items: start; }
.dropzone {
  border: 1.5px dashed #c3d7ea; border-radius: 12px; background: #f8fbfe; min-height: 208px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); cursor: pointer; transition: all 0.18s; text-align: center; padding: 20px; position: relative; overflow: hidden;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: #f1f8fe; }
.dropzone svg { width: 34px; height: 34px; color: #7fa9c9; }
.dropzone b { color: var(--ink); font-size: 14px; }
.preview-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #0f2540; }
.preview-wrap img { display: block; width: 100%; max-height: 300px; object-fit: contain; background: #0f2540; }
.preview-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; background: linear-gradient(transparent, rgba(2, 15, 30, 0.75)); }
.preview-bar .btn { background: rgba(255, 255, 255, 0.9); border: 0; }
.uploading { position: absolute; inset: 0; background: rgba(9, 30, 55, 0.55); color: #fff; display: grid; place-items: center; gap: 8px; font-size: 12.5px; }

.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.step { flex: 1; font-size: 11.5px; color: var(--faint); padding-top: 6px; border-top: 3px solid #e5ecf4; }
.step.on { color: var(--primary); border-top-color: var(--primary); font-weight: 600; }
.step.done { color: var(--green); border-top-color: #86efac; }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: #eef7ff; color: var(--primary-dark); border: 1px solid #d6e9f8; }

.hazard-card { border: 1px solid var(--line); border-radius: 13px; padding: 16px; margin-bottom: 12px; background: #fff; transition: border 0.15s, box-shadow 0.15s; }
.hazard-card.picked { border-color: #9ec7e6; box-shadow: 0 0 0 3px rgba(15, 98, 168, 0.08); }
.hazard-top { display: flex; gap: 11px; align-items: flex-start; }
.checkbox { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #c3d3e2; background: #fff; display: grid; place-items: center; flex: 0 0 18px; margin-top: 2px; padding: 0; }
.checkbox.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.checkbox svg { width: 12px; height: 12px; }
.hazard-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.hazard-sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.conf { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.conf-track { flex: 1; height: 5px; background: #eef2f7; border-radius: 99px; overflow: hidden; max-width: 180px; }
.conf-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #38bdf8, #0f62a8); }
.conf-num { font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.evidence { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag-mini { font-size: 11px; background: #f4f7fb; border: 1px solid #e8eef5; color: #52657a; padding: 1px 7px; border-radius: 5px; }

.basis { margin-top: 12px; border: 1px solid #e8eef5; border-radius: 10px; overflow: hidden; background: #fbfdff; }
.basis summary { padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: #334e68; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 7px; }
.basis summary::-webkit-details-marker { display: none; }
.basis summary::after { content: "展开"; margin-left: auto; font-weight: 400; color: var(--faint); font-size: 11.5px; }
.basis[open] summary::after { content: "收起"; }
.basis summary svg { width: 14px; height: 14px; color: var(--primary); }
.basis-body { padding: 0 12px 12px; }
.clause { border-left: 3px solid #bcd9ef; background: #fff; padding: 9px 11px; border-radius: 0 7px 7px 0; margin-bottom: 8px; }
.clause:last-child { margin-bottom: 0; }
.clause-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.clause-code { font-weight: 700; color: var(--primary-dark); font-family: ui-monospace, Consolas, monospace; }
.clause-text { font-size: 12.5px; color: #33475b; line-height: 1.7; }
.clause-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.advice { margin-top: 11px; background: #f0f9f3; border: 1px solid #d4efdd; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #23543a; line-height: 1.7; }
.advice b { color: #166534; }

.confirm-bar { position: sticky; bottom: 74px; margin-top: 14px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -6px 24px -18px rgba(15, 37, 62, 0.5); }
.confirm-summary { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.empty { text-align: center; padding: 44px 20px; color: var(--faint); }
.empty svg { width: 40px; height: 40px; color: #cbd8e6; margin-bottom: 10px; }
.empty b { display: block; color: #64748b; font-size: 14px; margin-bottom: 4px; }

/* ---------- 台账 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 13px 16px; margin-bottom: 14px; }
.filter-bar .search { flex: 1; min-width: 200px; position: relative; }
.filter-bar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); }
.filter-bar .search .input { padding-left: 33px; }
.filter-bar .select { width: auto; min-width: 120px; }
.status-tabs { display: flex; gap: 4px; background: #eef3f9; padding: 3px; border-radius: 9px; flex-wrap: wrap; }
.status-tab { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; color: var(--muted); background: transparent; border: 0; }
.status-tab.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 37, 62, 0.1); }

.record-list { display: flex; flex-direction: column; gap: 10px; }
.record-row { display: flex; gap: 14px; padding: 15px 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); cursor: pointer; position: relative; overflow: hidden; transition: border 0.15s, transform 0.15s; }
.record-row:hover { border-color: #b9d5ee; transform: translateY(-1px); }
.record-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #f59e0b; }
.record-row.major::before { background: var(--red); }
.record-row.closed::before { background: #86efac; }
.record-main { flex: 1; min-width: 0; }
.record-code { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.record-title { font-size: 14px; font-weight: 550; margin: 2px 0 4px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.record-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.record-meta span { display: inline-flex; align-items: center; gap: 4px; }
.record-meta svg { width: 12px; height: 12px; }
.record-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.due { font-size: 11.5px; color: var(--muted); }
.due.overdue { color: var(--red); font-weight: 600; }
.arrow { color: #c3d3e2; flex: 0 0 auto; }
.arrow svg { width: 18px; height: 18px; }

/* ---------- 详情 ---------- */
.detail-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h2 { font-size: 20px; line-height: 1.45; margin: 4px 0 8px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.detail-photo { border-radius: 12px; overflow: hidden; background: #0f2540; margin-bottom: 14px; }
.detail-photo img { width: 100%; display: block; max-height: 380px; object-fit: contain; }
.photo-empty { display: grid; place-items: center; min-height: 140px; background: #f8fbfe; border: 1px dashed #cfe0ee; border-radius: 12px; color: var(--faint); font-size: 12.5px; }
.desc-box { background: #f8fbfe; border: 1px solid #e8eef5; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.75; color: #2a3f55; }

.item-block { border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 10px; }
.item-block .hazard-title { font-size: 14px; }
.item-block.done { opacity: 0.65; }
.item-block.done .hazard-title { text-decoration: line-through; }
.progress-line { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.progress-line input { accent-color: var(--primary); }

.meta-list { display: flex; flex-direction: column; }
.meta-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eef2f7; font-size: 12.5px; }
.meta-item:last-child { border-bottom: 0; }
.meta-item .k { color: var(--faint); flex: 0 0 auto; }
.meta-item .v { text-align: right; font-weight: 550; }
.timeline { padding: 4px 0 0; }
.log { display: flex; gap: 10px; padding-bottom: 14px; position: relative; }
.log::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: #e6edf5; }
.log:last-child::before { display: none; }
.log-dot { width: 11px; height: 11px; border-radius: 50%; background: #cfe0ee; border: 2px solid #fff; box-shadow: 0 0 0 1px #dbe7f1; margin-top: 4px; flex: 0 0 11px; z-index: 1; }
.log-dot.key { background: var(--primary); }
.log-body { min-width: 0; }
.log-action { font-size: 12.5px; font-weight: 600; }
.log-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 1px; word-break: break-word; }
.log-time { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ---------- 依据库 ---------- */
.kb-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.kb-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 260px); overflow: auto; padding-right: 4px; }
.kb-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: all 0.15s; }
.kb-item:hover { border-color: #b9d5ee; }
.kb-item.active { border-color: var(--primary); background: #f5faff; box-shadow: 0 0 0 3px rgba(15, 98, 168, 0.07); }
.kb-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.kb-name { font-size: 13px; margin-top: 2px; line-height: 1.45; }
.kb-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.clause-card { border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 10px; }
.clause-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.clause-card .clause-text { font-size: 13px; margin-top: 8px; }
.clause-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.pending-count { font-size: 11.5px; color: #c2410c; }
.standard-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* ---------- 更新监控 ---------- */
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.source { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fff; }
.source-name { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.source-org { font-size: 11px; color: var(--faint); margin-top: 2px; }
.source-status { margin-top: 7px; display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: var(--faint); }
.update-card { border: 1px solid var(--line); border-radius: 13px; padding: 17px 18px; margin-bottom: 12px; background: #fff; }
.update-card.done { opacity: 0.7; }
.update-title { font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.update-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--faint); margin-top: 6px; align-items: center; }
.update-summary { font-size: 12.5px; color: #405a73; line-height: 1.7; margin-top: 9px; }
.impact { margin-top: 12px; background: #f8fbfe; border: 1px solid #e6eff7; border-radius: 10px; padding: 12px 13px; }
.impact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.impact-num { font-size: 19px; font-weight: 700; color: var(--primary-dark); line-height: 1.3; }
.impact-label { font-size: 11px; color: var(--faint); }
.impact-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.impact-line { font-size: 12px; color: #405a73; display: flex; gap: 7px; align-items: baseline; }
.impact-line b { font-weight: 600; }
.impact-line .badge { flex: 0 0 auto; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.diff-col { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 11.5px; line-height: 1.65; color: #405a73; }
.diff-col .tag { font-size: 10.5px; font-weight: 700; margin-bottom: 4px; display: block; }
.diff-col.before .tag { color: #94a3b8; }
.diff-col.after .tag { color: var(--green); }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #eef2f7; font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.code-like { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; background: #f4f7fb; padding: 2px 6px; border-radius: 5px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 36px; height: 20px; appearance: none; background: #d7e2ee; border-radius: 99px; position: relative; transition: background 0.2s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- 弹层 / 提示 ---------- */
.toast-host { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast {
  background: #12263a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5); animation: toast-in 0.22s ease; max-width: min(86vw, 520px);
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.55;
}
.toast.err { background: #7f1d1d; }
.toast.ok { background: #14532d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-host { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-host::before { content: ""; position: absolute; inset: 0; background: rgba(8, 22, 38, 0.5); backdrop-filter: blur(2px); }
.modal { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 470px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.5); overflow: hidden; animation: modal-in 0.18s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 20px 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 8px 20px 16px; font-size: 13px; color: #405a73; line-height: 1.7; }
.modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: #f3f7fb; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: #e9f0f7; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(15, 98, 168, 0.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
.spinner.light { border-color: rgba(255, 255, 255, 0.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabbar { display: none; }

/* ---------- 重大隐患治理 ---------- */
.module-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.module-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.module-tab:hover { color: var(--primary); }
.module-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.module-tab svg { width: 16px; height: 16px; }
.mh-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mh-step { display: flex; gap: 9px; align-items: center; padding: 4px; min-width: 0; }
.mh-step-no { width: 26px; height: 26px; border-radius: 50%; background: #eef3f9; color: #64748b; display: grid; place-items: center; font-size: 12px; flex: 0 0 26px; }
.mh-step.done .mh-step-no { background: #dcfce7; color: #15803d; }
.mh-step-no svg { width: 14px; height: 14px; }
.mh-step-label { font-size: 12.5px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-step-at { font-size: 11px; color: var(--faint); }
@media (max-width: 700px) {
  .mh-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 41号令判定 ---------- */
.zd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.zd-scope { display: block; padding: 16px 18px; transition: border 0.15s, transform 0.15s; color: inherit; }
.zd-scope:hover { border-color: #b9d5ee; transform: translateY(-1px); }
.zd-scope-name { font-size: 15px; font-weight: 650; margin-top: 9px; line-height: 1.45; }
.zd-scope-desc { font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 5px; min-height: 40px; }
.zd-scope-go { font-size: 12px; color: var(--primary); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.zd-scope-go svg { width: 14px; height: 14px; }
.zd-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr); gap: 16px; align-items: start; }
.zd-item { padding: 15px 18px; margin-bottom: 12px; }
.zd-item-head { display: flex; gap: 10px; align-items: flex-start; }
.zd-no { flex: 0 0 42px; font-size: 12px; color: var(--primary-dark); font-weight: 600; padding-top: 2px; }
.zd-text { font-size: 13px; line-height: 1.75; color: #243b55; }
.zd-item .cl-actions { margin-left: 0; }
.zd-item .cnote { min-height: 40px; }
.cbtn.unknown.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }

@media (max-width: 1024px) {
  .zd-grid { grid-template-columns: 1fr; }
  .zd-layout { grid-template-columns: 1fr; }
}

/* ---------- 专项检查 ---------- */
.cl-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr); gap: 16px; align-items: start; }
.cl-side { position: sticky; top: 82px; }
.cl-dim { margin-bottom: 14px; overflow: hidden; }
.cl-dim-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; background: #f8fbfe; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cl-dim-head b { font-size: 14.5px; margin: 0 6px; }
.cl-dim-score { font-size: 17px; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.cl-item { padding: 14px 18px; border-bottom: 1px solid #eef2f7; }
.cl-item:last-child { border-bottom: 0; }
.cl-item.flag-bad { background: #fffafa; }
.cl-item-head { display: flex; gap: 10px; align-items: flex-start; }
.cl-no { flex: 0 0 30px; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 2px; }
.cl-req { font-size: 13px; line-height: 1.7; color: #243b55; }
.cl-meta { display: flex; flex-direction: column; gap: 3px; margin: 7px 0 0 40px; font-size: 11.5px; color: #64748b; line-height: 1.6; }
.cl-meta b { color: #475569; font-weight: 600; }
.cl-actions { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0 40px; flex-wrap: wrap; }
.check-status { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.cbtn { border: 0; background: #fff; padding: 6px 13px; font-size: 12px; color: #64748b; }
.cbtn + .cbtn { border-left: 1px solid var(--line); }
.cbtn:hover { background: #f8fbfe; }
.cbtn.ok.active { background: #ecfdf5; color: #047857; font-weight: 600; }
.cbtn.bad.active { background: #fef2f2; color: #b91c1c; font-weight: 600; }
.cbtn.na.active { background: #f1f5f9; color: #475569; font-weight: 600; }
.cnote { flex: 1; min-width: 220px; min-height: 38px; max-height: 120px; resize: vertical; border: 1px solid #d8e2ee; border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.55; outline: none; }
.cnote:focus { border-color: #7fb4dd; box-shadow: 0 0 0 3px rgba(15, 98, 168, 0.08); }
.cl-progress { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.cl-progress .bar { flex: 1; }
.cl-total { font-size: 38px; font-weight: 700; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; color: var(--primary-dark); }
.cl-total small { font-size: 14px; font-weight: 500; color: var(--faint); margin-left: 4px; }
.cl-run-score { font-size: 22px; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.cl-run-score small { font-size: 11px; font-weight: 500; color: var(--faint); }
.cl-dim-chips { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .cl-layout { grid-template-columns: 1fr; }
  .cl-side { position: static; }
}
@media (max-width: 920px) {
  .cl-actions { margin-left: 0; }
  .cl-meta { margin-left: 0; }
  .cl-dim-head { padding: 11px 13px; }
  .cl-item { padding: 12px 13px; }
  .cnote { min-width: 100%; }
  .tab { font-size: 8.5px; padding: 4px 0 2px; }
  .tab svg { width: 18px; height: 18px; }
}

/* ---------- 报告 ---------- */
.report-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.paper { background: #fff; max-width: 820px; margin: 0 auto; padding: 46px 52px 40px; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 40px -30px rgba(15, 37, 62, 0.6); }
.paper-head { text-align: center; border-bottom: 2px solid #1f3a56; padding-bottom: 14px; margin-bottom: 20px; }
.paper-head h1 { font-size: 22px; letter-spacing: 0.12em; }
.paper-head .sub { font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: 0.06em; }
.paper-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.paper-table th, .paper-table td { border: 1px solid #cbd8e6; padding: 7px 9px; text-align: left; vertical-align: top; line-height: 1.65; }
.paper-table th { background: #f2f7fb; font-weight: 600; width: 92px; color: #33475b; }
.paper-section { margin-top: 20px; }
.paper-section h3 { font-size: 14px; margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
.paper-basis { font-size: 12px; line-height: 1.75; color: #33475b; }
.paper-sign { display: flex; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; margin-top: 44px; font-size: 12px; color: #475569; }
.paper-sign > div { white-space: nowrap; }
.paper-foot { margin-top: 26px; border-top: 1px dashed #cbd8e6; padding-top: 8px; font-size: 10.5px; color: var(--faint); line-height: 1.6; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .inspect-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .kb-layout { grid-template-columns: 320px minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
}
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2-even, .settings-grid { grid-template-columns: 1fr; }
  .inspect-grid, .kb-layout, .detail-grid { grid-template-columns: 1fr; }
  .kb-list { max-height: 360px; }
  .hero-side { display: none; }
}
@media (max-width: 920px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { height: 58px; padding: 0 16px; }
  .view { padding: 16px 16px 96px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tab { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 3px; color: #8fa3b8; font-size: 10.5px; border-radius: 8px; }
  .tab svg { width: 21px; height: 21px; }
  .tab.active { color: var(--primary); font-weight: 600; }
  .toast-host { bottom: 82px; }
  .hero { padding: 20px; flex-direction: column; align-items: flex-start; }
  .hero h2 { font-size: 19px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-value { font-size: 23px; }
  .stat-icon { width: 28px; height: 28px; right: 10px; top: 10px; }
  .confirm-bar { bottom: 76px; }
  .paper { padding: 26px 18px; }
  .record-side { flex-direction: column; align-items: flex-end; }
  .impact-grid { grid-template-columns: repeat(3, 1fr); }
  .diff { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-head h2 { font-size: 17px; }
  .filter-bar { padding: 11px; }
  .filter-bar .select { flex: 1; min-width: 0; }
  .status-tabs { width: 100%; overflow-x: auto; }
  .record-row { padding: 13px; gap: 10px; }
  .arrow { display: none; }
  .topbar-sub { display: none; }
}
@media (min-width: 1025px) {
  .inspect-grid > .card { position: sticky; top: 82px; }
}
@media (max-width: 640px) {
  .detail-head { flex-direction: column; }
  .detail-head h2 { font-size: 18px; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions .btn { flex: 1; }
  .record-meta { gap: 8px; }
  .record-row { flex-wrap: wrap; }
  .record-side { flex-direction: row; width: 100%; justify-content: space-between; }
  .page-head { flex-direction: column; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .tabbar, .toast-host, .modal-host, .report-actions, .no-print { display: none !important; }
  .main { margin: 0; }
  .view { padding: 0; max-width: none; }
  .paper { border: 0; box-shadow: none; max-width: none; padding: 0; }
  .paper-table th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
