/* ================================================================
   LED工具箱 · 管理后台样式 (艾比森橙风格)
   ================================================================ */

/* ==============================
   设计变量 — Art Design Pro 风格 (高级灰玻璃质感)
   ============================== */
:root {
  /* 基础背景 — 摒弃暖橙调，改用高级灰 */
  --bg: #fafbfc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f2f4f5;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-bg-solid: #ffffff;
  --card-hover: #ffffff;
  --card-border: rgba(0, 0, 0, 0.07);
  --card-border-hover: rgba(0, 0, 0, 0.12);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --card-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.06);

  /* 9级灰阶 (Art Design Pro 体系) */
  --gray-100: #f9fafb;
  --gray-200: #f2f4f5;
  --gray-300: #e6eaeb;
  --gray-400: #dbdfe1;
  --gray-500: #949eb7;
  --gray-600: #7987a1;
  --gray-700: #4d5875;
  --gray-800: #383853;
  --gray-900: #323251;

  /* 文字色 — 使用灰阶体系 */
  --text: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-inverse: #ffffff;

  /* 主题色 — 保留橙色但更精致 */
  --primary: #f39800;
  --primary-dark: #d48400;
  --primary-light: #f5b840;
  --primary-glow: rgba(243, 152, 0, 0.08);

  /* 状态色 — 对齐 Art Design Pro */
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #f87171;
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --info: #6366f1;
  --info-light: #818cf8;

  /* 导航 — 更干净的白 */
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-border: rgba(0, 0, 0, 0.06);
  --nav-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);

  /* 输入框 — 去掉橙色调 */
  --input-bg: #f9fafb;
  --input-border: #e6eaeb;
  --input-focus: rgba(243, 152, 0, 0.15);

  /* 圆角 — 更小更精致 */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* hover/active 状态色 (Art Design Pro 体系) */
  --hover-color: #f2f4f5;
  --active-color: #e6eaeb;

  --banner-gradient: linear-gradient(135deg, #f39800 0%, #e87d00 50%, #ff6b35 100%);
  --grid-color: rgba(0, 0, 0, 0.02);

  color-scheme: light;
}

/* ---- 深色模式 (Art Design Pro 暗色体系) ---- */
[data-theme="dark"] {
  --bg: #070707;
  --bg-secondary: #161618;
  --bg-tertiary: #1a1a1e;
  --card-bg: rgba(22, 22, 24, 0.88);
  --card-bg-solid: #161618;
  --card-hover: #1e1e22;
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-hover: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --card-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* 9级灰阶 (暗色反转) */
  --gray-100: #110f0f;
  --gray-200: #17171c;
  --gray-300: #393946;
  --gray-400: #505062;
  --gray-500: #73738c;
  --gray-600: #8f8fa3;
  --gray-700: #ababba;
  --gray-800: #c7c7d1;
  --gray-900: #e3e3e8;

  --text: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-inverse: #ffffff;

  --primary: #f5b840;
  --primary-dark: #f39800;
  --primary-light: #ffcc80;
  --primary-glow: rgba(245, 184, 64, 0.1);

  --danger: #f87171;
  --danger-dark: #ef4444;
  --danger-light: #fca5a5;
  --success: #34d399;
  --success-light: #6ee7b7;
  --warning: #fbbf24;
  --warning-light: #fcd34d;
  --info: #818cf8;
  --info-light: #a5b4fc;

  --nav-bg: rgba(22, 22, 24, 0.85);
  --nav-border: rgba(255, 255, 255, 0.06);
  --nav-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);

  --input-bg: #1a1a1e;
  --input-border: rgba(255, 255, 255, 0.08);
  --input-focus: rgba(245, 184, 64, 0.15);

  --hover-color: #252530;
  --active-color: #2e2e38;

  --grid-color: rgba(255, 255, 255, 0.015);

  color-scheme: dark;
}

/* ==============================
   重置 & 基础
   ============================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: var(--bg);
  transition: background 0.4s ease;
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 10%, transparent 70%);
  transition: background-image 0.4s ease;
}

::selection { background: rgba(243,152,0,0.15); color: var(--text); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; opacity: 0.5; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ==============================
   通用按钮 (Art Design Pro 风格)
   ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px; border: none;
  border-radius: var(--radius-xs); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
  text-decoration: none; white-space: nowrap; position: relative;
  font-family: inherit;
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: var(--danger); color: #fff;
}
.btn-danger:hover { background: var(--danger-dark); }

.btn-outline {
  background: transparent; border: 1px solid var(--card-border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--hover-color);
}

.btn-sm { padding: 5px 12px; font-size: 0.8rem; border-radius: var(--radius-xs); }

/* ==============================
   主题切换按钮（全局通用）
   ============================== */
.theme-toggle-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; transition: all 0.3s ease; flex-shrink: 0;
  color: var(--text-secondary);
}
.theme-toggle-btn:hover {
  border-color: var(--primary);
  background: rgba(243,152,0,0.06);
  transform: rotate(15deg);
}

/* ==============================
   登录页 (Art Design Pro 风格)
   ============================== */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; position: relative;
}
.login-page::before {
  content: ''; position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(243,152,0,0.06) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%;
  pointer-events: none;
}

.login-card {
  background: var(--card-bg); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 40px 36px; width: 100%; max-width: 380px;
  box-shadow: var(--card-shadow-lg);
  position: relative; z-index: 1;
}
.login-card .logo { text-align: center; margin-bottom: 28px; }
.login-card .logo .icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: var(--bg-tertiary);
  border: 1px solid var(--card-border); border-radius: 12px;
}
.login-card .logo h1 {
  font-size: 1.5rem; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.login-card .logo p {
  color: var(--text-muted); font-size: 0.85rem; font-weight: 400;
}
.login-card .form-group { margin-bottom: 22px; }
.login-card label {
  display: block; margin-bottom: 7px; font-size: 0.85rem;
  font-weight: 600; color: var(--text-secondary);
}
.login-card input {
  width: 100%; padding: 13px 16px;
  background: var(--input-bg); border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.95rem;
  outline: none; transition: all 0.25s ease; font-family: inherit;
}
.login-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--input-focus);
}
.login-error {
  background: rgba(239,68,68,0.08); color: var(--danger);
  padding: 11px 14px; border-radius: var(--radius-xs);
  font-size: 0.85rem; margin-bottom: 18px;
  border: 1px solid rgba(239,68,68,0.2); display: none; font-weight: 500;
}
.login-card .btn-primary { width: 100%; padding: 13px; font-size: 0.95rem; margin-top: 6px; }

/* ==============================
   主面板 — 初始全隐藏，登录成功后加 .visible 才显示
   （防止"登录卡片 + 后台侧边栏/Dashboard 同时显示"的尴尬）
   ============================== */
.app-page { display: none; min-height: 100vh; }
.app-page.visible { display: flex; flex-direction: column; }

