/* ==========================================================================
   晴天云面板 · Design System
   ========================================================================== */

:root {
  --bg: #070b12;
  --bg-2: #0a1019;
  --surface: #0f1725;
  --surface-2: #131d2e;
  --surface-3: #1a2538;
  --line: rgba(148, 163, 184, .12);
  --line-strong: rgba(148, 163, 184, .22);
  --text: #e8eef9;
  --text-soft: #c7d2e3;
  --muted: #93a3b8;
  --muted-2: #64748b;
  --accent: #4f8cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(79, 140, 255, .13);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .14);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .12);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(2, 6, 16, .45);
  --font: "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-2: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f8;
  --line: rgba(15, 23, 42, .08);
  --line-strong: rgba(15, 23, 42, .14);
  --text: #0f172a;
  --text-soft: #243047;
  --muted: #5a6b84;
  --muted-2: #8494ab;
  --accent: #2563eb;
  --accent-2: #0891b2;
  --accent-soft: rgba(37, 99, 235, .09);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, .1);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, .1);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, .09);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, .09);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, .09);
  --shadow: 0 24px 50px rgba(15, 23, 42, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

::selection { background: rgba(79, 140, 255, .35); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .22); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .4); background-clip: content-box; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(79, 140, 255, .12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  z-index: 50;
  transition: transform .25s ease;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; min-width: 0; }
.brand__mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #4f8cff, #22d3ee);
  color: #fff;
  box-shadow: 0 8px 22px rgba(79, 140, 255, .35);
}
.brand__name { font-weight: 700; font-size: 16px; letter-spacing: .01em; white-space: nowrap; }
.brand__sub { font-size: 10px; color: var(--muted-2); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 22px; overflow-y: auto; flex: 1; padding-bottom: 14px; }
.nav__label { padding: 0 10px 8px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.nav__group { display: flex; flex-direction: column; gap: 3px; }
.nav__link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
}
.nav__link svg { flex: 0 0 auto; opacity: .9; }
.nav__link:hover { background: rgba(148, 163, 184, .07); color: var(--text); }
.nav__link.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(79, 140, 255, .22), rgba(79, 140, 255, .06));
  border-color: rgba(79, 140, 255, .28);
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, .06);
}
[data-theme="light"] .nav__link.is-active { color: var(--accent); }
.nav__link .nav__count { margin-left: auto; font-size: 11px; color: var(--muted-2); background: rgba(148,163,184,.1); padding: 1px 7px; border-radius: 20px; }

.sidebar__footer { border-top: 1px solid var(--line); padding-top: 14px; }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.sidebar__user:hover { background: rgba(148, 163, 184, .07); }
.sidebar__user .meta { min-width: 0; }
.sidebar__user .meta b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user .meta span { font-size: 11.5px; color: var(--muted-2); }

.main { flex: 1; margin-left: 250px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.topbar__title .crumb { color: var(--muted-2); font-weight: 400; }
.topbar__spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  min-width: 220px;
}
.search input { border: 0; background: transparent; color: var(--text); outline: none; width: 100%; font-size: 13px; }
.search input::placeholder { color: var(--muted-2); }
.search:focus-within { border-color: rgba(79, 140, 255, .5); box-shadow: 0 0 0 3px rgba(79, 140, 255, .1); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: .16s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }

.content { padding: 26px 28px 70px; width: 100%; max-width: 1480px; }

.mobile-toggle { display: none; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 80%, var(--bg)));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card__head h2, .card__head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card__head .sub { color: var(--muted-2); font-size: 12px; }
.card__head .spacer { flex: 1; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); align-items: start; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.only-light { display: none !important; }
[data-theme="light"] .only-light { display: inline-flex !important; }
[data-theme="light"] .only-dark { display: none !important; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(2, 6, 16, .55); z-index: 45; backdrop-filter: blur(2px); }

