/* ==========================================================================
   运维控制台 · 样式
   设计语言：紫色渐变侧边栏 + 淡紫冷调底 + 白数据卡 + 染色入口卡
   形状：卡片 16 / 控件 10 / 胶囊 999；阴影只有两级
   ========================================================================== */

:root {
  /* ---------- 设计令牌 ---------- */
  --c-primary: #7C5CFC;
  --c-primary-hover: #6A4BE0;
  --c-primary-soft: #F1EEFF;
  --c-sidebar-from: #8A63F8;
  --c-sidebar-to: #6472F0;
  --c-bg: #EEF2FE;
  --c-card: #FFFFFF;
  --c-tint-lavender: #F1EEFF;
  --c-tint-blue: #EAF2FF;
  --c-tint-cream: #FFF6E8;
  --c-tint-mint: #E7F8F0;
  --c-icon-blue: #4A7DF0;
  --c-icon-teal: #2BC48A;
  --c-icon-orange: #F5A54A;
  --c-icon-purple: #8A63F8;
  --c-success: #2BC48A;
  --c-warning: #F5A54A;
  --c-danger: #E24B4A;
  --c-info: #4A7DF0;
  --c-text-1: #23294E;
  --c-text-2: #6B7395;
  --c-text-3: #9AA1BF;
  --c-border: rgba(99, 91, 255, .12);

  /* ---------- 兼容别名（历史类名沿用） ---------- */
  --bg: var(--c-bg);
  --card: var(--c-card);
  --border: var(--c-border);
  --border-strong: rgba(99, 91, 255, .20);
  --text: var(--c-text-1);
  --text-2: var(--c-text-2);
  --muted: var(--c-text-3);
  --primary: var(--c-primary);
  --primary-dark: #5B3FD0;
  --primary-soft: var(--c-primary-soft);
  --cyan: var(--c-info);
  --green: var(--c-success);
  --green-soft: var(--c-tint-mint);
  --orange: var(--c-warning);
  --orange-soft: var(--c-tint-cream);
  --red: var(--c-danger);
  --red-soft: #FDECEC;
  --nav-1: var(--c-sidebar-from);
  --nav-2: var(--c-sidebar-to);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 8px 24px rgba(99, 91, 255, .08);
  --shadow-md: 0 16px 40px rgba(35, 41, 78, .14);
  --ring: 0 0 0 3px rgba(124, 92, 252, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.62 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--c-bg);
}

code, pre, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { letter-spacing: -.01em; }

::selection { background: rgba(124, 92, 252, .18); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 滚动条 */
.report-list, .md-body, .modal-body, .raw-body, .rcpt-list, .tasklog { scrollbar-width: thin; scrollbar-color: rgba(99, 91, 255, .18) transparent; }
.report-list::-webkit-scrollbar, .md-body::-webkit-scrollbar, .modal-body::-webkit-scrollbar,
.raw-body::-webkit-scrollbar, .rcpt-list::-webkit-scrollbar, .tasklog::-webkit-scrollbar { width: 8px; height: 8px; }
.report-list::-webkit-scrollbar-thumb, .md-body::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb,
.raw-body::-webkit-scrollbar-thumb, .rcpt-list::-webkit-scrollbar-thumb, .tasklog::-webkit-scrollbar-thumb {
  background: rgba(99, 91, 255, .18); border-radius: 8px;
}
.report-list::-webkit-scrollbar-thumb:hover, .md-body::-webkit-scrollbar-thumb:hover { background: rgba(99, 91, 255, .32); }
.report-list::-webkit-scrollbar-track, .md-body::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   登录 / 初始化
   ========================================================================== */
.auth-wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(760px 460px at 8% 4%, rgba(138, 99, 248, .22), transparent 62%),
    radial-gradient(680px 420px at 96% 98%, rgba(100, 114, 240, .20), transparent 60%),
    var(--c-bg);
}
.auth-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 92, 252, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 252, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 78%);
}
.auth-glow {
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 99, 248, .30), transparent 68%);
  filter: blur(46px);
  top: -160px; right: -110px;
  pointer-events: none;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 400px;
  max-width: 100%;
  padding: 36px 32px 28px;
  border-radius: 20px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--c-sidebar-from), var(--c-sidebar-to));
}
.auth-logo {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .06em;
  background: linear-gradient(135deg, var(--c-sidebar-from), var(--c-sidebar-to));
  box-shadow: 0 10px 20px -12px rgba(124, 92, 252, .95);
}
.auth-card h1 { font-size: 22px; font-weight: 500; margin: 0 0 6px; }
.auth-sub { color: var(--text-2); font-size: 12.5px; margin: 0 0 22px; }
.auth-card label { display: block; margin-bottom: 14px; font-size: 12.5px; color: var(--text-2); }
.auth-card input { display: block; width: 100%; margin-top: 6px; }
.auth-msg { margin-top: 12px; font-size: 12.5px; min-height: 18px; }
.auth-msg.err { color: var(--red); }
.auth-msg.ok { color: var(--green); }
.auth-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.auth-note::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(43, 196, 138, .16);
  flex: 0 0 6px;
}

/* ==========================================================================
   表单元素
   ========================================================================== */
