/* ==========================================================================
   portal-hub · 现代企业统一门户导航系统 设计规范与样式
   ========================================================================== */

:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-elevated: #ffffff;
  --panel-rgb: 255, 255, 255;
  --text: #0f172a;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --line-hover: #cbd5e1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-soft-hover: #e0e7ff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-line: #a7f3d0;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -2px rgb(15 23 42 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(15 23 42 / 0.1), 0 8px 10px -6px rgb(15 23 42 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f19;
    --panel: #111827;
    --panel-elevated: #1a2234;
    --panel-rgb: 17, 24, 39;
    --text: #f8fafc;
    --muted: #94a3b8;
    --subtle: #64748b;
    --line: #1f293d;
    --line-hover: #334155;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: #1e1b4b;
    --accent-soft-hover: #312e81;
    --success: #34d399;
    --success-bg: #064e3b;
    --success-line: #065f46;
    --warn: #fbbf24;
    --warn-bg: #451a03;
    --warn-line: #78350f;
    --danger: #f87171;
    --danger-bg: #450a0a;
    --danger-line: #7f1d1d;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f19;
  --panel: #111827;
  --panel-elevated: #1a2234;
  --panel-rgb: 17, 24, 39;
  --text: #f8fafc;
  --muted: #94a3b8;
  --subtle: #64748b;
  --line: #1f293d;
  --line-hover: #334155;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: #1e1b4b;
  --accent-soft-hover: #312e81;
  --success: #34d399;
  --success-bg: #064e3b;
  --success-line: #065f46;
  --warn: #fbbf24;
  --warn-bg: #451a03;
  --warn-line: #78350f;
  --danger: #f87171;
  --danger-bg: #450a0a;
  --danger-line: #7f1d1d;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-elevated: #ffffff;
  --panel-rgb: 255, 255, 255;
  --text: #0f172a;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --line-hover: #cbd5e1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-soft-hover: #e0e7ff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-line: #a7f3d0;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -2px rgb(15 23 42 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(15 23 42 / 0.1), 0 8px 10px -6px rgb(15 23 42 / 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--panel); padding: 8px 16px; z-index: 50; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-weight: 500;
}
.skip:focus { left: 16px; top: 16px; outline: 2px solid var(--accent); }

/* ---------- 顶栏 (Glassmorphism Header) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(var(--panel-rgb), 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  letter-spacing: -0.5px;
}
.brand-titles { display: flex; flex-direction: column; }
.brand h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.brand-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* 搜索框与快捷键 */
.search-wrap {
  position: relative; flex: 1 1 340px; max-width: 520px; min-width: 240px;
}
.search-icon-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--subtle); display: flex; pointer-events: none;
}
#search {
  width: 100%; height: 40px; padding: 0 80px 0 40px;
  border: 1px solid var(--line); border-radius: var(--radius-full);
  background: var(--bg); color: var(--text); font-size: 13.5px;
  transition: all var(--transition-normal);
}
#search:hover { border-color: var(--line-hover); }
#search:focus {
  outline: none; background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-clear {
  position: absolute; right: 52px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 4px; color: var(--subtle);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.search-clear:hover { color: var(--text); background: var(--line); }
.search-hint {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--muted); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 6px; background: var(--panel); pointer-events: none;
}

/* 顶栏右侧动作区 */
.topbar-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.theme-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); cursor: pointer;
  transition: all var(--transition-fast);
}
.theme-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.field-inline {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
}
select.select-sm {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font-size: 12.5px;
  cursor: pointer; transition: border-color var(--transition-fast);
}
select.select-sm:hover { border-color: var(--line-hover); }
select.select-sm:focus { outline: none; border-color: var(--accent); }

/* 通用按钮系统 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--panel); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast); text-decoration: none;
  white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--panel-elevated); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #ffffff;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}
.btn.primary:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  color: #ffffff; box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.btn.tiny { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.icon-only { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- 警示条与系统公告 ---------- */
.warning {
  margin: 12px 24px 0; padding: 10px 16px;
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: var(--radius-md); font-size: 13px; color: var(--warn);
  display: flex; align-items: center; gap: 10px;
}
.notice-banner {
  margin: 12px 24px 0; padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg) 100%);
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-md); font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.notice-body { display: flex; align-items: center; gap: 10px; color: var(--text); }
.notice-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 4px; border-radius: 6px; display: flex;
}
.notice-close:hover { color: var(--text); background: var(--line); }

