/* ============================================================
   杀鱼台全能专业版 · 全新设计系统（v2）
   现代 UI · 响应式 · 无 Bootstrap 布局依赖
   仅使用 Bootstrap Icons 图标 + 原生 CSS 自定义属性
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 色彩 */
  --c-primary: #2563eb;
  --c-primary-dark: #1e40af;
  --c-primary-soft: #eff6ff;
  --c-accent: #0ea5e9;
  --c-success: #10b981;
  --c-success-soft: #ecfdf5;
  --c-warning: #f59e0b;
  --c-warning-soft: #fffbeb;
  --c-danger: #ef4444;
  --c-danger-soft: #fef2f2;
  --c-info: #06b6d4;
  --c-info-soft: #ecfeff;
  --c-purple: #8b5cf6;
  --c-purple-soft: #f5f3ff;

  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-surface-2: #f1f5f9;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;

  --c-text: #0f172a;
  --c-text-2: #475569;
  --c-text-3: #94a3b8;
  --c-text-inverse: #ffffff;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .06), 0 2px 4px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, .10), 0 8px 10px -6px rgba(15, 23, 42, .06);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, .25);

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* 间距 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px;  --sp-8: 40px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', Consolas, 'Liberation Mono', monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px;
  --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 34px;
  --lh-tight: 1.25; --lh-base: 1.6; --lh-loose: 1.8;

  /* 布局 */
  --topbar-h: 56px;

  /* 动效 */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: 180ms;
}

/* ---------- 2. 全局重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
::selection { background: var(--c-primary-soft); color: var(--c-primary-dark); }

/* ---------- 3. 应用布局（topnav + main） ---------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* 顶部导航栏 */
.sidebar {
  position: sticky;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: row;
  align-items: center;
  z-index: 100;
  overflow: visible;
  padding: 0 var(--sp-4);
  gap: var(--sp-4);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}
.sidebar-brand-mark {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}
.sidebar-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-name {
  font-size: var(--fs-base); font-weight: 700; color: #fff;
  letter-spacing: .2px; white-space: nowrap;
}
.sidebar-brand-sub {
  font-size: 10px; color: #64748b; letter-spacing: 1.5px;
  text-transform: uppercase; font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  display: none;
}
.nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  color: #cbd5e1;
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: rgba(37,99,235,.25);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 2px; border-radius: 1px;
  background: var(--c-primary);
}
.nav-item-icon {
  font-size: 15px; flex-shrink: 0;
  color: #94a3b8;
}
.nav-item.active .nav-item-icon { color: var(--c-accent); }
.nav-item-label { }
.nav-item-badge {
  font-size: 10px; padding: 1px 7px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,.1);
  color: #cbd5e1; font-weight: 600;
}
.nav-item.active .nav-item-badge { background: var(--c-primary); color: #fff; }

.sidebar-footer {
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-user {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 4px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-user-avatar {
  width: 28px; height: 28px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-purple), var(--c-accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: var(--fs-sm);
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: var(--fs-sm); color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: #64748b; }

/* 主区域 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-h));
}

/* 顶栏 */
.topbar {
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--r-md);
  align-items: center; justify-content: center;
  color: var(--c-text-2);
  font-size: 18px;
}
.topbar-title { font-size: var(--fs-lg); font-weight: 700; color: var(--c-text); margin-right: auto; }
.topbar-title small { font-size: var(--fs-xs); color: var(--c-text-3); font-weight: 500; margin-left: var(--sp-2); }

.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); position: relative; }
.topbar-clock {
  font-size: var(--fs-sm); color: var(--c-text-2);
  font-family: var(--font-mono);
  padding: 6px 12px;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
}
.topbar-support {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs);
  padding: 6px 12px;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  border-radius: var(--r-full);
  font-weight: 600;
  transition: background var(--dur) var(--ease);
}
.topbar-support:hover { background: var(--c-primary); color: #fff; }
.topbar-support i { font-size: 13px; }

/* 内容区 */
.content {
  flex: 1;
  padding: var(--sp-6);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  margin-bottom: var(--sp-6);
}
.page-header h1 {
  font-size: var(--fs-2xl); font-weight: 800; color: var(--c-text);
  margin: 0 0 var(--sp-1);
  letter-spacing: -.5px;
}
.page-header p { color: var(--c-text-2); margin: 0; font-size: var(--fs-sm); }
.page-header-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
}

