/* ==================== 基础样式重置 ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

html {
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  background-color: var(--bg-body);
  background-image: linear-gradient(135deg, #F8FAFF 0%, #EDE9FE 50%, #DDD6FE 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ==================== 变量定义 ==================== */
:root {

  /* 主色调 - 紫至蓝梦幻渐变（日间模式） */
  --primary: #7C3AED;
  --primary-light: #8B5CF6;
  --primary-dark: #6D28D9;
  --primary-alpha-10: rgba(124, 58, 237, 0.1);
  --primary-alpha-15: rgba(124, 58, 237, 0.15);
  --primary-alpha-20: rgba(124, 58, 237, 0.2);
  
  /* 辅助色 - 天空蓝系 */
  --accent: #3B82F6;
  --accent-light: #60A5FA;
  --accent-dark: #2563EB;
  --accent-alpha-15: rgba(59, 130, 246, 0.15);
  
  /* 成功状态 - 清新薄荷绿 */
  --success: #10B981;
  --success-light: #D1FAE5;
  --success-dark: #047857;
  
  /* 失败状态 - 温暖珊瑚红 */
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --danger-dark: #DC2626;
  
  /* 待处理状态 - 明亮琥珀橙 */
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --warning-dark: #D97706;
  
  /* 背景色 */
  --bg-body: #F8FAFF;
  --bg-alt: #EDE9FE;
  --bg-card: #FFFFFF;
  --bg-overlay: rgba(124, 58, 237, 0.1);
  
  /* 文字色 */
  --text-primary: #1E1B4B;
  --text-secondary: #312E81;
  --text-tertiary: #4338CA;
  --text-light: #6366F1;
  --text-on-dark: #FFFFFF;
  
  /* 边框 */
  --border-light: #DDD6FE;
  --border-medium: #C4B5FD;
  --border-dark: #A855F7;
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.1);
  --shadow-md: 0 4px 12px rgba(124, 58, 237, 0.15);
  --shadow-lg: 0 8px 24px rgba(124, 58, 237, 0.2);
  --shadow-xl: 0 12px 48px rgba(124, 58, 237, 0.25);
  
  /* 过渡动画 */
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* 字体大小 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
}

/* ==================== 布局容器 ==================== */
.container {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.view {
  display: none;
  min-height: 100vh;
}

#mainView {
  display: block;
}

/* ==================== 顶部导航栏 ==================== */
.date-filter {
  padding: 8px 20px;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 40%, #3B82F6 100%);
  border-bottom: 1px solid rgba(221, 214, 254, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
  min-height: 48px;
  gap: 12px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

  .today-stats {
    justify-content: center;
    padding: 4px 8px;
    font-size: var(--text-xs);
  }

  .stats-count {
    font-size: var(--text-sm);
  }

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: white;
  letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  opacity: 0;
}

.status-indicator.connecting {
  background-color: var(--warning);
}

.status-indicator.connecting::after {
  background-color: rgba(255, 193, 7, 0.2);
  animation: pulse-ring 1.5s infinite;
}

.status-indicator.connected {
  background-color: var(--success);
}

.status-indicator.connected::after {
  background-color: rgba(77, 168, 255, 0.2);
  animation: pulse-ring 1.5s infinite;
}

.status-indicator.disconnected {
  background-color: var(--danger);
}

.status-indicator.disconnected::after {
  background-color: rgba(255, 107, 107, 0.2);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.date-filter input[type="date"] {
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 13px;
  color: white;
  transition: var(--transition-fast);
  cursor: pointer;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.date-filter input[type="date"]:hover {
  background: transparent;
  border: none;
}

.date-filter input[type="date"]:focus {
  outline: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.today-stats {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: white;
  flex: 1;
  justify-content: center;
}

.stats-label {
  font-weight: 500;
  opacity: 0.9;
}

.stats-count {
  font-weight: 600;
  font-size: 13px;
  color: #10B981;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* ==================== 车牌卡片列表 ==================== */
.plate-cards {
  padding: 16px 16px 100px 16px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-body);
  position: relative;
}

/* ==================== 空状态提示 ==================== */
.empty-state {
  text-align: center;
  padding: 80px 30px;
  margin: 20px 0;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-alt) 100%);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-light);
  transition: var(--transition-normal);
}

.empty-state:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 24px;
  color: var(--primary);
  opacity: 0.7;
  animation: float 3s ease-in-out infinite;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* ==================== 车牌卡片设计 ==================== */
.plate-card {
  height: 72px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.plate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-alpha-15) 100%);
}

