/* ============ 主题色 ============ */
:root {
  --bg: #e8edf6;
  --blob1: rgba(129, 140, 248, .55);
  --blob2: rgba(45, 212, 191, .40);
  --blob3: rgba(244, 114, 182, .32);
  --blob4: rgba(251, 191, 36, .28);
  --glass: rgba(255, 255, 255, .52);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-soft: rgba(255, 255, 255, .42);
  --stroke: rgba(255, 255, 255, .75);
  --hair: rgba(15, 23, 42, .07);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .7);
  --shadow: 0 10px 30px -12px rgba(30, 41, 90, .22);
  --text: #0f172a;
  --muted: #5b6478;
  --faint: #8a93a6;
  --accent: #5b5bf0;
  --accent-2: #0ea5c6;
  --ok: #059669;     --ok-soft: rgba(16, 185, 129, .15);
  --warn: #c2700a;   --warn-soft: rgba(245, 158, 11, .17);
  --bad: #dc2626;    --bad-soft: rgba(239, 68, 68, .13);
  --info: #2f5fe0;   --info-soft: rgba(59, 130, 246, .13);
  --idle: #64748b;   --idle-soft: rgba(100, 116, 139, .13);
  --track: rgba(15, 23, 42, .08);
  --c-indigo: #5b5bf0; --c-cyan: #0891b2; --c-violet: #8b5cf6; --c-amber: #d97706; --c-rose: #e11d48; --c-teal: #0d9488;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --r: 18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b14;
    --blob1: rgba(79, 70, 229, .38); --blob2: rgba(8, 145, 178, .28); --blob3: rgba(190, 24, 93, .22); --blob4: rgba(180, 83, 9, .16);
    --glass: rgba(24, 30, 48, .52); --glass-strong: rgba(26, 32, 52, .88); --glass-soft: rgba(255, 255, 255, .035);
    --stroke: rgba(255, 255, 255, .09); --hair: rgba(255, 255, 255, .07); --highlight: inset 0 1px 0 rgba(255, 255, 255, .06);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --text: #e6e9f2; --muted: #9aa3b8; --faint: #6b7489; --accent: #8b93ff; --accent-2: #22d3ee;
    --ok: #34d399; --ok-soft: rgba(52, 211, 153, .14); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
    --bad: #f87171; --bad-soft: rgba(248, 113, 113, .14); --info: #7aa7ff; --info-soft: rgba(122, 167, 255, .14);
    --idle: #94a3b8; --idle-soft: rgba(148, 163, 184, .12); --track: rgba(255, 255, 255, .08);
    --c-indigo: #8b93ff; --c-cyan: #22d3ee; --c-violet: #a78bfa; --c-amber: #fbbf24; --c-rose: #fb7185; --c-teal: #2dd4bf;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080b14;
  --blob1: rgba(79, 70, 229, .38); --blob2: rgba(8, 145, 178, .28); --blob3: rgba(190, 24, 93, .22); --blob4: rgba(180, 83, 9, .16);
  --glass: rgba(24, 30, 48, .52); --glass-strong: rgba(26, 32, 52, .88); --glass-soft: rgba(255, 255, 255, .035);
  --stroke: rgba(255, 255, 255, .09); --hair: rgba(255, 255, 255, .07); --highlight: inset 0 1px 0 rgba(255, 255, 255, .06);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --text: #e6e9f2; --muted: #9aa3b8; --faint: #6b7489; --accent: #8b93ff; --accent-2: #22d3ee;
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .14); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .14); --info: #7aa7ff; --info-soft: rgba(122, 167, 255, .14);
  --idle: #94a3b8; --idle-soft: rgba(148, 163, 184, .12); --track: rgba(255, 255, 255, .08);
  --c-indigo: #8b93ff; --c-cyan: #22d3ee; --c-violet: #a78bfa; --c-amber: #fbbf24; --c-rose: #fb7185; --c-teal: #2dd4bf;
  color-scheme: dark;
}

