/* ============================================================
   IOM-Agent 设计系统：内网运维管理平台
   无外部依赖（离线可用）；浅色/深色双主题由 CSS 变量驱动
   ============================================================ */
:root {
  --bg: #f6f7fb; --panel: #fff; --line: #edf0f5; --text: #1f2329;
  --muted: #8a919f; --primary: #3b6ff5; --primary-dark: #2f5ce0;
  --primary-soft: rgba(59, 111, 245, .12);
  --danger: #e5484d; --ok: #30a46c; --warn: #e6a23c; --sidebar: #1a2233;
  --sidebar-text: #aab4c8;
  --th-bg: #fafbfd; --row-hover: #f6f8fc;
  --btn-bg: #fff; --btn-bg-hover: #f2f4f9; --input-bg: #fff;
  --tag-bg: rgba(59, 111, 245, .1); --tag-text: #2f5ce0;
  --badge-gray-bg: #f1f3f8; --badge-gray-text: #6b7280;
  --badge-blue-bg: rgba(59, 111, 245, .12); --badge-blue-text: #2f5ce0;
  --badge-green-bg: rgba(48, 164, 108, .14); --badge-green-text: #218358;
  --badge-red-bg: rgba(229, 72, 77, .12); --badge-red-text: #d6393f;
  --badge-yellow-bg: rgba(230, 162, 60, .16); --badge-yellow-text: #a16207;
  --toast-info: #2f3644;
  --login-box-bg: rgba(255, 255, 255, .92); --login-tab-bg: #eef1f7;
  --login-grad-a: #141c2e; --login-grad-b: #27406b;
  --msg-err-bg: rgba(229, 72, 77, .1); --msg-err-line: #f3c2c4;
  --msg-ok-bg: rgba(48, 164, 108, .12); --msg-ok-line: #b6e3c9;
  --captcha-hint-bg: rgba(59, 111, 245, .07); --captcha-hint-text: #2c477e; --captcha-border: #d7deeb;
  --side-text: #aab4c8; --side-dim: #6d7a90; --side-hover: rgba(59, 111, 245, .35);
  --side-line: rgba(255, 255, 255, .07); --side-btn-bg: rgba(255, 255, 255, .06);
  --side-active-bg: linear-gradient(90deg, rgba(59, 111, 245, .9), rgba(59, 111, 245, .55));
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 44px rgba(16, 24, 40, .16);
  --radius: 12px; --radius-sm: 8px;
}
:root[data-theme="dark"] {
  --bg: #0b0f16; --panel: #141a24; --line: #232c3b; --text: #e8ecf3;
  --muted: #8b95a7; --primary: #5b8cff; --primary-dark: #4a7bf0;
  --primary-soft: rgba(91, 140, 255, .14);
  --danger: #ff6b6e; --ok: #4cc38a; --warn: #e6b45c; --sidebar: #0d1219;
  --sidebar-text: #9aa6bc;
  --th-bg: #181f2b; --row-hover: #1a2130;
  --btn-bg: #1c2432; --btn-bg-hover: #263044; --input-bg: #0f141d;
  --tag-bg: rgba(91, 140, 255, .16); --tag-text: #8ab2ff;
  --badge-gray-bg: #263044; --badge-gray-text: #8b95a7;
  --badge-blue-bg: rgba(91, 140, 255, .16); --badge-blue-text: #8ab2ff;
  --badge-green-bg: rgba(76, 195, 138, .16); --badge-green-text: #6fd0a0;
  --badge-red-bg: rgba(255, 107, 110, .16); --badge-red-text: #ff9b9d;
  --badge-yellow-bg: rgba(230, 180, 92, .18); --badge-yellow-text: #ecc37c;
  --toast-info: #263044;
  --login-box-bg: rgba(20, 26, 36, .88); --login-tab-bg: #1c2432;
  --login-grad-a: #05080d; --login-grad-b: #16233c;
  --msg-err-bg: rgba(255, 107, 110, .12); --msg-err-line: #5c2b2d;
  --msg-ok-bg: rgba(76, 195, 138, .12); --msg-ok-line: #1f4d34;
  --captcha-hint-bg: rgba(91, 140, 255, .1); --captcha-hint-text: #a8c4f5; --captcha-border: #2c3850;
  --side-text: #9aa6bc; --side-dim: #6d7a90; --side-hover: rgba(91, 140, 255, .25);
  --side-line: rgba(255, 255, 255, .07); --side-btn-bg: rgba(255, 255, 255, .06);
  --side-active-bg: linear-gradient(90deg, rgba(91, 140, 255, .85), rgba(91, 140, 255, .45));
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "HarmonyOS Sans SC",
    "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }
::selection { background: var(--primary-soft); }

/* 细滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--badge-gray-bg); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- 布局 ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; background: linear-gradient(180deg, var(--sidebar), var(--sidebar) 70%, rgba(0, 0, 0, .18));
  color: var(--side-text); flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand {
  padding: 20px 18px 16px; font-size: 15.5px; font-weight: 700; color: #fff;
  border-bottom: 1px solid var(--side-line); letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar .brand::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px; flex: none;
  background: linear-gradient(135deg, var(--primary), #7ea4ff);
  box-shadow: 0 0 10px rgba(91, 140, 255, .8);
}
.sidebar nav { flex: 1; padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  color: var(--side-text); border-radius: var(--radius-sm); font-size: 13.5px;
  transition: background .15s, color .15s; position: relative;
}
.sidebar nav a .nav-ico { width: 18px; text-align: center; flex: none; font-size: 14px; opacity: .9; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: var(--side-active-bg); color: #fff; font-weight: 600; }
.sidebar .foot { padding: 14px 16px; font-size: 12px; color: var(--side-dim); border-top: 1px solid var(--side-line); }
.theme-toggle {
  display: block; margin: 8px 12px 6px; width: calc(100% - 24px);
  padding: 7px 10px; font-size: 12.5px; color: var(--side-text); background: var(--side-btn-bg);
  border: 1px solid var(--side-line); border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s, color .15s;
}
.theme-toggle:hover { background: var(--side-hover); color: #fff; }
.main { flex: 1; padding: 24px 30px 40px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; letter-spacing: .3px; }

/* ---- 卡片 ---- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
  animation: rise .25s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }
.card h3 {
  font-size: 13.5px; margin-bottom: 13px; color: var(--text); font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.card h3::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--primary); flex: none; }
.grid { display: grid; gap: 14px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.stat { position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; right: -18px; top: -18px; width: 84px; height: 84px;
  border-radius: 50%; background: var(--primary-soft); opacity: .55;
}
.stat .num { font-size: 27px; font-weight: 750; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat.warn .num { color: var(--danger); }
.stat.warn::after { background: rgba(229, 72, 77, .12); }

/* ---- 表格 ---- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  background: var(--th-bg); font-weight: 600; color: var(--muted); font-size: 12px;
  white-space: nowrap; letter-spacing: .3px;
}
th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--row-hover); }
td { font-variant-numeric: tabular-nums; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6.5px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--text); cursor: pointer; font-size: 13px;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { background: var(--btn-bg-hover); border-color: var(--captcha-border); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--primary-soft); border-color: var(--primary);
}
.btn.primary { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); border-color: transparent; color: #fff; font-weight: 500; }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 4px 12px rgba(59, 111, 245, .35); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--badge-red-bg); border-color: var(--msg-err-line); }
.btn.sm { padding: 3px 9px; font-size: 12px; box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---- 表单 ---- */
input, select, textarea {
  font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--captcha-border); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex-shrink: 0; }

