/* ============================================================
   危机干预协作系统 · 界面样式
   ============================================================ */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #182230;
  --ink-2: #34445a;
  --muted: #6b7a90;
  --line: #e3e8ef;
  --line-2: #eef2f7;
  --brand: #175cd3;
  --brand-dark: #0e3f96;
  --brand-soft: #e8f0fe;
  --danger: #d13b3b;
  --danger-soft: #fdecec;
  --warn: #b7791f;
  --warn-soft: #fdf6e7;
  --ok: #0d7a55;
  --ok-soft: #e7f6ef;
  --info: #2c7be5;
  --info-soft: #eaf2fd;
  --sidebar: #0e1726;
  --sidebar-2: #131f33;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #c9d4e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 16px; color: #fff; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2f7cf6, #124aa8); font-weight: 800; letter-spacing: -.5px; font-size: 15px;
  box-shadow: 0 6px 14px rgba(23, 92, 211, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14.5px; }
.brand-text em { font-style: normal; font-size: 11px; color: #7f93ad; letter-spacing: .06em; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav-group { margin-top: 10px; }
.nav-group-label {
  display: block; font-size: 10.5px; letter-spacing: .14em; color: #5d7089; padding: 6px 10px 4px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #b9c6d8;
  font-size: 13.5px; margin-bottom: 2px; position: relative; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(47, 124, 246, .28), rgba(47, 124, 246, .10)); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #4d8dff;
}
.nav-badge {
  margin-left: auto; background: #e64b4b; color: #fff; font-size: 10.5px; font-weight: 600;
  border-radius: 999px; padding: 0 6px; min-width: 18px; height: 17px; display: grid; place-items: center;
}
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .07); padding: 8px 10px 12px; }
.side-meta { font-size: 10.5px; color: #5d7089; padding: 6px 10px 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-weight: 650; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search {
  display: flex; align-items: center; gap: 6px; margin-left: 8px; flex: 1; max-width: 380px;
  background: #f3f5f9; border: 1px solid transparent; border-radius: 8px; padding: 0 10px; color: var(--muted);
}
.search:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input { border: 0; background: transparent; outline: none; flex: 1; height: 36px; color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.duty-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.duty-pill i { width: 6px; height: 6px; border-radius: 50%; background: #b8c2d0; }
.duty-pill.on { color: var(--ok); border-color: #bfe6d6; background: var(--ok-soft); }
.duty-pill.on i { background: #12a06b; box-shadow: 0 0 0 3px rgba(18, 160, 107, .18); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: #f7f9fc; }
.bell b {
  position: absolute; top: -5px; right: -5px; background: #e64b4b; color: #fff; font-size: 10px;
  border-radius: 999px; padding: 0 5px; min-width: 16px; height: 16px; display: grid; place-items: center;
}
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 999px; color: var(--ink); }
.user-chip:hover { background: #f3f6fb; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 14px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 12.5px; font-weight: 650; }
.user-meta em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.content { padding: 22px; flex: 1; max-width: 1500px; width: 100%; margin: 0 auto; }
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 22px 18px; font-size: 11.5px; color: #93a1b5;
}

/* ---------------- 通用组件 ---------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 14.5px; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }

.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head .desc { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  font-size: 13.5px; font-weight: 520; transition: all .15s; white-space: nowrap;
}
.btn:hover { background: #f7f9fc; border-color: #cfd8e5; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b32f2f; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0a5f43; }
.btn-ghost { background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-danger-soft { background: var(--danger-soft); border-color: #f5c6c6; color: #a92c2c; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 20px; white-space: nowrap;
}
.badge.lv0 { background: #edf1f6; color: #66788f; }
.badge.lv1 { background: var(--ok-soft); color: var(--ok); }
.badge.lv2 { background: var(--warn-soft); color: var(--warn); }
.badge.lv3 { background: #fdeee3; color: #b4550f; }
.badge.lv4 { background: var(--danger-soft); color: var(--danger); }
.badge.st-pending { background: #edf1f6; color: #5b6c83; }
.badge.st-assessing { background: var(--info-soft); color: #1f63c0; }
.badge.st-claimable { background: var(--warn-soft); color: var(--warn); }
.badge.st-emergency { background: var(--danger-soft); color: var(--danger); }
.badge.st-claimed { background: #efe9fd; color: #6941c6; }
.badge.st-active { background: var(--ok-soft); color: var(--ok); }
.badge.st-stabilized { background: #e6f7f4; color: #0d7a6c; }
.badge.st-followup { background: #eaf5fd; color: #1f74b8; }
.badge.st-referred { background: #eef0fe; color: #4a55c8; }
.badge.st-lost { background: #f3ecf4; color: #8a3d8f; }
.badge.st-closed { background: #edf1f6; color: #748398; }
.badge.st-duplicate { background: #f2f2f2; color: #8a8f98; }
.badge.role { background: #eef2f8; color: #55657c; }
.badge.solid-danger { background: var(--danger); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 6px;
  background: #f3f6fa; color: #4c5d75; font-size: 11.5px; margin: 0 4px 4px 0;
}
.chip.bad { background: var(--danger-soft); color: #b03535; }
.chip.good { background: var(--ok-soft); color: #0a6a4b; }

.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); border-color: #bfe6d6; color: #0a6247; }
.alert-warn { background: var(--warn-soft); border-color: #f0dcae; color: #8a5a10; }
.alert-danger { background: var(--danger-soft); border-color: #f5c6c6; color: #9f2b2b; }
.alert-info { background: var(--info-soft); border-color: #cfe0fa; color: #1f5da8; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; letter-spacing: .04em;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fafcff; }
table.data .num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field label .req { color: var(--danger); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.input, .field input[type=text], .field input[type=password], .field input[type=number], .field input[type=date],
.field input[type=datetime-local], .field input[type=tel], .field input[type=email], .field select, .field textarea,
.input-group input, .input-group select, .input-group textarea {
  width: 100%; border: 1px solid #d7dfea; background: #fff; border-radius: 8px; padding: 8px 11px;
  color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; min-height: 38px;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.8px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--brand); }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: #f7f9fc; border: 1px solid var(--line-2); font-size: 12.8px; }
.check-row .mark { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; font-size: 10px; color: #fff; background: #b9c4d3; }
.check-row.ok .mark { background: #12a06b; }
.check-row.no .mark { background: #d13b3b; }
.check-row .hint { color: var(--muted); font-size: 11.5px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .k { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat.danger .v { color: var(--danger); }
.stat.warn .v { color: var(--warn); }
.stat.ok .v { color: var(--ok); }

/* 列表 */
.case-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.case-row:last-child { border-bottom: 0; }
.case-row:hover { background: #fafcff; }
.case-row .no { font-weight: 600; font-size: 13px; }
.case-row .meta { color: var(--muted); font-size: 11.5px; }
.case-row .grow { flex: 1; min-width: 0; }
.case-row .title { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-row .right { display: flex; align-items: center; gap: 8px; flex: none; }
.list { display: flex; flex-direction: column; }
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }

/* ---------------- 案例房间 ---------------- */
.case-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.case-head h1 { font-size: 20px; }
.case-head .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.timeline { position: relative; padding: 4px 0 4px 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid #9fb0c6;
}
.tl-item.important::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tl-item.danger::before { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.tl-item .tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.tl-item .tl-action { font-weight: 650; color: var(--ink-2); font-size: 12.5px; }
.tl-item .tl-body { font-size: 13px; color: var(--ink-2); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.tl-item .tl-body strong { color: var(--ink); }
.tl-empty { color: var(--muted); font-size: 12.5px; padding: 10px 0; }
.tl-form { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 4px; }
.tl-form textarea { min-height: 76px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-actions .btn { width: 100%; justify-content: flex-start; }
.side-block { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.side-block:last-child { border-bottom: 0; }
.side-title { font-size: 11.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.timer.warn { color: var(--warn); }
.timer.danger { color: var(--danger); }
.identity-box { background: #fbfcfe; border: 1px dashed #d7dfea; border-radius: 10px; padding: 12px; }
.identity-box .row { font-size: 12.5px; padding: 3px 0; }
.identity-box .row span { color: var(--muted); display: inline-block; width: 66px; }

/* 附件 */
.attach-list { display: flex; flex-direction: column; gap: 6px; }
.attach { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 8px; background: #f7f9fc; border-radius: 7px; }
.attach .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 线下任务 */
.action-card { background: #0f1726; color: #d7e0ec; border-radius: 12px; padding: 16px 18px; }
.action-card h4 { color: #fff; font-size: 13.5px; margin-bottom: 8px; }
.action-card ul { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.8; color: #b8c6d8; }
.action-card .danger-line { color: #ff9b9b; }
.sos-btn {
  width: 100%; height: 54px; border-radius: 12px; border: 0; background: linear-gradient(135deg, #e23c3c, #a91f1f);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .08em; cursor: pointer;
  box-shadow: 0 8px 20px rgba(200, 40, 40, .3);
}
.sos-btn:active { transform: translateY(1px); }
.loc-list { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.map-box {
  height: 180px; border-radius: 10px; background:
    radial-gradient(circle at 30% 40%, #e8eef7 0, #e8eef7 2px, transparent 3px) 0 0/28px 28px,
    linear-gradient(135deg, #f7f9fc, #eef3fa);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 12px;
}

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 13px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 4px; padding: 12px 16px; flex-wrap: wrap; }
.pg { padding: 4px 9px; border-radius: 6px; font-size: 12.5px; color: var(--ink-2); border: 1px solid transparent; }
.pg:hover { background: #f3f6fa; }
.pg.active { background: var(--brand); color: #fff; }
.pg.disabled { opacity: .4; pointer-events: none; }
.pg.gap { color: var(--muted); }
.pg-info { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* 空状态 */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-ico { width: 46px; height: 46px; border-radius: 50%; background: #f1f4f9; display: grid; place-items: center; margin: 0 auto 12px; color: #9fb0c6; }
.empty h3 { font-size: 14.5px; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 460px; margin: 0 auto 14px; }

/* 登录 / 注册 */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.auth-left {
  background: radial-gradient(1200px 600px at 10% 0%, #1b3f7e 0, #0e1726 55%, #0a111c 100%);
  color: #dbe5f3; padding: 48px 52px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-left::after {
  content: ""; position: absolute; right: -120px; bottom: -160px; width: 460px; height: 460px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .07); box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 130px rgba(255, 255, 255, .018);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.auth-brand .brand-logo { width: 44px; height: 44px; font-size: 17px; }
.auth-brand strong { color: #fff; font-size: 17px; display: block; }
.auth-brand em { font-style: normal; font-size: 11.5px; color: #8195af; letter-spacing: .08em; }
.auth-left h1 { color: #fff; font-size: 27px; line-height: 1.35; margin-bottom: 14px; letter-spacing: -.02em; }
.auth-left .lead { color: #a9b9ce; font-size: 13.5px; max-width: 460px; line-height: 1.85; }
.auth-rules { margin-top: 36px; display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.auth-rule { display: flex; gap: 10px; font-size: 12.5px; color: #b6c5d8; }
.auth-rule .mark { width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, .07); display: grid; place-items: center; flex: none; color: #7ea6e8; }
.auth-foot { margin-top: auto; font-size: 11.5px; color: #6c7f98; padding-top: 32px; line-height: 1.8; }
.auth-right { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { margin-top: 6px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.auth-hotline { margin-top: 24px; padding: 12px 14px; border-radius: 10px; background: var(--danger-soft); color: #9f2b2b; font-size: 12.5px; line-height: 1.7; }
.auth-hotline strong { display: block; }

/* 模态 / 抽屉（JS 控制） */
.modal-mask { position: fixed; inset: 0; background: rgba(12, 20, 33, .45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(10, 20, 40, .3); max-height: 90vh; overflow: auto; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 15px; flex: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }

/* Toast */
#toast { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #101b2d; color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toastIn .18s ease-out; }
.toast.err { background: #8f2626; }
@keyframes toastIn { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 水印 */
.watermark {
  position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 170px; align-content: space-between;
  opacity: .055; transform: rotate(-22deg) scale(1.25); transform-origin: center;
}
.watermark span { font-size: 12px; color: #0b1b33; white-space: nowrap; padding: 20px; text-align: center; }

/* 错误页 */
.abort-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.abort-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px 40px; text-align: center; box-shadow: var(--shadow); max-width: 420px; }
.abort-code { font-size: 46px; font-weight: 800; color: #d7dfea; letter-spacing: -.04em; }
.abort-card h2 { margin: 4px 0 8px; }
.abort-card p { color: var(--muted); font-size: 13px; }

/* 下拉折叠 */
details.inline { border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: #fff; }
details.inline > summary { cursor: pointer; padding: 10px 0; font-size: 12.8px; color: var(--ink-2); font-weight: 560; }
details.inline[open] { padding-bottom: 12px; }

/* 响应式 */
@media (max-width: 1120px) {
  .case-layout { grid-template-columns: 1fr; }
  .case-layout .case-side { order: -1; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10, 18, 30, .4); z-index: 35; }
  .menu-btn { display: grid; }
  .content { padding: 16px; }
  .search { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .user-meta { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-title { font-size: 14px; }
}
@media (max-width: 620px) {
  .page-head h1 { font-size: 18px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
  .duty-pill { display: none; }
  .watermark { grid-template-columns: repeat(2, 1fr); }
}

/* 统计页：卡片网格、条形图、响应漏斗 */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.report-grid > .card + .card { margin-top: 0; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 9px; background: #f0f3f8; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5a97f8, #2f7cf6); }
.bar-fill.warn { background: linear-gradient(90deg, #f2c15a, #dd9200); }
.bar-fill.danger { background: linear-gradient(90deg, #f08a8a, #d13b3b); }
.bar-fill.ok { background: linear-gradient(90deg, #45c395, #12a06b); }
.bar-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.fn-label { width: 62px; flex: none; color: var(--muted); }
.fn-bar { height: 30px; border-radius: 7px; background: linear-gradient(90deg, rgba(47, 124, 246, .88), rgba(47, 124, 246, .42)); display: flex; align-items: center; justify-content: flex-end; padding: 0 9px; color: #fff; font-size: 11.5px; min-width: 38px; transition: width .2s; }
.fn-pct { width: 50px; flex: none; color: var(--muted); font-size: 11.5px; }
@media (max-width: 620px) {
  .report-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 88px minmax(0, 1fr) 40px; }
}

/* 管理后台成员表：逐列对齐，行内控件紧凑 */
.row-form { display: none; }
table.member-table th,
table.member-table td { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
table.member-table select,
table.member-table input[type="date"] {
  min-height: 30px;
  height: 30px;
  padding: 0 6px;
  font-size: 12px;
  width: 100%;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
table.member-table td:nth-child(3) { min-width: 128px; }
table.member-table td:nth-child(4) { min-width: 100px; }
table.member-table td:nth-child(5) { min-width: 92px; }
table.member-table td:nth-child(6) { min-width: 138px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.row-actions form { display: inline-flex; }

/* 运维工具：执行日志 */
.ops-log {
  margin: 0;
  padding: 12px 14px;
  background: #f6f8fa;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.8;
  color: #34445a;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 340px;
  overflow: auto;
}

