/* admin.css — 管理后台 v2: 浅色侧栏 + 卡片式内容区 */
body.admin-mode { background: #f6f7f9; }
body.admin-mode .hd, body.admin-mode .topbar, body.admin-mode .footer, body.admin-mode #announce { display: none; }
.adm-shell { display: flex; min-height: 100vh; --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; }

/* 侧栏 */
.adm-side { width: 228px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: #fff; color: var(--text); border-right: 1px solid var(--border-soft); padding: 18px 12px 14px; overflow-y: auto; scrollbar-width: none; }
.adm-side::-webkit-scrollbar { display: none; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: var(--text); }
.adm-brand:hover { text-decoration: none; color: var(--text); }
.adm-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--acc-2); color: #fff; display: grid; place-items: center; flex: none; }
.adm-brand b { display: block; font-size: 15px; line-height: 1.2; }
.adm-brand small { display: block; font-size: 11.5px; color: var(--faint); }
.adm-nav { flex: 1; }
.adm-group { margin-bottom: 14px; }
.adm-gt { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 0 10px 4px; }
.adm-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 13.5px; }
.adm-link .ic { color: var(--faint); }
.adm-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.adm-link.active { background: var(--peach); color: var(--acc-2); }
.adm-link.active .ic { color: var(--acc-2); }
.adm-side-foot { padding-top: 10px; border-top: 1px solid var(--border-soft); }

/* 顶栏 */
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-bar { height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 20; }
.adm-crumb { display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.adm-crumb .ic { color: var(--faint); }
.adm-jump { display: flex; align-items: center; gap: 6px; margin-left: 18px; height: 32px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-soft); width: 240px; color: var(--faint); }
.adm-jump input { border: 0 !important; background: transparent; height: 30px; padding: 0; flex: 1; min-width: 0; box-shadow: none !important; }
.adm-bar-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.adm-me { display: flex; align-items: center; gap: 8px; color: var(--text); }
.adm-me:hover { text-decoration: none; }
.adm-menu { display: none; }
.adm-scrim { display: none; }

