/* ================== 基础变量 - 工业实用主义风格 ================== */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

:root {
  /* 主色调 - 深蓝灰工业风 */
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --primary-600: #475569;
  --primary-500: #64748b;
  --primary-400: #94a3b8;
  --primary-300: #cbd5e1;
  --primary-200: #e2e8f0;
  --primary-100: #f1f5f9;
  --primary-50: #f8fafc;
  
  /* 功能色 */
  --accent-blue: #3b82f6;
  --accent-blue-dark: #2563eb;
  --accent-blue-light: #60a5fa;
  --success: #10b981;
  --success-dark: #059669;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --info: #06b6d4;
  
  /* 语义色 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;
  
  --border-primary: #e2e8f0;
  --border-secondary: #cbd5e1;
  --border-focus: #3b82f6;
  
  /* 阴影 - 更克制的工业风格 */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* 圆角 - 更克制的工业风格 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* 布局尺寸 */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --spacing-unit: 4px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
}

#app {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ================== 登录页面 ================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0066cc 0%, #0088ff 50%, #00aaff 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.login-box {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-primary);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img {
  max-width: 160px;
  height: auto;
  margin-bottom: 20px;
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-logo p {
  color: var(--text-tertiary);
  margin-top: 8px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--border-secondary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* ================== 按钮系统 - 多样化设计 ================== */

/* 基础按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  transition: all 0.15s ease-in-out;
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 按钮尺寸 */
.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* 1. 填充式按钮 - 主要操作 */
.btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-blue-dark);
  border-color: var(--accent-blue-dark);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-success:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
  box-shadow: var(--shadow-md);
}

.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
  background: var(--warning-dark);
  border-color: var(--warning-dark);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  background: var(--danger-dark);
  border-color: var(--danger-dark);
  box-shadow: var(--shadow-md);
}

.btn-dark {
  background: var(--primary-800);
  border-color: var(--primary-800);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-dark:hover {
  background: var(--primary-900);
  border-color: var(--primary-900);
  box-shadow: var(--shadow-md);
}

/* 2. 描边按钮 - 次要操作 */
.btn-outline-primary {
  background: transparent;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-outline-primary:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--text-inverse);
}

.btn-outline-success {
  background: transparent;
  border-color: var(--success);
  color: var(--success);
}

.btn-outline-success:hover {
  background: var(--success);
  border-color: var(--success);
  color: var(--text-inverse);
}

.btn-outline-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text-inverse);
}

.btn-outline-secondary {
  background: transparent;
  border-color: var(--border-secondary);
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-400);
  color: var(--text-primary);
}

/* 3. 幽灵按钮 - 第三级操作 */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-ghost-primary {
  background: rgba(59, 130, 246, 0.1);
  border-color: transparent;
  color: var(--accent-blue);
}

.btn-ghost-primary:hover {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue-dark);
}

.btn-ghost-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: transparent;
  color: var(--success);
}

.btn-ghost-success:hover {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-dark);
}

.btn-ghost-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: transparent;
  color: var(--danger);
}

.btn-ghost-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger-dark);
}

/* 4. 文字按钮 - 最轻量操作 */
.btn-text {
  background: transparent;
  border-color: transparent;
  color: var(--accent-blue);
  padding: 4px 8px;
}

.btn-text:hover {
  background: rgba(59, 130, 246, 0.1);
  text-decoration: none;
}

.btn-text-danger {
  color: var(--danger);
}

.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* 按钮组 */
.btn-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.btn-group-vertical {
  flex-direction: column;
  align-items: stretch;
}

.btn-group .btn:not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* ================== 主应用布局 ================== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow-xs);
}

.header-content {
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  width: 40px;
  height: 40px;
}

.menu-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.header-logo {
  height: 36px;
  object-fit: contain;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.user-role {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-primary);
}

.user-role.admin {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.2);
}

.btn-logout {
  padding: 8px 16px;
  font-size: 13px;
}

/* 主内容区域 */
.main-container {
  display: flex;
  flex: 1;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-primary);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: width 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sidebar-header p {
  font-size: 13px;
  color: var(--text-tertiary);
}

.sidebar-menu {
  list-style: none;
  padding: 12px 0;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  position: relative;
}

.sidebar-menu-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-menu-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  font-weight: 500;
}

.sidebar-menu-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-blue);
  border-radius: 0 3px 3px 0;
}

.sidebar-menu-item .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* 主内容 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  background: var(--bg-secondary);
  min-height: calc(100vh - var(--header-height));
}