/* ---- 徽章 / 标签 ---- */
.tag {
  display: inline-block; background: var(--tag-bg); color: var(--tag-text);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 1px 4px 1px 0; font-weight: 500;
}
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.badge.gray { background: var(--badge-gray-bg); color: var(--badge-gray-text); }
.badge.blue { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
.badge.green { background: var(--badge-green-bg); color: var(--badge-green-text); }
.badge.red { background: var(--badge-red-bg); color: var(--badge-red-text); }
.badge.yellow { background: var(--badge-yellow-bg); color: var(--badge-yellow-text); }

/* ---- Toast / 分页 / 杂项 ---- */
#toast { position: fixed; top: 18px; right: 18px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast-item {
  padding: 10px 16px; border-radius: var(--radius-sm); color: #fff; font-size: 13px;
  box-shadow: var(--shadow-lg); max-width: 380px; animation: slideIn .2s ease;
  backdrop-filter: blur(6px);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.toast-item.ok { background: rgba(48, 164, 108, .94); } .toast-item.err { background: rgba(229, 72, 77, .94); } .toast-item.info { background: var(--toast-info); }

.muted { color: var(--muted); font-size: 12px; }
.mt { margin-top: 12px; }
.hidden { display: none; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; color: var(--muted); font-size: 12.5px; }

/* ---- 登录页 ---- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 12% 18%, rgba(91, 140, 255, .22), transparent 60%),
    radial-gradient(800px 520px at 88% 85%, rgba(48, 164, 108, .14), transparent 60%),
    linear-gradient(135deg, var(--login-grad-a) 0%, var(--login-grad-b) 100%);
}
.login-box {
  width: 436px; background: var(--login-box-bg); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 16px; padding: 28px 32px 16px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: rise .3s ease;
}
.login-box h2 { font-size: 18px; margin-bottom: 5px; letter-spacing: .5px; }
.login-box .sub { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.login-box .tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--login-tab-bg); padding: 4px; border-radius: 10px; }
.login-box .tabs button {
  flex: 1; padding: 7px; border: none; background: transparent; color: var(--muted);
  border-radius: 7px; cursor: pointer; font-size: 13.5px; transition: all .15s; font-weight: 500;
}
.login-box .tabs button.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.login-box input { padding: 9px 12px; font-size: 14px; }
.login-box label { font-size: 12.5px; }
.login-theme-toggle {
  position: fixed; top: 16px; right: 18px; z-index: 10; padding: 7px 14px; font-size: 13px;
  color: var(--text); background: var(--login-box-bg); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px; cursor: pointer; box-shadow: var(--shadow); backdrop-filter: blur(10px);
  transition: filter .15s, transform .1s;
}
.login-theme-toggle:hover { filter: brightness(1.1); }
.login-theme-toggle:active { transform: translateY(1px); }

/* ---- 登录页：表单消息与点选验证码 ---- */
.form-msg { padding: 9px 13px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.form-msg.err { background: var(--msg-err-bg); color: var(--danger); border: 1px solid var(--msg-err-line); }
.form-msg.ok { background: var(--msg-ok-bg); color: var(--ok); border: 1px solid var(--msg-ok-line); }
.card.notice-ok { background: var(--msg-ok-bg); border-color: var(--msg-ok-line); }
/* 验证码：行式内嵌（提示左 + 图片右） */
/* 验证码样式已内联至 login.html */

.card.notice-ok { background: var(--msg-ok-bg); border-color: var(--msg-ok-line); }

.kb-content { white-space: pre-wrap; font-family: inherit; background: var(--th-bg);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; max-height: 480px; overflow: auto; }

/* ======== 运维驾驶舱（首页）======== */
.dash-hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--sidebar) 0%, #1a3a5c 60%, #1a4a7a 100%);
  border-radius: var(--radius); position: relative; overflow: hidden;
}
.dash-hero::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(91,140,255,.15), transparent 70%);
}
.dash-hero::after {
  content: ""; position: absolute; left: 30%; bottom: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: radial-gradient(circle, rgba(48,164,108,.08), transparent 70%);
}
.dash-title { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 2px; }
.dash-sub { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 4px; letter-spacing: 1px; }
.dash-ai-btn {
  background: linear-gradient(135deg, rgba(91,140,255,.3), rgba(91,140,255,.15));
  border: 1px solid rgba(91,140,255,.4); color: #8ab2ff;
  padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s; position: relative; z-index: 1;
}
.dash-ai-btn:hover { background: rgba(91,140,255,.35); box-shadow: 0 0 16px rgba(91,140,255,.3); }
.dash-ai-btn[disabled] { opacity: .5; cursor: wait; }