/* ---------- 4. 通用组件 ---------- */

/* 卡片 */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.card-title { font-size: var(--fs-md); font-weight: 700; color: var(--c-text); margin: 0; }
.card-title i { color: var(--c-primary); margin-right: var(--sp-2); }
.card-body { padding: var(--sp-5); }
.card-footer {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  font-size: var(--fs-xs); color: var(--c-text-3);
}

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--c-primary));
}
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.stat-card-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  background: var(--stat-bg, var(--c-primary-soft));
  color: var(--stat-color, var(--c-primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-card-trend {
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--c-text-3);
}
.stat-card-value { font-size: var(--fs-3xl); font-weight: 800; color: var(--c-text); letter-spacing: -1px; line-height: 1.1; }
.stat-card-label { font-size: var(--fs-sm); color: var(--c-text-2); margin-top: 4px; font-weight: 500; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn i { font-size: 15px; }

.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-secondary { background: var(--c-surface); color: var(--c-text-2); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-surface-2); border-color: var(--c-border-strong); color: var(--c-text); }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.btn-ghost { background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-sm { padding: 5px 10px; font-size: var(--fs-xs); }
.btn-sm i { font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: var(--fs-md); }
.btn-block { width: 100%; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  font-size: 11px; font-weight: 700;
  border-radius: var(--r-full);
  letter-spacing: .3px;
  line-height: 1.6;
}
.badge-success { background: var(--c-success-soft); color: #047857; }
.badge-danger { background: var(--c-danger-soft); color: #b91c1c; }
.badge-warning { background: var(--c-warning-soft); color: #b45309; }
.badge-info { background: var(--c-info-soft); color: #0e7490; }
.badge-primary { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.badge-purple { background: var(--c-purple-soft); color: #6d28d9; }
.badge-neutral { background: var(--c-surface-2); color: var(--c-text-2); }

/* 表单 */
.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block;
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-text);
  margin-bottom: 6px;
}
.form-label .req { color: var(--c-danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  outline: none;
}
.form-control::placeholder { color: var(--c-text-3); }
.form-control:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
}
.form-control:disabled { background: var(--c-surface-2); color: var(--c-text-3); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; font-family: var(--font-mono); }
.form-hint { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 5px; }
.form-error { font-size: var(--fs-xs); color: var(--c-danger); margin-top: 5px; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--c-border); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.table th {
  text-align: left;
  padding: 11px 14px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--c-primary-soft); }
.table tbody tr:last-child td { border-bottom: none; }
.table .mono { font-family: var(--font-mono); font-size: var(--fs-xs); }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--c-text-3);
}
.empty-state-icon {
  width: 64px; height: 64px;
  margin: 0 auto var(--sp-4);
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--c-text-3);
}
.empty-state-title { font-size: var(--fs-md); font-weight: 700; color: var(--c-text-2); margin-bottom: var(--sp-1); }
.empty-state-text { font-size: var(--fs-sm); }

/* 加载骨架 */
.skeleton {
  background: linear-gradient(90deg, var(--c-surface-2) 25%, #e8edf3 50%, var(--c-surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
  color: transparent !important;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast */
.toast-container {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-sm);
  animation: toastIn var(--dur) var(--ease);
}
.toast.out { animation: toastOut var(--dur) var(--ease) forwards; }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; flex-shrink: 0; }
.toast-success .toast-icon { background: var(--c-success); }
.toast-danger .toast-icon { background: var(--c-danger); }
.toast-warning .toast-icon { background: var(--c-warning); }
.toast-info .toast-icon { background: var(--c-info); }
.toast-msg { flex: 1; color: var(--c-text); }
.toast-close { background: none; border: none; color: var(--c-text-3); font-size: 16px; padding: 0; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* 模态框 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn var(--dur) var(--ease);
}
.modal-dialog {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 220ms var(--ease);
}
.modal-dialog.lg { max-width: 760px; }
.modal-dialog.xl { max-width: 1000px; }
.modal-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: var(--fs-md); font-weight: 700; color: var(--c-text); }
.modal-close { background: none; border: none; font-size: 22px; color: var(--c-text-3); line-height: 1; padding: 0; }
.modal-close:hover { color: var(--c-text); }
.modal-body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal-footer {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--c-border);
  display: flex; justify-content: flex-end; gap: var(--sp-2);
  background: var(--c-surface-2);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* 进度条 */
.progress {
  height: 8px;
  background: var(--c-surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  transition: width 400ms var(--ease);
}
.progress-bar.success { background: linear-gradient(90deg, var(--c-success), #34d399); }
.progress-bar.danger { background: linear-gradient(90deg, var(--c-danger), #f87171); }

/* 标签页（pill 风格） */
.tabs {
  display: flex; gap: 4px;
  background: var(--c-surface-2);
  padding: 4px;
  border-radius: var(--r-md);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: var(--sp-4);
}
.tab {
  padding: 7px 14px;
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-text-2);
  border: none; background: transparent;
  border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { color: var(--c-text); }
.tab.active { background: var(--c-surface); color: var(--c-primary); box-shadow: var(--shadow-sm); }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.toolbar .spacer { flex: 1; }
.search-box {
  position: relative;
  min-width: 220px;
  flex: 1;
  max-width: 360px;
}
.search-box i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-3); font-size: 14px;
}
.search-box .form-control { padding-left: 36px; }

/* 设备卡片 */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}
.device-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.device-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--c-border-strong); }
.device-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.device-card.active::before { opacity: 1; }
.device-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-4);
}
.device-name { font-size: var(--fs-md); font-weight: 700; color: var(--c-text); word-break: break-all; }
.device-ip { font-size: var(--fs-xs); color: var(--c-text-3); font-family: var(--font-mono); margin-top: 2px; }
.device-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.device-meta-item {
  padding: var(--sp-2);
  background: var(--c-surface-2);
  border-radius: var(--r-sm);
}
.device-meta-label { font-size: 10px; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.device-meta-value { font-size: var(--fs-sm); color: var(--c-text); font-weight: 600; margin-top: 2px; word-break: break-all; }
.device-progress-label {
  display: flex; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--c-text-2);
  margin-bottom: 6px; font-weight: 600;
}
.device-progress-label .stage { color: var(--c-primary); }
.device-actions {
  display: flex; gap: var(--sp-2); margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
}
.device-actions .btn { flex: 1; }