/* -- 导航栏 (Art Design Pro 风格  + 公司名 + 头像) -- */
.navbar {
  background: var(--nav-bg); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  padding: 0 20px 0 24px; height: 56px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.navbar .brand { display: flex; align-items: center; gap: 10px; }
.navbar .brand .icon {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  color: #4F46E5;
  border-radius: 10px;
}
.navbar .brand h1 {
  font-size: 1.02rem; font-weight: 700; color: var(--text); margin: 0;
  letter-spacing: 0.2px; line-height: 1.2;
}
.navbar .actions { display: flex; align-items: center; gap: 10px; }

/* — 用户头像 Chip — */
.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.user-chip:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--input-focus);
}
.avatar-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.82rem;
  background: linear-gradient(135deg,#4F46E5,#2563eb);
  box-shadow: 0 2px 6px rgba(37,99,235,0.35);
}
.user-chip .user-meta { line-height: 1.15; }
.user-chip .user-meta strong { font-size: 0.8rem; color: var(--text); display:block; font-weight:600;}
.user-chip .user-meta small  { font-size: 0.68rem; color: var(--text-muted); }
.user-chip .chev { font-size: 0.65rem; color: var(--text-muted); opacity: 0.7; }

/* -- 容器 -- */
.container { max-width: 1400px; margin: 0 auto; padding: 28px; }

/* ==============================
   标签切换
   ============================== */
.tabs-container {
  display: flex; align-items: center; margin-bottom: 24px; gap: 12px;
}
.tabs {
  display: inline-flex; gap: 2px; background: transparent;
  border-radius: 0; padding: 0;
  border: none; overflow-x: auto; max-width: 100%; flex: 1;
  border-bottom: 1px solid var(--card-border);
}
.tab {
  padding: 10px 18px; border-radius: 0;
  background: transparent; color: var(--text-muted);
  border: none; cursor: pointer; font-size: 0.88rem; white-space: nowrap;
  transition: all 0.2s ease; font-weight: 500;
  font-family: inherit; position: relative;
}
.tab:hover { color: var(--text); background: transparent; }
.tab.active {
  color: var(--primary); background: transparent;
  font-weight: 600;
}
.tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 60%; height: 2px; background: var(--primary); border-radius: 1px;
}
.tabs-container > a.btn-primary {
  flex-shrink: 0; font-size: 0.82rem; padding: 10px 16px; text-decoration: none;
}

/* ==============================
   工具栏
   ============================== */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  justify-content: space-between; margin-bottom: 22px;
}
.toolbar-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .search-icon {
  position: absolute; left: 13px; color: var(--text-muted);
  font-size: 0.85rem; pointer-events: none;
}
.toolbar input[type="text"] {
  padding: 8px 14px 8px 36px;
  background: var(--card-bg-solid); border: 1px solid var(--card-border);
  border-radius: var(--radius-xs); color: var(--text);
  font-size: 0.87rem; outline: none; min-width: 240px;
  transition: all 0.2s ease; font-family: inherit;
}
.toolbar input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--input-focus);
}
.toolbar input[type="text"]::placeholder { color: var(--text-muted); }

.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-badge {
  font-size: 0.78rem; color: var(--text-secondary);
  background: var(--bg-tertiary); padding: 5px 12px;
  border-radius: var(--radius-xs); border: 1px solid var(--card-border); font-weight: 500;
}

/* ---------- 筛选条（page-header 里，仅 CAD 模式显示） ---------- */
.filter-bar {
  width: 100%;
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 2px;
}
.filter-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.filter-label {
  font-size: 0.78rem; color: var(--text-muted); font-weight: 600;
  padding: 4px 2px; margin-right: 2px; white-space: nowrap;
}
.filter-chip {
  font-size: 0.78rem; font-weight: 500; font-family: inherit;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--bg-tertiary); color: var(--text-secondary);
  cursor: pointer; transition: all 0.18s ease;
  user-select: none; white-space: nowrap;
  line-height: 1.3;
}
.filter-chip:hover {
  color: var(--text); border-color: rgba(243,152,0,0.35);
  background: rgba(243,152,0,0.06);
}
.filter-chip.active {
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 6px rgba(249,115,22,0.25);
}

/* ==============================
   应用布局 — 双层侧边栏 (Dock + 白卡面板)
   参考图：左侧一列大图标 Dock + 右边白色菜单面板
   ============================== */
.app-page {
  min-height: 100vh;
}
.layout-wrap {
  display: flex; flex: 1;
  position: relative;
  background: #EEF2FF;  /* Dock 底色（CRM 同款浅蓝背景） */
}