/* 内容 */
.adm-content { padding: 26px 32px 64px; max-width: 1360px; width: 100%; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.adm-head h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -.2px; }
.adm-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.adm-head-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-content > .page-head { margin-bottom: 20px; }
.adm-content .box, .adm-content .set-card, .adm-card { background: #fff; border: 1px solid var(--border-soft); border-radius: 10px; box-shadow: 0 1px 2px rgba(20,20,30,.03); }
.adm-content .box { overflow: hidden; }
.adm-content .info-box { background: #fff; border: 1px solid var(--border-soft); border-radius: 10px; }
.adm-content table.list th { background: #fafafb; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.adm-content table.list td, .adm-content table.list th { padding: 10px 14px; }
.adm-content table.list tr:hover td { background: #fcfcfd; }
.adm-content .list-toolbar { margin-bottom: 14px; }
.adm-content .blankslate { background: #fff; border: 1px dashed var(--border); border-radius: 10px; }

.adm-card { margin-bottom: 16px; min-width: 0; }
.adm-card.flush { overflow: hidden; }
.adm-card.flush > .empty { padding: 48px 0; }
.adm-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; }
.adm-card-h h3 { font-size: 14.5px; font-weight: 600; margin: 0; }
.adm-card-h a { font-size: 13px; color: var(--link-2); }
.adm-card-b { padding: 14px 18px 18px; }
.adm-card-b.tight { padding: 8px 18px 14px; }
.adm-card > .adm-quick, .adm-card > .adm-feed { padding: 12px 18px 16px; }
.adm-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-grid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.adm-stack > .adm-card:last-child { margin-bottom: 16px; }

/* KPI */
.adm-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adm-kpi { background: #fff; border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px 16px; color: var(--text); min-width: 0; }
a.adm-kpi:hover { text-decoration: none; color: var(--text); border-color: var(--peach-line); box-shadow: 0 4px 14px rgba(242,96,31,.07); }
.adm-kpi-k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.adm-kpi-k .ic { color: var(--faint); }
.adm-kpi-v { font-size: 26px; font-weight: 650; margin-top: 6px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-kpi-v.sm { font-size: 18px; }
.adm-kpi-s { font-size: 12px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 柱状图 */
.adm-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.adm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.adm-legend i, .adm-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.adm-bars { position: relative; display: flex; gap: 10px; height: 190px; align-items: stretch; padding-top: 6px;
  background: repeating-linear-gradient(to top, transparent 0, transparent 41px, var(--border-soft) 41px, var(--border-soft) 42px); background-position: 0 -20px; }
.adm-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; cursor: default; }
.adm-bar-stack { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; gap: 2px; }
.adm-bar-stack i { display: block; width: 100%; border-radius: 0; }
.adm-bar-stack i:last-child { border-radius: 4px 4px 0 0; }
.adm-bar-stack i.zero { height: 2px; background: var(--border); }
.adm-bar-col:hover .adm-bar-stack { opacity: .85; }
.adm-bar-lbl { font-size: 11.5px; color: var(--faint); margin-top: 6px; font-variant-numeric: tabular-nums; }
.adm-tip { position: absolute; top: 0; transform: translateX(-50%); background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .1s; min-width: 120px; z-index: 2; }
.adm-tip.on { opacity: 1; }
.adm-tip b { display: block; margin-bottom: 4px; }
.adm-tip div { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.adm-tip div span { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 健康 / 用量 */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.adm-health { display: grid; grid-template-columns: 10px 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.adm-health:last-child { border-bottom: 0; }
.adm-health .k { color: var(--muted); }
.adm-health .v { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-usage { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.adm-usage:last-child { border-bottom: 0; }
.adm-meter { height: 6px; background: var(--bg-muted); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.adm-meter i { display: block; height: 100%; background: var(--acc-2); border-radius: 3px; }
.adm-kv { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px 14px; font-size: 13px; }
.adm-kv .k { color: var(--muted); }
.adm-kv .v { word-break: break-all; }

/* 动态 / 快捷 */
.adm-feed-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.adm-feed-row:last-child { border-bottom: 0; }
.adm-feed-row .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adm-quick a, .adm-quick button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 8px;
  background: #fff; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.adm-quick a:hover, .adm-quick button:hover { border-color: var(--peach-line); background: var(--peach); color: var(--acc-2); text-decoration: none; }
.adm-quick .ic { color: var(--acc-2); }

/* 工具栏 / 标签 */
.adm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.adm-toolbar .flex { align-items: center; gap: 8px; }
.adm-toolbar .search { min-width: 240px; position: relative; display: flex; align-items: center; margin: 0; }
.adm-toolbar .search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.adm-toolbar .search input { height: 34px; padding-left: 32px; margin: 0; }
.adm-toolbar select { height: 34px; margin: 0; }
.adm-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: #eceef1; padding: 3px; border-radius: 9px; }
.adm-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 500; }
.adm-tabs a:hover { color: var(--text); text-decoration: none; }
.adm-tabs a.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.adm-tabs .counter { font-size: 11px; }
.adm-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.adm-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: admPulse 2s infinite; }
@keyframes admPulse { 50% { opacity: .35; } }
tr.row-dim td { opacity: .55; }
.danger-text { color: var(--danger) !important; }
.check.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 维护任务 */
.adm-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.adm-task { background: #fff; border: 1px solid var(--border-soft); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; min-width: 0; }
.adm-task.busy { border-color: var(--peach-line); box-shadow: 0 0 0 3px var(--peach); }
.adm-task-h { display: flex; align-items: center; gap: 10px; }
.adm-task-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--peach); color: var(--acc-2); display: grid; place-items: center; flex: none; }
.adm-task p { color: var(--muted); font-size: 13px; margin: 10px 0; flex: 1; }
.adm-task-st { display: flex; align-items: center; gap: 4px; color: var(--muted); min-height: 20px; }
.adm-task-st .dot { margin-right: 4px; }
.adm-task-log { margin-top: 8px; font-size: 12px; }
.adm-task-log summary { cursor: pointer; color: var(--link-2); }
.adm-task-log pre { max-height: 220px; overflow: auto; background: var(--bg-soft); border-radius: 6px; padding: 8px 10px; margin: 6px 0 0; font-size: 11.5px; white-space: pre-wrap; }
.adm-task-f { margin-top: 12px; display: flex; justify-content: flex-end; }

/* 运行日志 */
.adm-log { max-height: calc(100vh - 230px); overflow: auto; background: #16181d; color: #d6d8de; font: 12px/1.6 var(--mono, ui-monospace, Consolas, monospace); padding: 12px 16px; }
.adm-log-l { display: flex; gap: 12px; white-space: pre-wrap; word-break: break-all; }
.adm-log-l .t { color: #7b8190; flex: none; }
.adm-log-l.bad { color: #ff9b8f; }
.adm-log-l.warn { color: #f2c46d; }

@media (max-width: 1200px) { .adm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .adm-grid, .adm-grid.even { grid-template-columns: 1fr; } .adm-kpis.four { grid-template-columns: 1fr 1fr; } .adm-jump { display: none; } }
@media (max-width: 860px) {
  .adm-side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.adm-open .adm-side { transform: none; }
  body.adm-open .adm-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 30; }
  .adm-menu { display: inline-flex; }
  .adm-bar { padding: 0 14px; }
  .adm-content { padding: 18px 14px 48px; }
  .adm-kpis { grid-template-columns: 1fr 1fr; }
}

/* 站点设置: 左侧分组导航 + 右侧分组卡片, 每行 标题/说明 | 控件 */
.set-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1080px; }
.set-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.set-nav a { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 7px; color: var(--muted); font-size: 13.5px; }
.set-nav a .ic { color: var(--faint); }
.set-nav a:hover { background: #fff; color: var(--text); text-decoration: none; }
.set-nav a.active { background: #fff; color: var(--acc-2); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.set-nav a.active .ic { color: var(--acc-2); }
.set-sec { scroll-margin-top: 76px; padding: 0; }
.set-sec-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.set-sec-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.set-sec-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--faint); }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 24px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); }
.set-row:last-child { border-bottom: 0; }
.set-row.wide { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.set-row-l b { font-size: 13.5px; font-weight: 600; }
.set-row-l p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.set-row-r { display: flex; justify-content: flex-end; min-width: 0; }
.set-row.wide .set-row-r { justify-content: flex-start; }
.set-row-r > input[type=text], .set-row-r > select { width: 100%; }
.set-num { display: flex; align-items: center; gap: 8px; }
.set-num input { width: 110px; text-align: right; }
.set-num span { color: var(--muted); font-size: 13px; min-width: 28px; }
.set-prefix { display: flex; align-items: center; width: 100%; max-width: 520px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.set-prefix span { padding: 0 10px; color: var(--muted); background: var(--bg-soft); height: 34px; display: flex; align-items: center; border-right: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
.set-prefix input { border: 0 !important; flex: 1; min-width: 0; box-shadow: none !important; }
.st-ok { color: var(--green); }
.st-bad { color: var(--danger); }
.set-save { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 0 16px;
  background: linear-gradient(to top, #f6f7f9 70%, rgba(246,247,249,0)); z-index: 5; }
@media (max-width: 900px) {
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .set-row { grid-template-columns: 1fr; gap: 10px; }
  .set-row-r { justify-content: flex-start; }
}
/* 卡片较窄时 (小窗口) 改为上下排列, 不挤压说明文字 */
.set-sec { container-type: inline-size; }
@container (max-width: 600px) {
  .set-row { grid-template-columns: 1fr; gap: 8px; }
  .set-row-r { justify-content: flex-start; }
}
@media (max-width: 1100px) { .set-layout { grid-template-columns: 1fr; } .set-nav { position: static; flex-direction: row; flex-wrap: wrap; } }

/* ---- 系统更新: 更新包上传 ---- */
.adm-up-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--border); border-radius: 10px; background: var(--card-2);
  padding: 28px 20px; cursor: pointer; text-align: center; transition: border-color .12s, background .12s, color .12s; }
.adm-up-drop:hover { border-color: var(--acc); background: var(--acc-soft); }
.adm-up-drop:hover .adm-up-ico { background: #fff; color: var(--acc); border-color: var(--acc); }
.adm-up-drop.drag { border-color: var(--acc); background: var(--acc-soft); border-style: solid; }
.adm-up-drop.drag .adm-up-ico { background: #fff; color: var(--acc); border-color: var(--acc); }
.adm-up-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: #fff; color: var(--faint); border: 1px solid var(--border-soft); transition: inherit; }
.adm-up-txt { display: grid; gap: 2px; margin-top: 2px; }
.adm-up-txt b { font-size: 13.5px; font-weight: 600; }
.adm-up-txt small { font-size: 12px; color: var(--muted); }
.adm-up-picked { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-soft);
  border-radius: 10px; background: #fff; padding: 12px 14px; }
.adm-up-picked .grow { min-width: 0; }
.adm-up-picked .grow b { display: block; font-size: 13px; font-weight: 600; word-break: break-all; }
.adm-up-picked .ic { color: var(--acc); }
.adm-up-prog { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.adm-up-prog .adm-meter { flex: 1; margin-top: 0; }
.adm-up-pct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

/* ---- 系统更新: 校验通过的暂存卡片 ---- */
.adm-up-staged { margin-top: 14px; border: 1px solid var(--border-soft); border-radius: 10px; background: #fff; overflow: hidden; }
.adm-up-staged-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--green-soft);
  border-bottom: 1px solid var(--border-soft); }
.adm-up-staged-h .grow { min-width: 0; }
.adm-up-staged-h b { font-size: 13.5px; font-weight: 600; color: var(--green); }
.adm-up-ico.ok { background: #fff; color: var(--green); border-color: rgba(31,138,76,.28); }
.adm-up-notes { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.adm-up-notes > b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.adm-up-notes > div { white-space: pre-wrap; }
.adm-up-files { padding: 6px 16px; }
.adm-up-file { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.adm-up-file + .adm-up-file { border-top: 1px solid var(--border-soft); }
.adm-up-file .ic { color: var(--faint); }
.adm-up-file .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-up-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px;
  border-top: 1px solid var(--border-soft); background: var(--card-2); }
.adm-up-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---- 维护任务: 进度条 ---- */
.adm-task-prog { margin: 10px 0 6px; }
.adm-task-meter { height: 6px; background: var(--bg-muted); border-radius: 3px; overflow: hidden; }
.adm-task-meter i { display: block; height: 100%; background: var(--acc); border-radius: 3px;
  transition: width .35s ease; }
.adm-task-meter.indet i { background: linear-gradient(90deg, var(--acc) 0%, var(--acc) 30%, var(--acc-soft) 50%, var(--acc) 70%, var(--acc) 100%);
  background-size: 220% 100%; animation: adm-indet 1.3s linear infinite; }
@keyframes adm-indet { from { background-position: 100% 0; } to { background-position: -120% 0; } }
.adm-task-prog-t { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 12px; }
.adm-task-prog-t > span:first-child { flex: 1; min-width: 0; }
.adm-task-prog-t .nowrap { flex: none; font-variant-numeric: tabular-nums; }