/* 日志 */
.log-toolbar {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.log-toolbar-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--sp-3); }

/* ===== 终端风格日志 ===== */

/* ===== 终端风格日志 ===== */
.terminal {
  background: #0c0c0c;
  border: 1px solid #1a1a2e;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
}
.terminal-screen {
  height: calc(100vh - 280px);
  overflow-y: auto;
  padding: 16px 20px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Menlo', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #00ff41;
}
.terminal-screen::-webkit-scrollbar { width: 8px; }
.terminal-screen::-webkit-scrollbar-track { background: #0c0c0c; }
.terminal-screen::-webkit-scrollbar-thumb { background: #1a3a1a; border-radius: 4px; }
.terminal-screen::-webkit-scrollbar-thumb:hover { background: #2a5a2a; }
.terminal-prompt {
  color: #00ff41;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a2a1a;
  font-weight: 600;
}
.terminal-prompt .prompt-symbol { color: #00cc33; margin-right: 8px; }
.term-line { white-space: pre-wrap; word-break: break-all; }
.term-time { color: #5a8a5a; }
.term-ip { color: #4a9aff; }
.term-msg { color: #00ff41; }
.term-trans { color: #88aa88; font-size: 12px; }
.terminal-cursor { margin-top: 8px; }
.terminal-cursor .cursor-block {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: #00ff41;
}
@keyframes blink { 50% { opacity: 0; } }
.terminal-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 300px; color: #2a4a2a; font-size: 14px; gap: 8px;
}
.terminal-empty i { font-size: 40px; color: #1a3a1a; }
.log-toolbar-row:last-child { margin-bottom: 0; }
.log-toolbar-label { font-size: var(--fs-xs); color: var(--c-text-3); font-weight: 600; min-width: 60px; }

.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  font-size: var(--fs-xs); font-weight: 600;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--c-border-strong); color: var(--c-text); }
.chip.active {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}
.chip .count {
  margin-left: 4px;
  padding: 0 5px;
  font-size: 10px;
  background: rgba(0,0,0,.08);
  border-radius: var(--r-full);
}
.chip.active .count { background: rgba(255,255,255,.25); }

.log-list {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.log-session {
  border-bottom: 1px solid var(--c-border);
}
.log-session:last-child { border-bottom: none; }
.log-session-header {
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface-2);
  cursor: pointer;
  display: flex; align-items: center; gap: var(--sp-2);
  transition: background var(--dur) var(--ease);
}
.log-session-header:hover { background: var(--c-border); }
.log-session-header .arrow { font-size: 10px; color: var(--c-text-3); transition: transform var(--dur) var(--ease); }
.log-session-header.collapsed .arrow { transform: rotate(-90deg); }
.log-session-meta { font-size: var(--fs-sm); color: var(--c-text-2); flex: 1; }
.log-session-meta strong { color: var(--c-text); }
.log-session-body { max-height: 400px; overflow-y: auto; }
.log-session-body.collapsed { display: none; }

.log-line {
  display: flex; gap: var(--sp-3);
  padding: 6px var(--sp-4);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--c-surface-2);
  align-items: flex-start;
}
.log-line:last-child { border-bottom: none; }
.log-line:hover { background: var(--c-primary-soft); }
.log-line-time { color: var(--c-text-3); min-width: 60px; flex-shrink: 0; }
.log-line-cat {
  min-width: 80px; flex-shrink: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.log-line-text { color: var(--c-text); word-break: break-all; flex: 1; }
.log-line-trans { color: var(--c-text-2); font-family: var(--font-sans); font-size: 11px; }

/* 文件中心 */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--sp-4);
}
.file-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease);
}
.file-card:hover { box-shadow: var(--shadow-md); }
.file-card-header {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-surface-2) 100%);
}
.file-card-title {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); font-weight: 700; color: var(--c-text);
  word-break: break-all; margin-bottom: var(--sp-2);
}
.file-card-title i { color: var(--c-primary); flex-shrink: 0; }
.file-card-meta {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  font-size: 11px; color: var(--c-text-3);
}
.file-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.file-card-actions {
  padding: var(--sp-3) var(--sp-4);
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
  border-bottom: 1px solid var(--c-border);
}
.file-card-content {
  padding: var(--sp-4);
  max-height: 320px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  white-space: pre-wrap;
  word-break: break-all;
  display: none;
}
.file-card-content.open { display: block; }

