/* 基础样式重置 - 统一按钮样式版本 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 主题色彩 - 优化版本 */
:root {
  /* 主色调 - 更现代的蓝色 */
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  
  /* 功能色彩 */
  --success-color: #10b981;
  --success-hover: #059669;
  --success-light: #d1fae5;
  
  --warning-color: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: #fef3c7;
  
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fee2e2;
  
  --info-color: #06b6d4;
  --info-hover: #0891b2;
  --info-light: #cffafe;
  
  /* 灰度色彩 - 浅色模式 */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* 背景色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  /* 文字色 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  
  /* 边框和阴影 */
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
}

/* 深色模式色彩 */
@media (prefers-color-scheme: dark) {
  :root {
    /* 主色调在深色模式下稍微调亮 */
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: #1e3a8a;
    --primary-dark: #93c5fd;
    
    /* 功能色彩 */
    --success-color: #34d399;
    --success-hover: #10b981;
    --success-light: #064e3b;
    
    --warning-color: #fbbf24;
    --warning-hover: #f59e0b;
    --warning-light: #451a03;
    
    --danger-color: #f87171;
    --danger-hover: #ef4444;
    --danger-light: #450a0a;
    
    --info-color: #22d3ee;
    --info-hover: #06b6d4;
    --info-light: #083344;
    
    /* 深色模式灰度 */
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    
    /* 深色模式背景 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    /* 深色模式文字 */
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e1;
    
    /* 深色模式边框 */
    --border-color: #334155;
    --border-color-hover: #475569;
    
    /* 深色模式阴影 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -1px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -2px rgb(0 0 0 / 0.2);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 10px 10px -5px rgb(0 0 0 / 0.2);
  }
}

/* 基础布局 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 头部样式 */
header {
  background: var(--bg-primary);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

header h1 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
}

/* 主内容区域 */
main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 卡片容器 */
.card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.card h2, .card h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* 表单样式 */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-color: var(--bg-primary);
}

input::placeholder, textarea::placeholder {
  color: var(--text-tertiary);
}

/* 按钮样式 - 全新设计 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px; /* 移动端友好的触摸目标 */
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
}

/* 按钮悬停和激活效果 */
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 主要按钮 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.4);
}

/* 成功按钮 */
.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, var(--success-hover) 100%);
  color: white;
  border-color: var(--success-color);
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--success-hover) 0%, #047857 100%);
  border-color: var(--success-hover);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.4);
}

/* 警告按钮 */
.btn-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, var(--warning-hover) 100%);
  color: white;
  border-color: var(--warning-color);
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
  background: linear-gradient(135deg, var(--warning-hover) 0%, #b45309 100%);
  border-color: var(--warning-hover);
  box-shadow: 0 6px 20px 0 rgba(245, 158, 11, 0.4);
}

/* 危险按钮 */
.btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-hover) 100%);
  color: white;
  border-color: var(--danger-color);
  box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-hover) 0%, #b91c1c 100%);
  border-color: var(--danger-hover);
  box-shadow: 0 6px 20px 0 rgba(239, 68, 68, 0.4);
}

/* 信息按钮 */
.btn-info {
  background: linear-gradient(135deg, var(--info-color) 0%, var(--info-hover) 100%);
  color: white;
  border-color: var(--info-color);
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.25);
}

.btn-info:hover {
  background: linear-gradient(135deg, var(--info-hover) 0%, #0e7490 100%);
  border-color: var(--info-hover);
  box-shadow: 0 6px 20px 0 rgba(6, 182, 212, 0.4);
}

/* 次要按钮 */
.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-color: var(--border-color);
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

/* 小按钮 */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 36px;
}

/* 按钮组 */
.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-group .btn {
  flex: 1;
  min-width: 0;
}

/* 表格样式 */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover {
  background-color: var(--bg-secondary);
}

tr:last-child td {
  border-bottom: none;
}

/* 新增登记区域样式 */
.register-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0.5rem;
}

.register-card {
  padding: 1rem;
}

.register-header {
  text-align: center; 
  margin-bottom: 1rem;
}

.register-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.register-header p {
  font-size: 0.875rem;
}

.compact-form-group {
  margin-bottom: 0.75rem;
}

