/* 邢台市卫健委演示 - 管理后台 */
:root {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --sidebar: #0b2a4a;
  --sidebar-2: #0e3d66;
  --accent: #1a7fd4;
  --accent-2: #0ea5e9;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --red: #ef4444;
  --yellow: #f59e0b;
  --green: #10b981;
  --blue: #3b82f6;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; }

/* login */
.login-page {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #071a2e 0%, #0b3d91 45%, #0ea5e9 100%);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(14,165,233,.25), transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,.08), transparent 35%);
}
.login-card {
  position: relative; width: 420px; padding: 40px 36px; border-radius: 16px;
  background: rgba(255,255,255,.96); box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-card h1 { margin: 0 0 6px; font-size: 20px; color: #0b3d91; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc;
}
.login-card .btn {
  width: 100%; margin-top: 22px; padding: 12px; border: 0; border-radius: 8px;
  background: linear-gradient(90deg, #0b3d91, #1a7fd4); color: #fff; font-weight: 600; cursor: pointer;
}
.login-card .hint { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }

/* shell */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 240px; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #dbeafe; display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar .brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand b { display: block; font-size: 14px; color: #fff; line-height: 1.4; }
.sidebar .brand span { font-size: 11px; opacity: .7; }
.nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.nav button {
  width: 100%; text-align: left; border: 0; background: transparent; color: #bfdbfe;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; margin-bottom: 2px;
}
.nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav button.active { background: rgba(14,165,233,.35); color: #fff; font-weight: 600; }
.nav .group { font-size: 11px; opacity: .55; padding: 10px 12px 4px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0;
}
.topbar .title { font-size: 15px; font-weight: 600; }
.topbar .meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); }
.topbar .btn-ai, .topbar .btn-screen {
  border: 0; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 12px; color: #fff;
}
.topbar .btn-ai { background: linear-gradient(90deg, #7c3aed, #2563eb); }
.topbar .btn-screen { background: #0b3d91; }

.content { flex: 1; overflow: auto; padding: 16px 18px 28px; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; }
.card .desc { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters select, .filters input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 12px;
}
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--border); background: #fff; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; font-size: 12px; color: var(--muted);
}
.tabs button.active { background: #0b3d91; color: #fff; border-color: #0b3d91; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 22px; font-weight: 700; color: #0b3d91; margin-top: 4px; }
.kpi .tag { display: inline-block; margin-top: 6px; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #e0f2fe; color: #0369a1; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chart-box { height: 280px; }
.chart-box.sm { height: 220px; }

table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th, table.data td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }
table.data th { background: #f8fafc; color: var(--muted); font-weight: 600; position: sticky; top: 0; }
table.data tr:hover td { background: #f1f5f9; }
.badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.badge.norm { background: #dbeafe; color: #1d4ed8; }
.badge.hand { background: #fef3c7; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.yellow { background: #fef3c7; color: #b45309; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.green { background: #d1fae5; color: #047857; }
.badge.ok { background: #d1fae5; color: #047857; }
.badge.fail { background: #fee2e2; color: #b91c1c; }

.table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(720px, 92vw); max-height: 80vh; overflow: auto; background: #fff; border-radius: 12px; padding: 18px 20px;
}
.modal h3 { margin: 0 0 10px; }
.modal pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; font-size: 12px; overflow: auto; }
.modal .close { float: right; border: 0; background: #f1f5f9; border-radius: 6px; padding: 4px 10px; cursor: pointer; }

/* AI */
.ai-layout { display: grid; grid-template-columns: 220px 1fr 280px; gap: 12px; min-height: calc(100vh - 120px); }
@media (max-width: 1100px) { .ai-layout { grid-template-columns: 1fr; } }
.ai-list button {
  display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 10px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 12px; line-height: 1.4;
}
.ai-list button:hover { border-color: var(--accent); }
.ai-chat { display: flex; flex-direction: column; height: 560px; }
.ai-msgs { flex: 1; overflow: auto; padding: 10px; background: #f8fafc; border-radius: 8px; border: 1px solid var(--border); }
.bubble { max-width: 90%; margin: 8px 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.bubble.user { margin-left: auto; background: #0b3d91; color: #fff; }
.bubble.ai { background: #fff; border: 1px solid var(--border); }
.ai-input { display: flex; gap: 8px; margin-top: 10px; }
.ai-input input { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.ai-input button { padding: 10px 16px; border: 0; border-radius: 8px; background: #0b3d91; color: #fff; cursor: pointer; }
.steps { font-size: 12px; color: var(--muted); margin: 8px 0; }
.steps li { margin: 4px 0; }
.steps li.done { color: var(--green); }

.linkish { color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; font-size: inherit; }
.muted { color: var(--muted); font-size: 12px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }
