/* ==========================================================================
   YY 云栈控制台 · 设计系统
   浅色 / 深色双主题，移动优先，8pt 栅格
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #eef2f8;
  --bg-tint-1: rgba(91, 140, 255, 0.16);
  --bg-tint-2: rgba(34, 211, 238, 0.13);

  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eef2f8;
  --glass: rgba(255, 255, 255, 0.78);
  --line: #e3e9f2;
  --line-strong: #d3dceb;

  --ink: #0d1728;
  --ink-2: #34435c;
  --muted: #6b7a92;
  --faint: #96a3b8;

  --brand: #2f6bff;
  --brand-2: #22d3ee;
  --brand-soft: rgba(47, 107, 255, 0.1);
  --brand-ring: rgba(47, 107, 255, 0.28);

  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.16);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.14);

  --shadow-1: 0 1px 2px rgba(13, 23, 40, 0.04), 0 6px 18px -10px rgba(13, 23, 40, 0.18);
  --shadow-2: 0 2px 6px rgba(13, 23, 40, 0.05), 0 18px 40px -18px rgba(13, 23, 40, 0.24);
  --shadow-pop: 0 24px 60px -18px rgba(13, 23, 40, 0.35);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --footer-h: calc(64px + env(safe-area-inset-bottom, 0px));
}

html.dark {
  color-scheme: dark;

  --bg: #080d17;
  --bg-tint-1: rgba(47, 107, 255, 0.22);
  --bg-tint-2: rgba(34, 211, 238, 0.12);

  --surface: #101827;
  --surface-2: #16202f;
  --surface-3: #0c1421;
  --glass: rgba(12, 20, 33, 0.76);
  --line: #1e2b3f;
  --line-strong: #2a3a54;

  --ink: #e9eff9;
  --ink-2: #c2cee0;
  --muted: #8c9cb5;
  --faint: #64758f;

  --brand: #5b8cff;
  --brand-2: #34e2f0;
  --brand-soft: rgba(91, 140, 255, 0.16);
  --brand-ring: rgba(91, 140, 255, 0.4);

  --ok: #2ad9a2;
  --ok-soft: rgba(42, 217, 162, 0.16);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.16);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.16);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -14px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.4), 0 24px 50px -24px rgba(0, 0, 0, 0.9);
  --shadow-pop: 0 30px 70px -20px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
html { overflow-x: hidden; }
body { overflow-x: hidden; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -8%, var(--bg-tint-1), transparent 62%),
    radial-gradient(900px 480px at 96% 4%, var(--bg-tint-2), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
::selection { background: var(--brand-ring); }

:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; border-radius: 8px; }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

.only-mobile { display: none !important; }
.topbar .back-btn { display: none; }

/* ==========================================================================
   登录
   ========================================================================== */