.compact-label {
  font-size: 0.875rem !important;
  margin-bottom: 0.25rem !important;
  font-weight: 600 !important;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.compact-input {
  padding: 0.5rem !important;
  font-size: 0.95rem !important;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.option-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.option-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.radio-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  flex: 1;
  text-align: left;
  min-width: fit-content;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-pill span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.radio-pill span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  box-sizing: border-box;
  background-color: #fff;
}

.radio-pill:has(input:checked) {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 500;
}

/* 兼容不支持 :has 的浏览器 */
.radio-pill input:checked + span {
  color: white; 
}
.radio-pill:has(input:checked) span::before {
  border-color: #fff;
  background-color: #fff;
  box-shadow: inset 0 0 0 3px var(--primary-color);
}
.radio-pill input:checked + span::before {
  border-color: #fff;
  background-color: #fff;
  box-shadow: inset 0 0 0 3px var(--primary-color);
}
/* 注意：如果没有 :has 支持，需要 JS 辅助或者依赖 input:checked + span 的样式覆盖，
   但这里为了简单，我们假设现代浏览器或仅做文字变色。
   为了更稳妥的纯CSS效果，我们可以把背景色加在 span 上或者 label 本身就是选中状态。
   由于结构是 label > input + span，
   我们可以用 label:has(input:checked) (现代) 
   或者改结构为 input + label (传统)。
   这里保持现有结构，主要依赖 :has。
*/

.responsive-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .option-column {
    grid-template-columns: repeat(3, 1fr); /* 大屏时风险提示横向排 */
  }
}

@media (max-width: 640px) {
  /* 手机端特定优化 */
  .btn {
    padding: 0.6rem;
  }
}

/* 查询筛选器容器 */
.filters-container {
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.filters-container form {
  display: grid;
  grid-template-areas: 
    "search search"
    "status status"
    "actions actions";
  gap: 1.5rem;
  padding: 1.5rem;
}

/* 搜索输入区域 */
.search-inputs {
  grid-area: search;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.input-group input {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 状态筛选区域 */
.status-filter-section {
  grid-area: status;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.status-controls {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--gray-600);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.status-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.status-option .status-badge {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
}

.status-option input:checked + .status-badge {
  border-color: var(--primary-color);
  background-color: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  font-weight: 600;
  transform: scale(1.02);
}

/* 为不同状态添加特定的选中效果 */
.status-option input:checked + .status-badge.status-pending {
  background-color: rgba(251, 191, 36, 0.15);
  border-color: #f59e0b;
}

.status-option input:checked + .status-badge.status-processing {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}

.status-option input:checked + .status-badge.status-done {
  background-color: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
}

.status-option input:checked + .status-badge.status-picked {
  background-color: rgba(168, 85, 247, 0.15);
  border-color: #a855f7;
}

.status-option input:checked + .status-badge.status-cancel {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* 操作按钮区域 */
.action-buttons {
  grid-area: actions;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
}

.action-buttons .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-width: auto;
}

.btn-icon {
  font-size: 1rem;
}

.btn-text {
  font-size: 0.875rem;
}

/* 操作按钮组 */
.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

/* 两列布局 */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* 状态标签 - 重新设计 */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.status-pending {
  background: linear-gradient(135deg, var(--warning-light) 0%, rgba(245, 158, 11, 0.1) 100%);
  color: var(--warning-color);
  border-color: rgba(245, 158, 11, 0.2);
}

.status-processing {
  background: linear-gradient(135deg, var(--info-light) 0%, rgba(6, 182, 212, 0.1) 100%);
  color: var(--info-color);
  border-color: rgba(6, 182, 212, 0.2);
}

.status-done {
  background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.1) 100%);
  color: var(--success-color);
  border-color: rgba(16, 185, 129, 0.2);
}

.status-picked {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(148, 163, 184, 0.1) 100%);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.status-cancel {
  background: linear-gradient(135deg, var(--danger-light) 0%, rgba(239, 68, 68, 0.1) 100%);
  color: var(--danger-color);
  border-color: rgba(239, 68, 68, 0.2);
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* 通知样式 */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.alert::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-success {
  background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.1) 100%);
  color: var(--success-color);
  border-color: rgba(16, 185, 129, 0.2);
}

.alert-success::before {
  background: var(--success-color);
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.alert-error {
  background: linear-gradient(135deg, var(--danger-light) 0%, rgba(239, 68, 68, 0.1) 100%);
  color: var(--danger-color);
  border-color: rgba(239, 68, 68, 0.2);
}

.alert-error::before {
  background: var(--danger-color);
  content: '!';
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  font-weight: bold;
}

/* 加载状态 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 二维码容器 */
.qr-container {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
}

.qr-container img {
  max-width: 200px;
  height: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }
  
  main {
    padding: 0 0.5rem;
  }
  
  .two-col {
    grid-template-columns: 1fr;
  }
  
  /* 移动端隐藏统计卡片 */
  .stats-grid {
    display: none;
  }
  
  /* 移动端筛选器优化 */
  .filters-container form {
    grid-template-areas: 
      "search"
      "actions";
    gap: 1rem;
    padding: 1rem;
  }
  
  .search-inputs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  /* 移动端隐藏单号输入框 */
  .search-inputs .input-group:first-child {
    display: none;
  }
  
  /* 移动端隐藏状态筛选区域 */
  .status-filter-section {
    display: none;
  }
  
  /* 移动端隐藏列设置按钮 */
  #columnToggle {
    display: none;
  }
  
  .status-filter-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .status-controls {
    align-self: stretch;
    justify-content: space-between;
  }
  
  .control-btn {
    flex: 1;
    text-align: center;
  }
  
  .status-badges {
    gap: 0.375rem;
  }
  
  .status-option .status-badge {
    padding: 0.375rem 0.625rem;
    font-size: 0.7rem;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .action-buttons .btn {
    justify-content: center;
    padding: 0.875rem;
  }
  
  /* 移动端表格优化 - 卡片式布局 */
  .table-container {
    border: none;
    border-radius: 0;
  }
  
  table, thead, tbody, th, td, tr {
    display: block;
  }
  
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  tbody tr {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  tbody td {
    border: none;
    padding: 0.25rem 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 1.5rem;
  }
  
  tbody td:before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    width: 35%;
  }
  
  tbody td:last-child {
    border-bottom: none;
  }
  
  /* 移动端操作按钮优化 */
  .actions {
    flex-direction: row !important;
    gap: 0.25rem !important;
    justify-content: flex-end;
  }
  
  .actions button {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.4rem !important;
    min-width: 45px;
  }
  
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* 对话框样式 */
dialog {
  border: none;
  border-radius: var(--border-radius);
  padding: 0;
  box-shadow: var(--shadow-md);
  max-width: 400px;
  width: 90vw;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

dialog .dialog-content {
  padding: 1.5rem;
}

dialog h4 {
  margin-bottom: 1rem;
  color: var(--gray-900);
}

/* 导航样式 */
.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.nav-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  text-decoration: underline;
}

/* 图片上传样式 */
.photo-upload-container {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--gray-50);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--gray-400);
}