/* ===== 侧边栏：单层白卡菜单面板（固定 248px） ===== */
.sidebar.menu-panel {
  width: 248px;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 56px; bottom: 0;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-left: none;
  border-radius: 0 14px 14px 0;
  margin: 12px 0 12px 0;
  display: flex; flex-direction: column;
  box-shadow: 6px 0 20px rgba(79,70,229,0.06), -2px 4px 18px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  z-index: 50;
  transition: width 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
}
/* 折叠面板：变窄显示图标列 */
.sidebar.collapsed.menu-panel {
  width: 64px;
}
.sidebar.collapsed .panel-head #panelTitle,
.sidebar.collapsed .panel-head .panel-tabs,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .menu-arrow,
.sidebar.collapsed .menu-dot,
.sidebar.collapsed .submenu,
.sidebar.collapsed .menu-badge,
.sidebar.collapsed .sidebar-footer {
  display: none !important;
}
.sidebar.collapsed .panel-collapse { transform: rotate(180deg); }
.sidebar.collapsed .menu-item,
.sidebar.collapsed .menu-parent {
  justify-content: center;
  padding: 0;
  height: 40px;
  gap: 0;
}
.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 8px 14px;
  border-bottom: 1px dashed #E5E7EB;
  margin-bottom: 4px;
  flex-shrink: 0;
}
#panelTitle {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}
.panel-tabs {
  margin-left: auto;
  display: inline-flex;
  background: #F3F4F6;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.panel-tab {
  padding: 4px 10px;
  border: none; background: transparent;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6B7280;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.panel-tab.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.panel-collapse {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
  background: #ffffff;
  color: #6B7280;
  font-size: 0.7rem;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
}
.panel-collapse:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* —— 菜单项（面板内） —— */
.sidebar-menu {
  flex: 1;
  padding: 8px 10px 14px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.menu-item {
  display: flex; align-items: center; gap: 11px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: #4B5563; font-size: 0.88rem;
  font-weight: 500; transition: all 0.18s ease;
  font-family: inherit; width: 100%; text-align: left;
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.menu-item:hover {
  background: #F3F4F6;
  color: #111827;
}
.menu-item.active {
  background: linear-gradient(90deg, #FFF7ED 0%, #FFEDD5 100%);
  color: #C2410C;
  font-weight: 700;
  border: 1px solid #FED7AA;
}
.menu-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
  line-height: 1;
}
.menu-text {
  flex: 1; overflow: hidden; text-overflow: ellipsis;
}
.menu-badge {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  letter-spacing: 0.3px;
}
.menu-badge.green { background: #10B981; }
.menu-badge.blue  { background: #2563EB; }
.menu-badge.red   { background: #EF4444; }
.menu-badge.orange{ background: #F59E0B; }

.sidebar.collapsed .menu-text,
.sidebar.collapsed .menu-arrow,
.sidebar.collapsed .menu-dot,
.sidebar.collapsed .submenu,
.sidebar.collapsed .menu-badge {
  display: none !important;
}
.sidebar.collapsed .menu-item,
.sidebar.collapsed .menu-parent {
  justify-content: center;
  padding: 0;
  height: 40px;
}
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px dashed #E5E7EB;
  flex-shrink: 0;
}
.sidebar-version {
  font-size: 0.72rem; color: #9CA3AF; text-align: center;
  letter-spacing: 0.3px;
}
.sidebar.collapsed .sidebar-footer {
  display: none;
}

/* -- 二级菜单 (面板内分组) -- */
.menu-group {
  display: flex; flex-direction: column;
  margin-top: 2px;
  position: relative;
}
.menu-parent {
  justify-content: flex-start;
  border-radius: 9px;
}
.menu-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.7;
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.32s cubic-bezier(.4,0,.2,1), opacity 0.22s ease;
  flex-shrink: 0;
  width: 18px; text-align: center;
  filter: drop-shadow(0 0 0 transparent);
}
.menu-parent:hover .menu-arrow { opacity: 1; }
.menu-group.collapsed .menu-arrow {
  transform: rotate(-90deg);
  background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.submenu {
  display: flex; flex-direction: column;
  overflow: hidden;
  /* max-height 由 JS _setSubmenuHeight 动态赋值（实际 scrollHeight），避免 1400px 大数值造成收起尾段拖沓感 */
  max-height: 0;
  transition: max-height 0.24s ease-out, padding 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
  padding: 6px 2px 8px 4px;
  gap: 2px;
  opacity: 1;
  margin-top: 2px;
  border-left: 2px dashed rgba(245,158,11,0.18);
  margin-left: 18px;
  position: relative;
  will-change: max-height;
  backface-visibility: hidden;
}
.menu-group.collapsed .submenu {
  padding: 0 2px 0 4px;
  opacity: 0.35;
  margin-top: 0;
  border-color: transparent;
}
.sub-item {
  position: relative;
  padding-left: 22px;
  padding-right: 12px;
  height: 34px;
  font-size: 0.84rem;
  gap: 9px;
  border-radius: 7px;
  color: #6B7280;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}
.sub-item::before {
  content: '';
  position: absolute;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #E5E7EB;
  transition: all 0.2s ease;
  box-shadow: 0 0 0 0 rgba(245,158,11,0);
}
.sub-item::after {
  content: none !important;
}
.menu-dot {
  width: 12px; height: 12px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.45;
  color: #9CA3AF;
  transition: all 0.2s ease;
}
.sub-item:hover {
  color: #111827;
  background: linear-gradient(90deg, rgba(255,247,237,0.65) 0%, rgba(255,237,213,0.35) 100%);
  border-color: rgba(254,215,170,0.6);
  transform: translateX(2px);
}
.sub-item:hover::before {
  background: #F59E0B;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.12);
  transform: translateY(-50%) scale(1.25);
}
.sub-item:hover .menu-dot { opacity: 0.95; color: #4B5563; }
.sub-item.active .menu-dot { opacity: 1; color: #C2410C; }
.sub-item.active {
  background: linear-gradient(90deg, #FFF7ED 0%, #FFEDD5 100%);
  color: #C2410C;
  font-weight: 600;
  border: 1px solid #FED7AA;
  box-shadow: 0 2px 6px rgba(234,88,12,0.08);
}
.sub-item.active::before {
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  box-shadow: 0 0 0 4px rgba(245,158,11,0.18);
  transform: translateY(-50%) scale(1.25);
  width: 7px; height: 7px;
}
/* 子菜单每项之间的细分隔线（非首尾/非选中项） */
.submenu .sub-item + .sub-item {
  border-top: 1px solid rgba(229,231,235,0.55);
  border-radius: 0;
  padding-top: 5px;
  margin-top: 3px;
}
.submenu .sub-item:first-child { border-top: none; margin-top: 0; padding-top: 0; border-top-left-radius: 7px; border-top-right-radius: 7px; }
.submenu .sub-item:last-child  { border-bottom-left-radius: 7px; border-bottom-right-radius: 7px; padding-bottom: 0; margin-bottom: 0; }

/* -- 三级菜单 (插卡式处理器子分类) -- */
.menu-group-inner {
  margin: 2px 0;
}
.menu-group-inner.collapsed > .submenu-inner {
  max-height: 0 !important;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-top: 0;
}
.submenu-inner {
  display: flex;
  flex-direction: column;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 2px solid rgba(243,152,0,0.3);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.24s ease-out, padding 0.2s ease, opacity 0.2s ease;
  padding-top: 2px;
  padding-bottom: 2px;
  opacity: 1;
}
.submenu-inner .sub-item {
  font-size: 0.82rem;
  padding: 6px 10px;
}
.submenu-inner .menu-dot {
  font-size: 0.7rem;
  color: #F59E0B;
}

/* -- 顶栏左侧 -- */
.nav-left {
  display: flex; align-items: center; gap: 14px;
}
.collapse-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--card-border);
  border-radius: var(--radius-xs); cursor: pointer; color: var(--text-secondary);
  font-size: 1rem; transition: all 0.18s ease;
}
.collapse-btn:hover {
  background: var(--hover-color); color: var(--primary);
  border-color: var(--primary);
}

/* -- 右侧主内容（避让单层面板 248px） -- */
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  margin-left: 248px;
  padding: 20px 24px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 16px;
  transition: margin-left 0.25s ease;
  min-width: 0;
}
.app-page.sidebar-collapsed .main-content {
  margin-left: 64px;  /* 折叠后窄列，保留图标 */
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--card-shadow);
}
.page-header .toolbar {
  border: none; box-shadow: none; padding: 0; margin: 0;
  background: transparent;
}

/* -- 旧的 .container 保留兼容 -- */
.container {
  padding: 28px; display: flex; flex-direction: column; gap: 20px;
  max-width: 100%; margin: 0 auto;
}
@media (min-width: 1400px) { .container { padding: 28px 40px; } }

/* ==============================
   表格 (Art Design Pro 风格)
   ============================== */
.table-wrap {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  overflow-x: auto; box-shadow: var(--card-shadow);
}
table {
  width: 100%; border-collapse: collapse; font-size: 0.87rem; min-width: 600px;
}
th {
  text-align: left; padding: 12px 16px; color: var(--text-muted);
  font-weight: 600; font-size: 0.75rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--card-border); white-space: nowrap;
  position: sticky; top: 0; z-index: 5;
}
td {
  padding: 12px 16px; border-bottom: 1px solid var(--card-border);
  vertical-align: middle; color: var(--text-secondary); transition: background 0.15s;
}
tr:last-child td { border-bottom: none; }

td .actions { display: flex; gap: 6px; }
td .actions .btn-outline {
  color: var(--primary); border-color: rgba(243,152,0,0.3);
}
td .actions .btn-outline:hover {
  background: rgba(243,152,0,0.08); border-color: var(--primary);
}
td .actions .btn-danger-btn {
  background: rgba(239,68,68,0.08); color: var(--danger);
  border: 1.5px solid rgba(239,68,68,0.25); box-shadow: none;
  padding: 5px 12px; font-size: 0.8rem; border-radius: var(--radius-xs);
  font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
td .actions .btn-danger-btn:hover {
  background: var(--danger); color: #fff; border-color: var(--danger);
}

.empty-row td {
  text-align: center; padding: 56px 20px; color: var(--text-muted);
}
.empty-row td .empty-icon { font-size: 42px; margin-bottom: 12px; opacity: 0.6; }
.empty-row td p { font-size: 0.95rem; font-weight: 500; }

/* ==============================
   模态框
   ============================== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px); z-index: 200;
  align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity 0.2s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 0; width: 100%; max-width: 620px; max-height: 88vh;
  overflow-y: auto; box-shadow: var(--card-shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.modal-overlay.active .modal { transform: translateY(0); }

/* 弹窗顶部栏 */
.modal-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 10;
  background: var(--card-bg-solid);
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-topbar h3 {
  font-size: 1.05rem; color: var(--text);
  font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px;
}
.modal-topbar h3::before {
  content: ''; width: 3px; height: 16px; border-radius: 2px;
  background: var(--primary); flex-shrink: 0;
}
.modal-topbar-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.modal-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--card-border); background: transparent;
  color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; line-height: 1; margin-left: 4px;
}
.modal-close-btn:hover {
  border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.06);
}

/* 弹窗内容区 */
.modal-body {
  padding: 24px 28px 20px;
}

/* 弹窗底部操作栏 */
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 28px;
  border-top: 1px solid var(--card-border);
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* 表单提示文字 */
.form-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== 系列级 CAD 图纸 - 上传区 ===== */
.sd-upload-zone {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-sm);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-secondary);
}
.sd-upload-zone:hover {
  border-color: var(--primary);
  background: rgba(243,152,0,0.04);
}
.sd-upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(243,152,0,0.08);
}
.sd-upload-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  line-height: 1;
}
.sd-upload-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.sd-upload-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.sd-file-picked {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.sd-file-picked-icon {
  font-size: 1rem;
}
.sd-file-picked-name {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-file-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 50%;
  transition: all 0.15s;
}
.sd-file-remove:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.1);
}