/* ============ 基础 ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
#app { max-width: 1240px; margin: 0 auto; position: relative; }
[hidden] { display: none !important; }
h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 14px; height: 14px; }
.i.xs { width: 12px; height: 12px; stroke-width: 2; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* 背景光斑：毛玻璃要有东西可"透"才好看 */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; width: 60vmax; height: 60vmax; }
.bg i:nth-child(1) { background: radial-gradient(closest-side, var(--blob1), transparent); top: -20vmax; left: -15vmax; animation: drift1 38s ease-in-out infinite alternate; }
.bg i:nth-child(2) { background: radial-gradient(closest-side, var(--blob2), transparent); top: -18vmax; right: -20vmax; animation: drift2 44s ease-in-out infinite alternate; }
.bg i:nth-child(3) { background: radial-gradient(closest-side, var(--blob3), transparent); bottom: -25vmax; right: -10vmax; animation: drift1 50s ease-in-out infinite alternate-reverse; }
.bg i:nth-child(4) { background: radial-gradient(closest-side, var(--blob4), transparent); bottom: -22vmax; left: -18vmax; animation: drift2 46s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-7vmax, 8vmax) scale(.94); } }

/* 毛玻璃 */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), var(--highlight);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}
@media (prefers-reduced-motion: reduce) { .bg i { animation: none; } .live { animation: none !important; } }

/* ============ 顶栏 ============ */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, #6366f1, #06b6d4); box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .7), inset 0 1px 0 rgba(255, 255, 255, .35); }
.logo .i { width: 22px; height: 22px; }
.logo.lg { width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 6px; }
.logo.lg .i { width: 28px; height: 28px; }
.host { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.host .sep { color: var(--faint); }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.live.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.top-actions { display: flex; gap: 8px; }

.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--text);
  background: var(--glass-soft); border: 1px solid var(--stroke); transition: transform .15s, background .15s; }
.icon-btn:hover { background: var(--glass-strong); }
.icon-btn:active { transform: scale(.94); }

.btn { font: inherit; font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px;
  border-radius: 10px; border: 1px solid var(--hair); background: var(--glass-soft); color: var(--text); cursor: pointer;
  white-space: nowrap; transition: background .15s, transform .15s; text-decoration: none; }
.btn:hover { background: var(--glass-strong); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, #6366f1, #4f8cf0); color: #fff; border-color: transparent; font-size: 14px; padding: 10px 14px; justify-content: center;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .8); }
.btn.block { width: 100%; }
.btn.danger { color: var(--bad); }
.btn .i { width: 14px; height: 14px; }

.banner { display: flex; align-items: center; gap: 8px; color: var(--warn); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }

/* ============ 顶部指标 ============ */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.tile { border-radius: var(--r); padding: 14px 14px 12px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tile-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); }
.ico .i { width: 16px; height: 16px; }
.ico.lg { width: 36px; height: 36px; border-radius: 11px; }
.ico.lg .i { width: 19px; height: 19px; }
.tile-main { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tile-value { font: 650 24px/1.1 var(--sans); letter-spacing: -.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 1px; letter-spacing: 0; }
.tile-sub { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 620px) { .tile-value { font-size: 21px; } .tile { padding: 12px; } }

/* 圆环：弹簧过渡（略微冲过头再回弹），末端光点跟着走，超阈值时呼吸发光 */
.ring { --rc: var(--c, var(--accent)); width: 46px; height: 46px; flex: none; transform: rotate(-90deg); overflow: visible;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--rc) 40%, transparent)); transition: filter .4s; }
.ring circle { fill: none; stroke-width: 4.2; }
.ring .track { stroke: var(--track); }
.ring .fill { stroke: var(--rc); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.1s var(--spring), stroke .4s; }
.ring .head { transform-box: view-box; transform-origin: 22px 22px; transition: transform 1.1s var(--spring), opacity .3s; }
.ring .head circle { stroke: none; transition: fill .4s; }
.ring .head .halo { fill: var(--rc); opacity: .55; transform-box: fill-box; transform-origin: center; animation: halo-breathe 2.8s ease-in-out infinite; }
.ring .head .spark { fill: var(--rc); opacity: .9; }
.ring .head .dot { fill: color-mix(in srgb, #fff 80%, var(--rc)); }
.ring.bad .head .halo { animation-duration: 1.2s; }
@keyframes halo-breathe { 50% { opacity: .9; transform: scale(1.35); } }
.ring.empty .head { opacity: 0; }
.ring.warn { --rc: var(--warn); animation: ring-glow 2.2s ease-in-out infinite; }
.ring.bad { --rc: var(--bad); animation: ring-glow 1.2s ease-in-out infinite; }
@keyframes ring-glow {
  50% { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--rc) 75%, transparent)); }
}