/* ---------- 分类胶囊栏 (Category Filter Pills) ---------- */
.category-nav-wrap {
  padding: 16px 24px 0;
  max-width: 1560px; margin: 0 auto; width: 100%;
}
.category-bar {
  display: flex; align-items: center; gap: 8px; overflow-x: auto;
  padding-bottom: 8px; scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-full);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast);
  white-space: nowrap; flex-shrink: 0;
}
.pill-btn:hover {
  border-color: var(--line-hover); color: var(--text); background: var(--panel-elevated);
}
.pill-btn.active {
  background: var(--text); color: var(--bg); border-color: var(--text);
  box-shadow: var(--shadow-sm);
}
.pill-btn .pill-count {
  font-size: 11px; padding: 1px 6px; border-radius: 10px;
  background: var(--bg); color: var(--muted); font-weight: 600;
}
.pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.2); color: inherit;
}
:root[data-theme="dark"] .pill-btn.active .pill-count {
  background: rgba(0, 0, 0, 0.3);
}

/* 过滤工具栏 */
.sub-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px; padding: 0 4px; flex-wrap: wrap;
}
.quick-network-filters {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
}
.net-filter-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 12px; cursor: pointer;
}
.net-filter-btn:hover { background: var(--line); color: var(--text); }
.net-filter-btn.active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600;
}

/* ---------- 门户主内容区与卡片网格 ---------- */
.content {
  padding: 16px 24px 48px; max-width: 1560px; margin: 0 auto; width: 100%; flex: 1;
}
.loading, .empty {
  color: var(--muted); padding: 60px 16px; text-align: center; font-size: 14px;
}
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.group { margin-bottom: 36px; }
.group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.group-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.group-count {
  font-size: 12px; color: var(--muted); font-weight: normal;
  background: var(--line); padding: 2px 8px; border-radius: 10px;
}
.group-toggle { margin-left: auto; }

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

/* ---------- 现代卡片设计 (Portal Card) ---------- */
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-hover);
  box-shadow: var(--shadow-lg);
}

.card-top {
  display: flex; align-items: flex-start; gap: 12px;
}
.card-icon-box {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center; color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  transition: transform var(--transition-fast);
}
.card:hover .card-icon-box { transform: scale(1.04); }

