/* ==========================================================================
   云枢 DNS · 控制台设计系统 (app.css) — Lead 维护，页面复用，勿改本文件
   深色科技风：深海蓝 + 青色高光。零外链、零构建。
   ========================================================================== */

:root {
  --bg: #060a14;
  --bg-soft: #0a1120;
  --bg-grid: rgba(56, 189, 248, 0.05);
  --panel: rgba(15, 24, 41, 0.86);
  --panel-solid: #0f1829;
  --panel-2: #131f35;
  --panel-hover: #17253e;
  --border: rgba(120, 160, 210, 0.16);
  --border-strong: rgba(120, 190, 235, 0.3);
  --text: #e8f0fb;
  --text-2: #c3d2e6;
  --muted: #8ba0be;
  --muted-2: #617792;
  --primary: #22d3ee;
  --primary-2: #3b82f6;
  --primary-soft: rgba(34, 211, 238, 0.12);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 238px;
  --topbar-h: 64px;
  --focus: 0 0 0 3px rgba(34, 211, 238, 0.22);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(34, 211, 238, 0.1), transparent 60%),
    radial-gradient(1000px 600px at 92% 0%, rgba(59, 130, 246, 0.1), transparent 62%),
    radial-gradient(800px 500px at 50% 110%, rgba(14, 116, 144, 0.1), transparent 60%),
    var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: 0.2px; }
p { margin: 0; }
img, svg { vertical-align: middle; }
button { font-family: inherit; }
::selection { background: rgba(34, 211, 238, 0.3); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 160, 210, 0.22);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 160, 210, 0.4); background-clip: padding-box; }

:focus-visible { outline: none; box-shadow: var(--focus); }

.hide { display: none !important; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.text-sm { font-size: 12.5px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.fw-600 { font-weight: 600; }
.success-text { color: var(--success); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.primary-text { color: var(--primary); }

/* ---------- 通用 Logo ---------- */
.logo-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.92), rgba(59, 130, 246, 0.92));
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.28), inset 0 1px 0 rgba(255,255,255,0.35);
  color: #04121f; font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: 0.4px; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }

/* ==========================================================================
   控制台布局
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px 16px;
  background: linear-gradient(180deg, rgba(10, 17, 32, 0.98), rgba(8, 13, 25, 0.98));
  border-right: 1px solid var(--border);
  z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sidebar-brand .brand-name { font-size: 15px; }
.sidebar-brand .brand-sub { font-size: 9.5px; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-group-title {
  font-size: 10.5px; letter-spacing: 1.4px; color: var(--muted-2);
  text-transform: uppercase; padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 13.5px; cursor: pointer;
  border: 1px solid transparent; background: transparent; text-align: left;
  width: 100%; transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.nav-item svg { width: 17px; height: 17px; opacity: 0.8; flex: 0 0 17px; }
.nav-item:hover { background: rgba(120, 160, 210, 0.08); color: var(--text); }
.nav-item.active {
  color: #dffaff;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.08));
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow: inset 2px 0 0 var(--primary);
}
.nav-item.active svg { opacity: 1; color: var(--primary); }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 99px;
  background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(34,211,238,.25);
}
.sidebar-foot { padding: 14px 10px 4px; border-top: 1px solid var(--border); margin-top: 12px; }
.sidebar-foot .ver { font-size: 11px; color: var(--muted-2); }

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

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 14, 26, 0.72);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 16px; font-weight: 650; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--border); border-radius: 99px; background: rgba(120,160,210,.05);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, rgba(34,211,238,.85), rgba(59,130,246,.9));
  color: #04121f; font-weight: 700; font-size: 12.5px;
}
.user-chip .u-name { font-size: 13px; font-weight: 600; }
.user-chip .u-role { font-size: 10.5px; color: var(--muted); }

.content { padding: 26px; max-width: 1520px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: 0.3px; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 5px; }

.menu-toggle { display: none; }

/* ==========================================================================
   卡片 / 统计
   ========================================================================== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 16px; height: 16px; color: var(--primary); }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; 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-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat-card {
  position: relative; padding: 17px 18px; border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(19, 31, 53, 0.92), rgba(12, 20, 36, 0.92));
  border: 1px solid var(--border); overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -40px; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12), transparent 68%);
  pointer-events: none;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.stat-ico {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--primary);
  background: var(--primary-soft); border: 1px solid rgba(34, 211, 238, 0.2);
}
.stat-ico svg { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: 0.5px; margin-top: 9px; line-height: 1.15; font-family: var(--mono); }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; font-family: var(--font); }
.stat-foot { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--muted-2); flex: 0 0 7px; }
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.live { background: var(--success); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.5);} 50% { box-shadow: 0 0 0 5px rgba(52,211,153,0);} }

.kpi { display: flex; align-items: baseline; gap: 8px; }
.kpi b { font-family: var(--mono); font-size: 20px; }
.kpi span { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(120, 160, 210, 0.06);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s;
  white-space: nowrap; line-height: 1.3; user-select: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: rgba(120, 160, 210, 0.13); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #3b82f6);
  border-color: transparent; color: #04121f; font-weight: 700;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.22);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.btn-danger { color: #ffe4e4; background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.35); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 12px; }
.btn.loading { pointer-events: none; opacity: 0.75; }
.btn.loading::after {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-icon { padding: 7px; border-radius: 8px; }
.btn-icon svg { width: 15px; height: 15px; }
.link-btn {
  background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12.5px;
  padding: 2px 4px; border-radius: 6px;
}
.link-btn:hover { background: var(--primary-soft); }
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { background: var(--danger-soft); }

/* ==========================================================================
   表单
   ========================================================================== */