/* ---------- Stat cards ---------- */
.stat { position: relative; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: -60% -30% auto auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 65%); pointer-events: none; }
.stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat__icon--green { background: var(--green-soft); color: var(--green); }
.stat__icon--amber { background: var(--amber-soft); color: var(--amber); }
.stat__icon--violet { background: var(--violet-soft); color: var(--violet); }
.stat__value { font-size: 25px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.stat__label { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.stat__meta { margin-top: 12px; font-size: 12px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.stat__meta .up { color: var(--green); }
.stat__meta .down { color: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 37px; padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: .16s;
}
.btn:hover { border-color: rgba(148, 163, 184, .34); color: var(--text); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { flex: 0 0 auto; }
.btn--primary { background: linear-gradient(135deg, #4f8cff, #3b6fe0); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(79, 140, 255, .28); }
.btn--primary:hover { background: linear-gradient(135deg, #6199ff, #4479ea); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: rgba(148, 163, 184, .08); color: var(--text); }
.btn--danger { color: var(--red); border-color: rgba(248, 113, 113, .3); background: var(--red-soft); }
.btn--danger:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 11px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--icon { width: 30px; padding: 0; }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--violet { background: var(--violet-soft); color: var(--violet); }
.badge--gray { background: rgba(148, 163, 184, .1); color: var(--muted); }
.badge--dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 500; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted-2); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: rgba(148, 163, 184, .04); }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions .btn { margin-left: 4px; }
.cell-main { font-weight: 550; color: var(--text); display: flex; align-items: center; gap: 9px; }
.cell-sub { color: var(--muted-2); font-size: 11.5px; margin-top: 1px; }
.cell-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: 0 0 30px; }

/* ---------- Progress ---------- */
.progress { height: 7px; border-radius: 20px; background: rgba(148, 163, 184, .14); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 20px; background: linear-gradient(90deg, #4f8cff, #22d3ee); transition: width .3s; }
.progress__bar--green { background: linear-gradient(90deg, #34d399, #10b981); }
.progress__bar--amber { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress__bar--red { background: linear-gradient(90deg, #f87171, #ef4444); }
.progress-row { display: grid; grid-template-columns: 84px 1fr 74px; align-items: center; gap: 12px; font-size: 12.5px; }
.progress-row + .progress-row { margin-top: 13px; }
.progress-row .label { color: var(--muted); }
.progress-row .value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .field--full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.field > label .req { color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.field .error-text { font-size: 11.5px; color: var(--red); }
.input, .select, .textarea {
  width: 100%;
  min-height: 39px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-size: 13px;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.textarea--code { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(79, 140, 255, .6); box-shadow: 0 0 0 3px rgba(79, 140, 255, .12); }
.input:disabled { opacity: .6; }
.input--has-error { border-color: rgba(248, 113, 113, .6); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-group .btn { flex: 0 0 auto; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 40px; height: 22px; border-radius: 20px; background: rgba(148, 163, 184, .25); position: relative; transition: .2s; flex: 0 0 40px; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.switch input:checked + .switch__track { background: linear-gradient(135deg, #4f8cff, #3b6fe0); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch__label { font-size: 13px; color: var(--text-soft); }

.form-actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; align-items: flex-start; }
.alert svg { flex: 0 0 auto; margin-top: 1px; }
.alert--success { border-color: rgba(52, 211, 153, .25); background: var(--green-soft); color: var(--green); }
.alert--error { border-color: rgba(248, 113, 113, .28); background: var(--red-soft); color: var(--red); }
.alert--warning { border-color: rgba(251, 191, 36, .28); background: var(--amber-soft); color: var(--amber); }
.alert--info { border-color: rgba(96, 165, 250, .25); background: var(--blue-soft); color: var(--blue); }
.alert a { text-decoration: underline; text-underline-offset: 2px; }
.alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-list__item { display: flex; gap: 10px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; align-items: flex-start; }
.alert-list__item svg { flex: 0 0 auto; margin-top: 2px; }
.alert-list__item--warning svg { color: var(--amber); }
.alert-list__item--info svg { color: var(--blue); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 14px; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-color: var(--accent); }

/* ---------- Site header ---------- */
.site-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.site-hero__main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.site-hero__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(79,140,255,.25), rgba(34,211,238,.12)); color: var(--accent); border: 1px solid rgba(79,140,255,.25); flex: 0 0 52px; }
.site-hero h1 { margin: 0 0 5px; font-size: 23px; font-weight: 650; letter-spacing: -.01em; }
.site-hero .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted-2); font-size: 12px; }
.site-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Key-value ---------- */
.kv { display: grid; grid-template-columns: 124px 1fr; gap: 11px 16px; font-size: 13px; }
.kv dt { color: var(--muted-2); }
.kv dd { margin: 0; color: var(--text-soft); word-break: break-word; }
.kv--wide { grid-template-columns: 140px 1fr; }

/* ---------- File manager ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--muted-2); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: rgba(148, 163, 184, .04); }
.file-row__icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 32px; background: rgba(148, 163, 184, .08); color: var(--muted); }
.file-row__icon--dir { background: var(--accent-soft); color: var(--accent); }
.file-row__name { min-width: 0; flex: 1; }
.file-row__name a { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.file-row__name a:hover { color: var(--accent); }
.file-row__meta { color: var(--muted-2); font-size: 11.5px; }
.file-row__actions { display: flex; gap: 4px; opacity: .55; transition: opacity .15s; }
.file-row:hover .file-row__actions { opacity: 1; }

.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: var(--surface-2); transition: .16s; cursor: pointer; }
.dropzone:hover, .dropzone.is-drag { border-color: rgba(79, 140, 255, .6); background: var(--accent-soft); color: var(--text); }
.dropzone input[type=file] { display: none; }

/* ---------- Chart ---------- */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-tooltip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; font-size: 11.5px; color: var(--text); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, -110%); transition: opacity .12s; white-space: nowrap; z-index: 5; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 5px 10px; cursor: pointer; }
.seg button.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Activity ---------- */
.activity { display: flex; flex-direction: column; }
.activity__item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.activity__item:last-child { border-bottom: 0; }
.activity__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: 0 0 8px; box-shadow: 0 0 0 4px var(--accent-soft); }
.activity__body { flex: 1; min-width: 0; font-size: 12.5px; }
.activity__body b { font-weight: 550; }
.activity__time { color: var(--muted-2); font-size: 11.5px; white-space: nowrap; }

/* ---------- Empty ---------- */
.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty__icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted-2); }
.empty h3 { margin: 0 0 5px; font-size: 15px; color: var(--text-soft); }
.empty p { margin: 0 0 16px; font-size: 12.5px; color: var(--muted-2); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 6px; padding: 13px 16px; border-top: 1px solid var(--line); justify-content: space-between; flex-wrap: wrap; }
.pagination__info { color: var(--muted-2); font-size: 12px; }
.pagination__pages { display: flex; gap: 4px; }
.page-link { min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.page-link:hover { color: var(--text); border-color: var(--line-strong); }
.page-link.is-active { background: var(--accent-soft); border-color: rgba(79,140,255,.35); color: var(--accent); }
.page-link.is-disabled { opacity: .4; pointer-events: none; }

/* ---------- Modal ---------- */
dialog.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 40px 100px rgba(0,0,0,.55); }
dialog.modal::backdrop { background: rgba(3, 7, 15, .65); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modalIn .18s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal__head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal__body { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.modal__close { border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; }
.modal__close:hover { background: rgba(148,163,184,.1); color: var(--text); }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow); font-size: 13px; animation: toastIn .22s ease; }
.toast svg { flex: 0 0 auto; margin-top: 1px; }
.toast--success svg { color: var(--green); }
.toast--error svg { color: var(--red); }
.toast--warning svg { color: var(--amber); }
.toast--info svg { color: var(--blue); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; padding: 6px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow); display: none; z-index: 60; }
.dropdown.is-open .dropdown__menu { display: block; animation: modalIn .14s ease; }
.dropdown__item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--text-soft); cursor: pointer; width: 100%; border: 0; background: transparent; text-align: left; }
.dropdown__item:hover { background: rgba(148, 163, 184, .09); color: var(--text); }
.dropdown__item--danger { color: var(--red); }
.dropdown__divider { height: 1px; background: var(--line); margin: 5px 2px; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #4f8cff, #22d3ee); flex: 0 0 32px; }
.avatar--lg { width: 48px; height: 48px; font-size: 18px; flex: 0 0 48px; }
.avatar--sm { width: 26px; height: 26px; font-size: 11px; flex: 0 0 26px; }

/* ---------- Login ---------- */
.auth-body { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.auth-brand { position: relative; overflow: hidden; padding: 54px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(1100px 500px at 10% 0%, rgba(79,140,255,.22), transparent 55%), radial-gradient(800px 600px at 90% 100%, rgba(34,211,238,.12), transparent 55%), #070b12; }
.auth-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(148,163,184,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 40% 40%, #000, transparent 75%); }
.auth-brand__top { position: relative; display: flex; align-items: center; gap: 11px; }
.auth-brand__content { position: relative; max-width: 480px; }
.auth-brand__content h2 { font-size: 38px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 16px; font-weight: 650; }
.auth-brand__content p { color: #9db0c9; font-size: 14.5px; line-height: 1.8; margin: 0 0 30px; }
.auth-features { display: flex; flex-direction: column; gap: 13px; }
.auth-feature { display: flex; gap: 11px; align-items: flex-start; color: #c7d5e8; font-size: 13.5px; }
.auth-feature svg { color: #4f8cff; flex: 0 0 auto; margin-top: 2px; }
.auth-brand__foot { position: relative; color: #5b6b81; font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: linear-gradient(180deg, #0a1019, #070b12); }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-card > p { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.auth-card .form { gap: 16px; }
.auth-hint { margin-top: 22px; padding: 13px 14px; border-radius: 10px; border: 1px dashed var(--line-strong); color: var(--muted-2); font-size: 12px; line-height: 1.7; }
.auth-hint b { color: var(--muted); font-weight: 550; }
.auth-hint code { color: var(--accent); font-family: var(--mono); }
.auth-standalone { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 50% 0%, rgba(79,140,255,.15), transparent 60%), var(--bg); }
.auth-standalone .auth-card { text-align: center; }
.auth-standalone .auth-card h1 { font-size: 40px; margin-bottom: 8px; }

/* ---------- Code / pre ---------- */
.code { font-family: var(--mono); font-size: 12.5px; background: #060a11; border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; line-height: 1.7; color: #c8d6ea; white-space: pre; }
[data-theme="light"] .code { background: #0f172a; color: #dbe6f6; border-color: #1e293b; }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.code-header + .code { border-radius: 0 0 10px 10px; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.meta-list { display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.meta-list__row { display: flex; justify-content: space-between; gap: 14px; }
.meta-list__row span:first-child { color: var(--muted-2); }
.meta-list__row span:last-child { color: var(--text-soft); text-align: right; word-break: break-all; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(148,163,184,.1); color: var(--muted); }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.site-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: border-color .16s, transform .16s; }
.site-card:hover { border-color: rgba(79, 140, 255, .35); transform: translateY(-1px); }

.overview-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.overview-metric { background: var(--surface); padding: 16px 18px; }
.overview-metric .label { color: var(--muted-2); font-size: 11.5px; }
.overview-metric .value { font-size: 17px; font-weight: 600; margin-top: 3px; }

.result-table { max-height: 420px; overflow: auto; }
.result-table table { font-family: var(--mono); font-size: 12px; }
.result-table th { position: sticky; top: 0; z-index: 1; }

.db-tables { display: flex; flex-direction: column; }
.db-table-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.db-table-row:last-child { border-bottom: 0; }
.db-table-row .name { font-family: var(--mono); color: var(--text-soft); }

.q-quote { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; color: var(--muted); font-size: 12.5px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.section-title h2 { margin: 0; font-size: 15px; font-weight: 600; }

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

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: 30px 0 80px rgba(0,0,0,.5); }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .mobile-toggle { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 60px; }
  .search { display: none; }
  .auth-body { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; }
}

@media (max-width: 720px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; }
  .stat__value { font-size: 22px; }
  .site-hero__actions { width: 100%; }
  .site-hero__actions .btn { flex: 1; }
  .kv { grid-template-columns: 92px 1fr; }
  .topbar__title .crumb { display: none; }
  .progress-row { grid-template-columns: 68px 1fr 64px; }
}

/* ==========================================================================
   晴天云定制：下载目录壁纸 + 粉色按钮文字
   ========================================================================== */

:root {
  --pink: #ff8fc4;
  --pink-strong: #ff6fb2;
  --pink-soft: #ffc2de;
}

[data-theme="light"] {
  --pink: #d6336c;
  --pink-strong: #b02a5b;
  --pink-soft: #a61e4d;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(4, 7, 13, .80), rgba(4, 7, 13, .92)),
    url("wallpaper/landscape.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

[data-theme="light"] body {
  background-image:
    linear-gradient(180deg, rgba(244, 247, 252, .88), rgba(244, 247, 252, .95)),
    url("wallpaper/landscape.jpg");
}

.auth-brand {
  background-image:
    linear-gradient(90deg, rgba(4, 8, 15, .94) 0%, rgba(4, 8, 15, .62) 60%, rgba(4, 8, 15, .90) 100%),
    url("wallpaper/landscape.jpg");
  background-size: cover;
  background-position: center;
}

.auth-brand__content h2,
.auth-brand__content p,
.auth-feature {
  text-shadow: 0 2px 18px rgba(0, 0, 0, .65);
}

.auth-brand__content p {
  color: #c9d6e7;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.auth-panel {
  background-image:
    linear-gradient(180deg, rgba(5, 9, 16, .92), rgba(5, 9, 16, .97)),
    url("wallpaper/landscape.jpg");
  background-size: cover;
  background-position: center;
}

.brand__name {
  font-size: 14px;
  letter-spacing: 0;
}

.btn {
  color: var(--pink);
}

.btn:hover {
  color: var(--pink-soft);
}

.btn--primary {
  background: linear-gradient(135deg, #64193d, #3c0f26);
  border-color: rgba(255, 143, 196, .5);
  color: #ff9ecb;
  box-shadow: 0 8px 24px rgba(255, 111, 178, .18);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #7a1f4b, #4a1330);
  color: #ffd6e9;
}

.btn--ghost {
  color: var(--pink);
}

.btn--ghost:hover {
  color: var(--pink-soft);
}

.btn--danger {
  color: var(--pink);
  border-color: rgba(255, 143, 196, .35);
  background: rgba(255, 111, 178, .10);
}

.btn--danger:hover {
  background: #9d174d;
  border-color: #be185d;
  color: #ffe0ee;
}

.page-link {
  color: var(--pink);
}

.page-link:hover {
  color: var(--pink-soft);
}

.page-link.is-active {
  color: var(--pink-strong);
  border-color: rgba(255, 111, 178, .4);
  background: rgba(255, 111, 178, .12);
}

.seg button {
  color: var(--pink);
}

.seg button.is-active {
  color: var(--pink-strong);
  background: rgba(255, 111, 178, .12);
}

@media (max-width: 960px) {
  body {
    background-image:
      linear-gradient(180deg, rgba(4, 7, 13, .74), rgba(4, 7, 13, .92)),
      url("wallpaper/portrait.jpg");
  }

  [data-theme="light"] body {
    background-image:
      linear-gradient(180deg, rgba(244, 247, 252, .86), rgba(244, 247, 252, .94)),
      url("wallpaper/portrait.jpg");
  }

  .auth-panel {
    background-image:
      linear-gradient(180deg, rgba(5, 9, 16, .82), rgba(5, 9, 16, .94)),
      url("wallpaper/portrait.jpg");
  }

  .auth-mobile-brand {
    display: flex;
  }
}

button.dropdown__item {
  color: var(--pink);
}

button.dropdown__item:hover {
  color: var(--pink-soft);
}