/* ================== 页面头部 ================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-primary);
  gap: 16px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-description {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ================== 卡片系统 ================== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-primary);
  padding: 24px;
  margin-bottom: 24px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ================== 统计卡片网格 ================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-primary);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-blue);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-card h3 {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}

.stat-change {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================== 欢迎区域 ================== */
.welcome-section {
  background: linear-gradient(135deg, #0066cc 0%, #0088ff 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.welcome-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
}

.welcome-section p {
  opacity: 0.8;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

/* ================== 表格系统 ================== */
.table-container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-primary);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
  max-height: 65vh;
  overflow-y: auto;
}

/* 表头固定样式 */
.table-responsive table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.table-responsive thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-responsive th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
}

.table-responsive td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  vertical-align: middle;
}

.table-responsive tbody tr {
  transition: background 0.15s;
}

.table-responsive tbody tr:hover {
  background: var(--bg-secondary);
}

.table-responsive tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}

.table-responsive tbody tr:nth-child(even):hover {
  background: var(--bg-secondary);
}

.table-responsive tbody tr:last-child td {
  border-bottom: none;
}

/* 表格中的操作按钮 */
.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.table-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
}

.empty-message {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
}

/* ================== 状态标签 - 全新设计 ================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* 设备状态 */
.status-已入库 {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

.status-已入库::before {
  background: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.status-已出库 {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-dark);
}

.status-已出库::before {
  background: var(--warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.status-已安装 {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-dark);
}

.status-已安装::before {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.status-有维修 {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.status-有维修::before {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* 客户状态 */
.status-未成交 {
  background: rgba(100, 116, 139, 0.1);
  color: var(--primary-600);
}

.status-未成交::before {
  background: var(--primary-500);
}

/* 状态标签样式类 */
.status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-dark);
}

.status-warning::before {
  background: var(--warning);
}

.status-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-dark);
}

.status-success::before {
  background: var(--success);
}

.status-info {
  background: rgba(6, 182, 212, 0.1);
  color: var(--info);
}

.status-info::before {
  background: var(--info);
}

.status-primary {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

.status-primary::before {
  background: var(--accent-blue);
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.status-error::before {
  background: var(--danger);
}

.status-已成交 {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-dark);
}

.status-已成交::before {
  background: var(--success);
}

.status-已失效 {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.status-已失效::before {
  background: var(--danger);
}

/* ================== 客户标签 - B端/C端等级颜色 ================== */
.customer-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* B端标签 - 蓝色系，S最深C最浅 */
.tag-b-s {
  background: #1e3a5f;
  color: #ffffff;
  border: 1px solid #1e3a5f;
}

.tag-b-a {
  background: #3b82f6;
  color: #ffffff;
  border: 1px solid #3b82f6;
}

.tag-b-b {
  background: #93c5fd;
  color: #1e3a5f;
  border: 1px solid #60a5fa;
}

.tag-b-c {
  background: #dbeafe;
  color: #1e3a5f;
  border: 1px solid #bfdbfe;
}

/* C端标签 - 绿色系，S最深C最浅 */
.tag-c-s {
  background: #064e3b;
  color: #ffffff;
  border: 1px solid #064e3b;
}

.tag-c-a {
  background: #10b981;
  color: #ffffff;
  border: 1px solid #10b981;
}

.tag-c-b {
  background: #6ee7b7;
  color: #064e3b;
  border: 1px solid #34d399;
}

.tag-c-c {
  background: #d1fae5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
}

/* 同行标签 */
.tag-tonghang {
  background: #f59e0b;
  color: #ffffff;
  border: 1px solid #f59e0b;
}

/* ================== 表单系统 ================== */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border-primary);
}

.form-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-primary);
}

/* ================== 筛选栏 ================== */
.filter-bar {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  flex: 1;
}

.filter-item label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-item input,
.filter-item select {
  padding: 10px 14px;
  border: 1.5px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-primary);
  transition: all 0.2s;
}

.filter-item input:focus,
.filter-item select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filter-actions {
  display: flex;
  gap: 10px;
}

/* ================== 搜索框 ================== */
.search-box {
  position: relative;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s;
  background: var(--bg-primary);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* ================== 分页组件 - 全新设计 ================== */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0;
  margin-top: 20px;
  border-top: 1px solid var(--border-primary);
  flex-wrap: wrap;
  gap: 16px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-tertiary);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-primary);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--border-secondary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.page-btn.nav {
  padding: 0 14px;
  font-size: 12px;
}

.page-btn.nav i {
  font-size: 12px;
}

.page-btn.ellipsis {
  cursor: default;
  border-color: transparent;
  background: transparent;
}

.page-btn.ellipsis:hover {
  background: transparent;
}

/* 分页尺寸选择器 */
.page-size-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.page-size-selector select {
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-primary);
  cursor: pointer;
}

/* ================== 标签页 ================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* ================== 扫码区域 ================== */
.scan-container {
  max-width: 600px;
  margin: 0 auto;
}