.sd-edit-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 16px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #92400E;
  line-height: 1.5;
}
.sd-edit-hint-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* 弹窗表单区域 */
#editForm, .modal > form {
  padding: 24px 28px 28px;
}
#editModal .modal, #deleteModal .modal, #pwdModal .modal, #importModal .modal {
  padding: 0;
}

.modal .form-group { margin-bottom: 18px; }
.modal label {
  display: block; margin-bottom: 7px; font-size: 0.82rem;
  font-weight: 600; color: var(--text-secondary);
}
.modal input, .modal textarea, .modal select {
  width: 100%; padding: 11px 14px;
  background: var(--bg); border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.92rem;
  outline: none; font-family: inherit; transition: all 0.25s ease;
}
.modal input:focus, .modal textarea:focus, .modal select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--input-focus);
}
.modal select {
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
.modal textarea { resize: vertical; min-height: 72px; }
.modal input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px; cursor: pointer;
  accent-color: var(--primary);
}
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal .form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--card-border);
}
.modal .form-actions .btn { min-width: 80px; }

/* ==============================
   Toast
   ============================== */
.toast {
  position: fixed; top: 24px; left: 50%;
  transform: translateX(-50%) translateY(-16px);
  padding: 13px 26px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; z-index: 300; display: none;
  box-shadow: var(--card-shadow-lg); max-width: 90vw; text-align: center;
  opacity: 0; transition: all 0.3s ease;
}
.toast.success { background: var(--banner-gradient); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.active { display: block; opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==============================
   加载
   ============================== */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 64px 20px; color: var(--text-muted); gap: 10px; font-size: 0.92rem;
}

/* ==============================
   CAD 预览
   ============================== */
.btn-cad-preview {
  background: none; border: 1px solid #e8ecf0; border-radius: 5px;
  padding: 2px 6px; font-size: 15px; line-height: 1;
  cursor: pointer; transition: all 0.2s; color: #f39800;
}
.btn-cad-preview:hover {
  border-color: #f39800; background: #fff8f0; transform: scale(1.12);
}
.no-cad {
  color: #bfc9d4; font-size: 12px; font-style: italic;
}
#cadPreviewBody svg {
  max-width: 100%; max-height: 70vh;
}

/* ==============================
   删除确认 / 修改密码模态框
   ============================== */
#deleteModal .modal { max-width: 380px; text-align: center; padding: 36px 32px; }
#deleteModal .modal h3 { justify-content: center; color: var(--danger); }
#deleteModal .modal h3::before { display: none; }
#deleteModal p { margin-bottom: 24px; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.7; }
#deleteModal .form-actions { justify-content: center; border-top: none; padding-top: 0; margin-top: 0; }

#pwdModal .modal { max-width: 400px; padding: 28px; }
#pwdModal .modal h3 { color: var(--warning); }

/* ==============================
   报价系统专用
   ============================== */