/* 设置页 */
.settings-card {
  max-width: 560px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--c-border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info { flex: 1; min-width: 0; }
.settings-row-title { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); }
.settings-row-desc { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 2px; }
.settings-row-action { flex-shrink: 0; }

/* 登录页 */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(37,99,235,.10) 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 100%, rgba(14,165,233,.10) 0%, transparent 60%),
    var(--c-bg);
  position: relative;
  overflow: hidden;
}
.auth-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,23,42,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-7);
  position: relative;
  z-index: 1;
  animation: modalIn 300ms var(--ease);
}
.auth-brand {
  text-align: center;
  margin-bottom: var(--sp-6);
}
.auth-brand-mark {
  width: 64px; height: 64px;
  margin: 0 auto var(--sp-3);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(37,99,235,.35);
}
.auth-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-brand-name { font-size: 22px; font-weight: 800; color: var(--c-text); letter-spacing: -.5px; }
.auth-brand-sub { font-size: var(--fs-xs); color: var(--c-text-3); letter-spacing: 2px; text-transform: uppercase; font-weight: 600; margin-top: 4px; }
.auth-submit { margin-top: var(--sp-5); }
.auth-support {
  text-align: center;
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--c-border);
  font-size: var(--fs-xs); color: var(--c-text-3);
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.auth-support span { display: inline-flex; align-items: center; gap: 4px; }
.auth-support i { font-size: 11px; color: var(--c-success, #34c759); }
.auth-support-dot { color: var(--c-border); }

/* ---------- 响应式（多断点） ---------- */

/* 桌面大屏（≤1280px）：收紧间距 */
@media (max-width: 1280px) {
  .content { max-width: 100%; padding: var(--sp-5); }
}

/* 桌面 / 平板横屏（≤1024px） */
@media (max-width: 1024px) {
  .content { padding: var(--sp-5); }
  .topbar { padding: 0 var(--sp-4); }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .device-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .extract-cat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .metric-bar-label { width: 140px; }
  .metric-bar-num { width: 100px; }
  .search-results { width: 320px; }
}

/* 平板竖屏 / 小笔记本（≤768px）：顶部导航紧凑 */
@media (max-width: 768px) {
  .sidebar { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .sidebar-brand-name { display: none; }
  .nav-item { padding: 6px 10px; font-size: var(--fs-xs); }
  .nav-item-icon { font-size: 14px; }
  .nav-item-label { display: none; }
  .sidebar-user-info { display: none; }
  .topbar { padding: 0 var(--sp-3); }
  .topbar-clock { display: none; }
  .topbar-support { display: none; }
  .content { padding: var(--sp-4); }
  .page-header h1 { font-size: var(--fs-xl); }
  .page-header-row { flex-direction: column; align-items: stretch; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .stat-card { padding: var(--sp-4); }
  .stat-card-value { font-size: var(--fs-2xl); }
  .device-grid { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: 1fr; }
  .extract-cat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .extract-cat-card { padding: 10px 12px; }
  .extract-cat-icon { width: 36px; height: 36px; font-size: 16px; }
  .extract-cat-count { font-size: 18px; }
  .auth-card { padding: var(--sp-5); }
  .modal-dialog { max-width: 100%; border-radius: var(--r-lg); }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-dialog { max-height: 95vh; }
  .table-wrap { border-radius: var(--r-sm); }
  .table th, .table td { padding: 10px 10px; font-size: 12px; }
  .toolbar { gap: var(--sp-1); }
  .toolbar .btn { padding: 6px 10px; font-size: var(--fs-xs); }
  .search-box { min-width: 0; max-width: none; flex: 1; }
  .device-meta { grid-template-columns: 1fr; }
  .device-actions { flex-wrap: wrap; }
  .device-actions .btn { flex: 1 1 calc(50% - 4px); }
  .log-line { flex-wrap: wrap; }
  .log-line-time { min-width: 50px; }
  .log-line-cat { min-width: 60px; }
  .log-line-text { min-width: 0; }
  .audit-item { gap: 10px; }
  .audit-icon { width: 32px; height: 32px; font-size: 14px; }
  .result-pre { font-size: 11px; padding: 10px; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
  .settings-row-action { width: 100%; }
  .settings-row-action .btn { width: 100%; justify-content: center; }
  .metric-bar-label { width: 100px; font-size: 12px; }
  .metric-bar-num { width: 80px; font-size: 12px; }
  .topbar-search input { width: 100px; }
  .topbar-search { padding: 4px 10px; }
  .search-results { width: calc(100vw - 32px); max-height: 360px; }
  .notif-list { max-height: 400px; }
  .toast-container { max-width: calc(100vw - 32px); }
}

/* 手机（≤480px）：紧凑模式 */
@media (max-width: 480px) {
  .content { padding: var(--sp-3); }
  .topbar { padding: 0 var(--sp-3); height: 52px; }
  .topbar-title { font-size: var(--fs-md); }
  .topbar-title small { display: none; }
  .page-header h1 { font-size: var(--fs-lg); }
  .page-header p { font-size: var(--fs-xs); }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card-value { font-size: var(--fs-xl); }
  .stat-card-icon { width: 36px; height: 36px; font-size: 16px; }
  .extract-cat-grid { grid-template-columns: 1fr; }
  .table-wrap { margin: 0 calc(-1 * var(--sp-3)); border-radius: 0; border-left: none; border-right: none; }
  .table th, .table td { padding: 8px 8px; font-size: 11px; }
  .btn { padding: 7px 12px; font-size: var(--fs-xs); }
  .btn-lg { padding: 10px 16px; font-size: var(--fs-sm); }
  .card-body { padding: var(--sp-4); }
  .card-header { padding: var(--sp-3) var(--sp-4); flex-wrap: wrap; }
  .auth-card { padding: var(--sp-5) var(--sp-4); }
  .form-control { padding: 8px 10px; }
  .modal-dialog { max-width: 100%; }
  .modal-body { padding: var(--sp-4); }
  .modal-footer { padding: var(--sp-2) var(--sp-4); flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; }
  .log-session-header { padding: var(--sp-2) var(--sp-3); }
  .log-line { padding: 5px var(--sp-3); }
  .chip { padding: 4px 10px; font-size: 11px; }
  .empty-state { padding: var(--sp-6) var(--sp-3); }
  .empty-state-icon { width: 48px; height: 48px; font-size: 22px; }
  .topbar-search { display: none; }
  .topbar-bell { width: 32px; height: 32px; font-size: 15px; }
}

/* 顶部导航遮罩（移动端，已废弃） */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 99;
  animation: fadeIn var(--dur) var(--ease);
}
.sidebar-overlay.show { display: block; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 5px; border: 2px solid var(--c-surface); }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-3); }

/* 工具类 */
.text-mono { font-family: var(--font-mono); }
.text-2 { color: var(--c-text-2); }
.text-3 { color: var(--c-text-3); }
.text-success { color: var(--c-success); }
.text-danger { color: var(--c-danger); }
.text-warning { color: var(--c-warning); }
.text-primary { color: var(--c-primary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* ============================================================
   新功能组件（v2.1）
   ============================================================ */

/* ---------- 顶栏：全局搜索 + 通知铃铛 ---------- */
.topbar-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: 5px 12px;
  margin-right: 4px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.topbar-search:focus-within { border-color: var(--c-primary); box-shadow: var(--shadow-focus); }
.topbar-search i { color: var(--c-text-3); font-size: 14px; }
.topbar-search input {
  border: none; background: transparent; outline: none;
  font-size: var(--fs-sm); width: 180px; color: var(--c-text);
}
.topbar-bell {
  position: relative; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-2); font-size: 17px;
  transition: background var(--dur) var(--ease);
  margin-right: 6px;
}
.topbar-bell:hover { background: var(--c-surface-2); }
.topbar-bell-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--c-danger); color: #fff;
  border-radius: var(--r-full);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--c-surface);
}
.search-results {
  position: absolute; top: 100%; right: 0;
  width: 360px; max-height: 420px; overflow-y: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  margin-top: 6px; z-index: 100;
  padding: 6px;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  cursor: pointer;
}
.search-result-item:hover { background: var(--c-surface-2); }
.search-result-icon { color: var(--c-text-3); font-size: 15px; flex-shrink: 0; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-title { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-sub { font-size: var(--fs-xs); color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-empty { padding: 20px; text-align: center; color: var(--c-text-3); font-size: var(--fs-sm); }

/* ---------- 通知中心列表 ---------- */
.notif-list { max-height: 480px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 8px; border-bottom: 1px solid var(--c-border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--c-primary-soft); }
.notif-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); }
.notif-desc { font-size: var(--fs-xs); color: var(--c-text-2); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--c-text-3); margin-top: 4px; }

