/* ================== 基础变量 ================== */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#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%, #0099ff 50%, #00ccff 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: float 20s linear infinite;
}

@keyframes float {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.login-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img {
  max-width: 180px;
  height: auto;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #0066cc 0%, #0099ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-secondary);
  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: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: all 0.2s;
  background: var(--bg-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* ================== 主应用布局 ================== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.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: 24px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: var(--bg-tertiary);
}

.header-logo {
  height: 40px;
  object-fit: contain;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.btn-logout {
  padding: 8px 18px;
  font-size: 14px;
  width: auto;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-logout:hover {
  background: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

/* 主内容区域 */
.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-color);
  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-light);
}

.sidebar-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.sidebar-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.sidebar-menu {
  list-style: none;
  padding: 12px 0;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  margin: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.sidebar-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-color);
  transform: scaleY(0);
  transition: transform 0.2s;
}

.sidebar-menu-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-menu-item:hover::before {
  transform: scaleY(1);
}

.sidebar-menu-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
  color: var(--primary-color);
  font-weight: 600;
}

.sidebar-menu-item.active::before {
  transform: scaleY(1);
}

.sidebar-menu-item .icon {
  font-size: 20px;
  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-color);
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* ================== 卡片 ================== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  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;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ================== 统计卡片网格 ================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card h3 {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card.success::before {
  background: linear-gradient(90deg, var(--success-color) 0%, #34d399 100%);
}

.stat-card.warning::before {
  background: linear-gradient(90deg, var(--warning-color) 0%, #fbbf24 100%);
}

.stat-card.danger::before {
  background: linear-gradient(90deg, var(--danger-color) 0%, #f87171 100%);
}

/* ================== 欢迎区域 ================== */
.welcome-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: white;
  margin-bottom: 24px;
}

.welcome-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.welcome-section p {
  opacity: 0.9;
  font-size: 15px;
  line-height: 1.6;
}

/* ================== 表格 ================== */
.table-container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover {
  background: var(--bg-secondary);
}

tr:last-child td {
  border-bottom: none;
}

.empty-message {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
}

/* ================== 状态标签 ================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-已入库 {
  background: #dbeafe;
  color: #1e40af;
}

.status-已入库::before {
  background: #3b82f6;
}

.status-已出库 {
  background: #fef3c7;
  color: #92400e;
}

.status-已出库::before {
  background: #f59e0b;
}

.status-已安装 {
  background: #d1fae5;
  color: #065f46;
}

.status-已安装::before {
  background: #10b981;
}

.status-有维修 {
  background: #fee2e2;
  color: #991b1b;
}

.status-有维修::before {
  background: #ef4444;
}

/* ================== 表单 ================== */
.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;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* ================== 扫码区域 ================== */
.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-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.2s;
}

.scan-input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.scan-result {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 200px;
}

/* ================== 图片上传 ================== */
.image-upload {
  border: 2px dashed var(--border-color);
  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(--primary-color);
  background: rgba(37, 99, 235, 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-color);
  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: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.image-remove:hover {
  background: var(--danger-color);
  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-color);
  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: 'Courier New', 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-color);
}

.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(--primary-color);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.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-color);
  box-shadow: var(--shadow-sm);
}

/* ================== 提示信息 ================== */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 16px 24px;
  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: 12px;
}

.toast::before {
  font-size: 20px;
}

.toast-success {
  background: var(--success-color);
}

.toast-success::before {
  content: '✓';
}

.toast-error {
  background: var(--danger-color);
}

.toast-error::before {
  content: '✕';
}

.toast-warning {
  background: var(--warning-color);
}

.toast-warning::before {
  content: '!';
}

@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(0, 0, 0, 0.5);
  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-lg);
  animation: modalIn 0.2s ease;
}

@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: 20px;
  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;
}

.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;
}

/* ================== 搜索框 ================== */
.search-box {
  position: relative;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
}

/* ================== 标签页 ================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  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;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* ================== 分页 ================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.page-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.page-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.page-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================== 响应式设计 ================== */
@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;
  }
  
  .sidebar-menu-item .icon {
    font-size: 24px;
  }
  
  .main-content {
    margin-left: var(--sidebar-collapsed);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  
  .header-content {
    padding: 0 12px;
  }
  
  .header-title {
    font-size: 14px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .header-logo {
    height: 28px;
  }
  
  .menu-toggle {
    display: block;
    font-size: 20px;
    padding: 6px;
  }
  
  .sidebar {
    width: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    top: var(--header-height);
    z-index: 200;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-header h2,
  .sidebar-header p,
  .sidebar-menu-item span:last-child {
    display: block;
  }
  
  .sidebar-menu-item {
    justify-content: flex-start;
    padding: 14px 20px;
  }
  
  .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;
  }
  
  .stat-number {
    font-size: 24px;
  }
  
  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }
  
  .page-header h2 {
    font-size: 18px;
  }
  
  .page-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  
  .search-box {
    max-width: 100%;
    order: 2;
  }
  
  .page-actions .btn {
    width: 100%;
    order: 1;
  }
  
  .card {
    padding: 14px;
    margin-bottom: 16px;
  }
  
  .card-header {
    margin-bottom: 16px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .table-responsive {
    font-size: 13px;
  }
  
  th, td {
    padding: 8px 10px;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    width: 100%;
  }
  
  .scan-input-group {
    flex-direction: column;
  }
  
  .qrcode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
  }
  
  .modal {
    max-height: 95vh;
    margin: 8px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .user-info {
    gap: 8px;
  }
  
  .user-info .user-role {
    display: none;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .btn-logout {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .welcome-section {
    padding: 20px;
    margin-bottom: 16px;
  }
  
  .welcome-section h2 {
    font-size: 18px;
  }
  
  .welcome-section p {
    font-size: 13px;
  }
  
  .login-box {
    padding: 32px 24px;
    margin: 16px;
  }
  
  .login-logo h1 {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .login-box {
    padding: 32px 24px;
  }
  
  .login-logo h1 {
    font-size: 22px;
  }
  
  .qrcode-grid {
    grid-template-columns: 1fr;
  }
  
  .page-actions {
    width: 100%;
  }
  
  .page-actions .btn {
    flex: 1;
  }
}

/* ================== 打印样式 ================== */
@media print {
  .header,
  .sidebar,
  .btn,
  .page-actions {
    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;
  }
}

/* ================== 加载动画 ================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@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;
  }
}