.card-header-main {
  flex: 1 1 auto; min-width: 0;
}
.card-title-row {
  display: flex; align-items: center; gap: 6px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin: 0; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-title a {
  color: inherit; text-decoration: none; transition: color var(--transition-fast);
}
.card-title a:hover { color: var(--accent); }
.card-ext-icon { color: var(--subtle); flex-shrink: 0; }

.card-domain {
  font-size: 12px; color: var(--muted); word-break: break-all; margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}

.star-btn {
  background: none; border: none; padding: 5px; color: var(--subtle);
  cursor: pointer; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.star-btn:hover { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.star-btn.active { color: #f59e0b; }

.card-desc {
  margin: 0; font-size: 12.5px; color: var(--muted);
  line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; min-height: 18px;
}

/* 标签徽标组 */
.card-badges {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500; padding: 2.5px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
}
.badge.net-intranet {
  background: #e0f2fe; color: #0369a1;
}
.badge.net-vpn {
  background: #fef3c7; color: #b45309; border: 1px solid #fde68a;
}
.badge.net-public {
  background: #dcfce7; color: #15803d;
}
:root[data-theme="dark"] .badge.net-intranet { background: #082f49; color: #7dd3fc; }
:root[data-theme="dark"] .badge.net-vpn { background: #451a03; color: #fcd34d; border-color: #78350f; }
:root[data-theme="dark"] .badge.net-public { background: #052e16; color: #86efac; }

.badge.status-maint { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.badge.status-offline { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.badge.hot { background: #ffedd5; color: #c2410c; }
:root[data-theme="dark"] .badge.hot { background: #431407; color: #fdba74; }

.badge.env-both { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
:root[data-theme="dark"] .badge.env-both { background: #3b0764; color: #d8b4fe; border-color: #581c87; }

.badge.env-prod { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
:root[data-theme="dark"] .badge.env-prod { background: #064e3b; color: #6ee7b7; border-color: #047857; }

.badge.env-dev { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
:root[data-theme="dark"] .badge.env-dev { background: #431407; color: #fdba74; border-color: #7c2d12; }

.badge.plain { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* 开发环境专用按钮 */
.btn.tiny.outline-dev {
  background: transparent;
  color: #ea580c;
  border: 1px solid #fdba74;
}
.btn.tiny.outline-dev:hover {
  background: #fff7ed;
  border-color: #ea580c;
}
:root[data-theme="dark"] .btn.tiny.outline-dev {
  color: #fb923c;
  border-color: #9a3412;
}
:root[data-theme="dark"] .btn.tiny.outline-dev:hover {
  background: #431407;
}

.btn.tiny.primary-dev {
  background: #ea580c;
  color: #ffffff;
  border: 1px solid #c2410c;
}
.btn.tiny.primary-dev:hover {
  background: #c2410c;
}

.domain-dev {
  color: #ea580c;
  font-weight: 500;
}
:root[data-theme="dark"] .domain-dev {
  color: #fb923c;
}
.domain-sep {
  margin: 0 4px;
  color: var(--muted);
}

/* 卡片动作栏 */
.card-actions {
  display: flex; align-items: center; gap: 6px; margin-top: 4px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.card-actions .spacer { flex: 1; }

mark {
  background: #fef08a; color: #1e293b; border-radius: 2px; padding: 0 2px; font-weight: 600;
}
:root[data-theme="dark"] mark { background: #854d0e; color: #fef9c3; }

/* ---------- 凭据抽屉 (Credentials Area) ---------- */
.creds {
  margin-top: 4px; padding: 10px 12px; background: var(--bg);
  border: 1px dashed var(--line); border-radius: var(--radius-md);
  display: grid; gap: 8px; animation: fadeIn 0.2s ease-out;
}
.cred-row {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
}
.cred-row .k { color: var(--muted); width: 36px; flex: none; font-weight: 500; }
.cred-row .v {
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: 13px; letter-spacing: 0.3px; flex: 1; word-break: break-all;
  background: var(--panel); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line);
}
.cred-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.account-notes-box {
  font-size: 12px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid #3b82f6;
  border-radius: 6px; padding: 6px 10px; line-height: 1.5;
}

/* ---------- 模态弹窗系统 (Modals) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px; z-index: 100;
  animation: fadeIn 0.15s ease-out;
}
.modal {
  width: min(720px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--panel); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
}
.modal.modal-lg { width: min(920px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--muted); border-radius: 6px; padding: 2px 6px; line-height: 1;
}
.modal-close:hover { background: var(--line); color: var(--text); }
.modal-body { padding: 20px 22px; display: grid; gap: 14px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px;
  border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 5px; }
.field.wide, fieldset.wide { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 13.5px; font-family: inherit; width: 100%;
  transition: border-color var(--transition-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); background: var(--panel);
}
.field textarea { min-height: 64px; resize: vertical; }
.field .hint { font-size: 11.5px; color: var(--subtle); }
fieldset {
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px;
  display: grid; gap: 12px; background: var(--bg);
}
legend { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 6px; }

/* 审计日志表格 */
.audit-table-wrap {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; max-height: 480px; overflow-y: auto;
}
.audit-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px; text-align: left;
}
.audit-table th {
  background: var(--bg); padding: 10px 12px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2;
}
.audit-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text);
}
.audit-table tr:last-child td { border-bottom: none; }
.audit-table tr:hover td { background: var(--accent-soft); }

/* 批量导入弹窗与使用指引 */
.guide-banner {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.guide-banner-text {
  flex: 1 1 300px;
  display: grid;
  gap: 4px;
}
.guide-banner-text h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.guide-banner-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.55;
}
.doc-section {
  display: grid;
  gap: 8px;
}
.doc-section h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.field-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel);
}
.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.field-table th {
  background: var(--bg);
  padding: 8px 10px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.field-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.field-table tr:last-child td { border-bottom: none; }
.field-table tr:hover td { background: var(--accent-soft); }
.upload-dropzone {
  border: 2px dashed var(--line-hover);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.badge.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }

/* ---------- 提示浮层 (Toast System) ---------- */
.toast-root {
  position: fixed; right: 24px; bottom: 24px; display: grid; gap: 10px; z-index: 200; pointer-events: none;
}
.toast {
  padding: 10px 18px; border-radius: var(--radius-md);
  background: #1e293b; color: #f8fafc; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-xl); border-left: 4px solid var(--accent);
  display: flex; align-items: center; gap: 8px; pointer-events: auto;
  animation: slideUp 0.22s ease-out;
}
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--success); }

/* ---------- 页脚 ---------- */
.foot {
  text-align: center; padding: 24px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--line); background: var(--panel); margin-top: auto;
}

/* ---------- 登录页 (Modern Glass Login) ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 20%, rgba(79, 70, 229, 0.08) 0%, transparent 60%), var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; padding: 32px 28px 26px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
  display: grid; gap: 20px;
}
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand h1 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.login-brand p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.password-input-wrap {
  position: relative; display: flex; align-items: center;
}
.login-card input[type="password"], .login-card input[type="text"] {
  padding: 11px 42px 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text); font-size: 14px; width: 100%;
}
.login-card input:focus {
  outline: none; border-color: var(--accent); background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pwd-toggle-btn {
  position: absolute; right: 10px; background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px; display: flex; align-items: center;
}
.pwd-toggle-btn:hover { color: var(--text); }
.login-card .btn.primary { width: 100%; padding: 11px; font-size: 14px; font-weight: 600; }
.login-error { font-size: 12.5px; color: var(--danger); min-height: 18px; margin: 0; }
.login-hint { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.6; }

/* ---------- 动画 ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .topbar { padding: 10px 16px; }
  .content { padding: 12px 16px 36px; }
  .category-nav-wrap { padding: 12px 16px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .search-hint { display: none; }
  #search { padding-right: 36px; }
}