.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.dash-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px 16px; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  animation: rise .3s ease both;
}
.dash-card:nth-child(1) { animation-delay: 0s; }
.dash-card:nth-child(2) { animation-delay: .05s; }
.dash-card:nth-child(3) { animation-delay: .1s; }
.dash-card:nth-child(4) { animation-delay: .15s; }
.dash-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.dash-card::after {
  content: ""; position: absolute; right: -14px; top: -14px; width: 72px; height: 72px;
  border-radius: 50%; background: var(--primary-soft); opacity: .4;
}
.dash-card.alert::after { background: rgba(229,72,77,.1); }
.dash-card.alert .dash-card-num { color: var(--danger); }
.dash-card-icon { font-size: 22px; margin-bottom: 8px; opacity: .8; }
.dash-card-num { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.dash-card-label { font-size: 12px; color: var(--muted); margin-top: 6px; }

.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.dash-panel { min-height: 120px; }
.dash-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-badge { font-size: 12.5px; padding: 4px 12px; }
.dash-badge b { margin-left: 4px; font-size: 14px; }
.dash-tag { font-size: 12.5px; padding: 3px 10px; }
.dash-tag b { margin-left: 3px; }

.dash-actions-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.dash-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  text-decoration: none; color: var(--text); font-size: 12.5px; font-weight: 500;
  transition: all .15s;
}
.dash-action:hover { border-color: var(--primary); background: var(--primary-soft);
  transform: translateY(-2px); color: var(--primary); }
.da-icon { font-size: 24px; }

@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-two-col { grid-template-columns: 1fr; }
  .dash-actions-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ======== 任务中心：视图切换与任务概览 ======== */
.view-tabs {
  display: flex; gap: 6px; margin-bottom: 16px; background: var(--login-tab-bg);
  padding: 4px; border-radius: 10px; width: fit-content;
}
.view-tab {
  padding: 7px 20px; border: none; background: transparent; color: var(--muted);
  border-radius: 7px; cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: all .15s; white-space: nowrap;
}
.view-tab.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