.plate-card.new-item {
  animation: fadeIn 0.5s ease, slideUp 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}


/* 车牌号码 - 强制保持深色 */
.plate-number {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary) !important;
  letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  display: flex;
  align-items: center;
  gap: 4px;
}

.plate-number .separator {
  color: var(--primary);
  font-weight: bold;
}


/* 调整分隔符颜色适配背景 */
.plate-card.plate-type-blue .plate-number .separator {
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.15);
}
.plate-card.plate-type-green .plate-number .separator {
  color: #065F46;
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* 蓝牌样式 - 专业深蓝配色 */
.plate-card.plate-type-blue .plate-number {
  background: linear-gradient(180deg, #1E3A8A 0%, #1E40AF 100%);
  color: white !important;
  padding: 4px 5px;
  border-radius: 5px;
  background-image: 
    linear-gradient(180deg, #1E3A8A 0%, #1E40AF 100%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 2px 5px rgba(30, 58, 138, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.35),
    0 0 0 1px #1E40AF;
  
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 1px;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.15);
  vertical-align: middle;
  display: inline-block;
}

/* 绿牌样式 - 真实内缩边框 */
.plate-card.plate-type-green .plate-number {
  position: relative;
  background: linear-gradient(180deg, #E8F5E8 0%, #059669 100%);
  color: #1A202C !important;
  padding: 6px 7px;
  border-radius: 5px;
  background-image: 
    linear-gradient(180deg, #E8F5E8 0%, #059669 100%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  border: none;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
  
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 1px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
  vertical-align: middle;
  display: inline-block;
  margin-left: -1px;
}

.plate-card.plate-type-green .plate-number::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  border: 1px solid #1A202C;
  border-radius: 4px;
  pointer-events: none;
}


/* 分隔符同步调整，确保与文字对齐 */
.plate-card.plate-type-blue .plate-number .separator,
.plate-card.plate-type-green .plate-number .separator {
  vertical-align: middle; /* 分隔符与文字基线对齐 */
  font-size: 16px; /* 与文字大小一致 */
}

/* 调整绿牌分隔符样式 */
.plate-card.plate-type-green .plate-number .separator {
  color: rgba(26, 32, 44, 0.8);
  font-weight: bold;
  margin: 0 1px; /* 等距分隔 */
}


/* 分隔符样式调整 */
.plate-number .separator {
  margin: 0 4px;
}
/* 状态和时间容器 */
.status-time-container {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

/* 全新状态图标设计 - 现代渐变风格 */
.status-icon {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.status-icon i {
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

/* 成功状态 - 翡翠绿渐变 */
.plate-card.status-success .status-icon {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.plate-card.status-success .status-icon::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: #10B981;
  z-index: -1;
  opacity: 0.3;
  filter: blur(4px);
}

/* 失败状态 - 珊瑚红渐变 */
.plate-card.status-failed .status-icon {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: white;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.plate-card.status-failed .status-icon::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: #EF4444;
  z-index: -1;
  opacity: 0.3;
  filter: blur(4px);
}

/* 待处理状态 - 紫蓝色渐变圆环加载动画 */
.plate-card.status-pending .status-icon {
  background: transparent;
  color: transparent;
  box-shadow: none;
  position: relative;
  overflow: visible;
  border: 3px solid rgba(124, 58, 237, 0.2);
  border-top-color: #7C3AED;
  border-right-color: #A855F7;
  border-bottom-color: #3B82F6;
  border-radius: 50%;
  animation: circle infinite 0.75s linear;
}

/* 待处理状态中的计时器 - 不跟随转圈，深蓝紫色主题 */
.plate-card.status-pending .status-processing-timer {
  background: linear-gradient(135deg, #4C1D95 0%, #5B21B6 40%, #7C3AED 100%);
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 800;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
  animation: timerPulse 2s infinite !important; /* 只保留脉冲动画，不跟随转圈 */
  z-index: 10;
  position: relative;
  width: 26px;  /* 统一为26px，与默认状态图标一致 */
  height: 26px; /* 统一为26px，与默认状态图标一致 */
  border-radius: 50%;
  border: none; /* 移除转圈的边框 */
}

.plate-card.status-pending .status-icon::before,
.plate-card.status-pending .status-icon::after {
  display: none;
}

@keyframes circle {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 图标样式调整 */
.status-icon i {
  font-size: 14px; /* 与容器同步缩小 */
  font-weight: 900;
  line-height: 1;
}

/* 时间显示 */
.plate-time {
  font-size: 14px;
  opacity: 0.5;
  text-align: center;
  min-width: 40px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* 处理中计时器样式 - 深蓝紫色主题 */
.status-processing-timer {
  background: linear-gradient(135deg, #4C1D95 0%, #5B21B6 40%, #7C3AED 100%);
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
  animation: timerPulse 2s infinite;
  z-index: 10;
  position: relative;
}

.status-processing-timer::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: #7C3AED;
  z-index: -1;
  opacity: 0.5;
  filter: blur(4px);
}

.processing-timer {
  font-size: 11px;
  font-weight: 800;
  min-width: 16px;
  text-align: center;
}

@keyframes timerPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.8);
  }
}

/* 处理完成时长显示样式 */
.status-success-duration,
.status-failed-duration {
  font-size: 12px;
  font-weight: 800;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  min-width: 16px;
  text-align: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important; /* 成功和失败状态用白色文字 */
}

.status-success-duration {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.status-failed-duration {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.status-success-duration::before,
.status-failed-duration::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.3;
  filter: blur(4px);
}

.status-success-duration::before {
  background: #10B981;
}

.status-failed-duration::before {
  background: #EF4444;
}



/* ==================== 悬浮操作按钮 ==================== */
.btn-add, .btn-scan {
  position: fixed;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-normal);
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.btn-add {
  bottom: 20px;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 40%, #3B82F6 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-scan {
  bottom: 88px;
  background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 40%, #7C3AED 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-add:hover, .btn-scan:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.btn-add:active, .btn-scan:active {
  animation: clickScale 0.3s ease;
}

@keyframes clickScale {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ==================== 车牌录入界面 ==================== */
.input-view {
  display: none;
  position: relative;
  min-height: 100vh;
  background: var(--bg-body);
  padding-top: 210px; /* 调整为210px，为下移的预设车牌区域留出空间 */
}

.plate-display-container {
  padding: 12px;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 700px;
  margin: 0 auto;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: #7C3AED;
  margin-bottom: var(--space-md);
  text-align: center;
}

.plate-display-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.plate-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  padding: 8px 0;
}

.plate-char {
  width: 52px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 600;
  color: #1E1B4B;
  background: #FFFFFF;
  border: 1px solid #DDD6FE;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.1);
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.plate-char:hover {
  border-color: #C4B5FD;
  background: #F8FAFF;
  box-shadow: 0 2px 4px rgba(196, 181, 253, 0.2);
}

.plate-char.active {
  border-color: #7C3AED;
  color: #1E1B4B;
  background: #FFFFFF;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.2);
}

.plate-display .separator {
  font-size: var(--text-2xl);
  color: #9CA3AF;
  align-self: center;
  width: 12px;
  text-align: center;
  font-weight: 500;
}

/* ==================== 底部键盘区域 ==================== */
.bottom-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  z-index: 10;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  border-top: 1px solid var(--border-light);
}

.keyboard-integrated {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 220px); /* 调整为220px，为下移的预设车牌区域留出空间 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.keyboard-container {
  background: var(--bg-card);
}

.keyboard-buttons {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 8px;
  align-items: center;
  transition: var(--transition-normal);

}

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.keyboard-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.key, .action-key, .btn-submit, .btn-delete, .btn-return, .btn-confirm {
  color: #1E1B4B;
  min-height: 48px;
  font-size: var(--text-lg);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  border: 1px solid #DDD6FE;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.1);
  transition: var(--transition-normal);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
}

.key:hover, .action-key:hover, .btn-submit:hover, .btn-delete:hover, .btn-return:hover {
  border-color: #C4B5FD;
  box-shadow: 0 2px 4px rgba(196, 181, 253, 0.2);
  background: #FFFFFF;
  color: #7C3AED;
}

.btn-return i {
  color: var(--primary);
  transition: var(--transition-fast);
}

.btn-return:hover i {
  color: var(--primary-dark);
}

.btn-confirm i {
  color: var(--text-tertiary);
  transition: var(--transition-fast);
}

.btn-confirm.enabled i {
  color: white;
}

.btn-delete i {
  color: var(--danger);
  transition: var(--transition-fast);
}

.btn-delete:hover i {
  color: var(--danger-dark);
}

.action-key {
  aspect-ratio: auto;
  font-size: var(--text-lg);
  min-height: 48px;
  background: #FFFFFF;
  border: 1px solid #DDD6FE;
  color: #7C3AED;
  font-weight: 600;
}

.btn-return, .btn-confirm, .btn-delete {
  color: #1E1B4B;
  background: #FFFFFF;
  border: 1px solid #DDD6FE;
  font-weight: 600;
}

.btn-confirm.enabled {
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  font-weight: 600;
}

.key:active, .action-key:active,
.btn-return:active, .btn-confirm:not(:disabled):active, .btn-delete:active {
  background: #F8FAFF;
  color: #7C3AED;
  border-color: #7C3AED;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.2);
  transform: scale(0.98);
}

/* ==================== 预设车牌区域 ==================== */
.preset-plates-container {
  position: fixed;
  top: 140px; /* 调整到车牌容器和键盘容器中间位置 */
  left: 0;
  right: 0;
  max-width: 700px;
  margin: 0 auto;
  padding: 12px 12px 16px; /* 增加上下内边距，让区域更舒展 */
  background-color: transparent;
  border: none;
  z-index: 99;
}

.preset-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.preset-plates-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 改为5列，为新能源车牌留出更多空间 */
  gap: 10px; /* 大幅增加间距，便于精准点击 */
}

.preset-plate-btn {
  padding: 8px 8px; /* 调整内边距，为新能源车牌留出空间 */
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md); /* 增大圆角 */
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px; /* 适当减小字体，避免新能源车牌换行 */
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  min-height: 38px; /* 保持最小高度 */
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.2px; /* 调整字符间距 */
  overflow: hidden; /* 防止内容溢出 */
}

.preset-plate-btn:hover {
  background: var(--primary-alpha-10);
  border-color: var(--primary-light);
  color: var(--primary);
  /* 移除transform偏移效果，保持位置不变 */
  box-shadow: var(--shadow-sm);
}

.preset-plate-btn:active {
  /* 移除transform效果，保持按钮位置不变 */
  box-shadow: none;
}

/* 预设车牌数量统计 */
.preset-plate-count {
  font-size: var(--text-xs);
  color: var(--text-light);
  margin-left: 4px;
  opacity: 0.8;
}

/* 小屏幕适配 */
@media (max-width: 375px) {
    .preset-plates-container {
        top: 130px; /* 小屏幕上相应调整位置 */
        padding: 8px 8px 12px;
    }
    
    .preset-plates-list {
        grid-template-columns: repeat(3, 1fr); /* 小屏幕改为3列，避免新能源车牌换行 */
        gap: 8px; /* 小屏幕上保持较大间距 */
    }
    
    .preset-plate-btn {
        padding: 6px 6px; /* 小屏幕上减小内边距，为新能源车牌留出空间 */
        font-size: 11px; /* 小屏幕上适当减小字体 */
        min-height: 32px;
        letter-spacing: -0.2px;
        overflow: hidden; /* 防止内容溢出 */
    }
    
    .input-view {
        padding-top: 190px; /* 小屏幕上调整为190px，为下移的预设车牌区域留出空间 */
    }
    
    .keyboard-integrated {
        max-height: calc(100vh - 210px); /* 小屏幕上调整为210px，为下移的预设车牌区域留出空间 */
    }
}

/* ==================== 模态框和提示 ==================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.3s;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--bg-card);
  width: 92%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px dashed #9CA3AF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #1E1B4B;
  transition: var(--transition-normal);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: -8px;
}

.modal-close:hover {
  background: #F8FAFF;
  color: #7C3AED;
}

.modal-close:active {
  animation: clickScale 0.3s ease;
}

.modal-body {
  padding: 24px;
}

.camera-container {
  width: 100%;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  padding-top: 65%;
}



#cameraPreview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-tips, .result-tips {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  text-align: center;
  line-height: 1.5;
  font-weight: 500;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px dashed #9CA3AF;
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* 统一按钮尺寸 */
.btn-capture, 
.btn-retry, 
.btn-confirm-result {
  height: 48px; /* 改为固定高度 */
  font-size: var(--text-md);
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  padding: 0 24px;
  box-sizing: border-box;
  line-height: 1;
}

/* 识别中覆盖层 */
.recognizing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 10;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid white;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 识别中文本 */
.recognizing-text {
  color: white;
  font-size: var(--text-lg);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
  margin: 0;
  animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.btn-capture, .btn-confirm-result {
  color: white;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* 重复车牌确认对话框样式 - 与反馈提示框完全统一 */
.confirm-modal-content {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-alpha-10) 100%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-width: 320px;
  max-width: 90%;
}

.confirm-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

.confirm-header {
  text-align: center;
  padding: 32px 24px 16px;
  position: relative;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25);
  animation: confirmIconPulse 2s ease-in-out infinite;
}

@keyframes confirmIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.confirm-header h3 {
  margin: 0;
  font-size: var(--text-2xl);
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.confirm-body {
  padding: 0 32px 24px;
  text-align: center;
}

.confirm-body p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
  font-weight: 500;
}

.confirm-footer {
  padding: 0 32px 32px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.btn-cancel-confirm, .btn-confirm-submit-new {
  height: 52px;
  font-size: var(--text-md);
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  padding: 0 28px;
  box-sizing: border-box;
  line-height: 1;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-cancel-confirm {
  background: var(--bg-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-cancel-confirm:hover {
  background: var(--border-light);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-cancel-confirm::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-cancel-confirm:hover::before {
  left: 100%;
}

.btn-confirm-submit-new {
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border: none;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
  position: relative;
}

.btn-confirm-submit-new:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
}

.btn-confirm-submit-new::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-confirm-submit-new:hover::before {
  left: 100%;
}

.btn-cancel-confirm:active, .btn-confirm-submit-new:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-capture:hover, .btn-confirm-result:hover {
  background: linear-gradient(135deg, #A855F7 0%, #3B82F6 100%);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
  color: white;
}

.btn-retry {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.btn-retry:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  background: var(--bg-alt);
  color: var(--text-primary);
}

.btn-retry:active {
  transform: scale(0.98);
  box-shadow: none;
}

.btn-capture:active, .btn-confirm-result:active {
  background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 100%);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
  transform: scale(0.98);
}

.recognized-plate {
  font-size: var(--text-3xl);
  text-align: center;
  padding: 16px;
  letter-spacing: 2px;
  font-weight: 700;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  margin: 16px 0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* 重复车牌确认专用样式 - 字体更小适合手机 */
.recognized-plate.confirm-plate-text {
  font-size: var(--text-lg); /* 改为更小字体 */
  padding: 12px 16px;
  letter-spacing: 1px; /* 减小字间距 */
  margin: 12px 0;
  white-space: nowrap; /* 强制不换行 */
  overflow: hidden; /* 隐藏溢出 */
  text-overflow: ellipsis; /* 超出显示省略号 */
}

.feedback-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 280px;
  max-width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  z-index: 1002;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.feedback-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}



.feedback-toast .icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-md);
}

.feedback-toast.success .icon {
  background: var(--primary); /* 使用主色调 */
  color: white;
  box-shadow: 0 4px 16px rgba(15, 28, 46, 0.3); /* 使用主色调阴影 */
}

.feedback-toast.error .icon {
  background: var(--danger-dark); /* 使用深色危险色 */
  color: white;
  box-shadow: 0 4px 16px rgba(230, 55, 87, 0.3); /* 使用危险色阴影 */
}

.feedback-toast.loading .icon {
  background: var(--primary); /* 使用主色调 */
  color: white; /* 白色图标 */
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.feedback-toast .message {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feedback-toast .submessage {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
  background-size: 200% 100%;
  width: 0%;
  transition: width 2s ease-out;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(15, 28, 46, 0.4);
  position: relative;
  overflow: hidden;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.toast-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.feedback-toast .action-btn,
.feedback-toast .action-btn-secondary {
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  width: 100%;
  max-width: 200px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1;
}

.feedback-toast .action-btn {
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.feedback-toast .action-btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.feedback-toast .action-btn:hover {
  background: linear-gradient(135deg, #A855F7 0%, #3B82F6 100%);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.feedback-toast .action-btn:active {
  animation: clickScale 0.3s ease;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 480px) {
  /* 重复车牌确认对话框手机优化 */
  .recognized-plate.confirm-plate-text {
    font-size: 1rem; /* 手机上更小字体 */
    padding: 10px 12px;
    letter-spacing: 0.5px;
    margin: 10px 0;
  }
  
  .modal-content {
    margin: 20px;
    max-width: calc(100% - 40px);
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .result-tips {
    font-size: 0.875rem;
    margin-top: 12px;
  }
  
  .modal-footer {
    padding: 16px;
    gap: 8px;
  }
  
  .btn-retry, .btn-confirm-result {
    height: 44px;
    font-size: 0.875rem;
    padding: 0 16px;
  }
  
  /* 原有手机样式 */
  .container {
    max-width: 100%;
  }
  
  .date-filter {
    padding: 8px 16px;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
  }
  
  .date-filter form {
    flex-shrink: 0;
  }
  
  .today-stats {
    flex: 1;
    justify-content: center;
    padding: 4px 6px;
    font-size: 12px;
    min-width: 0;
  }
  
  .stats-label {
    font-size: 12px;
  }
  
  .stats-count {
    font-size: 12px;
  }
  
  .connection-status {
    flex-shrink: 0;
    font-size: 12px;
  }
  
  .date-filter input[type="date"] {
    font-size: 12px;
    padding: 4px 6px;
  }

  .plate-card {
    height: 68px;
  }
  
  .plate-number {
    font-size: var(--text-lg);
  }
  
  .plate-time {
    font-size: var(--text-sm);
  }
  
  .keyboard-row {
    gap: 6px;
  }
  
  .keyboard-buttons {
    gap: 6px;
  }
  
  .key, .action-key {
    min-height: 44px;
    font-size: var(--text-md);
  }
  
  .btn-add, .btn-scan {
    width: 52px;
    height: 52px;
    right: 16px;
  }
  
  .btn-add {
    bottom: 16px;
  }
  
  .btn-scan {
    bottom: 80px;
  }
  
  .plate-display {
    gap: 6px;
  }
  
  .plate-char {
    width: 48px;
    height: 68px;
    font-size: var(--text-xl);
  }
  
  .modal-content {
    width: 95%;
  }
  
  /* 响应式调整按钮 */
  .btn-capture, 
  .btn-retry, 
  .btn-confirm-result {
    height: 44px; /* 改为固定高度 */
    font-size: var(--text-md);
    padding: 0 20px;
    box-sizing: border-box;
    line-height: 1;
  }
  
  .toast-buttons {
    gap: 6px;
  }
  
  .feedback-toast .action-btn,
  .feedback-toast .action-btn-secondary {
    height: 42px; /* 移动端稍小一点 */
    font-size: var(--text-md);
    padding: 0 16px;
    box-sizing: border-box;
    line-height: 1;
    max-width: 180px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    max-width: 90%;
  }
  
  .date-filter {
    gap: 10px;
  }
  
  .today-stats {
    padding: 4px 8px;
    font-size: 13px;
  }
  
  .connection-status {
    font-size: 13px;
    gap: 4px;
  }
  
  .date-filter input[type="date"] {
    font-size: 13px;
  }
  
  .plate-cards {
    padding: 20px;
  }
  
  .plate-card {
    padding: 16px 20px;
  }
  
  .plate-number {
    font-size: var(--text-xl);
  }
  
  .plate-time {
    font-size: var(--text-sm);
  }
  
  .keyboard-buttons button {
    font-size: var(--text-md);
  }
  
  .modal-content {
    max-width: 450px;
  }
}

@media (min-width: 769px) {
  .container {
    max-width: 700px;
    margin: 24px auto;
    border-radius: var(--radius-lg);
  }
  
  .plate-cards {
    padding: 24px;
  }
  
  .plate-card {
    padding: 18px 24px;
    margin-bottom: 16px;
  }
  
  .plate-number {
    font-size: var(--text-2xl);
  }
  
  .keyboard-integrated {
    padding: 24px;
    gap: 12px;
  }
  
  .key, .action-key {
    min-height: 52px;
    font-size: var(--text-lg);
  }
  
  .modal-content {
    max-width: 550px;
  }
}
/* 拍照识别加载状态样式 */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #FFFFFF;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    font-size: var(--text-md);
    font-weight: 500;
}

/* ==================== 智能轮询状态样式 ==================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.loading-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.loading-state p {
    font-size: var(--text-lg);
    font-weight: 500;
    margin-bottom: 8px;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--danger);
    text-align: center;
}

.error-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--danger);
}

.error-state h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.error-state p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 错误状态中的重试按钮 - 使用主要按钮样式 */
.error-state .btn-retry {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.error-state .btn-retry:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.error-state .btn-retry:active {
    transform: translateY(0);
}

/* 轮询错误提示 */
#poll-error {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
}

#poll-error.hide {
    animation: slideUp 0.3s ease;
}

/* ==================== 首页加载动画 ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 40%, #3B82F6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    text-align: center;
    color: white;
}

/* ==================== CONCENTRIC SPINNER同心圆旋转加载效果 ==================== */
.concentric-spinner {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
}

.spinner-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 3px solid transparent; /* 统一调整为3px，更细且一致 */
    transform: translate(-50%, -50%);
}

/* 外圈 - 最大 */
.ring-1 {
    width: 100px;
    height: 100px;
    border-top-color: #fff;
    border-right-color: #fff;
    animation: concentric-spin 1.2s linear infinite;
}

/* 中圈 - 中等 */
.ring-2 {
    width: 70px;
    height: 70px;
    border-bottom-color: #fff;
    border-left-color: #fff;
    animation: concentric-spin-reverse 1.2s linear infinite;
}

/* 内圈 - 最小 */
.ring-3 {
    width: 40px;
    height: 40px;
    border-top-color: #fff;
    border-right-color: #fff;
    animation: concentric-spin 1.2s linear infinite;
}

@keyframes concentric-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes concentric-spin-reverse {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

.loading-percentage {
    font-size: 24px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 12px;
}

.loading-text {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
    animation: loading-text-pulse 2s ease-in-out infinite;
}

@keyframes loading-text-pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}