.login {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(closest-side at 30% 30%, rgba(47, 107, 255, 0.35), transparent),
    radial-gradient(closest-side at 75% 70%, rgba(34, 211, 238, 0.28), transparent),
    radial-gradient(closest-side at 50% 95%, rgba(124, 92, 255, 0.22), transparent);
  filter: blur(10px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.login-card {
  position: relative;
  width: min(400px, 100%);
  padding: 34px 30px 26px;
  border-radius: var(--r-xl);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(26px) saturate(1.3);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  text-align: center;
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.login-logo { width: 62px; height: 62px; margin: 0 auto 16px; }
.login-logo svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 22px rgba(47, 107, 255, 0.35)); }
.login-card h1 { font-size: 23px; letter-spacing: 0.02em; font-weight: 700; }
.login-sub { margin-top: 5px; color: var(--muted); font-size: 13px; }
.login-card .field { margin: 24px 0 16px; text-align: left; }
.login-err { min-height: 20px; margin-top: 10px; color: var(--bad); font-size: 13px; }
.login-foot { margin-top: 4px; color: var(--faint); font-size: 11.5px; letter-spacing: 0.04em; }

/* ==========================================================================
   表单控件
   ========================================================================== */

.field { display: block; }
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.field-box {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 13px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field-box:focus-within {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.field-box .ico { color: var(--faint); flex: none; }
.field-box input, .field-box textarea {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 15px;
}
.field-box input::placeholder { color: var(--faint); }
.field-box textarea { padding: 12px 0; resize: vertical; line-height: 1.6; height: auto; }
.field-box.is-area { height: auto; align-items: flex-start; padding-top: 4px; }
.pw-toggle { color: var(--faint); padding: 4px; margin-right: -4px; }
.pw-toggle:hover { color: var(--ink-2); }
.field-hint { margin-top: 6px; font-size: 12px; color: var(--faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.12s, background 0.16s, border-color 0.16s, box-shadow 0.16s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn:active { transform: scale(0.975); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #3b74ff, #1f8ff0 55%, #0fb6c9);
  box-shadow: 0 8px 20px -8px rgba(47, 107, 255, 0.7);
}
.btn-primary:hover { filter: brightness(1.05); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: rgba(239, 68, 68, 0.35); background: var(--bad-soft); }
.btn-block { width: 100%; height: 48px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn.is-active {
  color: var(--brand);
  border-color: var(--brand-ring);
  background: var(--brand-soft);
}

select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color: var(--ink);
}
select option { background: var(--surface); color: var(--ink); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background 0.16s, color 0.16s, transform 0.12s;
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.is-on { color: var(--brand); border-color: var(--brand-ring); background: var(--brand-soft); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #4f7cff, #12b3c9);
  box-shadow: 0 6px 16px -8px rgba(47, 107, 255, 0.9);
  flex: none;
}

.switch {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: background 0.2s, border-color 0.2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.switch.is-on { background: linear-gradient(135deg, #3b74ff, #12b3c9); border-color: transparent; }
.switch.is-on::after { transform: translateX(18px); }

/* ==========================================================================
   框架布局
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.brand-text em { font-size: 11px; font-style: normal; color: var(--faint); letter-spacing: 0.06em; }

.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.16s, color 0.16s;
  position: relative;
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.side-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.side-item .ico { width: 19px; height: 19px; }
.side-item .badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--muted);
}
.side-item.active .badge { background: rgba(47, 107, 255, 0.16); color: var(--brand); }

.side-foot { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.side-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.side-quit {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.16s, background 0.16s;
}
.side-quit:hover { color: var(--bad); background: var(--bad-soft); }
.side-quit .ico { width: 17px; height: 17px; }

.workspace { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.topbar-title p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.ico-sun { display: none; }
html.dark .ico-sun { display: block; }
html.dark .ico-moon { display: none; }

.main {
  flex: 1;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 8px 26px 56px;
  outline: none;
}

.tabbar { display: none; }

/* ==========================================================================
   通用块
   ========================================================================== */

.section { margin-top: 26px; }
.section:first-child { margin-top: 12px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 2px;
}
.section-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.section-head span { font-size: 12px; color: var(--faint); }
.section-head .more { margin-left: auto; font-size: 12.5px; color: var(--brand); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.live { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px var(--ok-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 30px;
  border-radius: var(--r-xl);
  color: #fff;
  background: linear-gradient(118deg, #16265c 0%, #2548a8 42%, #0b7f8d 100%);
  box-shadow: 0 26px 54px -26px rgba(20, 45, 120, 0.75);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(560px 260px at 88% -20%, rgba(80, 220, 255, 0.45), transparent 68%),
    radial-gradient(420px 240px at 4% 118%, rgba(120, 100, 255, 0.5), transparent 66%);
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.9px, transparent 0.9px);
  background-size: 18px 18px;
  opacity: 0.5;
  mask-image: linear-gradient(110deg, #000 0%, transparent 62%);
  -webkit-mask-image: linear-gradient(110deg, #000 0%, transparent 62%);
  z-index: -1;
}
.hero-body { flex: 1; min-width: 0; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}
.hero h1 { margin-top: 12px; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.hero-sub { margin-top: 6px; font-size: 13.5px; color: rgba(255, 255, 255, 0.78); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  transition: background 0.16s;
}
.chip:hover { background: rgba(255, 255, 255, 0.22); }
.chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

.hero-ring {
  position: relative;
  width: 108px;
  height: 108px;
  flex: none;
  display: grid;
  place-items: center;
}
.hero-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hero-ring .ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 8; }
.hero-ring .ring-fg {
  fill: none;
  stroke: #6ef0d5;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.3, 1, 0.4, 1);
  filter: drop-shadow(0 0 6px rgba(110, 240, 213, 0.6));
}
.hero-ring .ring-in { text-align: center; line-height: 1.15; }
.hero-ring .ring-in b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.hero-ring .ring-in span { font-size: 11px; color: rgba(255, 255, 255, 0.72); }

/* ==========================================================================
   KPI
   ========================================================================== */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.kpi {
  padding: 15px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s, box-shadow 0.18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.kpi-top .ico { width: 15px; height: 15px; }
.kpi-val {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.kpi-val small { font-size: 12px; font-weight: 500; color: var(--faint); }
.kpi-foot { margin-top: 3px; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   服务卡片
   ========================================================================== */

.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; }
.svc {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.18s, border-color 0.18s;
  overflow: hidden;
}
.svc:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.svc:active { transform: scale(0.985); }
.svc-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: var(--c, #2f6bff);
  box-shadow: 0 8px 18px -10px var(--c, #2f6bff);
}
.svc-tile .ico { width: 20px; height: 20px; stroke-width: 1.9; }
.svc-main { min-width: 0; flex: 1; }
.svc-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-host {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.svc-meta { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; min-width: 0; }
.svc-lat {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.svc-lat.up { color: var(--ok); }
.svc-lat.down { color: var(--bad); }
.svc-acc {
  font-size: 11px;
  color: var(--faint);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 可用率小方块 */
.dots { display: flex; gap: 2px; margin-top: 7px; height: 12px; }
.dots i {
  flex: 1 1 0;
  max-width: 12px;
  min-width: 2px;
  border-radius: 2px;
  background: var(--surface-3);
}
.dots i.up { background: color-mix(in srgb, var(--ok) 62%, transparent); }
.dots i.down { background: var(--bad); }

.svc-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--faint);
  transition: color 0.16s, background 0.16s;
}
.mini-btn:hover { color: var(--ink); background: var(--surface-2); }
.mini-btn .ico { width: 16px; height: 16px; }

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 2px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ==========================================================================
   文件管理
   ========================================================================== */

.files-wrap { display: flex; flex-direction: column; gap: 12px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 180px;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-box .ico { width: 16px; height: 16px; color: var(--faint); }
.search-box input { border: 0; outline: 0; background: none; width: 100%; font-size: 13.5px; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.crumbs::-webkit-scrollbar { display: none; }
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}
.crumb:hover { background: var(--surface-2); color: var(--ink); }
.crumb.cur { color: var(--ink); font-weight: 600; background: var(--surface-3); }
.crumb-sep { color: var(--faint); font-size: 12px; flex: none; }

.file-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.file-head {
  display: grid;
  grid-template-columns: 26px 36px minmax(0, 1fr) 100px 140px 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.file-row {
  display: grid;
  grid-template-columns: 26px 36px minmax(0, 1fr) 100px 140px 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.14s;
  position: relative;
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--surface-2); }
.file-row.sel { background: var(--brand-soft); }
.file-row.sel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
}
.check {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.6px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all 0.15s;
  flex: none;
}
.check .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.file-row.sel .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.check:hover { border-color: var(--brand); }

.file-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}
.file-ico .ico { width: 18px; height: 18px; }
.file-ico.dir { background: rgba(245, 184, 60, 0.16); color: #d99a0b; }
html.dark .file-ico.dir { color: #f5c04a; }
.file-ico.img { background: rgba(47, 107, 255, 0.14); color: var(--brand); }
.file-ico.zip { background: rgba(124, 92, 255, 0.16); color: #7c5cff; }
.file-ico.code { background: rgba(0, 184, 148, 0.14); color: #00a884; }

.file-name { min-width: 0; }
.file-name b {
  display: block;
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-name small { display: none; font-size: 11.5px; color: var(--faint); }
.file-col { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-act { display: grid; place-items: center; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--faint);
}
.empty .ico { width: 38px; height: 38px; margin: 0 auto 10px; opacity: 0.5; }
.empty p { font-size: 13.5px; }
.empty .btn { margin-top: 14px; }

.drop-hint {
  border: 2px dashed var(--brand-ring);
  background: var(--brand-soft);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  color: var(--brand);
  font-weight: 600;
  font-size: 13.5px;
}

/* 选择悬浮条 */
.selbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-h) + 14px);
  transform: translateX(-50%) translateY(20px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 16px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  white-space: nowrap;
}
.selbar.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.selbar .count { font-size: 13px; font-weight: 600; margin-right: 6px; }
.selbar .btn { height: 34px; padding: 0 12px; font-size: 13px; }

/* 上传进度 */
.uploader {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  width: min(340px, calc(100vw - 32px));
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}
.up-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.up-head .icon-btn { width: 26px; height: 26px; margin-left: auto; border: 0; }
.up-item { margin-top: 8px; }
.up-item .nm { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.up-item .nm span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 5px; border-radius: 99px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #3b74ff, #12b3c9); transition: width 0.2s; }
.up-item.done .bar > i { background: var(--ok); }
.up-item.err .bar > i { background: var(--bad); }

/* ==========================================================================
   工具 / 设置
   ========================================================================== */

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.cert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 64px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.cert-row:last-child { border-bottom: 0; }
.cert-row .h { font-size: 13.5px; font-weight: 600; }
.cert-row .s {
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cert-meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cert-meter > i { display: block; height: 100%; border-radius: 99px; }
.cert-days { text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.kv-list { padding: 4px 16px 8px; }
.kv {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.kv:last-child { border-bottom: 0; }
.kv-k { font-size: 13px; color: var(--muted); flex: none; min-width: 78px; }
.kv-v { font-size: 13.5px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kv-v.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.kv .icon-btn { width: 30px; height: 30px; margin-left: auto; border: 0; color: var(--faint); }
.kv .icon-btn:hover { color: var(--brand); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.svc-edit {
  display: grid;
  grid-template-columns: 34px minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.9fr) 34px;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.svc-edit input {
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 0 9px;
  font-size: 12.5px;
  min-width: 0;
  outline: 0;
}
.svc-edit input:focus { border-color: var(--brand); background: var(--surface); }
.svc-edit .swatch {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: none;
}
.svc-edit .swatch input { width: 46px; height: 46px; margin: -8px; border: 0; padding: 0; background: none; cursor: pointer; }

/* ==========================================================================
   浮层：toast / sheet / modal
   ========================================================================== */

.toasts {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(420px, calc(100vw - 28px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(18px);
  animation: toastIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast.out { animation: toastOut 0.2s forwards; }
.toast .ico { width: 17px; height: 17px; flex: none; }
.toast.ok .ico { color: var(--ok); }
.toast.err .ico { color: var(--bad); }
.toast.info .ico { color: var(--brand); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(0.97); } }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 13, 23, 0.44);
  backdrop-filter: blur(3px);
  animation: fade 0.2s;
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 90;
  width: min(560px, 100%);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: var(--shadow-pop);
  animation: sheetIn 0.3s cubic-bezier(0.2, 0.9, 0.25, 1);
  overflow: hidden;
}
@keyframes sheetIn { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet.center {
  top: 50%;
  bottom: auto;
  width: min(520px, calc(100vw - 28px));
  border-radius: var(--r-xl);
  border-bottom: 1px solid var(--line);
  transform: translate(-50%, -50%);
  animation: pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 86dvh;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); } }
.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--line-strong);
  margin: 2px auto 8px;
  flex: none;
}
.sheet.center .sheet-grab { display: none; }
.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 12px;
  flex: none;
}
.sheet-head h3 { font-size: 16px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .icon-btn { margin-left: auto; width: 32px; height: 32px; border: 0; }
.sheet-body { padding: 0 18px 8px; overflow: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 8px; padding: 12px 18px 4px; flex: none; }
.sheet-foot .btn { flex: 1; }

.act-list { padding: 2px 8px 8px; }
.act {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  text-align: left;
  transition: background 0.14s;
}
.act:hover { background: var(--surface-2); }
.act .ico { width: 19px; height: 19px; color: var(--muted); }
.act.danger { color: var(--bad); }
.act.danger .ico { color: var(--bad); }

.preview-img {
  display: block;
  max-width: 100%;
  max-height: 62dvh;
  margin: 0 auto;
  border-radius: 12px;
  background: var(--surface-2);
}
.code-area {
  width: 100%;
  min-height: 44dvh;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  resize: vertical;
  outline: 0;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}
.code-area:focus { border-color: var(--brand); }

/* ==========================================================================
   骨架屏
   ========================================================================== */
.sk {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ==========================================================================
   响应式
   ========================================================================== */

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

@media (max-width: 960px) {
  .app { display: block; }
  .sidebar { display: none; }
  .only-mobile { display: grid !important; }
  .topbar .back-btn { display: grid; }
  .main { padding: 6px 14px calc(var(--footer-h) + 22px); }
  .topbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
    gap: 8px;
    border-bottom-color: var(--line);
  }
  .topbar-title h2 { font-size: 17px; }
  .topbar-title p { display: none; }
  .topbar-actions { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px 20px; gap: 18px; }
  .hero h1 { font-size: 22px; }
  .hero-ring { position: absolute; right: 18px; top: 20px; width: 76px; height: 76px; }
  .hero-ring .ring-in b { font-size: 18px; }
  .hero-ring .ring-in span { font-size: 9.5px; }
  .hero-chips { margin-top: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi-val { font-size: 19px; }
  .svc-grid { grid-template-columns: 1fr; gap: 9px; }
  .section { margin-top: 20px; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: var(--footer-h);
    padding: 0 6px env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border-top: 1px solid var(--line);
  }
  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 600;
    padding-top: 3px;
    transition: color 0.18s;
    position: relative;
  }
  .tab .ico { width: 22px; height: 22px; stroke-width: 1.75; }
  .tab.active { color: var(--brand); }
  .tab.active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 26px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--brand);
  }
  .tab:active { transform: scale(0.94); }

  .file-head { display: none; }
  .file-row {
    grid-template-columns: 22px 34px minmax(0, 1fr) 34px;
    gap: 9px;
    padding: 11px 13px;
  }
  .file-col.size, .file-col.time { display: none; }
  .file-name small { display: block; }
  .file-name b { font-size: 14.5px; }

  .form-grid { grid-template-columns: 1fr; }
  .svc-edit { grid-template-columns: 30px minmax(0, 1fr) 34px; }
  .svc-edit .e-host, .svc-edit .e-acct, .svc-edit .e-secret { display: none; }
  .uploader { right: 12px; left: 12px; bottom: calc(var(--footer-h) + 10px); width: auto; }
  .selbar { bottom: calc(var(--footer-h) + 12px); padding-left: 14px; }
  .selbar .btn span { display: none; }
  .selbar .btn { padding: 0 10px; }
  .cert-row { grid-template-columns: minmax(0, 1fr) 60px 52px; gap: 8px; }
  .cert-date { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chip { font-size: 11.5px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