.scan-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.scan-input-group input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.2s;
}

.scan-input-group input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.scan-result {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 200px;
  border: 1px solid var(--border-primary);
}

/* ================== 图片上传 ================== */
.image-upload {
  border: 2px dashed var(--border-secondary);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-secondary);
}

.image-upload:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.02);
}

.image-upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.image-upload-text {
  color: var(--text-secondary);
  font-size: 15px;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.image-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.image-remove:hover {
  background: var(--danger);
  transform: scale(1.1);
}

/* ================== 二维码打印 ================== */
.qrcode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px;
  padding: 24px;
}

.qrcode-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.qrcode-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.qrcode-item img {
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
}

.qrcode-label {
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

/* ================== 时间线 ================== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-primary);
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--accent-blue);
}

.timeline-time {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.timeline-content {
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xs);
}

/* ================== 提示信息 ================== */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 500;
  z-index: 10000;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-warning {
  background: var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ================== 模态框 ================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.2s ease;
  border: 1px solid var(--border-primary);
}

@keyframes modalIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ================== 工具提示 ================== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--primary-800);
  color: white;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 100;
  margin-bottom: 6px;
}

.tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--primary-800);
  margin-bottom: -6px;
}

/* ================== 加载动画 ================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.loading-dark {
  border-color: var(--border-secondary);
  border-top-color: var(--accent-blue);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ================== 批次卡片 ================== */
.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.batch-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.batch-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.batch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.batch-date {
  font-size: 12px;
  color: var(--text-muted);
}

.batch-info {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.batch-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.batch-info-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.batch-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.batch-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ================== 响应式设计 - 移动端优化 ================== */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  
  .sidebar-header h2,
  .sidebar-header p,
  .sidebar-menu-item span:last-child {
    display: none;
  }
  
  .sidebar-menu-item {
    justify-content: center;
    padding: 16px;
    margin: 4px 8px;
  }
  
  .sidebar-menu-item .icon {
    font-size: 22px;
  }
  
  .main-content {
    margin-left: var(--sidebar-collapsed);
  }
  
  .sidebar-menu-item.active::before {
    left: -8px;
  }
}