.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  min-width: 0;
}
@media (min-width: 1600px) {
  .quote-layout { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
}
.quote-form.card, .quote-list.card {
  background: #fff;
  border: 1px solid rgba(229,231,235,0.9);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(17,24,39,0.04), 0 2px 6px rgba(17,24,39,0.025);
  min-width: 0;
}
.quote-form h3, .quote-list h3 {
  font-size: 1rem; margin: 0 0 14px 0; color: #0F172A; font-weight: 700;
  letter-spacing: 0.1px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(226,232,240,0.95);
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.form-grid-2 label {
  display: flex !important;
  flex-direction: column;
  font-size: 0.76rem;
  color: #475569;
  gap: 5px;
  font-weight: 600;
  width: 100%;
  min-width: 0;
}
.form-grid-2 label > span,
.form-grid-2 label::before {
  content: none;
}
.form-grid-2 input, .form-grid-2 select {
  padding: 9px 12px;
  background: #F8FAFC;
  border: 1px solid rgba(203,213,225,0.9);
  border-radius: 10px;
  color: #0F172A;
  font-size: 0.86rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.form-grid-2 input:focus, .form-grid-2 select:focus {
  border-color: rgba(245,158,11,0.7);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.12);
}
.form-grid-2 select option { background: #fff; color: #0F172A; }

/* —— 新建报价预览卡片 —— */
.quote-preview {
  margin: 16px 0 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #FFFBF4 0%, #FFFFFF 100%);
  border: 1px solid rgba(254,215,170,0.8);
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.9;
  color: #334155;
  position: relative;
}
.quote-preview::before {
  content: '📝 报价预览';
  position: absolute;
  top: -9px; left: 14px;
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 4px rgba(234,88,12,0.18);
}
.quote-preview b { color: #9A3412; font-weight: 700; }

/* —— 历史报价单 —— */
.quote-list { min-width: 0; }
.quote-list .table-wrap {
  box-shadow: none;
  border: 1px solid rgba(226,232,240,0.9);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 1200px) {
  .quote-layout { grid-template-columns: 1fr; }
}

.data-table {
  width: 100%;
  min-width: 640px;   /* 历史报价至少要能完整显示 6 列，避免被父容器压成一列 */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}
.data-table th {
  position: sticky; top: 0;
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  text-align: left;
  padding: 10px 14px;
  color: #475569;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(226,232,240,0.95);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(241,245,249,0.95);
  color: #334155;
  transition: background 0.2s;
  vertical-align: top;
  white-space: nowrap;
}
.data-table tbody tr:hover td { background: #FFFBEB; }
.data-table tbody tr:last-child td { border-bottom: none; }
/* 报价清单列宽建议 */
.quote-list .data-table th:nth-child(1),
.quote-list .data-table td:nth-child(1) { min-width: 180px; white-space: normal; }
.quote-list .data-table th:nth-child(2),
.quote-list .data-table td:nth-child(2) { min-width: 160px; white-space: normal; }
.quote-list .data-table th:nth-child(3),
.quote-list .data-table td:nth-child(3) { min-width: 120px; }
.quote-list .data-table th:nth-child(4),
.quote-list .data-table td:nth-child(4) { min-width: 90px; text-align: right; }
.quote-list .data-table th:nth-child(5),
.quote-list .data-table td:nth-child(5) { min-width: 120px; text-align: right; }
.quote-list .data-table th:nth-child(6),
.quote-list .data-table td:nth-child(6) { min-width: 110px; }

/* ==============================
   批量导入模态框
   ============================== */
.import-content { padding: 20px 28px 24px; }
.import-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: var(--bg-tertiary); border-radius: var(--radius-sm);
  padding: 4px;
}
.import-tab {
  flex: 1; padding: 9px 16px; border: none; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-muted);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.import-tab.active {
  background: var(--banner-gradient); color: #fff;
  box-shadow: 0 2px 8px rgba(243,152,0,0.2);
}
.import-tab:hover:not(.active) { color: var(--text); }
.import-guide {
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 14px; line-height: 1.6;
}
.import-textarea {
  width: 100%; min-height: 220px; padding: 14px;
  background: var(--bg); border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.8rem; outline: none; resize: vertical;
  transition: border-color 0.25s;
}
.import-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--input-focus);
}
.file-drop-zone {
  border: 2px dashed var(--card-border); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; color: var(--text-muted);
  transition: all 0.25s; cursor: pointer;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--primary); background: rgba(243,152,0,0.03);
  color: var(--primary);
}
.file-drop-icon { font-size: 2.4rem; margin-bottom: 10px; opacity: 0.6; }
.file-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg-tertiary);
  border-radius: var(--radius-xs); font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 模板下载 */
.template-download-area {
  text-align: center; padding: 10px 0;
}
.template-info-card {
  background: var(--bg-tertiary); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); padding: 20px 24px;
  text-align: left; margin-bottom: 10px;
}
.template-info-card h4 {
  font-size: 1rem; color: var(--text); font-weight: 700; margin-bottom: 8px;
}
.template-info-card p {
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px;
}
.template-fields {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.template-fields .field-tag {
  display: inline-block; padding: 4px 10px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 20px; font-size: 0.72rem; color: var(--text-secondary);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }

/* 隐藏 number 输入框的 +/- 按钮 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ==============================
   响应式
   ============================== */
@media (max-width: 768px) {
  .navbar { padding: 0 14px; height: 56px; }
  .navbar .brand h1 { font-size: 0.95rem; }
  .navbar .brand .icon { width: 32px; height: 32px; font-size: 16px; }
  .user-tag { display: none; }

  .container { padding: 14px; }

  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 9px 12px; font-size: 0.8rem; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-direction: column; align-items: stretch; }
  .search-box, .toolbar input[type="text"] { min-width: auto; width: 100%; }

  .modal { max-height: 92vh; }
  .modal-topbar { padding: 16px 18px; }
  #editForm, .modal > form { padding: 18px; }
  .modal .form-row { grid-template-columns: 1fr; }
  .modal .form-actions { flex-direction: column-reverse; }
  .modal .form-actions .btn { width: 100%; }
  .modal-topbar-actions { gap: 6px; }
  .modal-topbar-actions .btn-sm { padding: 5px 10px; font-size: 0.75rem; }

  .login-card { padding: 32px 22px; }
  .login-card .logo h1 { font-size: 1.4rem; }

  .tabs-container { flex-direction: column; align-items: stretch; }
  .tabs-container > a.btn-primary { margin-left: 0; }

  .quote-layout { grid-template-columns: 1fr; }
}

/* ==============================
   CAD 悬停预览 Tooltip
   ============================== */
.cad-tooltip {
  position: absolute; z-index: 9999;
  width: 520px; height: 360px;
  background: #111; border: 1px solid #333;
  border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  overflow: hidden; display: none; pointer-events: auto;
  padding: 6px; box-sizing: border-box;
}
.cad-tooltip.active { display: block; }
.cad-tooltip svg {
  width: 100%; height: 100%; display: block;
  background: #111; border: none; border-radius: 4px;
}
@media (max-width: 768px) {
  .cad-tooltip { width: 90vw; left: 5vw !important; }
}

/* ==============================
   批量管理工具栏 & 选择列
   ============================== */