input[type=text], input[type=password], input[type=number], input[type=email], input:not([type]), select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input::placeholder, textarea::placeholder { color: var(--c-text-3); }
input:hover, select:hover, textarea:hover { border-color: rgba(99, 91, 255, .28); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9AA1BF 50%), linear-gradient(135deg, #9AA1BF 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { resize: vertical; min-height: 76px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .1s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: #FCFAFF; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }
.btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: 0 6px 16px -10px rgba(124, 92, 252, .9);
}
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 6px; padding: 10px 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled:hover { border-color: var(--border-strong); color: var(--text); background: #fff; }
.btn-primary:disabled:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==========================================================================
   布局骨架
   ========================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 232px;
  width: 232px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: rgba(255, 255, 255, .86);
  /* 令牌色相不变，叠一层深紫压暗：保证菜单文字对渐变底对比度 ≥ 4.5:1 */
  background:
    linear-gradient(180deg, rgba(35, 20, 90, .16), rgba(35, 20, 90, .16)),
    linear-gradient(180deg, var(--c-sidebar-from) 0%, var(--c-sidebar-to) 100%);
  border-right: none;
  box-shadow: 0 8px 24px rgba(99, 91, 255, .10);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 18px;
  border-bottom: none;
}
.brand-mark {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 6px 16px -10px rgba(35, 26, 80, .55);
}
.brand b { display: block; color: #fff; font-size: 14px; font-weight: 600; }
.brand small { display: block; color: rgba(255, 255, 255, .74); font-size: 11px; letter-spacing: .02em; }

.sidebar nav { flex: 1; padding: 6px 12px 14px; overflow-y: auto; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 3px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .92);
  font-size: 13.5px;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .92; }