.field { margin-bottom: 14px; }
.field label, .field-label {
  display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 550;
}
.field label .req { color: var(--danger); margin-left: 3px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(6, 12, 23, 0.72);
  color: var(--text); font-size: 13px; font-family: var(--font);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgba(34, 211, 238, 0.55); box-shadow: var(--focus);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238ba0be' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select option { background: #0d1728; color: var(--text); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.input.sm, .select.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.field-hint { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-error {
  color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(248,113,113,.28);
  padding: 8px 12px; border-radius: 9px; font-size: 12.5px; margin-bottom: 12px;
}
.form-ok {
  color: var(--success); background: var(--success-soft); border: 1px solid rgba(52,211,153,.28);
  padding: 8px 12px; border-radius: 9px; font-size: 12.5px;
}
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 99px; cursor: pointer;
  background: rgba(120, 160, 210, 0.22); transition: background 0.18s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  left: 3px; top: 3px; background: #dce8f7; transition: transform 0.18s;
}
.switch input:checked + .slider { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.switch input:checked + .slider::before { transform: translateX(17px); background: #04121f; }

/* ==========================================================================
   表格
   ========================================================================== */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: 0.5px;
  color: var(--muted); text-transform: uppercase; padding: 11px 14px;
  border-bottom: 1px solid var(--border); background: rgba(10, 17, 31, 0.5);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid rgba(120, 160, 210, 0.08); vertical-align: middle; }
.table tbody tr { transition: background 0.14s ease; }
.table tbody tr:hover { background: rgba(120, 160, 210, 0.055); }
.table tbody tr:last-child td { border-bottom: none; }
.table .tbl-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.table .row-main { font-weight: 600; color: var(--text); }
.table .row-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }
.table .num { font-family: var(--mono); }
.table.compact td { padding: 8px 12px; }
.table.compact th { padding: 8px 12px; }