/* ---------- RCE 成功率看板 ---------- */
.metric-board { margin-bottom: var(--sp-5); }
.metric-board:last-child { margin-bottom: 0; }
.metric-board-title { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text-2); margin-bottom: var(--sp-3); }
.metric-bars { display: flex; flex-direction: column; gap: 10px; }
.metric-bar-row { display: flex; align-items: center; gap: 12px; }
.metric-bar-label { width: 180px; flex-shrink: 0; font-size: var(--fs-sm); color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-bar-track { flex: 1; height: 10px; background: var(--c-surface-2); border-radius: var(--r-full); overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: var(--r-full); transition: width .5s var(--ease); }
.metric-bar-fill.success { background: var(--c-success); }
.metric-bar-fill.warn { background: var(--c-warning); }
.metric-bar-fill.danger { background: var(--c-danger); }
.metric-bar-num { width: 130px; flex-shrink: 0; font-size: var(--fs-sm); text-align: right; }
.metric-bar-num span { font-size: 11px; }
.metric-event-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.metric-event-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  padding: 5px 12px; border-radius: var(--r-full);
  font-size: var(--fs-xs); color: var(--c-text-2);
}
.metric-event-chip i { color: var(--c-primary); font-size: 8px; }
.metric-event-chip b { color: var(--c-text); font-weight: 700; }