/* 指标卡：悬停微微浮起，数字变化时轻跳 */
.tile { transition: transform .35s var(--spring), box-shadow .3s; }
@media (hover: hover) { .tile:hover { transform: translateY(-2px); } .tile:hover .ico { transform: scale(1.1) rotate(-4deg); } }
.ico { transition: transform .4s var(--spring); }
.tile-value.bump { animation: bump .55s var(--spring); }
@keyframes bump { 0% { transform: translateY(3px) scale(.94); opacity: .6; } }

/* 实时图标：动不动、动多快都跟数据走（--spd 由脚本按负载分档设置） */
.i.anim * { transform-box: fill-box; transform-origin: center; }
.tile.act .core { animation: core-beat var(--spd, 2s) ease-in-out infinite; }
@keyframes core-beat { 50% { transform: scale(.5); fill: currentColor; fill-opacity: .45; } }
.tile.act .pins { animation: blink var(--spd, 2s) steps(2, jump-none) infinite; }
.tile.act .bar { animation: bar-wave var(--spd, 2s) ease-in-out infinite; animation-delay: calc(var(--spd, 2s) * var(--k) * -.2); }
@keyframes bar-wave { 50% { transform: scaleY(1.9); opacity: .35; } }
.tile.act .led { animation: blink calc(var(--spd, 2s) * .5) steps(2, jump-none) infinite; animation-delay: calc(var(--spd, 2s) * var(--k) * -.25); }
@keyframes blink { 50% { opacity: .2; } }
.tile.act .fan { animation: spin-fan var(--spd, 2s) linear infinite; }
@keyframes spin-fan { to { transform: rotate(360deg); } }
.tile.rx .dn { animation: flow-dn var(--spd, 2s) ease-in-out infinite; }
.tile.tx .up { animation: flow-up var(--spd, 2s) ease-in-out infinite; animation-delay: calc(var(--spd, 2s) * -.5); }
@keyframes flow-dn { 0% { transform: translateY(-2.5px); opacity: .25; } 45% { opacity: 1; } 100% { transform: translateY(2.5px); opacity: .25; } }
@keyframes flow-up { 0% { transform: translateY(2.5px); opacity: .25; } 45% { opacity: 1; } 100% { transform: translateY(-2.5px); opacity: .25; } }
.i.anim .hand-m, .i.anim .hand-h { transform-box: view-box; transform-origin: 12px 12px; }
.tile .hand-m { animation: spin-fan 6s linear infinite; }
.tile .hand-h { animation: spin-fan 72s linear infinite; }