/* ==========================================================================
   徽章 / 标签 / 提示
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.7;
}
.badge .dot { width: 6px; height: 6px; flex: 0 0 6px; box-shadow: none; }
.badge-success { color: #7ff0c6; background: var(--success-soft); border-color: rgba(52, 211, 153, 0.28); }
.badge-warn { color: #ffd77a; background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.28); }
.badge-danger { color: #ffb1b1; background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.28); }
.badge-info { color: #a9cdff; background: var(--info-soft); border-color: rgba(96, 165, 250, 0.28); }
.badge-muted { color: var(--muted); background: rgba(120, 160, 210, 0.09); border-color: var(--border); }
.tag {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px;
  font-size: 11px; color: var(--muted); background: rgba(120, 160, 210, 0.08);
  border: 1px solid var(--border); font-family: var(--mono);
}
.tag.primary { color: var(--primary); border-color: rgba(34, 211, 238, .3); background: var(--primary-soft); }

.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.6; border: 1px solid; }
.alert svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.alert-info { color: #b6d4ff; background: var(--info-soft); border-color: rgba(96,165,250,.25); }
.alert-warn { color: #ffe0a1; background: var(--warn-soft); border-color: rgba(251,191,36,.25); }
.alert-danger { color: #ffc0c0; background: var(--danger-soft); border-color: rgba(248,113,113,.25); }
.alert-success { color: #a8f5d4; background: var(--success-soft); border-color: rgba(52,211,153,.25); }

/* ==========================================================================
   工具栏 / 分页 / 空态
   ========================================================================== */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.toolbar-spacer { flex: 1; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.search .input { padding-left: 34px; min-width: 220px; }
.toolbar .select { width: auto; min-width: 120px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.pagination .btn { padding: 5px 10px; font-size: 12px; }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .empty-ico {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34, 211, 238, 0.07); border: 1px dashed rgba(34, 211, 238, 0.28); color: var(--primary);
}
.empty .empty-ico svg { width: 24px; height: 24px; }
.empty-title { font-size: 14px; color: var(--text-2); font-weight: 600; margin-bottom: 5px; }
.empty-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }

.loading-block { padding: 42px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(120,160,210,.2); border-top-color: var(--primary);
  animation: spin 0.75s linear infinite; vertical-align: -4px; margin-right: 8px;
}
.skeleton {
  background: linear-gradient(90deg, rgba(120,160,210,.06), rgba(120,160,210,.14), rgba(120,160,210,.06));
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; min-height: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==========================================================================
   Tabs / Stepper / Progress
   ========================================================================== */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 6px; overflow-x: auto; }
.tab {
  padding: 12px 16px; font-size: 13.5px; color: var(--muted); cursor: pointer; border: none;
  background: transparent; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }

.stepper { display: flex; align-items: flex-start; gap: 0; padding: 6px 0 2px; overflow-x: auto; }
.step { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 150px; position: relative; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 15px; left: calc(50% + 24px); right: -18px;
  height: 2px; background: var(--border); border-radius: 2px;
}
.step:not(:last-child).done::after { background: linear-gradient(90deg, var(--success), rgba(52,211,153,.25)); }
.step .step-dot {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; font-family: var(--mono);
  background: rgba(120,160,210,.1); border: 1px solid var(--border); color: var(--muted);
}
.step .step-body { padding-top: 2px; }
.step .step-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.step .step-desc { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.step.active .step-dot { background: var(--primary-soft); border-color: rgba(34,211,238,.5); color: var(--primary); box-shadow: 0 0 0 4px rgba(34,211,238,.08); }
.step.active .step-title { color: var(--primary); }
.step.done .step-dot { background: var(--success-soft); border-color: rgba(52,211,153,.45); color: var(--success); }
.step.done .step-title { color: var(--success); }
.step.failed .step-dot { background: var(--danger-soft); border-color: rgba(248,113,113,.45); color: var(--danger); }
.step.failed .step-title { color: var(--danger); }
.step-body { flex: 1; min-width: 0; }

.progress { height: 7px; border-radius: 99px; background: rgba(120,160,210,.13); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22d3ee, #3b82f6); transition: width .35s ease; }
.progress-bar.warn { background: linear-gradient(90deg, #fbbf24, #fb923c); }
.progress-bar.danger { background: linear-gradient(90deg, #f87171, #ef4444); }
.progress-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }

/* ==========================================================================
   代码块 / 复制行
   ========================================================================== */
.code-block {
  position: relative; background: rgba(4, 9, 18, 0.92); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 46px 13px 14px; font-family: var(--mono);
  font-size: 12.5px; color: #c9e3ff; overflow-x: auto; line-height: 1.65;
  white-space: pre-wrap; word-break: break-all;
}
.code-block.one-line { white-space: pre; word-break: normal; padding-right: 46px; }
.copy-btn {
  position: absolute; top: 7px; right: 7px; padding: 5px; border-radius: 7px; cursor: pointer;
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.22); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.copy-btn:hover { background: rgba(34,211,238,.2); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-line { display: flex; align-items: center; gap: 8px; }
.copy-line .code-block { flex: 1; }
.install-cmd { font-size: 12px; }

/* ==========================================================================
   模态框 / Toast / 抽屉
   ========================================================================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000; background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.16s ease;
}
.modal {
  width: 560px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column;
  background: linear-gradient(160deg, #111c30, #0b1424);
  border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 17px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.modal-title svg { width: 18px; height: 18px; color: var(--primary); }
.modal-close {
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px;
  border-radius: 7px; display: inline-flex;
}
.modal-close:hover { background: rgba(120,160,210,.1); color: var(--text); }
.modal-close svg { width: 17px; height: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.modal-foot .left { margin-right: auto; }
.modal.wide { width: 760px; }
.modal.narrow { width: 440px; }

.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; min-width: 220px; max-width: 380px;
  padding: 11px 14px; border-radius: 11px; font-size: 13px; line-height: 1.55;
  background: rgba(16, 26, 44, 0.97); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); color: var(--text); pointer-events: auto;
  animation: toastIn 0.2s ease;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.toast.success { border-color: rgba(52,211,153,.4); }
.toast.success svg { color: var(--success); }
.toast.error { border-color: rgba(248,113,113,.45); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--info); }
.toast.warn { border-color: rgba(251,191,36,.4); }
.toast.warn svg { color: var(--warn); }
.toast.leaving { opacity: 0; transform: translateX(12px); transition: all .22s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.drawer-mask {
  position: fixed; inset: 0; z-index: 1000; background: rgba(2, 6, 14, 0.6);
  display: flex; justify-content: flex-end; animation: fadeIn .16s ease;
}
.drawer {
  width: min(640px, 100%); height: 100%; background: #0c1526;
  border-left: 1px solid var(--border-strong); display: flex; flex-direction: column;
  animation: drawerIn .2s ease; box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px; z-index: 100;
  background: #101b2e; border: 1px solid var(--border-strong); border-radius: 11px;
  box-shadow: var(--shadow); padding: 5px; animation: fadeIn .13s ease;
}
.dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 11px;
  background: none; border: none; color: var(--text-2); font-size: 12.5px; border-radius: 7px; cursor: pointer; text-align: left;
}
.dropdown-menu button:hover { background: rgba(120,160,210,.1); color: var(--text); }
.dropdown-menu button.danger { color: var(--danger); }
.dropdown-menu svg { width: 14px; height: 14px; }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ==========================================================================
   登录页
   ========================================================================== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 30px 18px; position: relative; overflow: hidden;
}
.auth-page::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}
.auth-glow {
  position: absolute; width: 560px; height: 560px; border-radius: 50%; filter: blur(90px);
  background: radial-gradient(circle, rgba(34,211,238,.16), transparent 66%);
  top: -160px; left: 50%; transform: translateX(-50%); pointer-events: none;
}
.auth-main { width: 100%; max-width: 430px; }
.auth-card {
  background: linear-gradient(165deg, rgba(19, 31, 53, 0.94), rgba(10, 17, 31, 0.96));
  border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 34px 32px 26px; box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.auth-brand .logo-mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; font-size: 17px; }
.auth-title { font-size: 21px; font-weight: 750; letter-spacing: 0.5px; }
.auth-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.auth-form .field label { font-size: 12.5px; }
.auth-form .input { padding: 11px 13px; font-size: 13.5px; }
.auth-submit { margin-top: 20px; padding: 12px; font-size: 14.5px; letter-spacing: 4px; }
.auth-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; font-size: 11.5px; color: var(--muted-2); }
.auth-note { margin-top: 18px; font-size: 11.5px; color: var(--muted-2); line-height: 1.7; text-align: center; }
.auth-page .auth-error { margin-top: 14px; }

/* ==========================================================================
   落地页
   ========================================================================== */
.landing { overflow-x: hidden; }
.landing-nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 22px;
  padding: 15px clamp(18px, 5vw, 64px);
  background: rgba(6, 10, 20, 0.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(120,160,210,.1);
}
.landing-nav .nav-links { display: flex; gap: 20px; margin-left: 18px; font-size: 13px; color: var(--text-2); }
.landing-nav .nav-links a { color: inherit; }
.landing-nav .nav-links a:hover { color: var(--primary); text-decoration: none; }
.landing-nav .spacer { flex: 1; }
.landing-section { padding: clamp(46px, 7vw, 86px) clamp(18px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }
.hero { position: relative; padding-top: clamp(52px, 8vw, 96px); text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 52px 52px; mask-image: radial-gradient(circle at 50% 38%, #000 0%, transparent 74%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 99px;
  font-size: 12px; color: var(--primary); background: var(--primary-soft);
  border: 1px solid rgba(34,211,238,.25); margin-bottom: 22px; letter-spacing: 0.4px;
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.18; font-weight: 780; letter-spacing: -0.5px; }
.hero h1 .grad {
  background: linear-gradient(100deg, #67e8f9 10%, #60a5fa 52%, #a78bfa 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 720px; margin: 20px auto 0; color: var(--muted); font-size: clamp(13.5px, 1.6vw, 16px); line-height: 1.85; }
.hero-cta { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  max-width: 860px; margin: 44px auto 0; padding: 18px 22px;
  background: rgba(15, 24, 41, 0.62); border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: blur(10px);
}
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-family: var(--mono); font-size: clamp(19px, 2.6vw, 26px); color: #d9f6ff; }
.hero-stat span { font-size: 11.5px; color: var(--muted); }
.landing h2 { font-size: clamp(23px, 3vw, 31px); text-align: center; font-weight: 730; letter-spacing: 0.2px; }
.landing .sec-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 10px auto 0; max-width: 640px; line-height: 1.8; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 36px; }
.feature-card {
  position: relative; padding: 24px 22px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, rgba(19,31,53,.8), rgba(11,18,32,.8));
  border: 1px solid var(--border); transition: transform .18s ease, border-color .18s ease;
}
.feature-card:hover { transform: translateY(-3px); border-color: rgba(34,211,238,.3); }
.feature-ico {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; color: var(--primary);
  background: linear-gradient(140deg, rgba(34,211,238,.14), rgba(59,130,246,.1));
  border: 1px solid rgba(34,211,238,.2);
}
.feature-ico svg { width: 21px; height: 21px; }
.feature-card h3 { font-size: 15.5px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 12.8px; line-height: 1.78; }
.flow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 36px; counter-reset: flow; }
.flow-item {
  position: relative; padding: 22px; border-radius: 14px; border: 1px solid var(--border);
  background: rgba(15, 24, 41, 0.55);
}
.flow-item::before {
  counter-increment: flow; content: "0" counter(flow);
  font-family: var(--mono); font-size: 13px; color: var(--primary); font-weight: 700;
  display: inline-block; margin-bottom: 12px; padding: 2px 9px; border-radius: 7px;
  background: var(--primary-soft); border: 1px solid rgba(34,211,238,.22);
}
.flow-item h3 { font-size: 14.5px; margin-bottom: 7px; }
.flow-item p { color: var(--muted); font-size: 12.6px; line-height: 1.75; }
.landing-cta {
  margin: 20px auto 70px; max-width: 1000px; text-align: center; padding: 40px 26px;
  border-radius: 20px; border: 1px solid rgba(34,211,238,.22);
  background: radial-gradient(700px 240px at 50% 0%, rgba(34,211,238,.12), transparent 70%),
    linear-gradient(160deg, rgba(19,31,53,.86), rgba(10,17,31,.9));
}
.landing-cta h2 { margin-bottom: 10px; }
.landing-cta p { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.landing-footer {
  border-top: 1px solid var(--border); padding: 26px clamp(18px, 5vw, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  color: var(--muted-2); font-size: 12px; flex-wrap: wrap;
}
.landing-footer .links { display: flex; gap: 18px; }
.landing-footer a { color: var(--muted); }
.os-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 28px; background: rgba(15,24,41,.5); border-radius: 12px; overflow: hidden; }
.os-table th, .os-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid rgba(120,160,210,.1); }
.os-table th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; background: rgba(10,17,31,.6); }
.os-table tr:last-child td { border-bottom: none; }
.recommend-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.recommend-pill { padding: 6px 14px; border-radius: 99px; font-size: 12px; border: 1px solid var(--border); color: var(--text-2); background: rgba(15,24,41,.6); }
.recommend-pill.primary { color: var(--success); border-color: rgba(52,211,153,.35); background: var(--success-soft); }

/* ==========================================================================
   解析记录共享组件（records.js）
   ========================================================================== */
.records-table td { vertical-align: top; }
.line-values { display: flex; flex-direction: column; gap: 4px; }
.line-row { display: flex; gap: 8px; align-items: flex-start; }
.line-name {
  flex: 0 0 auto; font-size: 11px; padding: 1px 7px; border-radius: 6px;
  background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--primary); white-space: nowrap;
}
.line-name.is-default {
  background: rgba(120, 160, 210, 0.1); border-color: var(--border); color: var(--muted);
}
.line-vals { font-size: 12.5px; line-height: 1.55; word-break: break-all; }
.val-disabled { color: var(--muted-2); font-size: 11px; margin-left: 4px; }
.rec-values-box { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.rec-line-row {
  display: grid; grid-template-columns: 126px minmax(0, 1fr) 80px 80px 90px 34px;
  gap: 8px; align-items: center;
}
.rec-line-row .select, .rec-line-row .input { width: 100%; }
.rec-line-remove { justify-self: end; }
@media (max-width: 900px) {
  .rec-line-row { grid-template-columns: 1fr 1fr; }
  .rec-line-remove { justify-self: start; }
}

/* ---------- 批量导入解析记录（records.js） ---------- */
.bulk-format {
  max-height: 260px; overflow: auto; font-size: 12px; line-height: 1.7;
  white-space: pre; word-break: normal; color: #b9dcff;
}
.bulk-errors { margin-top: 14px; }
.bulk-error-list {
  display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto;
  background: rgba(6, 12, 23, 0.6); border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 10px; padding: 10px 12px;
}
.bulk-error-row { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.bulk-error-line { flex: 0 0 auto; color: var(--danger); font-weight: 600; }
.bulk-error-msg { flex: 1; color: #ffc9c9; line-height: 1.55; }
.bulk-error-raw { flex: 0 1 42%; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: var(--shadow); background: #0a1220;
  }
  .sidebar.open { transform: none; }
  .sidebar-mask {
    position: fixed; inset: 0; z-index: 39; background: rgba(2,6,14,.6);
    animation: fadeIn .16s ease;
  }
  .landing-nav .nav-links { display: none; }
}
@media (max-width: 760px) {
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row, .form-row-3 { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 0 14px; }
  .topbar-sub { display: none; }
  .user-chip .u-name, .user-chip .u-role { display: none; }
  .user-chip { padding: 3px; }
  .table { min-width: 560px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .auth-card { padding: 26px 20px 22px; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .modal-body { padding: 16px; }
}