.upload-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.photo-preview {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--gray-100);
}

.photo-preview img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.remove-photo-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-photo-btn:hover {
  background: var(--danger-color);
  transform: scale(1.1);
}

/* 上传进度条 */
.upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gray-200);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
  width: 0%;
}

/* 图片显示样式 */
.photo-display {
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.photo-display img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.photo-display img:hover {
  transform: scale(1.02);
}

/* 图片模态框 */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* 状态筛选器样式 */
.status-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.status-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
  position: relative;
}

.status-checkbox input[type="checkbox"] {
  display: none;
}

.status-checkbox .status-badge {
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  opacity: 0.5;
  transform: scale(0.95);
  position: relative;
  overflow: hidden;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.status-checkbox .status-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  opacity: 1;
  transition: opacity 0.15s ease;
}

.status-checkbox input[type="checkbox"]:checked + .status-badge {
  opacity: 1;
  transform: scale(1);
  border-color: currentColor;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-checkbox input[type="checkbox"]:checked + .status-badge::before {
  opacity: 0;
}

.status-checkbox:hover .status-badge {
  opacity: 0.75;
  transform: scale(0.98);
}

.status-checkbox input[type="checkbox"]:checked:hover + .status-badge {
  opacity: 1;
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 状态筛选器控制按钮 */
.status-filter-controls {
  display: flex;
  gap: 0.25rem;
}

.status-filter-controls .btn {
  font-size: 0.7rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  transition: all 0.15s ease;
  min-height: auto;
}

.status-filter-controls .btn:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 状态计数器动画 */
#statusCount {
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 8px;
}

/* 筛选器整体动画 */
.filters-container {
  transition: box-shadow 0.2s ease;
}

.filters-container:hover {
  box-shadow: var(--shadow-md);
}

/* 平板端优化 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .filters-container form {
    grid-template-areas: 
      "search search"
      "status actions";
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 1.25rem;
  }
  
  .search-inputs {
    grid-template-columns: 1fr 1fr;
  }
  
  .action-buttons {
    flex-direction: column;
    min-width: 140px;
  }
}

/* 大屏幕优化 (1024px+) */
@media (min-width: 1024px) {
  .filters-container form {
    grid-template-areas: 
      "search status actions";
    grid-template-columns: 2fr 3fr auto;
    align-items: end;
    gap: 2rem;
  }
  
  .search-inputs {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  .status-filter-section {
    gap: 0.5rem;
  }
  
  .status-filter-header {
    flex-direction: row;
    margin-bottom: 0.25rem;
  }
  
  .action-buttons {
    flex-direction: column;
    min-width: 120px;
    gap: 0.5rem;
  }
  
  .action-buttons .btn {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }
  
  .btn-text {
    font-size: 0.8rem;
  }
}

/* 视觉增强 */
.filters-container form {
  position: relative;
}

.filters-container form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* 输入框增强效果 */
.input-group input:focus {
  transform: translateY(-1px);
}

/* 状态徽章悬停效果 */
.status-option:hover .status-badge {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 按钮悬停效果增强 */
.action-buttons .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-btn:hover {
  transform: translateY(-1px);
}

/* 状态标签动画增强 */
.status-checkbox .status-badge::after {
  content: '✓';
  position: absolute;
  top: 50%;
  right: 0.2rem;
  transform: translateY(-50%) scale(0);
  color: white;
  font-weight: bold;
  font-size: 0.6rem;
  transition: transform 0.15s ease;
}

.status-checkbox input[type="checkbox"]:checked + .status-badge::after {
  transform: translateY(-50%) scale(1);
}

/* 响应式状态筛选器 */
@media (max-width: 768px) {
  .status-filter-group {
    gap: 0.2rem;
  }
  
  .status-checkbox .status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  /* 小屏幕优化 */
  .filters-container form {
    padding: 1rem;
    gap: 1rem;
  }
  
  .search-inputs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .action-buttons {
    flex-direction: row;
    justify-content: center;
  }
  
  .action-buttons .btn {
    flex: 1;
    max-width: 150px;
  }
}

/* 首页特殊样式 - 重新设计 */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .nav-links {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
}

.nav-links .btn {
  flex: 1;
  min-width: 200px;
  font-weight: 600;
  letter-spacing: 0.025em;
  position: relative;
  overflow: hidden;
}

/* 店铺登录按钮 */
.nav-links .btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border: 2px solid var(--primary-color);
  color: white;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.nav-links .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
  border-color: var(--primary-hover);
  box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
  transform: translateY(-3px);
}

/* 总店登录按钮 */
.nav-links .btn-info {
  background: linear-gradient(135deg, var(--info-color) 0%, var(--info-hover) 100%);
  border: 2px solid var(--info-color);
  color: white;
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

.nav-links .btn-info:hover {
  background: linear-gradient(135deg, var(--info-hover) 0%, #0e7490 100%);
  border-color: var(--info-hover);
  box-shadow: 0 12px 35px rgba(6, 182, 212, 0.4);
  transform: translateY(-3px);
}

/* 管理员登录按钮 */
.nav-links .btn-secondary {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.nav-links .btn-secondary:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--gray-300) 100%);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
}

/* 深色模式下的导航按钮优化 */
@media (prefers-color-scheme: dark) {
  .nav-links .btn-secondary {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }

  .nav-links .btn-secondary:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--gray-600) 100%);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  }
}
/* 加载状态和动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 按钮加载状态 */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 脉冲动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* 滑入动画 */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-up {
  animation: slideInUp 0.4s ease-out;
}

/* 缩放动画 */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.2s ease-out;
}

/* 触摸反馈增强 */
.btn, .card, .status-badge {
  -webkit-tap-highlight-color: transparent;
}

/* 焦点可见性增强 */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }
  
  .card {
    border-width: 2px;
  }
  
  .status-badge {
    border-width: 2px;
    font-weight: 700;
  }
}

/* 打印样式 */
@media print {
  .btn,
  .nav-links,
  .filters-container,
  .actions {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* 骨架屏加载效果 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes loading-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-button {
  height: 2.5rem;
  width: 100px;
}

/* 工具提示 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gray-900);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* 深色模式下的工具提示 */
@media (prefers-color-scheme: dark) {
  .tooltip::before {
    background: var(--gray-100);
    color: var(--gray-900);
  }
  
  .tooltip::after {
    border-top-color: var(--gray-100);
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color-hover);
}

/* Firefox 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-secondary);
}

/* 选择文本样式 */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text-primary);
}