/* ---------- 命令模板库 ---------- */
.tpl-group { margin-bottom: var(--sp-4); }
.tpl-group-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tpl-group-name { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text-2); }
.tpl-items { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); padding: 6px 12px;
  font-size: var(--fs-xs); color: var(--c-text-2);
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.tpl-chip:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }
.tpl-chip-del { font-size: 11px; color: var(--c-text-3); cursor: pointer; }
.tpl-chip-del:hover { color: var(--c-danger); }

/* ---------- 命令结果回看 ---------- */
.result-block { margin-bottom: var(--sp-4); }
.result-block-label { font-size: var(--fs-xs); font-weight: 700; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.result-pre {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--c-surface-2); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  padding: 12px; margin: 0; white-space: pre-wrap; word-break: break-word;
  max-height: 280px; overflow-y: auto;
}
.result-pre.fail { background: var(--c-danger-soft); color: #b91c1c; border-color: #fecaca; }

/* ---------- 操作审计时间线 ---------- */
.audit-timeline { display: flex; flex-direction: column; }
.audit-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 4px; border-bottom: 1px solid var(--c-border);
}
.audit-item:last-child { border-bottom: none; }
.audit-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.audit-body { flex: 1; min-width: 0; }
.audit-title { font-size: var(--fs-sm); color: var(--c-text); }
.audit-desc { font-size: var(--fs-xs); color: var(--c-text-2); margin-top: 3px; word-break: break-word; }
.audit-time { font-size: 11px; color: var(--c-text-3); margin-top: 5px; }