/* 服务概况 */
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 620px) { .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.chip { border-radius: 16px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.chip-text { min-width: 0; }
.chip .ico .i { transform-origin: 50% 20%; }
.chip.busy .ico .i { animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 25% { transform: rotate(7deg); } 75% { transform: rotate(-7deg); } }
.chip.alarm .ico { animation: alarm-bg 2s ease-in-out infinite; }
.chip.alarm .ico .i { transform-origin: 50% 90%; animation: wiggle 2s ease-in-out infinite; }
.chip.alarm.hot .ico, .chip.alarm.hot .ico .i { animation-duration: 1s; }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-14deg); } 76% { transform: rotate(12deg); } 84% { transform: rotate(-7deg); } 92% { transform: rotate(4deg); } }
@keyframes alarm-bg { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 18%, transparent); } }
.chip-value { font: 650 17px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.chip-value small { font-size: 12px; color: var(--muted); font-weight: 500; }
.chip-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ 标签页 ============ */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; margin: 22px 0 14px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { font: inherit; font-size: 13px; display: flex; align-items: center; gap: 6px; background: none; border: none; padding: 7px 14px;
  border-radius: 10px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.tab .i { width: 15px; height: 15px; }
.tab.active { background: var(--glass-strong); color: var(--text); font-weight: 600; box-shadow: 0 2px 8px -3px rgba(15, 23, 42, .2); }
.badge { font: 600 10.5px/16px var(--sans); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; text-align: center; }
@media (max-width: 620px) { .tabs { width: 100%; } .tab { flex: 1; justify-content: center; padding: 7px 6px; } }

.toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.toggle { font: inherit; font-size: 12.5px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 11px; color: var(--muted); cursor: pointer; }
.toggle .i { width: 14px; height: 14px; }
.toggle[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--glass)); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; gap: 2px; }
.seg button { font: inherit; font-size: 12.5px; padding: 4px 12px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.seg button.active { background: var(--glass-strong); color: var(--text); font-weight: 600; }

/* ============ 服务面板 ============ */
.panel { border-radius: 20px; margin-bottom: 14px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.panel-title { font-weight: 650; font-size: 15px; }
.panel-sub { font-size: 12px; color: var(--muted); }
.panel-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count b { color: var(--text); font-size: 14px; }
.panel-body { padding: 0 12px 12px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); align-items: start; }
.panel-empty { padding: 0 16px 16px; color: var(--muted); font-size: 13px; }
.panel-empty code { font-family: var(--mono); font-size: 12px; background: var(--glass-soft); border: 1px solid var(--hair); padding: 1px 5px; border-radius: 5px; }

.card { border-radius: 15px; padding: 12px; background: var(--glass-soft); border: 1px solid var(--hair); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.card.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 6%, var(--glass-soft)); }
.card.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-name { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-main { font-size: 13px; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.card-main b { font-weight: 600; white-space: nowrap; }
.card-main span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.meta .bad { color: var(--bad); font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

.pill { font-size: 11px; font-weight: 600; padding: 2px 8px 2px 7px; border-radius: 20px; white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 5px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.ok::before, .pill.info::before { animation: dot-breathe 2.2s ease-in-out infinite; }
.pill.bad::before { animation: dot-breathe 1s ease-in-out infinite; }
@keyframes dot-breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 60% { box-shadow: 0 0 0 4px transparent; } }
.card.bad { animation: card-alert 2s ease-in-out infinite; }
@keyframes card-alert { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); } }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.idle { background: var(--idle-soft); color: var(--idle); }

.queue { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.queue-k { font-size: 11px; color: var(--faint); margin-right: 2px; }
.queue span:not(.queue-k) { font-size: 11px; border-radius: 7px; padding: 1px 7px; background: var(--glass-soft); border: 1px solid var(--hair); color: var(--muted); white-space: nowrap; display: inline-flex; gap: 4px; }
.queue span i { font-style: normal; color: var(--faint); font-variant-numeric: tabular-nums; }
.queue span.due { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.queue span.due i { color: inherit; opacity: .8; }

/* ---- 可点击的卡片 ---- */
.card { position: relative; transition: transform .3s var(--spring), border-color .2s, box-shadow .2s; }
.card.linkable { cursor: pointer; }
@media (hover: hover) {
  .card.linkable:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--accent) 60%, transparent); }
  .card.linkable:hover .go { opacity: 1; transform: none; }
}
.card.linkable:active { transform: scale(.985); transition-duration: .08s; }
.card-head .who { flex: 1; min-width: 0; }
.card-sub { font: 11px/1.3 var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--accent); flex: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent); opacity: .55; transform: translate(-2px, 2px); transition: opacity .2s, transform .3s var(--spring); }
@media (hover: none) { .go { opacity: 1; transform: none; } }

/* ---- AzurPilot 实例卡片 ---- */
.card.azur { gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--st);
  background: color-mix(in srgb, var(--st) 14%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--st) 30%, transparent); }
