:root {
  color-scheme: light;
  --bg: #f2f5fa;
  --card: #fff;
  --text: #172033;
  --muted: #718096;
  --line: #e7ebf2;
  --blue: #2463eb;
  --blue-soft: #eef4ff;
  --red: #d92d20;
  --red-soft: #fff1f0;
  --orange: #d97706;
  --green: #138a5b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #dbeafe, transparent 35%), var(--bg); }
.login-card { width: min(420px, 100%); background: #fff; padding: 36px; border-radius: 20px; box-shadow: 0 24px 80px rgba(24, 39, 75, .12); }
.shield { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: var(--blue); color: #fff; font-size: 25px; }
.login-card h1 { margin: 20px 0 8px; font-size: 25px; }
.login-card p { margin: 0 0 28px; color: var(--muted); }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field span { font-size: 13px; color: #4a5568; }
input, select { min-height: 42px; padding: 0 12px; border: 1px solid #d8deea; border-radius: 9px; background: #fff; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 99, 235, .1); }
.primary, .ghost, .danger, .small { border: 0; border-radius: 9px; padding: 10px 16px; }
.primary { background: var(--blue); color: #fff; }
.primary:disabled { opacity: .55; cursor: not-allowed; }
.ghost { color: #44506a; background: #eef1f6; }
.danger { color: var(--red); background: var(--red-soft); }
.small { padding: 6px 10px; color: var(--blue); background: var(--blue-soft); }
.wide { width: 100%; margin-top: 8px; }
.error { padding: 10px 12px; margin: 0 0 14px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; }
.topbar { height: 68px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand .shield { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }
.user { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.page { max-width: 1500px; margin: 0 auto; padding: 24px 28px 60px; }
.headline { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.headline h2 { margin: 0 0 6px; font-size: 24px; }
.headline p { margin: 0; color: var(--muted); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 16px rgba(30, 41, 59, .04); }
.metric { padding: 18px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 27px; }
.metric.danger strong { color: var(--red); }
.panel { padding: 18px; margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 17px; }
.panel-head small { color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.filters .span-2 { grid-column: span 2; }
.check { min-height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #d8deea; border-radius: 9px; color: #4a5568; background: #fff; }
.check input { min-height: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 10px; text-align: left; color: var(--muted); background: #f8fafc; font-weight: 600; white-space: nowrap; }
td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: top; }
tr.clickable:hover { background: #f8fbff; }
.preview { max-width: 420px; color: #344054; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-thumb { display: block; width: 72px; height: 72px; margin-bottom: 4px; border-radius: 8px; object-fit: cover; background: #eef1f6; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.tag { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; font-size: 11px; background: #edf2f7; color: #526079; white-space: nowrap; }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: #eaf8f2; color: var(--green); }
.tag.orange { background: #fff5e6; color: var(--orange); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 160px; }
.list { display: grid; gap: 8px; max-height: 330px; overflow: auto; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.list-item strong { display: block; font-size: 13px; }
.list-item small { color: var(--muted); }
.alert-item { border-left: 4px solid var(--orange); }
.alert-item.high { border-left-color: var(--red); }
.alert-item.done { opacity: .62; border-left-color: #a0aec0; }
.drawer-mask { position: fixed; inset: 0; z-index: 30; background: rgba(15,23,42,.38); }
.drawer { position: fixed; top: 0; right: 0; z-index: 31; width: min(620px, 92vw); height: 100vh; display: flex; flex-direction: column; background: #fff; box-shadow: -20px 0 60px rgba(15,23,42,.2); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; }
.drawer-body { flex: 1; overflow: auto; padding: 18px; background: #f7f9fc; }
.message { max-width: 82%; margin-bottom: 13px; }
.message.mine { margin-left: auto; text-align: right; }
.message small { display: block; margin-bottom: 4px; color: var(--muted); }
.bubble { display: inline-block; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-align: left; white-space: pre-wrap; word-break: break-word; }
.message.mine .bubble { background: var(--blue-soft); border-color: #d8e5ff; }
.audit-image { display: block; max-width: min(360px, 72vw); max-height: 420px; border-radius: 12px; object-fit: contain; background: #eef1f6; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; padding: 12px 16px; color: #fff; background: #172033; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
@media (max-width: 1050px) { .cards { grid-template-columns: repeat(3, 1fr); } .filters { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .topbar { padding: 0 14px; } .page { padding: 18px 14px 40px; } .cards { grid-template-columns: repeat(2, 1fr); } .filters { grid-template-columns: 1fr 1fr; } .filters .span-2 { grid-column: span 2; } .two-col { grid-template-columns: 1fr; } .headline { align-items: flex-start; flex-direction: column; } }
