/* ═══════════ Aurora Glass 设计系统 ═══════════ */
:root {
  --bg: #0a0e1a;
  --panel: rgba(22, 28, 48, 0.62);
  --panel-solid: #151b30;
  --border: rgba(148, 163, 184, 0.14);
  --border-hi: rgba(148, 163, 184, 0.3);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --dim: #64748b;
  --brand: #6366f1;
  --brand2: #22d3ee;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --grad: linear-gradient(135deg, #6366f1, #22d3ee);
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; overflow-x: hidden; }
a { color: var(--brand2); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 4px; }

/* ── 极光流动背景 ── */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(ellipse at bottom, #0d1226 0%, #0a0e1a 60%); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.aurora i:nth-child(1) { width: 46vw; height: 46vw; background: #4338ca; top: -12%; left: -8%; animation: drift1 26s ease-in-out infinite; }
.aurora i:nth-child(2) { width: 38vw; height: 38vw; background: #0e7490; bottom: -14%; right: -6%; animation: drift2 32s ease-in-out infinite; }
.aurora i:nth-child(3) { width: 30vw; height: 30vw; background: #7c3aed; top: 34%; left: 44%; opacity: .32; animation: drift3 40s ease-in-out infinite; }
@keyframes drift1 { 50% { transform: translate(9vw, 7vh) scale(1.15); } }
@keyframes drift2 { 50% { transform: translate(-8vw, -9vh) scale(1.1); } }
@keyframes drift3 { 33% { transform: translate(-10vw, 6vh); } 66% { transform: translate(6vw, -8vh) scale(1.2); } }

/* ── 玻璃卡片 ── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s, border-color .25s; position: relative; }
.card.hoverable:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: 0 14px 44px rgba(0,0,0,.5), 0 0 24px rgba(99,102,241,.12); }
.card-pad { padding: 18px 20px; }

/* ── 布局 ── */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex-shrink: 0; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; background: rgba(13,17,32,.72); border-right: 1px solid var(--border); backdrop-filter: blur(20px); position: sticky; top: 0; height: 100vh; z-index: 30; transition: margin-left .3s; }
.logo { display: flex; align-items: center; gap: 10px; padding: 8px 12px 20px; font-weight: 700; font-size: 16px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; font-size: 17px; box-shadow: 0 4px 14px rgba(99,102,241,.45); }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; color: var(--muted); cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; transition: color .2s, background .2s; overflow: hidden; }
.nav-item:hover { color: var(--text); background: rgba(99,102,241,.1); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(99,102,241,.22), rgba(34,211,238,.1)); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--brand2); animation: glowPulse 2.4s ease-in-out infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 4px var(--brand2); } }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 26px; border-bottom: 1px solid var(--border); background: rgba(13,17,32,.5); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.topbar-title { font-size: 17px; font-weight: 600; flex: 1; }
.content { padding: 24px 26px 60px; animation: pageIn .35s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
.hamburger { display: none; }

/* ── 按钮（涟漪） ── */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--border-hi); background: rgba(148,163,184,.08); color: var(--text); cursor: pointer; font-weight: 500; transition: background .2s, transform .1s, box-shadow .2s; white-space: nowrap; }
.btn:hover { background: rgba(148,163,184,.16); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.btn-primary:hover { box-shadow: 0 6px 22px rgba(99,102,241,.55); background: var(--grad); filter: brightness(1.1); }
.btn-danger { background: rgba(244,63,94,.15); border-color: rgba(244,63,94,.4); color: #fda4af; }
.btn-danger:hover { background: rgba(244,63,94,.28); }
.btn-ok { background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.4); color: #6ee7b7; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: ripple .55s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* ── 表单 ── */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input { width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border-hi); background: rgba(10,14,26,.55); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.input.err { border-color: var(--danger); }
.field .hint { font-size: 12px; color: var(--dim); margin-top: 4px; }
.field .hint.error { color: #fda4af; }
select.input option { background: var(--panel-solid); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 11px 14px; color: var(--dim); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid rgba(148,163,184,.07); white-space: nowrap; }
tbody tr { animation: rowIn .4s ease both; transition: background .15s; }
tbody tr:hover { background: rgba(99,102,241,.06); }
tbody tr:nth-child(1) { animation-delay: .02s; } tbody tr:nth-child(2) { animation-delay: .05s; } tbody tr:nth-child(3) { animation-delay: .08s; } tbody tr:nth-child(4) { animation-delay: .11s; } tbody tr:nth-child(5) { animation-delay: .13s; } tbody tr:nth-child(6) { animation-delay: .15s; } tbody tr:nth-child(7) { animation-delay: .17s; } tbody tr:nth-child(8) { animation-delay: .19s; } tbody tr:nth-child(9) { animation-delay: .21s; } tbody tr:nth-child(10) { animation-delay: .23s; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } }
.empty { text-align: center; padding: 46px 0; color: var(--dim); }
.empty .empty-icon { font-size: 34px; margin-bottom: 10px; opacity: .5; }

/* ── 徽章 ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge-ok { background: rgba(16,185,129,.14); color: #6ee7b7; } .badge-ok .dot { background: var(--ok); }
.badge-warn { background: rgba(245,158,11,.14); color: #fcd34d; } .badge-warn .dot { background: var(--warn); animation: breathe 1.6s ease-in-out infinite; }
.badge-danger { background: rgba(244,63,94,.14); color: #fda4af; } .badge-danger .dot { background: var(--danger); }
.badge-dim { background: rgba(100,116,139,.16); color: var(--muted); } .badge-dim .dot { background: var(--dim); }
.badge-info { background: rgba(34,211,238,.12); color: #67e8f9; } .badge-info .dot { background: var(--brand2); }
@keyframes breathe { 50% { opacity: .35; transform: scale(.8); } }

/* ── 统计卡 ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 16px 18px; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-value.plain { background: none; -webkit-text-fill-color: currentColor; }
.stat-sub { font-size: 12px; color: var(--dim); margin-top: 4px; }

/* ── 图表 ── */
.chart-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-bottom: 20px; }
.chart-box canvas { width: 100%; height: 240px; display: block; }
.chart-title { font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 14px 18px 0; }

/* ── 弹窗 / 抽屉 ── */
.overlay { position: fixed; inset: 0; background: rgba(5,8,18,.6); backdrop-filter: blur(4px); z-index: 90; display: flex; align-items: center; justify-content: center; animation: fadeIn .22s ease; padding: 20px; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; padding: 24px; animation: popIn .3s cubic-bezier(.34,1.4,.64,1) both; }
.modal.wide { max-width: 680px; }
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(14px); } }
.modal-title { font-size: 16px; font-weight: 650; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: none; border: none; color: var(--dim); font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: rgba(148,163,184,.12); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(5,8,18,.55); backdrop-filter: blur(3px); z-index: 90; animation: fadeIn .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 94vw); background: rgba(16,21,40,.97); border-left: 1px solid var(--border-hi); z-index: 95; overflow-y: auto; padding: 24px; animation: slideIn .32s cubic-bezier(.3,1,.4,1) both; backdrop-filter: blur(24px); }
@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } }

/* ── Toast ── */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 12px; background: rgba(20,26,46,.95); border: 1px solid var(--border-hi); box-shadow: var(--shadow); backdrop-filter: blur(16px); animation: toastIn .35s cubic-bezier(.3,1.2,.5,1) both; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(70px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(70px); } }
.toast-ok { border-left: 3px solid var(--ok); } .toast-err { border-left: 3px solid var(--danger); } .toast-info { border-left: 3px solid var(--brand2); }

/* ── 骨架屏 ── */
.skeleton { border-radius: 10px; background: linear-gradient(100deg, rgba(148,163,184,.08) 40%, rgba(148,163,184,.2) 50%, rgba(148,163,184,.08) 60%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-row { height: 42px; margin-bottom: 8px; }

/* ── 分页 ── */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 4px 2px; color: var(--muted); font-size: 13px; }

/* ── 登录页 ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; perspective: 1100px; padding: 20px; }
.login-card { width: 100%; max-width: 400px; padding: 38px 34px; transform-style: preserve-3d; transition: transform .18s ease-out; will-change: transform; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-logo .logo-mark { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; animation: floatY 4s ease-in-out infinite; }
@keyframes floatY { 50% { transform: translateY(-7px); } }
.login-title { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--dim); font-size: 12.5px; }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-img { width: 132px; border-radius: 10px; border: 1px solid var(--border-hi); cursor: pointer; display: grid; place-items: center; overflow: hidden; background: #0b1020; transition: border-color .2s; }
.captcha-img:hover { border-color: var(--brand); }
.captcha-img svg { display: block; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 10px 18px; background: none; border: none; color: var(--muted); cursor: pointer; font-weight: 500; position: relative; }
.tab.active { color: #fff; }
.tab.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 10px rgba(99,102,241,.6); }

/* ── 工具条 / 杂项 ── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 150px; }
.spacer { flex: 1; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .ok-text { color: #6ee7b7; } .danger-text { color: #fda4af; } .warn-text { color: #fcd34d; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--dim); } .kv dd { word-break: break-all; }
.section-title { font-size: 13px; font-weight: 650; color: var(--muted); margin: 20px 0 10px; letter-spacing: .4px; }
.copy-chip { cursor: pointer; border: 1px dashed var(--border-hi); padding: 2px 8px; border-radius: 7px; transition: border-color .2s, color .2s; }
.copy-chip:hover { border-color: var(--brand2); color: var(--brand2); }
.log-item { padding: 9px 12px; border-left: 2px solid var(--border-hi); margin-bottom: 8px; background: rgba(10,14,26,.4); border-radius: 0 9px 9px 0; font-size: 12.5px; }
.log-item.lv-error { border-left-color: var(--danger); } .log-item.lv-warn { border-left-color: var(--warn); } .log-item.lv-info { border-left-color: var(--brand2); } .log-item.lv-security { border-left-color: #c084fc; }
.log-time { color: var(--dim); font-size: 11.5px; margin-right: 8px; }
pre.code { background: rgba(6,9,18,.7); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow-y: auto; }
details.fold { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
details.fold summary { padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 550; background: rgba(148,163,184,.05); list-style: none; }
details.fold summary:hover { color: var(--text); }
details.fold[open] summary { border-bottom: 1px solid var(--border); }
details.fold .fold-body { padding: 12px 14px; }
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border-hi); background: rgba(148,163,184,.06); cursor: pointer; transition: all .18s; }
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 3px 12px rgba(99,102,241,.4); }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; background: rgba(22,28,48,.98); border: 1px solid var(--border-hi); border-radius: 12px; box-shadow: var(--shadow); z-index: 50; overflow: hidden; animation: popIn .18s ease both; backdrop-filter: blur(20px); }
.dropdown-menu button { display: block; width: 100%; padding: 9px 16px; text-align: left; background: none; border: none; color: var(--text); cursor: pointer; font-size: 13px; }
.dropdown-menu button:hover { background: rgba(99,102,241,.14); }
.dropdown-menu button.danger { color: #fda4af; }
.hidden { display: none !important; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--warn); }

@media (max-width: 860px) {
  .sidebar { position: fixed; margin-left: -230px; }
  .sidebar.open { margin-left: 0; box-shadow: 0 0 60px rgba(0,0,0,.6); }
  .hamburger { display: inline-flex; }
  .chart-grid { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 50px; }
}