/* ---------- 日志搜索框 ---------- */
.log-search { height: 32px; }
.log-search::-webkit-search-cancel-button { cursor: pointer; }

.hidden { display: none !important; }

/* ============ 关键信息提取 ============ */
.extract-cats { margin-bottom: 18px; }
.extract-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.extract-cat-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: 14px 16px; cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .12s; text-align: left;
}
.extract-cat-card:hover { border-color: var(--c-cat-color, var(--c-primary)); box-shadow: var(--shadow-sm); }
.extract-cat-card.active { border-color: var(--c-cat-color, var(--c-primary)); background: var(--c-surface-2); box-shadow: var(--shadow-md); }
.extract-cat-icon {
  width: 42px; height: 42px; border-radius: var(--r-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-surface-2); color: var(--c-cat-color, var(--c-primary)); font-size: 20px;
}
.extract-cat-card.active .extract-cat-icon { background: var(--c-cat-color, var(--c-primary)); color: #fff; }
.extract-cat-info { flex: 1; min-width: 0; }
.extract-cat-label { font-size: 14px; font-weight: 600; color: var(--c-text); }
.extract-cat-count { font-size: 22px; font-weight: 700; color: var(--c-cat-color, var(--c-primary)); line-height: 1.2; }
.extract-cat-count .unit { font-size: 11px; font-weight: 400; color: var(--c-text-3); margin-left: 2px; }

/* ---------- 设备上线语音提示 ---------- */
.voice-wrap { display: inline-flex; align-items: center; gap: 6px; margin: 0 10px; position: relative; }
.voice-skip {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
  transition: background .15s, color .15s;
}
.voice-skip:hover { background: var(--c-surface-2); color: var(--c-text); }
.voice-badge {
  position: relative; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-primary); color: #fff; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.voice-badge-num {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  background: var(--c-danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
  line-height: 1;
}
.voice-badge.voice-speaking { animation: voice-pulse 1.1s ease-in-out infinite; }
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--c-primary-rgb, 64,128,255), .5); }
  50% { box-shadow: 0 0 0 6px rgba(var(--c-primary-rgb, 64,128,255), 0); }
}
/* 开关 */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--c-border);
  border-radius: 24px; transition: background .2s;
}
.switch-slider:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .switch-slider { background: var(--c-primary); }
.switch input:checked + .switch-slider:before { transform: translateX(18px); }
.settings-row-action input[type="range"] { accent-color: var(--c-primary); }
@media (max-width: 480px) {
  .voice-wrap { margin: 0 4px; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .settings-row-action { width: 100%; }
  #voice-template { width: 100% !important; }
}