.freq-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.freq-tab {
  padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.freq-tab:hover { border-color: var(--primary); color: var(--primary); }
.freq-tab.active {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-color: transparent; color: #fff; font-weight: 600;
}
.freq-tab .cnt { margin-left: 4px; opacity: .75; font-size: 12px; font-variant-numeric: tabular-nums; }

.ov-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.ov-kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s; animation: rise .3s ease both;
}
.ov-kpi:nth-child(1) { animation-delay: 0s; } .ov-kpi:nth-child(2) { animation-delay: .04s; }
.ov-kpi:nth-child(3) { animation-delay: .08s; } .ov-kpi:nth-child(4) { animation-delay: .12s; }
.ov-kpi:nth-child(5) { animation-delay: .16s; }
.ov-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ov-kpi.clickable { cursor: pointer; }
.ov-kpi-ico {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; font-size: 17px; margin-bottom: 10px; background: var(--badge-gray-bg);
}
.ov-kpi.k-blue .ov-kpi-ico { background: var(--badge-blue-bg); }
.ov-kpi.k-green .ov-kpi-ico { background: var(--badge-green-bg); }
.ov-kpi.k-yellow .ov-kpi-ico { background: var(--badge-yellow-bg); }
.ov-kpi.k-red .ov-kpi-ico { background: var(--badge-red-bg); }
.ov-kpi .num { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.ov-kpi.k-red .num { color: var(--danger); }
.ov-kpi .label { font-size: 12px; color: var(--muted); margin-top: 5px; }
.ov-kpi .sub { font-size: 11.5px; margin-top: 2px; color: var(--muted); }
.ov-kpi .sub b { color: var(--text); }

.ov-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }

.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-center { font-variant-numeric: tabular-nums; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 170px; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dl-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }
.dl-row b { margin-left: auto; font-variant-numeric: tabular-nums; }

.freq-slices { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.fs-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 4px 6px; border-radius: var(--radius-sm); transition: background .15s;
}
.fs-row:hover { background: var(--row-hover); }
.fs-name { width: 62px; font-size: 12.5px; font-weight: 500; flex: none; }
.fs-bar { flex: 1; height: 10px; background: var(--badge-gray-bg); border-radius: 5px; overflow: hidden; }
.fs-bar > div { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }
.fs-meta { width: 150px; text-align: right; font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }

.person-bars { display: flex; flex-direction: column; gap: 10px; }
.pb-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 5px 6px; border-radius: var(--radius-sm); transition: background .15s;
}
.pb-row:hover { background: var(--row-hover); }
.pb-who { width: 118px; flex: none; overflow: hidden; }
.pb-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-vendor { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-track { flex: 1; height: 14px; background: var(--badge-gray-bg); border-radius: 7px; overflow: hidden; display: flex; }
.pb-seg { height: 100%; transition: width .3s; }
.pb-meta { width: 200px; flex: none; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.due-pill {
  display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px;
  font-weight: 600; white-space: nowrap;
}
.due-pill.red { background: var(--badge-red-bg); color: var(--badge-red-text); }
.due-pill.yellow { background: var(--badge-yellow-bg); color: var(--badge-yellow-text); }
.due-pill.gray { background: var(--badge-gray-bg); color: var(--badge-gray-text); }

.ov-upcoming-bar { display: inline-block; width: 80px; height: 7px; background: var(--badge-gray-bg); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.ov-upcoming-bar > div { height: 100%; background: var(--primary); border-radius: 4px; }

/* ======== 值班管理：今日值班 ======== */
.duty-summary { display: flex; gap: 34px; align-items: center; flex-wrap: wrap; }
.ds-item { display: flex; flex-direction: column; gap: 1px; min-width: 64px; }
.ds-item b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ds-item .muted { font-size: 11.5px; }
.ds-item.ok b { color: var(--ok); }
.ds-item.warn b { color: var(--danger); }

.duty-group h3 .tag { margin-left: 4px; }
.duty-member {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 6px; border-bottom: 1px solid var(--line);
}
.duty-group .duty-member:last-child { border-bottom: none; }
.dm-who { min-width: 200px; }
.dm-who b { font-size: 13.5px; margin-right: 8px; }
.dm-who .muted { font-size: 12px; }
.dm-checkin { min-width: 96px; }
.dm-actions { margin-left: auto; display: flex; gap: 6px; }

.tl-item { padding: 9px 0 9px 14px; border-left: 2px solid var(--primary-soft); position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.tl-head { font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-body {
  margin-top: 5px; font-size: 12.5px; color: var(--muted); white-space: pre-wrap;
  background: var(--th-bg); border-radius: var(--radius-sm); padding: 8px 12px;
}

@media (max-width: 1000px) {
  .ov-kpis { grid-template-columns: repeat(2, 1fr); }
  .ov-two-col { grid-template-columns: 1fr; }
  .pb-meta { width: 150px; }
}