.nav-item:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.nav-item.active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, .18);
  box-shadow: none;
}
.nav-item.active svg { opacity: 1; color: #fff; }

/* 底部用户区：白色小圆角卡（头像 + 状态 + 退出） */
.sidebar-foot {
  padding: 12px 12px 14px;
  border-top: none;
  display: block;
}
/* 两行网格：第一行 头像 | 姓名 | 退出登录；第二行 状态胶囊（跨列，避免被挤压截断） */
.sidebar-user {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 9px;
  row-gap: 4px;
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 20px -12px rgba(35, 26, 80, .6);
}
.sidebar-user .su-avatar { grid-row: 1 / span 2; }
.sidebar-user #sideStatus { grid-column: 2 / span 2; justify-self: start; }
.su-avatar {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  background: linear-gradient(135deg, var(--c-sidebar-from), var(--c-sidebar-to));
}
.su-main { flex: 1; min-width: 0; }
.su-main b { display: block; color: var(--c-text-1); font-size: 12.5px; font-weight: 600; }
.su-main .pill {
  margin-top: 1px; font-size: 10.5px; padding: 1px 7px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.su-out {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--c-text-2);
  font-size: 11px;
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.su-out svg { width: 13px; height: 13px; flex: 0 0 13px; }
.su-out:hover { background: var(--c-tint-lavender); color: var(--c-primary); }
.logout { font-size: 12px; color: rgba(255, 255, 255, .8); }
.logout:hover { color: #fff; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .92);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* 白色用户卡内的状态胶囊用浅底深字 */
.sidebar-user .pill { background: var(--c-tint-mint); color: #12996B; }
.sidebar-user .pill-bad { background: #FDECEC; color: #C93B3A; }
.pill-ok { background: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .95); }
.pill-bad { background: rgba(255, 255, 255, .18); color: #FFE1E0; }

.main {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 34px;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   页头（问候式：大标题 22/500 + 一行 13 次文字）
   ========================================================================== */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { font-size: 22px; margin: 0 0 5px; font-weight: 500; letter-spacing: -.01em; }
.page-head .sub { margin: 0; color: var(--text-2); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 7px; }
.chip-ok { border-color: #BEEBD8; background: var(--c-tint-mint); color: #12996B; }
.chip-ok::before { background: var(--c-success); }
.chip-warn { border-color: #F7E3C4; background: var(--c-tint-cream); color: #B8762B; }
.chip-warn::before { background: var(--c-warning); }
.chip-bad { border-color: #F6D2D3; background: #FDECEC; color: #C93B3A; }
.chip-bad::before { background: var(--c-danger); }
.chip-info { border-color: #E4DDFF; background: var(--c-primary-soft); color: var(--primary-dark); }
.chip-info::before { background: var(--c-primary); }

/* ==========================================================================
   卡片 / 栅格
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: .01em; }
.card-head .hint { font-size: 11.5px; color: var(--c-text-2); }
.card-head .link { font-size: 12px; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 14px; }

/* ==========================================================================
   指标卡
   ========================================================================== */
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 17px 18px;
  overflow: hidden;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(99, 91, 255, .24); }
.stat::after {
  content: "";
  position: absolute;
  right: -40px; top: -50px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 252, .06), transparent 70%);
  pointer-events: none;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 12px; color: var(--muted); }
/* 图标容器：44px 圆角方块 + 对应染色 12% 透明底 + 单色线性图标 */
.stat-icon,
.task-icon {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-tint-lavender);
  color: var(--c-icon-purple);
}
.stat-icon svg { width: 21px; height: 21px; }
.task-icon svg { width: 22px; height: 22px; }
.ic-purple { background: rgba(138, 99, 248, .13); color: #7C5CFC; }
.ic-blue   { background: rgba(74, 125, 240, .13); color: #3B6FE0; }
.ic-teal   { background: rgba(43, 196, 138, .14); color: #17A473; }
.ic-orange { background: rgba(245, 165, 74, .16); color: #DE8A2C; }
.si-green { background: var(--green-soft); color: #12996B; }
.si-orange { background: var(--orange-soft); color: #B8762B; }
.si-red { background: var(--red-soft); color: var(--red); }
.stat-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-1);
}
.stat-value.sm { font-size: 17px; font-weight: 500; margin-top: 14px; }
.stat-value .unit { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; letter-spacing: 0; }
.stat-foot { font-size: 12px; color: var(--text-2); margin-top: 5px; }

/* ==========================================================================
   告警
   ========================================================================== */
/* 告警：整块铺开，按级别配色 */
.alert-stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; margin-bottom: 14px; }
/* 染色卡：文字一律 text-1/text-2，状态色只落在徽标与左侧竖条 */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--c-text-1);
  border: 1px solid transparent;
  border-left-width: 4px;
  min-height: 52px;
}
.alert svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.alert-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; min-width: 0; }
.alert-tag { flex: 0 0 auto; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.alert-text { flex: 1 1 180px; min-width: 0; }
.alert-high { background: rgba(226, 75, 74, .08); border-color: rgba(226, 75, 74, .16); border-left-color: var(--c-danger); }
.alert-high svg { color: var(--c-danger); }
.alert-high .alert-tag { background: #FDECEC; color: #C93B3A; }
.alert-warn { background: var(--c-tint-cream); border-color: #F7E3C4; border-left-color: var(--c-warning); }
.alert-warn svg { color: var(--c-warning); }
.alert-warn .alert-tag { background: #FBEBD2; color: #B8762B; }
.alert-info { background: var(--c-tint-blue); border-color: #DCE8FF; border-left-color: var(--c-info); }
.alert-info svg { color: var(--c-info); }
.alert-info .alert-tag { background: #DFEBFF; color: #3A63C9; }

/* ==========================================================================
   自动化完成情况
   ========================================================================== */
.auto-list { display: flex; flex-direction: column; }
.auto-row {
  display: grid;
  /* 右侧两列固定宽度：每行是独立网格，宽度必须写死才能逐行对齐 */
  grid-template-columns: minmax(0, 1fr) 84px 104px;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid rgba(99, 91, 255, .07);
  border-radius: 7px;
  transition: background .16s;
}
.auto-row:hover { background: #F7F8FE; }
.auto-row:last-child { border-bottom: none; }
.auto-main { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.auto-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.auto-detail {
  min-width: 0; font-size: 11.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auto-cron {
  font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis;
}
.auto-last {
  font-size: 11.5px; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.ok { background: var(--green-soft); color: #12996B; }
.badge.warn { background: var(--orange-soft); color: #B8762B; }
.badge.bad { background: var(--red-soft); color: #C93B3A; }
.badge.run { background: var(--primary-soft); color: var(--primary-dark); }
.badge.run::before { animation: blink 1.4s ease-in-out infinite; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ==========================================================================
   服务 / 资源
   ========================================================================== */
.svc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #EFF0FB;
  font-size: 12.5px;
}
.svc-row:last-of-type { border-bottom: none; }
.svc-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.svc-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(43, 196, 138, .14); }
.svc-dot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(226, 75, 74, .14); }
.svc-name { flex: 0 0 76px; font-weight: 600; }
.svc-extra { flex: 1; min-width: 0; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
}

.res-row { margin-bottom: 14px; }
.res-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 6px; color: var(--text-2); }
.res-head b { color: var(--text); font-weight: 600; }
.res-head span:last-child { font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: #EFF0FB; overflow: hidden; box-shadow: inset 0 1px 1px rgba(35, 41, 78, .05); }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .5s cubic-bezier(.4, 0, .2, 1); background: linear-gradient(90deg, #A78BFF, var(--primary)); }
.b-orange { background: linear-gradient(90deg, #F5C36A, var(--orange)); }
.b-red { background: linear-gradient(90deg, #F0928F, var(--red)); }
.res-extra { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--text-2); margin: 6px 0 14px; }

/* ==========================================================================
   表格
   ========================================================================== */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid rgba(99, 91, 255, .07); }
.tbl th {
  color: var(--c-text-2);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #F7F8FE;
  white-space: nowrap;
}
.tbl th:first-child { border-radius: 8px 0 0 8px; }
.tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl tbody tr { transition: background .14s; }
.tbl tbody tr:hover { background: #F7F8FE; }
.tbl tr:last-child td { border-bottom: none; }
.tbl.sm th, .tbl.sm td { padding: 7px 8px; }
.tbl.xs { font-size: 11.5px; }
.tbl.xs th, .tbl.xs td { padding: 3px 6px; }
.tbl.xs th { font-size: 10.5px; }
.tbl td.red { color: var(--red); font-weight: 600; }
.tbl code { font-size: 11.5px; }
.tbl td { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   目录索引
   ========================================================================== */
/* 目录索引：单行紧凑列表 */
.paths { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 6px 10px; }
.path-item {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #FBFBFE, #F5F6FE);
  transition: border-color .16s, box-shadow .16s;
}
.path-item:hover { border-color: rgba(99, 91, 255, .34); box-shadow: 0 6px 16px -12px rgba(35, 41, 78, .5); }
.path-name { flex: 0 0 auto; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.path-name::before { content: ""; width: 3px; height: 10px; border-radius: 2px; background: var(--primary); opacity: .55; }
.path-code {
  flex: 1 1 auto; min-width: 0;
  font-size: 11px; color: var(--primary-dark);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.path-desc { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* ==========================================================================
   任务卡片
   ========================================================================== */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.task-card {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: stretch;
  margin-bottom: 0;
  padding: 17px 18px;
  overflow: hidden;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(99, 91, 255, .20); }
.task-card::after {
  content: '';
  position: absolute;
  right: -42px; top: -50px;
  width: 118px; height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 252, .04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
/* 装饰圆不得压住文字 */
.task-card > * { position: relative; z-index: 1; }
/* 入口类内容用染色卡（全站最像参考图的位置），文字一律 text-1/text-2 */
.task-card.tint-lavender { background: var(--c-tint-lavender); border-color: rgba(138, 99, 248, .16); }
.task-card.tint-blue     { background: var(--c-tint-blue);     border-color: rgba(74, 125, 240, .16); }
.task-card.tint-mint     { background: var(--c-tint-mint);     border-color: rgba(43, 196, 138, .18); }
.task-card.tint-cream    { background: var(--c-tint-cream);    border-color: rgba(245, 165, 74, .20); }
.task-card.tint-soft     { background: #F6F3FF;                border-color: rgba(138, 99, 248, .16); }
/* 染色卡内的图标容器改为白色内衬（参考图立体感的扁平近似） */
.task-card .task-icon { background: rgba(255, 255, 255, .78); box-shadow: 0 8px 18px -18px rgba(35, 41, 78, .9); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-title { font-size: 14px; font-weight: 600; color: var(--c-text-1); }
.task-desc { font-size: 12px; color: var(--c-text-2); margin: 4px 0 9px; line-height: 1.58; min-height: 36px; }
/* 卡片等高：输出信息在上、按钮统一贴底左侧，五张卡按钮同一基线 */
.task-foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: auto; padding-top: 8px; }
/* 操作行：修改 / 立即备份 同一行、等宽、左右对齐 */
.task-actions { display: flex; align-items: center; gap: 8px; width: 100%; }
.task-actions .btn {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
/* 没有「修改」按钮时（如日志留存配置）：主按钮与其它卡同宽并靠右，右侧边缘保持一致 */
.task-actions .btn:only-child { flex: 0 0 calc(50% - 4px); margin-left: auto; }
.task-out { font-size: 11px; color: var(--muted); line-height: 1.5; }
.task-out code { font-size: 10.5px; }
/* 点「立即备份」后的范围选择面板（弹窗内） */
.task-pick-panel { padding: 2px 0 6px; }
.pick-hint { font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.pick-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.pick-row select {
  width: 100%;
  padding: 8px 30px 8px 10px; font-size: 13px; color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; background-color: #fff;
}
/* hidden 优先级：按钮/文本块默认 display 会覆盖 [hidden] */
[hidden] { display: none !important; }
.pick-tip { margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.foot-actions { display: inline-flex; align-items: center; gap: 8px; }
.row-actions { white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 6px; }

/* 计划表：状态副行 / 已暂停行 */
.cell-sub { font-size: 11px; color: var(--text-2); line-height: 1.55; }
/* 备份对象：仅列已勾选对象，一行一个；对象过多时限高滚动 */
.tgt-list {
  display: flex; flex-direction: column;
  max-height: 176px; overflow-y: auto;
  font-size: 11.5px; line-height: 1.75; color: var(--text-2);
}
.tgt-list span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-target code { font-size: 11px; }
/* 失败原因摘要：两行封顶，完整内容看悬停或「日志」 */
.cell-err {
  margin-top: 3px;
  max-width: 200px;
  font-size: 11px; line-height: 1.5;
  color: #C93B3A;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fail-item .cell-err { max-width: none; -webkit-line-clamp: 3; margin-top: 4px; }
.dim { color: var(--text-2); }
.row-off td { opacity: .5; }
.row-off td .badge { opacity: .9; }
.card-head .foot-actions .hint { margin-right: 4px; }
.hint.ok { color: #12996B; }
.hint.warn { color: #B8762B; }

/* ==========================================================================
   总览：紧凑布局（尽量一屏看完，减少上下滚动）
   ========================================================================== */
.dash-row-2 { grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); }
.dash-row-3 { grid-template-columns: minmax(0, .98fr) minmax(0, 1.06fr) minmax(0, 1fr); }
/* ==========================================================================
   总览「常用操作」入口卡（染色 + 圆形箭头，参考图的核心气质）
   ========================================================================== */
.dash-sec { margin: 4px 0 10px; }
.task-grid.dash-entries { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.task-card.mini { padding: 14px 40px 14px 15px; align-items: center; gap: 11px; min-height: 78px; }
.task-card.mini .task-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
.task-card.mini .task-icon svg { width: 19px; height: 19px; }
.task-card.mini .task-title { font-size: 13px; }
.task-card.mini .task-desc {
  font-size: 11.5px; min-height: 0; margin: 3px 0 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.task-card .task-arrow {
  position: absolute; right: 13px; top: 50%; margin-top: -13px; z-index: 2;
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  color: var(--c-primary);
  font-size: 13px;
  box-shadow: 0 6px 14px -12px rgba(35, 41, 78, .9);
  transition: transform .18s, background .18s;
}
.task-card.mini:hover .task-arrow { transform: translateX(2px); background: var(--c-primary); color: #fff; }

@media (max-width: 1180px) {
  .dash-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .dash-row-3, .dash-row-2 { grid-template-columns: minmax(0, 1fr); }
}

#view-dashboard .page-head { margin-bottom: 11px; flex-wrap: nowrap; }
#view-dashboard .page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
#view-dashboard .head-actions { flex: 0 0 auto; }
#view-dashboard .page-head h1 { font-size: 19px; margin-bottom: 3px; }
#view-dashboard .chips { margin-top: 7px; gap: 6px; }
#view-dashboard .chip { padding: 3px 10px; font-size: 11.5px; line-height: 1.6; }
#view-dashboard .alert-stack { margin-bottom: 10px; gap: 8px; }
#view-dashboard .alert { padding: 6px 11px; font-size: 12px; }
#view-dashboard .alert-main { flex-wrap: nowrap; align-items: center; }
#view-dashboard .alert-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-dashboard .grid { gap: 11px; }
#view-dashboard .grid + .grid { margin-top: 11px; }
#view-dashboard .card { padding: 12px 14px; }
#view-dashboard .card-head { margin-bottom: 7px; }
#view-dashboard .card-head h2 { font-size: 13px; }

/* 指标卡压扁 */
#view-dashboard .stat { padding: 10px 12px; gap: 0; }
#view-dashboard .stat:hover { transform: none; }
#view-dashboard .stat-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
#view-dashboard .stat-icon svg { width: 18px; height: 18px; }
#view-dashboard .stat-label { font-size: 11.5px; }
#view-dashboard .stat-value { margin-top: 4px; font-size: 28px; }
#view-dashboard .stat-value.sm { margin-top: 6px; font-size: 15px; }
#view-dashboard .stat-foot { margin-top: 1px; font-size: 10.5px; }

/* 自动化 / 服务 / 资源：行距压缩 */
#view-dashboard .svc-row { padding: 1px 0; font-size: 11.5px; line-height: 1.85; }
#view-dashboard .svc-name { flex-basis: 62px; }
#view-dashboard .svc-dot { width: 7px; height: 7px; flex-basis: 7px; }
#view-dashboard .svc-versions {
  margin-top: 5px; padding-top: 5px; gap: 1px 12px; font-size: 10.5px;
  flex-wrap: nowrap; overflow: hidden; white-space: nowrap;
}
#view-dashboard .res-row { margin-bottom: 7px; }
#view-dashboard .res-head { font-size: 11.5px; margin-bottom: 3px; }
#view-dashboard .bar { height: 5px; }
#view-dashboard .res-extra { gap: 4px 16px; font-size: 11px; margin: 4px 0 7px; }
#view-dashboard .paths { gap: 3px 8px; }
#view-dashboard .path-item { padding: 1px 7px; }
#view-dashboard .path-name { font-size: 11px; }
#view-dashboard .path-desc { font-size: 10px; }
#view-dashboard .empty { padding: 16px 10px; }
/* 资源使用卡片的采集时间：窄屏只留「刷新」按钮，避免卡头换行 */
@media (max-width: 1180px) {
  #view-dashboard #resAt { display: none; }
}

/* ==========================================================================
   流量守门员：胶囊下方一行概览 + 设置页明细
   ========================================================================== */
.traffic-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 9px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: 14px;
  background: var(--c-card);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}
.traffic-bar.is-warn { border-left-color: var(--c-warning); background: var(--c-tint-cream); }
.traffic-bar.is-closed { border-left-color: var(--c-danger); background: rgba(226, 75, 74, .06); }
.tb-main { flex: 0 1 230px; min-width: 170px; }
.tb-line { display: flex; align-items: baseline; gap: 6px; }
.tb-line b { font-size: 14px; font-variant-numeric: tabular-nums; }
.tb-label { color: var(--muted); font-size: 11.5px; }
.tb-dim { color: var(--text-2); font-size: 11.5px; }
.tb-pct { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.tb-pct.red { color: var(--red); }
.tb-bar { height: 5px; border-radius: 99px; background: #EFF0FB; overflow: hidden; margin-top: 4px; }
.tb-bar.sm { height: 3px; margin-top: 3px; }
.tb-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #A78BFF, var(--primary)); transition: width .45s ease; }
.tb-bar i.b-orange { background: linear-gradient(90deg, #F5C36A, var(--orange)); }
.tb-bar i.b-red { background: linear-gradient(90deg, #F0928F, var(--red)); }
.tb-day { flex: 0 0 auto; min-width: 112px; }
.tb-day b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tb-top { flex: 1 1 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tb-site {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 158px; padding: 1px 9px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff;
  font-size: 10.5px; color: var(--text-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tb-site b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tb-site.off { opacity: .5; text-decoration: line-through; }
.tb-side { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-left: auto; }

#stab-traffic .bar { height: 7px; }
#stab-traffic .bar i.b-blue { background: linear-gradient(90deg, #A78BFF, var(--primary)); }
#stab-traffic .bar i.b-orange { background: linear-gradient(90deg, #F5C36A, var(--orange)); }
#stab-traffic .bar i.b-red { background: linear-gradient(90deg, #F0928F, var(--red)); }
#stab-traffic .form-inline { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--text-2); }

.tr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
/* 流量采集异常提示：把原因与修复命令直接铺在面板上 */
.tr-diag { font-size: 12px; line-height: 1.7; padding: 9px 13px; border-radius: 12px; margin-bottom: 12px; }
.tr-diag.warn { color: var(--c-text-1); background: var(--c-tint-cream); border: 1px solid #F7E3C4; }
.tr-diag.warn b { color: #B8762B; }
.tr-diag code { font-size: 11.5px; background: rgba(35, 41, 78, .06); padding: 1px 5px; border-radius: 5px; }
.tr-cell {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 10px;
  background: linear-gradient(180deg, #FBFBFE, #F5F6FE);
}
.tr-cell > span { font-size: 11.5px; color: var(--muted); }
.tr-cell > b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tr-cell > em { font-size: 11px; color: var(--text-2); font-style: normal; }

.stab-traffic { --stab-c: #7c5cf0; --stab-soft: #f0ecff; --stab-deep: #5b3fd0; }
#stab-traffic { --stab-c: #7c5cf0; }

@media (max-width: 900px) {
  .tb-side { margin-left: 0; }
}

/* ==========================================================================
   设置与自检：彩色选项卡（邮件=蓝 / 报告与备份=绿 / 环境自检=橙 / 账号安全=红）
   ========================================================================== */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.stab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text-2);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.stab svg { width: 15px; height: 15px; color: var(--stab-c); }
.stab::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--stab-c); opacity: .3; transition: opacity .15s, box-shadow .15s; }
.stab.active::after { opacity: 1; box-shadow: 0 0 0 3px var(--stab-soft); }
.stab:hover { border-color: var(--stab-c); color: var(--text); }
.stab.active {
  background: var(--stab-soft);
  border-color: var(--stab-c);
  color: var(--stab-deep);
  font-weight: 600;
  box-shadow: 0 6px 16px -12px rgba(35, 41, 78, .5);
}
.stab-mail   { --stab-c: var(--primary); --stab-soft: var(--primary-soft); --stab-deep: var(--primary-dark); }
.stab-backup { --stab-c: var(--green);   --stab-soft: var(--green-soft);   --stab-deep: #12996B; }
.stab-diag   { --stab-c: var(--orange);  --stab-soft: var(--orange-soft);  --stab-deep: #B8762B; }
.stab-auth   { --stab-c: var(--red);     --stab-soft: var(--red-soft);     --stab-deep: #C93B3A; }

.stab-panel { --stab-c: var(--primary); }
#stab-backup { --stab-c: var(--green); }
#stab-diag   { --stab-c: var(--orange); }
#stab-auth   { --stab-c: var(--red); }
.stab-panel:not([hidden]) { animation: view-in .18s ease; }
.stab-panel > .card { border-top: 3px solid var(--stab-c); }
.stab-panel > .card > .card-head { padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.stab-panel > .card > .card-head h2 { position: relative; padding-left: 12px; }
.stab-panel > .card > .card-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 14px; border-radius: 3px;
  background: var(--stab-c);
}
/* 主按钮跟随当前选项卡配色 */
.stab-panel > .card .form-foot .btn-primary { background: var(--stab-c); border-color: var(--stab-c); }
.stab-panel > .card .form-foot .btn-primary:hover:not(:disabled) { filter: brightness(1.07); }

/* ==========================================================================
   报告中心
   ========================================================================== */
.report-layout { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 16px; align-items: start; }
.report-list-card { position: sticky; top: 18px; padding: 0; overflow: hidden; }
.tabs { display: flex; padding: 6px; gap: 4px; background: #F7F8FE; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.tab:hover { color: var(--primary); background: #fff; }
.tab.active { color: var(--primary-dark); font-weight: 600; background: #fff; box-shadow: 0 1px 3px rgba(35, 41, 78, .1); }
.report-dir { padding: 9px 14px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--border); word-break: break-all; }
.report-dir code { font-size: 10.5px; }
/* 报告批量操作条 */
.report-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 14px;
  background: #FBFBFE;
  border-bottom: 1px solid var(--border);
}
.report-bar .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); cursor: pointer; flex: 0 0 auto; }
.report-bar .chk input { accent-color: var(--primary); width: 13px; height: 13px; }
.report-sel { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-bar .btn-danger { flex: 0 0 auto; }
.btn-danger { background: #fff; border-color: #F6D2D3; color: #C93B3A; }
.btn-danger:hover:not(:disabled) { background: #FDECEC; border-color: #F6D2D3; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }
.report-list { max-height: calc(100vh - 292px); overflow-y: auto; padding: 8px; }
.report-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .16s, box-shadow .16s;
}
.report-item:hover { background: #F5F6FE; }
.report-item.active { background: linear-gradient(90deg, var(--primary-soft), #FAF8FF); box-shadow: inset 2px 0 0 var(--primary); }
.ri-icon { color: var(--primary); display: flex; }
.ri-icon svg { width: 16px; height: 16px; }
.ri-main { min-width: 0; flex: 1; }
.ri-name { font-size: 12.5px; font-weight: 600; word-break: break-all; }
.ri-meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ri-check { display: flex; align-items: center; flex: 0 0 auto; }
.ri-check input { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }
.ri-del {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border: none; border-radius: 7px;
  background: none; color: var(--muted);
  cursor: pointer; opacity: .35;
  transition: opacity .15s, background .15s, color .15s;
}
.report-item:hover .ri-del, .report-item.active .ri-del { opacity: 1; }
.ri-del:hover { background: #FDECEC; color: #C93B3A; }
.ri-del svg { width: 15px; height: 15px; }
.rcpt-cell { font-size: 11.5px; line-height: 1.65; }

.report-view-card { padding: 0; overflow: hidden; }
.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: #FBFBFE;
}
.rt-left b { font-size: 13.5px; }
.rt-left .meta, .meta { font-size: 11.5px; color: var(--muted); margin-left: 8px; font-variant-numeric: tabular-nums; }
.rt-right { display: flex; gap: 8px; }
.backup-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  padding: 11px 18px;
  background: var(--c-primary-soft);
  border-left: 4px solid var(--c-primary);
  border-bottom: 1px solid #E4DDFF;
  font-size: 11.5px;
  color: var(--c-text-1);
}
.backup-hint svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--c-primary); }
.backup-hint b { font-weight: 600; }
.backup-hint code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10.5px; background: #fff; padding: 1px 6px; border-radius: 6px; border: 1px solid #E4DDFF;
}

.md-body {
  padding: 22px 26px 34px;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.78;
  color: #333A5C;
}
.md-body h1 {
  font-size: 19px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.md-body h1::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 64px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}
.md-body h2 {
  font-size: 14.5px;
  margin: 24px 0 9px;
  padding-left: 11px;
  border-left: 3px solid var(--primary);
  color: var(--primary-dark);
  line-height: 1.5;
}
.md-body h3 { font-size: 13px; margin: 16px 0 6px; color: var(--text); }
.md-body p { margin: 6px 0; }
.md-body ul { margin: 6px 0; padding-left: 20px; }
.md-body li { margin: 3px 0; }
.md-body li::marker { color: #B9AEE8; }
.md-body hr { border: none; border-top: 1px dashed var(--border-strong); margin: 20px 0; }
.md-body a { border-bottom: 1px solid rgba(124, 92, 252, .3); }
.md-body strong { color: var(--text); font-weight: 650; }
.md-body blockquote {
  margin: 12px 0;
  padding: 9px 14px;
  background: #F3F0FF;
  border-left: 3px solid var(--primary);
  color: #5B3FD0;
  border-radius: 0 8px 8px 0;
}
.md-body blockquote p { margin: 0; }
.md-body pre {
  background: #1B1B33;
  color: #DCD8F5;
  border: 1px solid #2A2A48;
  border-radius: 10px;
  padding: 13px 15px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.65;
  margin: 10px 0;
}
.md-body code { background: #F0EDFF; color: #4E3AAE; padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }
.md-body pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.md-body table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 12px 0; font-size: 12px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.md-body th, .md-body td { border-bottom: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.md-body th { background: #F7F8FE; font-weight: 600; color: var(--text-2); }
.md-body tr:last-child td { border-bottom: none; }
.raw-body {
  margin: 0;
  padding: 20px;
  font-size: 11.5px;
  line-height: 1.65;
  max-height: calc(100vh - 250px);
  overflow: auto;
  background: #FBFBFE;
  color: #3A4166;
  white-space: pre-wrap;
  word-break: break-all;
}
.empty { padding: 44px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty.sm { padding: 14px; }

/* ==========================================================================
   表单布局 / 自检
   ========================================================================== */
.form label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 13px; }
.form label input, .form label select, .form label textarea { display: block; margin-top: 6px; }
.form-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  line-height: 1.5;
}
.form-inline input[type=checkbox] { width: auto; flex: 0 0 auto; margin: 0; accent-color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-msg { font-size: 12.5px; color: var(--text-2); }
.form-msg.ok { color: #0E7C57; }
.form-msg.err { color: var(--red); }

.diag-sum {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12.5px;
  font-weight: 550;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: 12px;
}
.diag-sum.ok { background: var(--green-soft); color: #12996B; border-color: #BEEBD8; }
.diag-sum.warn { background: var(--orange-soft); color: #B8762B; border-color: #F7E3C4; }
.diag-sum .meta { color: inherit; opacity: .7; margin-left: auto; font-weight: 400; }
.diag-row {
  display: flex;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  margin-bottom: 5px;
}
.diag-row.is-bad { background: var(--c-tint-cream); }
.diag-icon {
  width: 20px; height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.diag-icon.ok { background: var(--c-tint-mint); color: #12996B; }
.diag-icon.bad { background: #FBEBD2; color: #B8762B; }
.diag-main { min-width: 0; }
.diag-name { font-size: 12.5px; font-weight: 600; }
.diag-detail { font-size: 11.5px; color: var(--text-2); word-break: break-all; }
.diag-fix { font-size: 11px; color: #B8762B; margin-top: 4px; line-height: 1.6; }

/* ==========================================================================
   外观与身份：设置页预览 + 上传控件 + 图片模式的图标/头像
   ========================================================================== */
.look-preview {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--c-sidebar-from) 0%, var(--c-sidebar-to) 100%);
}
.look-preview .brand { padding: 0; border: none; }
.look-preview .sidebar-user { width: 236px; }
.look-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.look-file input[type=file] { flex: 1 1 130px; min-width: 0; font-size: 11.5px; color: var(--c-text-2); }
.look-file input[type=file]::file-selector-button {
  margin-right: 8px; padding: 4px 9px;
  font: inherit; font-size: 11.5px;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: #fff; color: var(--c-text-1); cursor: pointer;
}

/* 上传了图片：底色转白 + 裁切填充（文字模式下这些规则不生效） */
.brand-mark.has-img,
.su-avatar.has-img,
.auth-logo.has-img {
  padding: 0; overflow: hidden;
  background: #fff;
  color: transparent;
}
.brand-mark.has-img img,
.su-avatar.has-img img,
.auth-logo.has-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   弹窗 / Toast
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(35, 41, 78, .38);
  backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
.modal[hidden] { display: none; }
.modal-box {
  width: 520px;
  max-width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.1);
}
.modal-box.wide { width: 840px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.modal-head .x { background: none; border: none; color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; padding: 0 2px; transition: color .16s; }
.modal-head .x:hover { color: var(--red); }
.modal-body { padding: 17px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 20px; border-top: 1px solid var(--border); background: #FBFBFE; border-radius: 0 0 14px 14px; }
.tasklog {
  margin: 0;
  padding: 14px 16px;
  max-height: 54vh;
  overflow: auto;
  border-radius: 10px;
  background: #1B1B33;
  color: #DCD8F5;
  border: 1px solid #2A2A48;
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

.mail-report { font-size: 13px; margin-bottom: 10px; }
.mail-note {
  font-size: 11.5px;
  color: var(--text-2);
  background: #F7F8FE;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  padding: 9px 12px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.mail-sendto .label { font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.mail-sendto input { display: block; }
.rcpt-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; max-height: 168px; overflow: auto; }
.rcpt { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 3px; border-radius: 6px; cursor: pointer; }
.rcpt:hover { background: #F5F6FE; }
.rcpt input { accent-color: var(--primary); }
.mail-status { font-size: 12.5px; margin-top: 10px; color: var(--text-2); min-height: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 99;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  color: #fff;
  background: #23294E;
  box-shadow: 0 18px 40px -18px rgba(20, 18, 48, .9);
  animation: toast-up .22s ease;
}
.toast[hidden] { display: none; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6ee7b7; }
.toast.err { background: #C93B3A; }
.toast.err::before { background: #FFD9D8; }
.toast.ok { background: #12996B; }
.toast.ok::before { background: #a7f3d0; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toast-up { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view:not([hidden]) { animation: view-in .22s ease; }

/* ==========================================================================
   总览：检查更新横幅（页内进度 + 两种结果）
   ========================================================================== */
.deploy-bar {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: 14px;
  background: var(--c-card);
  box-shadow: var(--shadow-sm);
  animation: view-in .2s ease;
}
.deploy-ico {
  flex: 0 0 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 14px; font-weight: 700;
}
.deploy-main { flex: 1 1 auto; min-width: 0; }
.deploy-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.deploy-sub { margin-top: 3px; font-size: 12px; color: var(--text-2); word-break: break-all; }
.deploy-log {
  margin: 9px 0 0; padding: 9px 11px;
  max-height: 170px; overflow: auto;
  border-radius: 8px;
  background: #1B1B33; color: #CFCBEC;
  font-size: 11px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all;
}
.deploy-side { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
.deploy-state {
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary-dark);
}
.deploy-bar.running .deploy-ico { animation: spin-ico 1.4s linear infinite; }
@keyframes spin-ico { 0%,100% { transform: none; } 50% { transform: translateY(-2px); } }
.deploy-bar.done { border-left-color: var(--green); }
.deploy-bar.done .deploy-ico { background: var(--green-soft); color: #12996B; }
.deploy-bar.done .deploy-state { background: var(--green-soft); color: #12996B; }
.deploy-bar.latest { border-left-color: #9AA1BF; }
.deploy-bar.latest .deploy-ico { background: #F1F0FB; color: #6B7395; }
.deploy-bar.latest .deploy-state { background: #F1F0FB; color: #6B7395; }
.deploy-bar.busy { border-left-color: var(--orange); }
.deploy-bar.busy .deploy-ico { background: var(--orange-soft); color: #B8762B; }
.deploy-bar.busy .deploy-state { background: var(--orange-soft); color: #B8762B; }
.deploy-bar.failed { border-left-color: var(--red); }
.deploy-bar.failed .deploy-ico { background: var(--red-soft); color: #C93B3A; }
.deploy-bar.failed .deploy-state { background: var(--red-soft); color: #C93B3A; }

/* ==========================================================================
   任务页：执行记录（紧凑）+ 右侧执行失败区块
   ========================================================================== */
.task-bottom { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) { .task-bottom { grid-template-columns: 1fr; } }

.tbl.compact th { padding: 7px 8px; font-size: 11px; }
.tbl.compact td { padding: 5px 8px; font-size: 11.5px; }
.tbl.compact tbody tr { height: 32px; }
.tbl.compact .c-task { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.compact .c-by, .tbl.compact .c-exit { color: var(--muted); }
.tbl.compact .c-time { font-variant-numeric: tabular-nums; color: var(--text-2); }
.tbl.compact .badge { padding: 1px 7px; font-size: 10.5px; }
.tbl.compact .btn-xs { padding: 2px 8px; font-size: 10.5px; }
.tbl.compact .row-actions { text-align: right; }

.fail-card { border-top: 3px solid var(--red); }
.fail-card > .card-head h2 { position: relative; padding-left: 12px; }
.fail-card > .card-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 14px; border-radius: 3px; background: var(--red);
}
.fail-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.fail-item {
  padding: 9px 11px;
  border: 1px solid #F6D2D3; border-left: 3px solid var(--red);
  border-radius: 9px; background: #FDECEC;
}
.fail-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fail-name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fail-code { flex: 0 0 auto; font-size: 10.5px; font-weight: 600; color: #C93B3A; background: var(--red-soft); padding: 1px 7px; border-radius: 999px; }
.fail-time { margin-top: 3px; font-size: 11px; color: var(--muted); }
.fail-ops { margin-top: 7px; display: flex; gap: 6px; }
.fail-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.fail-empty span { display: block; font-size: 22px; margin-bottom: 6px; }
.fail-more { padding: 4px 2px; font-size: 11px; color: var(--muted); }

/* 任务卡上的「输出 + 修改」：始终同一行，路径过长时省略 */
.task-out {
  display: flex; align-items: center; gap: 6px;
  min-width: 0; white-space: nowrap;
}
.task-out code {
  min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 修改按钮不再单独缩小：与主按钮同为 btn-sm，尺寸一致 */
.task-cfg-btn { color: var(--c-text-2); }

/* ==========================================================================
   任务参数弹窗（执行时间 / 输出目录 / 备份对象）
   ========================================================================== */
.cfg-cron-row { display: grid; grid-template-columns: minmax(0, 1fr) 156px; gap: 8px; align-items: stretch; }
.modal .form .cfg-cron-row input, .modal .form .cfg-cron-row select {
  width: 100%; min-width: 0; height: 38px; box-sizing: border-box;
  padding: 0 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff;
  color: var(--text);
}
.modal .form .cfg-cron-row select { padding-right: 26px; }

/* 直观时间设置：频率 + 星期/日期 + 时间 */
.cfg-when { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.cfg-when > label { min-width: 0; margin: 0; }
.modal .form .cfg-when input, .modal .form .cfg-when select {
  width: 100%; min-width: 0; height: 38px; box-sizing: border-box;
  padding: 0 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff;
  color: var(--text);
}
.cfg-preview {
  padding: 9px 11px; border-radius: 9px;
  border: 1px dashed var(--border); background: #F5F6FE;
  font-size: 12px; line-height: 1.75; color: var(--text-2);
}
.cfg-preview code { font-size: 11.5px; color: var(--text); }
.cfg-ex { margin-top: 4px; }
.cfg-ex-title { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.cfg-ex-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px;
  max-height: 210px; overflow: auto;
  padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: #FBFBFE;
}
.cfg-ex-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.cfg-ex-item input { margin: 0; }

/* ==========================================================================
   页脚
   ========================================================================== */
.app-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}
.app-foot code { font-size: 11px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-layout { grid-template-columns: 250px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static;
    flex: none;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .brand { border-bottom: none; padding: 12px 14px; }
  .brand small { display: none; }
  .sidebar nav { display: flex; padding: 8px 6px; overflow-x: auto; }
  .nav-item { white-space: nowrap; margin: 0 2px; }
  .nav-item.active::before { display: none; }
  .nav-item span { display: inline; }
  .sidebar-foot { border-top: none; padding: 10px 12px; flex: 0 0 auto; }
  .main { padding: 16px 14px 26px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .report-layout { grid-template-columns: 1fr; }
  .report-list-card { position: static; }
  .report-list { max-height: 240px; }
  .md-body, .raw-body { max-height: none; }
  .row2 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* 入口卡栅格随宽度收敛 */
@media (min-width: 1600px) { .task-grid.dash-entries { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .task-grid.dash-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