/* 平板竖屏优化 */
@media (max-width: 820px) {
  html {
    font-size: 15px;
  }
  
  .main-content {
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  
  html {
    font-size: 16px;
  }
  
  body {
    line-height: 1.5;
  }
  
  .header-content {
    padding: 0 12px;
    gap: 8px;
  }
  
  .header-title {
    font-size: 16px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .header-logo {
    height: 28px;
  }
  
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
  }
  
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    top: var(--header-height);
    z-index: 200;
    box-shadow: var(--shadow-xl);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }
  
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  .sidebar-header h2,
  .sidebar-header p,
  .sidebar-menu-item span:last-child {
    display: block;
  }
  
  .sidebar-menu-item {
    justify-content: flex-start;
    padding: 14px 20px;
    margin: 4px 12px;
    font-size: 15px;
  }
  
  .main-content {
    margin-left: 0;
    padding: 12px;
  }
  
  /* 移动端统计卡片 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-card h3 {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .stat-number {
    font-size: 22px;
  }
  
  /* 移动端页面头部 */
  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  
  .page-header h2 {
    font-size: 18px;
    line-height: 1.3;
  }
  
  .page-description {
    font-size: 13px;
  }
  
  .page-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .page-actions .btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
  }
  
  /* 移动端筛选栏 */
  .filter-bar {
    padding: 14px;
    margin-bottom: 16px;
  }
  
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .filter-item {
    min-width: 100%;
  }
  
  .filter-item label {
    font-size: 13px;
  }
  
  .filter-item input,
  .filter-item select {
    padding: 10px 12px;
    font-size: 15px;
  }
  
  .filter-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: 8px;
  }
  
  .filter-actions .btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
  }
  
  /* 移动端卡片 */
  .card {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }
  
  .card-title {
    font-size: 15px;
  }
  
  /* 移动端表格 - 改为卡片式布局 */
  .table-container {
    border-radius: var(--radius-md);
    box-shadow: none;
    border: none;
    background: transparent;
  }
  
  .table-responsive {
    overflow-x: visible;
    max-height: none;
    border-radius: var(--radius-md);
  }
  
  .table-responsive table {
    display: block;
    font-size: 14px;
  }
  
  .table-responsive thead {
    display: none;
  }
  
  .table-responsive tbody {
    display: block;
  }
  
  .table-responsive tr {
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
  }
  
  .table-responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-primary);
    text-align: right;
    font-size: 14px;
  }
  
  .table-responsive td:last-child {
    border-bottom: none;
  }
  
  .table-responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-right: 10px;
  }
  
  /* 移动端表格操作按钮 */
  .table-actions {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }
  
  .table-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  /* 移动端搜索框 */
  .search-box {
    max-width: 100%;
    order: -1;
  }
  
  .search-box input {
    padding: 10px 12px 10px 36px;
    font-size: 15px;
  }
  
  .search-box .search-icon {
    left: 12px;
    font-size: 14px;
  }
  
  /* 移动端按钮组 */
  .btn-group {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .btn-group .btn {
    flex: 1;
    min-width: 70px;
    padding: 8px 12px;
    font-size: 13px;
  }
  
  /* 移动端分页 */
  .pagination-container {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0 0;
  }
  
  .pagination {
    order: -1;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pagination-info {
    font-size: 13px;
    text-align: center;
  }
  
  .page-btn {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
  }
  
  /* 移动端表单 */
  .form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .form-section {
    padding: 14px;
    margin-bottom: 16px;
  }
  
  .form-section-title {
    font-size: 14px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }
  
  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 12px;
    font-size: 15px;
  }
  
  /* 移动端模态框 */
  .modal {
    max-height: 95vh;
    margin: 10px;
    border-radius: var(--radius-lg);
    max-width: calc(100% - 20px);
  }
  
  .modal-header {
    padding: 16px 16px 0;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    padding: 0 16px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  
  .modal-footer .btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
  }
  
  /* 移动端用户信息 */
  .user-info {
    gap: 8px;
  }
  
  .user-role {
    display: none;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .btn-logout {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  /* 移动端欢迎区域 */
  .welcome-section {
    padding: 18px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }
  
  .welcome-section h2 {
    font-size: 18px;
    line-height: 1.3;
  }
  
  .welcome-section p {
    font-size: 14px;
  }
  
  /* 移动端登录 */
  .login-box {
    padding: 28px 20px;
    margin: 12px;
    border-radius: var(--radius-lg);
  }
  
  .login-logo h1 {
    font-size: 22px;
  }
  
  .login-logo img {
    max-width: 120px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  /* 移动端批次卡片 */
  .batch-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .batch-card {
    padding: 14px;
    border-radius: var(--radius-md);
  }
  
  .batch-title {
    font-size: 13px;
  }
  
  /* 移动端二维码 */
  .qrcode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
  }
  
  .qrcode-item {
    padding: 14px;
  }
  
  .qrcode-item img {
    width: 100px;
    height: 100px;
  }
  
  .qrcode-label {
    font-size: 11px;
  }
  
  /* 移动端扫码 */
  .scan-input-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .scan-input-group input {
    font-size: 15px;
    padding: 12px 14px;
  }
  
  /* 移动端标签 */
  .customer-tag {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .status-badge {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  /* 移动端按钮 */
  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .btn-xs {
    padding: 4px 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }
  
  .header-title {
    font-size: 14px;
    max-width: 100px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-card h3 {
    font-size: 11px;
  }
  
  .stat-number {
    font-size: 20px;
  }
  
  .page-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .page-actions .btn {
    padding: 10px 12px;
  }
  
  .filter-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .filter-actions .btn {
    padding: 10px 12px;
  }
  
  .qrcode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .qrcode-item {
    padding: 10px;
  }
  
  .qrcode-item img {
    width: 80px;
    height: 80px;
  }
  
  /* 表格在超小屏幕下保持卡片式布局 */
  .table-responsive td {
    font-size: 13px;
    padding: 5px 0;
  }
  
  .table-responsive td::before {
    font-size: 11px;
  }
  
  .table-actions {
    flex-direction: column;
    width: 100%;
    gap: 4px;
  }
  
  .table-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
  }
  
  .page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    font-size: 12px;
  }
  
  .page-btn.nav {
    padding: 0 8px;
  }
  
  .pagination-info {
    font-size: 12px;
  }
  
  .page-size-selector {
    font-size: 12px;
  }
  
  /* 模态框优化 */
  .modal {
    margin: 5px;
    max-width: calc(100% - 10px);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .modal-footer .btn {
    padding: 10px 14px;
  }
  
  /* 表单优化 */
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  /* 按钮优化 */
  .btn {
    padding: 9px 14px;
    font-size: 13px;
  }
}

/* ================== 打印样式 ================== */
@media print {
  .header,
  .sidebar,
  .btn,
  .page-actions,
  .pagination-container {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0;
    padding: 0;
  }
  
  .qrcode-grid {
    border: none;
    padding: 0;
    grid-template-columns: repeat(3, 1fr);
  }
  
  .qrcode-item {
    border: 1px solid #000;
    margin: 0;
    padding: 5px;
    page-break-inside: avoid;
  }
}