.card.azur { --st: var(--idle); }
.card.azur.s-running { --st: var(--ok); } .card.azur.s-waiting { --st: var(--info); } .card.azur.s-stuck { --st: var(--bad); }
.card.azur.s-running .avatar .i { animation: sway 3.2s ease-in-out infinite; transform-origin: 50% 20%; }
.task { border-radius: 11px; padding: 8px 10px; background: color-mix(in srgb, var(--st) 7%, var(--glass-soft)); border: 1px solid color-mix(in srgb, var(--st) 16%, transparent); }
.task-k { font-size: 11px; color: var(--muted); margin-bottom: 1px; }
.task-v { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.task-v b { font-size: 15px; font-weight: 650; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.task-v span { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; margin-left: auto; }
.errline { font: inherit; text-align: left; width: 100%; display: flex; align-items: center; gap: 8px; cursor: pointer;
  color: var(--bad); background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 18%, transparent);
  border-radius: 10px; padding: 6px 9px; font-size: 12px; transition: background .2s, transform .25s var(--spring); }
.errline .t { font: 600 11px var(--mono); flex: none; opacity: .85; }
.errline .m { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.errline .more { flex: none; font-size: 11px; font-weight: 600; opacity: .8; }
.errline:hover { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.errline:active { transform: scale(.98); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--hair); }
.card-foot .actions { margin: 0; }
.err-count { font: inherit; font-size: 11.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
  color: var(--bad); background: var(--bad-soft); border: none; border-radius: 7px; padding: 1px 7px; }
.err-count:hover { background: color-mix(in srgb, var(--bad) 20%, transparent); }

/* ---- MuMu 卡片：上方是画面预览，点击看实时画面 ---- */
.card.mumu { padding: 8px 8px 12px; }
.card.mumu > :not(.screen) { margin: 0 4px; }
.screen { position: relative; aspect-ratio: 16 / 9; border-radius: 11px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c-cyan) 22%, #0b1020), #0b1020); color: #fff; }
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform .5s var(--out), opacity .3s; }
.screen-cta { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 20px; background: rgba(0, 0, 0, .38); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .3s var(--spring), background .2s; }
.live-tag { position: absolute; top: 8px; left: 8px; font: 700 9.5px/1 var(--sans); letter-spacing: .8px; padding: 4px 6px 4px 14px;
  border-radius: 6px; background: rgba(0, 0, 0, .42); }
.live-tag::before { content: ""; position: absolute; left: 6px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
  background: #ef4444; animation: blink 1.4s steps(2, jump-none) infinite; }
.screen.off { background: var(--glass-soft); color: var(--faint); border: 1px dashed var(--hair); }
.screen.off .screen-cta { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.card.mumu.linkable .screen { cursor: pointer; }
@media (hover: hover) {
  .card.mumu.linkable:hover .screen img { transform: scale(1.04); opacity: 1; }
  .card.mumu.linkable:hover .screen-cta { transform: scale(1.06); background: color-mix(in srgb, var(--c-cyan) 70%, #000); }
}
.card.mumu .meta .pill { font-size: 10.5px; padding: 1px 7px 1px 6px; }

/* ---- 实时画面弹窗 ---- */
.live-view { display: grid; gap: 10px; }
.live-stage { position: relative; border-radius: 14px; overflow: hidden; background: #05070d; min-height: 200px; display: grid; place-items: center; }
.live-stage img { display: block; width: 100%; height: auto; max-height: calc(100vh - 210px); object-fit: contain; border-radius: 0; opacity: 0; transition: opacity .3s; }
.live-stage.ready img { opacity: 1; }
.live-wait { position: absolute; display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 13px; }
.live-wait .i { animation: spin-fan 1s linear infinite; }
.live-stage.ready .live-wait { display: none; }
.live-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.live-bar .btn { margin-left: auto; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok-soft); animation: dot-breathe 1.6s ease-in-out infinite; color: var(--ok); }
.live-view.paused .live-dot { background: var(--idle); animation: none; }
.live-view.err .live-dot { background: var(--bad); color: var(--bad); }
.live-view.err .live-stat { color: var(--bad); }

/* ---- 报错原因弹窗 ---- */
.errs { display: grid; gap: 8px; }
.errs-note { margin: 0 0 2px; }
.errs-h { margin: 12px 0 2px; font-size: 13px; display: flex; align-items: baseline; gap: 8px; }
.err-item { border-radius: 13px; border: 1px solid var(--hair); background: var(--glass-soft); overflow: hidden; }
.err-item > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; }
.err-item > summary::-webkit-details-marker { display: none; }
.err-item .lv { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.err-item .t { font: 600 12px var(--mono); color: var(--muted); flex: none; }
.err-item .m { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.err-item .chev { flex: none; color: var(--faint); font-size: 16px; transition: transform .3s var(--spring); }
.err-item[open] > summary .chev { transform: rotate(90deg); }
.err-item[open] > summary { border-bottom: 1px solid var(--hair); }
.err-body { padding: 10px 12px 12px; display: grid; gap: 10px; animation: rise .35s var(--out); }
.cause { border-radius: 10px; padding: 9px 11px; background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 18%, transparent); }
.cause .k { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; color: var(--bad); margin-bottom: 3px; }
.cause .v { font: 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.err-shot { display: grid; gap: 4px; justify-items: center; }
.err-shot img { border-radius: 10px; max-height: 46vh; width: auto; max-width: 100%; }
.err-log > summary { cursor: pointer; font-size: 12px; color: var(--accent); padding: 2px 0; }
.err-log .log { margin-top: 6px; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--text) 4%, transparent); max-height: 50vh; overflow: auto; }
.log.wide { white-space: pre; word-break: normal; font-size: 10.5px; }

/* ============ 进程表 ============ */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .two, .charts { grid-template-columns: 1fr; } }
.box { border-radius: 20px; padding: 14px 16px; min-width: 0; }
.box h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 650; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.box h3 span { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--hair); }
tr:last-child td { border-bottom: none; }
th { color: var(--faint); font-weight: 500; font-size: 11.5px; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.name { max-width: 0; width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 曲线 ============ */
.chart { position: relative; height: 150px; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--hair); stroke-width: 1; }
.chart .axis { fill: var(--faint); font: 10px var(--sans); }
.chart .tip { position: absolute; pointer-events: none; top: 0; transform: translate(-50%, -112%); white-space: nowrap;
  font: 11px/1.4 var(--sans); padding: 5px 8px; border-radius: 8px; background: var(--glass-strong); border: 1px solid var(--stroke); box-shadow: var(--shadow); }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.note { border-radius: 14px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; }

/* ============ 动态记录 ============ */
.events { list-style: none; margin: 0; padding: 4px 0; border-radius: 20px;
  max-height: min(60vh, 560px); overflow-y: auto; overflow-x: hidden;
  overscroll-behavior-y: contain; overflow-anchor: none; scrollbar-gutter: stable; }
.events:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.events li { display: grid; grid-template-columns: 8px 64px minmax(0, 150px) minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 16px; font-size: 13px; }
.events li + li { border-top: 1px solid var(--hair); }
.events .lv { width: 8px; height: 8px; border-radius: 50%; }
.events .lv.ok { background: var(--ok); } .events .lv.info { background: var(--info); }
.events .lv.warn { background: var(--warn); } .events .lv.error { background: var(--bad); }
.events .t { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.events .src { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.events .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.events .empty { display: block; color: var(--muted); text-align: center; padding: 28px; }
@media (max-width: 620px) {
  .events { max-height: min(60vh, 480px); max-height: min(60svh, 480px); }
  .events li { grid-template-columns: 8px minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 14px; }
  .events .lv { grid-row: 1 / 3; align-self: center; }
  .events .src { grid-column: 2; grid-row: 1; }
  .events .t { grid-column: 3; grid-row: 1; }
  .events .msg { grid-column: 2 / 4; grid-row: 2; white-space: normal; overflow-wrap: anywhere; }
}

/* ============ 弹窗 / 提示 / 登录 ============ */
dialog { border-radius: 20px; padding: 0; color: var(--text); width: min(960px, calc(100vw - 24px)); max-height: calc(100vh - 48px); background: var(--glass-strong); }
dialog::backdrop { background: rgba(8, 11, 20, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--hair); }
.modal-actions { display: flex; gap: 6px; }
.modal-actions .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.modal-body { padding: 12px 16px 16px; overflow: auto; max-height: calc(100vh - 120px); }
.modal-body img { max-width: 100%; display: block; margin: 0 auto; border-radius: 12px; }
.log { font: 11px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; margin: 0; }
.log .e { color: var(--bad); } .log .w { color: var(--warn); }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); border-radius: 12px;
  padding: 9px 16px; font-size: 13px; z-index: 10; max-width: calc(100vw - 32px); background: var(--glass-strong); }

.login { min-height: 88vh; display: grid; place-items: center; }
.login-card { border-radius: 24px; padding: 30px 26px 22px; width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-card h1 { font-size: 20px; }
.login-card p { margin: -8px 0 6px; }
.field { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--glass-soft); color: var(--faint); }
.field:focus-within { border-color: var(--accent); }
.field input { flex: 1; min-width: 0; font: inherit; padding: 11px 0; border: none; outline: none; background: none; color: var(--text); }
.login-err { color: var(--bad); font-size: 12px; min-height: 18px; margin: 0 !important; }

.foot { margin-top: 26px; text-align: center; font-size: 11.5px; color: var(--faint); }

/* ============ 交互动画：按下压扁，松开果冻回弹 ============ */
:root { --spring: cubic-bezier(.34, 1.56, .64, 1); --out: cubic-bezier(.22, 1, .36, 1); }
.btn, .icon-btn, .tab, .chip, .seg button, .toggle {
  transition: transform .22s var(--spring), background .2s, color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn:active, .icon-btn:active, .tab:active, .seg button:active, .toggle:active { transform: scale(.92); transition-duration: .08s; }
.chip:active { transform: scale(.96); transition-duration: .08s; }
@media (hover: hover) { .chip:hover { transform: translateY(-2px); } .icon-btn:hover .i { transform: scale(1.08); } }
.icon-btn .i { transition: transform .3s var(--spring); }
.jelly { animation: jelly .52s var(--out) both; }
.chip.jelly { --j: .5; }
@keyframes jelly {
  0%   { transform: scale(calc(1 - .08 * var(--j, 1))); }
  32%  { transform: scale(calc(1 + .07 * var(--j, 1)), calc(1 - .06 * var(--j, 1))); }
  52%  { transform: scale(calc(1 - .035 * var(--j, 1)), calc(1 + .035 * var(--j, 1))); }
  72%  { transform: scale(calc(1 + .015 * var(--j, 1)), calc(1 - .012 * var(--j, 1))); }
  100% { transform: scale(1); }
}
.icon-btn.spin .i { animation: spin .7s var(--out); }
@keyframes spin { from { transform: rotate(-200deg) scale(.8); } }
#theme-btn .i { animation: pop-in .5s var(--spring); }
@keyframes pop-in { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }
.btn.loading { pointer-events: none; animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }

/* 标签页 / 分段按钮：滑块弹性跟随 */
.tabs, .seg { position: relative; }
.tab, .seg button { position: relative; z-index: 1; }
.tabs.has-slider .tab.active, .seg.has-slider button.active { background: none; box-shadow: none; }
.slider { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 10px; z-index: 0; pointer-events: none;
  background: var(--glass-strong); box-shadow: 0 2px 10px -3px rgba(15, 23, 42, .22);
  transition: transform .5s var(--spring), width .5s var(--spring); }
.seg .slider { top: 3px; bottom: 3px; border-radius: 8px; }
.slider.instant { transition: none; }

/* 进场 */
.tab-body:not([hidden]) { animation: rise .42s var(--out); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
#app.intro .tile, #app.intro .chip, #app.intro .tabs { animation: rise .6s var(--out) both; }
#app.intro .tiles > :nth-child(2) { animation-delay: .04s; } #app.intro .tiles > :nth-child(3) { animation-delay: .08s; }
#app.intro .tiles > :nth-child(4) { animation-delay: .12s; } #app.intro .tiles > :nth-child(5) { animation-delay: .16s; }
#app.intro .tiles > :nth-child(6) { animation-delay: .2s; }
#app.intro .chips > :nth-child(1) { animation-delay: .18s; } #app.intro .chips > :nth-child(2) { animation-delay: .22s; }
#app.intro .chips > :nth-child(3) { animation-delay: .26s; } #app.intro .chips > :nth-child(4) { animation-delay: .3s; }
#app.intro .tabs { animation-delay: .32s; }
.login-card { animation: pop .6s var(--spring) both; }
dialog[open] { animation: pop .45s var(--spring); }
dialog[open]::backdrop { animation: fade .3s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
.toast:not([hidden]) { animation: toast-in .45s var(--spring); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 18px) scale(.9); } }
.login-card.shake { animation: shake .45s var(--out); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ 访问地址 ============ */
.icon-btn { position: relative; }
.dot-badge { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--glass-strong); display: none; }
.dot-badge.ok { display: block; background: var(--ok); }
.dot-badge.warn { display: block; background: var(--warn); }
.dot-badge.bad { display: block; background: var(--bad); }
.access { display: grid; gap: 10px; }
.access-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--glass-soft); border: 1px solid var(--hair); }
.access-row .grow { flex: 1 1 180px; min-width: 0; }
.access-row .k { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.access-row .v { font: 600 13.5px var(--mono); word-break: break-all; margin-top: 2px; }
.access-row .v a { color: var(--accent); text-decoration: none; }
.access-row .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 620px) { .top-actions { gap: 6px; } .icon-btn { width: 36px; height: 36px; } }