#batchToolbar {
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px;
  background: #fff7ed; border: 1px solid #fed7aa;
  font-size: 0.85rem;
  box-shadow: 0 -4px 20px rgba(249, 115, 22, 0.15);
  animation: batchSlideUp 0.2s ease;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
}
@keyframes batchSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#batchToolbar .batch-count {
  color: #9a3412; font-weight: 500;
}
#batchToolbar .batch-count b {
  color: #c2410c; font-weight: 700; margin: 0 2px;
}
#batchToolbar .batch-actions {
  display: flex; align-items: center; gap: 8px;
}
.batch-btn {
  padding: 5px 14px; border: none; border-radius: 5px;
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.batch-btn:active { transform: scale(0.97); }
.batch-delete {
  background: #ef4444; color: #fff;
}
.batch-delete:hover { background: #dc2626; }
.batch-cancel {
  background: #fff; color: #475569; border: 1px solid #e2e8f0;
}
.batch-cancel:hover { background: #f8fafc; }
.col-cb { width: 40px; text-align: center; }
.col-cb input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer; accent-color: #f39800;
}

/* ==============================
   CAD 模型图库（卡片网格布局）
   ============================== */
/* ====== CAD 型号分组（折叠） ====== */
.cad-group {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17,24,39,0.04);
}
.cad-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  background: linear-gradient(180deg, #FFFBF4 0%, rgba(255,255,255,1) 100%);
  border-bottom: 1px solid rgba(229,231,235,0.8);
  cursor: pointer; user-select: none;
  transition: background .2s ease;
}
.cad-group-head:hover { background: linear-gradient(180deg, #FEF3E2 0%, #FFFFFF 100%); }
.cad-group-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.cad-group-right { display: flex; align-items: center; gap: 8px; }
.cad-group-toggle-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(245,158,11,0.1);
  color: #B45309; font-size: 0.7rem; font-weight: 700;
  flex: 0 0 22px;
}
.cad-group-title {
  font-size: 0.95rem; font-weight: 700; color: #111827;
  letter-spacing: 0.1px;
}
.cad-group-count {
  font-size: 0.75rem; color: #6B7280;
  background: rgba(107,114,128,0.08);
  padding: 2px 10px; border-radius: 999px;
  font-weight: 500;
}
.cad-group-sub {
  font-size: 0.72rem; color: #9CA3AF;
  letter-spacing: 0.1px;
}
.cad-group-body { padding: 10px 12px 12px; }

/* ====== CAD 卡片网格（5 列默认） ====== */
.cad-grid {
  display: grid;
  gap: 12px;
  padding: 2px;
}
/* 5 列（固定）— 默认启用 */
.cad-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* 自适应备选（用户点按钮切过去） */
.cad-grid-auto { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ====== CAD 卡片：基础样式（所有尺寸共享） ====== */
.cad-card {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(17,24,39,0.04), 0 2px 6px rgba(17,24,39,0.03);
  overflow: hidden; cursor: pointer;
  transition: all 0.28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  position: relative;
}
.cad-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, rgba(245,158,11,0) 0%, rgba(245,158,11,0.55) 50%, rgba(245,158,11,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cad-card:hover {
  border-color: rgba(245,158,11,0.4);
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.08), 0 4px 10px rgba(234, 88, 12, 0.04);
  transform: translateY(-2px);
}
.cad-card:hover::before { opacity: 1; }
.cad-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 15px 18px 13px;
  background: linear-gradient(180deg, #FFFBF4 0%, rgba(255,251,244,0) 100%);
  border-bottom: 1px solid rgba(229,231,235,0.75);
  gap: 12px;
}
.cad-card-name {
  font-size: 0.94rem; font-weight: 700; color: #111827;
  margin-bottom: 4px; letter-spacing: 0.1px;
}
.cad-card-sub {
  font-size: 0.76rem; color: #6B7280;
  background: rgba(107,114,128,0.06);
  display: inline-block;
  padding: 2px 8px; border-radius: 999px; margin-top: 2px;
}
.cad-tag {
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
  border: 1px solid transparent;
  letter-spacing: 0.2px;
  backdrop-filter: blur(6px);
}
.cad-tag.success {
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(5,150,105,0.08));
  color: #047857; border-color: rgba(16,185,129,0.25);
}
.cad-tag.warning {
  background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(217,119,6,0.08));
  color: #B45309; border-color: rgba(245,158,11,0.3);
}
.cad-tag.danger {
  background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(220,38,38,0.06));
  color: #B91C1C; border-color: rgba(239,68,68,0.25);
}
.cad-card-thumbs {
  padding: 14px 16px 16px;
  flex: 1; min-height: 180px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #FAFBFC;
  border-bottom: 1px solid rgba(229,231,235,0.75);
}
.cad-thumb {
  background: #fff;
  border: 1px solid rgba(229,231,235,0.9);
  border-radius: 10px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255,255,255,1);
  transition: all 0.22s ease;
}
.cad-thumb:hover {
  border-color: rgba(245,158,11,0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,158,11,0.08), inset 0 1px 0 rgba(255,255,255,1);
}
.cad-thumb-title {
  padding: 5px 9px; font-size: 0.7rem;
  color: #4B5563; font-weight: 600;
  background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
  border-bottom: 1px solid rgba(229,231,235,0.8);
  display: flex; align-items: center; justify-content: space-between;
}
.cad-thumb svg { width: 100%; height: 72px; display: block; padding: 4px; }
.cad-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #6B7280; font-size: 0.85rem;
  grid-column: 1 / -1;
  background: repeating-linear-gradient(135deg, rgba(249,250,251,1) 0px, rgba(249,250,251,1) 12px, rgba(243,244,246,0.7) 12px, rgba(243,244,246,0.7) 24px);
  border: 1px dashed rgba(209,213,219,0.8);
  border-radius: 10px;
  min-height: 170px; font-weight: 500;
}
.cad-empty-sub { font-size: 0.7rem; color: #9CA3AF; margin-top: 6px; opacity: 0.85; }
.cad-card-foot {
  padding: 11px 18px 13px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; background: #fff;
}
.cad-file-info {
  font-size: 0.74rem; color: #6B7280;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
  background: rgba(107,114,128,0.05);
  padding: 4px 9px; border-radius: 7px;
  border: 1px solid rgba(229,231,235,0.75);
}

@media (max-width: 768px) {
  .cad-tooltip { max-width: 90vw; left: 5vw !important; }
}

/* ====== 小尺寸卡片 cad-card-sm（在基础样式之上做紧凑覆盖） ====== */
.cad-card-sm { border-radius: 12px; }
.cad-card-sm::before { height: 2px; }
.cad-card-head-sm { padding: 9px 12px 8px; gap: 8px; }
.cad-card-head-col { min-width: 0; flex: 1; }
.cad-card-name-sm {
  font-size: 0.8rem; line-height: 1.25;
  margin-bottom: 2px;
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cad-card-sub-sm { font-size: 0.65rem; padding: 1px 7px; margin-top: 1px; }
.cad-tag { padding: 3px 8px; font-size: 0.65rem; }
.cad-card-thumbs-sm { padding: 8px; gap: 6px; min-height: 0; display: block; }

/* 系列卡片专属覆盖 */
.cad-series-card .cad-card-head-sm {
  padding: 8px 12px 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.cad-series-card .cad-card-title-sm {
  font-size: 0.85rem; font-weight: 700; color: #111827;
}
.cad-series-card .cad-card-tags-sm { display: flex; gap: 4px; }

/* 整体预览图 —— 覆盖 grid 为 block，让大图独占一行 */
.cad-series-card .cad-card-thumbs {
  display: block;
  padding: 8px 10px;
  min-height: 160px;
}
.cad-full-preview {
  display: block;
  width: 100%;
  padding: 4px;
}
.cad-full-preview svg {
  width: 100%;
  height: auto;
  max-height: 220px;
  display: block;
  border: 1px solid rgba(229,231,235,0.6);
  border-radius: 8px;
  background: #fff;
}

.cad-series-card .cad-card-foot-sm {
  padding: 6px 10px 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.cad-series-card .cad-card-name-sm {
  font-size: 0.72rem; color: #6B7280;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(107,114,128,0.05);
  padding: 3px 8px; border-radius: 6px;
}
.cad-series-card .cad-card-btns-sm {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.cad-series-card .cad-card-btns-sm .btn {
  font-size: 0.65rem; padding: 3px 8px; line-height: 1.3;
}

.cad-thumb { border-radius: 8px; }
.cad-thumb-title {
  padding: 3px 7px; font-size: 0.65rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px;
}
.cad-thumb-title > span { font-size: 0.62rem; color: #9CA3AF; font-weight: 500; }
.cad-thumb svg { width: 100%; height: 56px; display: block; padding: 3px; }
.cad-thumb-fallback {
  padding: 10px 6px; text-align: center; color: #6B7280; font-size: 0.7rem;
  background: repeating-linear-gradient(135deg, #F9FAFB 0, #F9FAFB 10px, #F3F4F6 10px, #F3F4F6 20px);
  border-radius: 6px; margin: 5px;
  display: flex; align-items: center; justify-content: center;
  flex: 1; min-height: 48px; white-space: nowrap;
}
.cad-empty { padding: 14px 8px; min-height: 120px; font-size: 0.78rem; gap: 4px; }
.cad-empty > span:first-child { font-size: 1.35rem; }
.cad-empty-sub { font-size: 0.65rem; margin-top: 2px; }
.cad-card-foot-sm { padding: 8px 10px 9px; gap: 8px; }
.cad-file-info-sm { font-size: 0.65rem; padding: 3px 7px; }
.btn-xs {
  padding: 3px 8px; font-size: 0.68rem;
  border-radius: 6px; line-height: 1.5; white-space: nowrap;
}
.btn-ghost {
  background: transparent;
  color: #6B7280;
  border: 1px solid rgba(107,114,128,0.2);
}
.btn-ghost:hover { background: rgba(107,114,128,0.06); }


/* 窄屏降级：5 列在窄屏自动降为 3/2/1 列，避免卡片被挤到无法读 */
@media (max-width: 1440px) {
  .cad-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .cad-grid-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .cad-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cad-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 480px) {
  .cad-grid-5 { grid-template-columns: 1fr; }
}


/* ==============================
   CAD 模型图 编辑弹窗（重新排版）
   ============================== */
.cad-edit-card {
  background: #fff;
  border: 1px solid rgba(229,231,235,0.85);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(17,24,39,0.03);
}
.cad-edit-card.product-card {
  background: linear-gradient(135deg, #FFFBF4 0%, #FFFFFF 60%, #F0F9FF 100%);
  border: 1px solid rgba(254,215,170,0.7);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cad-card-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cad-edit-icon {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FDE68A 0%, #FDBA74 100%);
  color: #92400E; font-size: 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.cad-edit-title { font-size: 0.72rem; color: #92400E; font-weight: 600; letter-spacing: 0.5px; margin-bottom: 3px; opacity: 0.85; text-transform: uppercase; }
.cad-edit-sub { font-size: 0.9rem; color: #111827; font-weight: 600; line-height: 1.35; word-break: break-all; }
.cad-edit-chip {
  padding: 5px 11px; border-radius: 999px;
  background: rgba(15,23,42,0.04);
  color: #334155;
  border: 1px solid rgba(148,163,184,0.25);
  font-size: 0.72rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%;
}
.cad-edit-section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(226,232,240,0.9);
}
.cad-edit-section-title > span:first-child {
  font-size: 0.9rem; font-weight: 700; color: #111827; letter-spacing: 0.1px;
}
.cad-edit-desc { font-size: 0.72rem; color: #94A3B8; white-space: nowrap; }

.cad-upload-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cad-file-pick {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(245,158,11,0.6);
  background: linear-gradient(180deg, #FFFBF4 0%, #FFF7ED 100%);
  color: #9A3412; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s ease;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.cad-file-pick:hover {
  border-color: rgba(234,88,12,0.7);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(234,88,12,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}
.cad-file-pick input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.cad-file-picked {
  flex: 1; min-width: 180px;
  padding: 7px 12px;
  background: #F8FAFC;
  border: 1px solid rgba(226,232,240,0.9);
  border-radius: 9px;
  font-size: 0.8rem; color: #334155;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cad-upload-main {
  padding: 8px 16px; font-size: 0.84rem; font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(234,88,12,0.14);
  flex: 0 0 auto;
}
.cad-ghost-btn {
  flex: 0 0 auto;
}

.cad-tip-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px;
}
.cad-tip {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.75rem; color: #475569;
  line-height: 1.55;
  border: 1px solid rgba(226,232,240,0.75);
  background: #FBFCFD;
}
.cad-tip b { color: #0F172A; margin-right: 2px; }
.cad-tip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex: 0 0 auto; margin-top: 6px;
  background: #CBD5E1;
  box-shadow: 0 0 0 3px rgba(148,163,184,0.12);
}
.cad-tip.green { border-color: rgba(16,185,129,0.22); background: linear-gradient(180deg, #ECFDF5 0%, #F0FDF4 100%); }
.cad-tip.green b { color: #065F46; }
.cad-tip.green .cad-tip-dot { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,0.14); }
.cad-tip.orange { border-color: rgba(245,158,11,0.22); background: linear-gradient(180deg, #FFF7ED 0%, #FFFBEB 100%); }
.cad-tip.orange b { color: #9A3412; }
.cad-tip.orange .cad-tip-dot { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,0.14); }
@media (max-width: 560px) {
  .cad-tip-row { grid-template-columns: 1fr; }
  .cad-file-picked { min-width: 100%; order: 3; flex: 0 0 100%; }
  .cad-upload-main { order: 2; }
}

#cadImgPreviewBox {
  padding: 10px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid rgba(226,232,240,0.85);
  text-align: center;
}
#cadImgPreview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid rgba(203,213,225,0.8);
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,0.05);
}

.cad-template-status {
  padding: 14px 16px;
  border: 1px solid rgba(226,232,240,0.85);
  border-radius: 10px;
  font-size: 0.82rem;
  background: linear-gradient(180deg, #FBFCFD 0%, #FFFFFF 100%);
  min-height: 160px;
}


/* ==============================
   详情抽屉 (RuoYi 风格)
   ============================== */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(2px);
  z-index: 250; opacity: 0; transition: opacity 0.3s ease;
}
.drawer-overlay.active { display: block; opacity: 1; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 90vw;
  background: var(--bg); z-index: 251;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,0.12);
}
.drawer.active { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}
.drawer-header h3 {
  font-size: 1.1rem; font-weight: 600; color: var(--text);
  margin: 0;
}
.drawer-close {
  background: none; border: none; font-size: 1.6rem;
  color: var(--text-muted); cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: all 0.2s; line-height: 1;
}
.drawer-close:hover { background: var(--bg-tertiary); color: var(--text); }

.drawer-body {
  flex: 1; overflow-y: auto; padding: 20px 24px;
}

.drawer-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px; border-top: 1px solid var(--card-border);
  flex-shrink: 0; background: var(--bg-secondary);
}

/* 详情区块 */
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  margin-bottom: 10px; padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.detail-items {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--card-bg-solid); border-radius: 8px;
  overflow: hidden; border: 1px solid var(--card-border);
}
.detail-item {
  padding: 10px 14px; border-bottom: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
}
.detail-item:nth-child(2n) { border-right: none; }
.detail-item-full { grid-column: 1 / -1; border-right: none; }
.detail-label {
  display: block; font-size: 0.72rem; color: var(--text-muted);
  margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.3px;
}
.detail-value {
  display: block; font-size: 0.88rem; color: var(--text);
  font-weight: 500; word-break: break-all;
}

/* ==============================
   表格增强 (RuoYi 风格)
   ============================== */
.data-row { cursor: pointer; transition: background 0.15s; }
.data-row:hover td { background: rgba(243,152,0,0.04); }
.data-row:active td { background: rgba(243,152,0,0.08); }

tr:nth-child(even) td { background: rgba(0,0,0,0.015); }
[data-theme="dark"] tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tr:hover td { background: rgba(243,152,0,0.04) !important; }

.cat-badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 10px; font-size: 0.75rem; font-weight: 600;
  white-space: nowrap;
}

.row-actions { display: flex; gap: 6px; }

/* 表格最小宽度减小（列少了） */
table { min-width: 600px; }

/* ==============================
   处理器分类筛选 pill 标签
   ============================== */
.proc-filter-bar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.proc-filter-pill {
  padding: 5px 14px; border-radius: 16px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--card-border); background: var(--card-bg-solid);
  color: var(--text-secondary); transition: all 0.2s;
  font-family: inherit;
}
.proc-filter-pill:hover { border-color: var(--primary); color: var(--primary); }
.proc-filter-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(243,152,0,0.25);
}
.proc-filter-pill .count {
  display: inline-block; margin-left: 4px;
  font-size: 0.72rem; opacity: 0.8;
}

/* ==============================
   Dashboard 数据概览
   ============================== */
.dashboard-root {
  display: flex; flex-direction: column;
  gap: 18px;
}
.dashboard-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.dashboard-head h2 {
  font-size: 1.15rem; margin: 0; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
.dashboard-head .sub {
  font-size: 0.78rem; color: var(--text-muted); font-weight: normal;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 18px 16px 18px;
  position: relative; overflow: hidden;
  transition: all 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.stat-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.stat-card-label {
  font-size: 0.82rem; color: var(--text-muted); font-weight: 500;
}
.stat-card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.stat-card-icon.blue   { background: rgba(37,99,235,0.10); color: #2563eb; }
.stat-card-icon.green  { background: rgba(16,185,129,0.10); color: #10b981; }
.stat-card-icon.orange { background: rgba(243,152,0,0.10); color: #f39800; }
.stat-card-icon.cyan   { background: rgba(14,165,233,0.10); color: #0ea5e9; }
.stat-card-icon.violet { background: rgba(139,92,246,0.10); color: #8b5cf6; }
.stat-card-value {
  font-size: 1.8rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.5px; line-height: 1.2;
}
.stat-card-delta {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}
.stat-card-delta.up { color: #10b981; background: rgba(16,185,129,0.08); }
.stat-card-delta.down { color: #ef4444; background: rgba(239,68,68,0.08); }
.stat-card-delta.flat { color: var(--text-muted); background: var(--hover-color); }

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dashboard-card {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
}
.dashboard-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.dashboard-card-head h4 {
  margin: 0; font-size: 0.96rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.dashboard-card-head .tag {
  font-size: 0.72rem; color: #10b981; font-weight: 500;
}
.chart-wrap {
  position: relative;
  height: 280px;
}
.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.overview-strip-item {
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
}
.overview-strip-item .label {
  font-size: 0.74rem; color: var(--text-muted); margin-bottom: 6px;
}
.overview-strip-item .value {
  font-size: 1.3rem; font-weight: 700; color: var(--text);
}
.overview-strip-item .delta {
  font-size: 0.72rem; margin-top: 4px; font-weight: 500;
}
.overview-strip-item .delta.up { color: #10b981; }
.overview-strip-item .delta.down { color: #ef4444; }

.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* 板块热度排行条 */
.rank-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--card-border);
}
.rank-row:last-child { border-bottom: none; }
.rank-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rank-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF); font-size: 1rem;
}
.rank-label { font-size: 0.85rem; color: var(--text); font-weight: 500; }
.rank-right { display: flex; align-items: center; gap: 10px; flex: 1; margin-left: 18px; }
.rank-bar {
  flex: 1; max-width: 260px;
  height: 7px; border-radius: 999px; background: var(--hover-color); overflow: hidden;
}
.rank-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, rgba(245,158,11,0.9), rgba(239,68,68,0.85));
  border-radius: 999px;
}
.rank-count { font-size: 0.78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }

/* 操作痕迹时间线 */
.timeline { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.tl-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  gap: 8px; align-items: center;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.8rem;
}
.tl-row:hover { background: var(--bg-secondary); }
.tl-chip {
  padding: 2px 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600;
  background: rgba(37,99,235,0.10); color: #2563eb;
  white-space: nowrap;
}
.tl-chip.mod-led        { background: rgba(37,99,235,0.10); color: #2563eb; }
.tl-chip.mod-processor  { background: rgba(139,92,246,0.10); color: #8b5cf6; }
.tl-chip.mod-peripheral { background: rgba(14,165,233,0.10); color: #0ea5e9; }
.tl-chip.mod-cad        { background: rgba(16,185,129,0.10); color: #10b981; }
.tl-chip.mod-quote      { background: rgba(245,158,11,0.10); color: #f39800; }
.tl-chip.mod-dashboard  { background: rgba(71,85,105,0.10); color: #475569; }
.tl-chip.mod-auth       { background: rgba(239,68,68,0.10); color: #ef4444; }
.tl-chip.mod-sim        { background: rgba(236,72,153,0.10); color: #ec4899; }
.tl-chip.mod-steel      { background: rgba(5,150,105,0.10);  color: #059669; }
.tl-dot { color: #cbd5e1; font-size: 0.5rem; }
.tl-action { font-weight: 500; color: var(--text); }
.tl-obj { color: var(--primary); font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 0.75rem; }
.tl-ua  { color: var(--text-muted); font-size: 0.72rem; }
.tl-time{ color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 分布区块（设备 / 浏览器 / 来源） */
.dist-block { display: flex; flex-direction: column; gap: 8px; }
.dist-title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.dist-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.dist-k { font-size: 0.8rem; color: var(--text); }
.dist-bar {
  height: 6px; border-radius: 999px; background: var(--hover-color); overflow: hidden;
}
.dist-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, rgba(37,99,235,0.95), rgba(139,92,246,0.9));
  border-radius: 999px;
}
.dist-v {
  font-size: 0.76rem; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 100px; text-align: right;
}
.dashboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}
.dashboard-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding: 10px 12px;
  font-size: 0.76rem;
  border-bottom: 1px solid var(--card-border);
}
.dashboard-table td {
  padding: 10px 12px;
  border-bottom: 1px dashed var(--card-border);
  color: var(--text);
}
.dashboard-table tr:last-child td { border-bottom: none; }
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 0.75rem;
}
.activity-list {
  display: flex; flex-direction: column; gap: 12px;
  list-style: none; padding: 0; margin: 0;
}
.activity-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.82rem;
  color: var(--text);
}
.activity-dot {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  background: rgba(37,99,235,0.08);
  color: #2563eb;
  flex-shrink: 0;
}
.activity-list .meta {
  font-size: 0.7rem; color: var(--text-muted); margin-top: 3px;
}
.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  margin-bottom: 8px;
  font-size: 0.84rem;
}
.todo-item input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--primary);
}
.todo-item.done { opacity: 0.6; text-decoration: line-through; }
.tab-btns {
  display: inline-flex; gap: 0;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}
.tab-btns button {
  background: transparent; border: none; cursor: pointer;
  padding: 5px 14px; font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: inherit; font-weight: 500;
}
.tab-btns button.active {
  background: var(--primary); color: #fff;
}

/* Dashboard 响应式 */
@media (max-width: 1280px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .overview-strip { grid-template-columns: repeat(2, 1fr); }
  .dashboard-row { grid-template-columns: 1fr; }
  .dashboard-bottom-row { grid-template-columns: 1fr; }
}
