/**
 * 移动端优化样式 - 深色模式友好版本
 * 
 * 包含：
 * - 响应式布局优化
 * - 触摸友好的交互
 * - 深色模式适配
 * - 移动端特定组件
 * - 性能优化
 */

/* 移动端基础优化 */
@media (max-width: 768px) {
  /* 防止横向滚动 */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  /* 优化触摸滚动 */
  body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  /* 禁用文本选择（在某些交互元素上） */
  button, .btn, .card-header {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }

  /* 优化点击高亮 */
  button, .btn, a, input, select, textarea {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
    touch-action: manipulation; /* 防止双击缩放 */
  }

  /* 移动端字体优化 */
  body {
    font-size: 16px; /* 防止iOS缩放 */
    line-height: 1.5;
  }

  /* 头部移动端优化 */
  header {
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  header h1 {
    font-size: 1.25rem;
  }

  /* 主内容区域移动端优化 */
  main {
    padding: 0 0.75rem;
    margin-bottom: 2rem; /* 为底部导航留空间 */
  }

  /* 卡片移动端优化 */
  .card {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
  }

  /* 表单移动端优化 */
  .form-group {
    margin-bottom: 1rem;
  }

  .form-group label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
  }

  input, select, textarea {
    font-size: 16px; /* 防止iOS缩放 */
    padding: 0.875rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
  }

  input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
  }

  /* 按钮移动端优化 */
  .btn {
    min-height: 52px; /* 更大的触摸目标 */
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }

  .btn:active {
    transform: scale(0.98);
  }

  /* 按钮波纹效果 */
  .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
  }

  .btn:active::before {
    width: 300px;
    height: 300px;
  }

  /* 表格移动端优化 - 卡片式布局 */
  .table-container {
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tbody tr {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    position: relative;
    transition: all 0.2s ease;
  }

  tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }

  tbody td {
    border: none;
    padding: 0.5rem 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 2rem;
  }

  tbody td:before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    width: 40%;
  }

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

  /* 操作按钮移动端优化 */
  .actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0.625rem;
    min-height: 44px;
  }

  /* 状态标签移动端优化 */
  .status-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
  }

  /* 导航链接移动端优化 */
  .nav-links {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .nav-links .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
  }

  /* 二维码容器移动端优化 */
  .qr-container {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
  }

  .qr-container img {
    max-width: 250px;
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
  }

  /* 筛选器移动端优化 */
  .filters-container {
    margin-bottom: 1rem;
    border-radius: var(--border-radius-lg);
    background: var(--bg-primary);
  }

  .filters-container form {
    padding: 1rem;
    gap: 1rem;
  }

  .search-inputs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .status-filter-section {
    display: none; /* 移动端隐藏复杂筛选 */
  }

  .action-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
  }

  .action-buttons .btn {
    flex: 1;
    max-width: 120px;
    font-size: 0.875rem;
    padding: 0.625rem 0.5rem;
  }

  /* 统计卡片移动端优化 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-card {
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
  }

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

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

  .stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
  }

  /* 通知移动端优化 */
  .alert {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
  }

  /* 图片上传移动端优化 */
  .photo-upload-container {
    border-radius: var(--border-radius-lg);
  }

  .upload-area {
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border-width: 3px;
    background: var(--bg-secondary);
    border-color: var(--border-color);
  }

  .upload-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .upload-text {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
  }

  .upload-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
  }

  .photo-preview img {
    height: 200px;
    border-radius: var(--border-radius-lg);
  }

  .remove-photo-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(10px);
  }
}

/* 小屏幕设备优化 (< 480px) */
@media (max-width: 480px) {
  /* 更紧凑的布局 */
  header {
    padding: 0.5rem 0.75rem;
  }

  header h1 {
    font-size: 1.125rem;
  }

  main {
    padding: 0 0.5rem;
  }

  .card {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  /* 表单优化 */
  .form-group {
    margin-bottom: 0.75rem;
  }

  input, select, textarea {
    padding: 0.625rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }

  /* 两列布局改为单列 */
  .two-col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* 统计卡片单列显示 */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* 操作按钮更紧凑 */
  .actions .btn {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  /* 表格卡片更紧凑 */
  tbody tr {
    padding: 0.75rem;
  }

  tbody td {
    padding: 0.375rem 0;
    font-size: 0.875rem;
  }

  tbody td:before {
    font-size: 0.75rem;
    width: 35%;
  }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
  /* 减少垂直间距 */
  header {
    padding: 0.5rem 1rem;
  }

  .card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

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

  /* 表单字段横向排列 */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  /* 统计卡片横向显示 */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.75rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }
}

/* 触摸设备特定优化 */
@media (hover: none) and (pointer: coarse) {
  /* 移除悬停效果，使用点击效果 */
  .btn:hover {
    transform: none;
    box-shadow: none;
  }

  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  /* 表格行点击效果 */
  tbody tr:hover {
    background-color: white;
  }

  tbody tr:active {
    background-color: var(--gray-50);
    transform: scale(0.99);
    transition: all 0.1s ease;
  }

  /* 链接点击效果 */
  a:active {
    opacity: 0.7;
    transition: opacity 0.1s ease;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 优化边框和阴影 */
  .card, .btn, input, select, textarea {
    border-width: 0.5px;
  }

  /* 优化图标和小元素 */
  .status-badge, .btn-sm {
    font-size: 0.8rem;
  }
}

/* 可访问性优化 */
@media (prefers-reduced-motion: reduce) {
  /* 减少动画 */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* 保留重要的焦点指示 */
  input:focus, select:focus, textarea:focus, .btn:focus {
    transition: none;
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
}

/* 深色模式支持 - 增强版 */
@media (prefers-color-scheme: dark) {
  /* 深色模式下的特殊处理 */
  .card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* 深色模式下的表单元素 */
  input, select, textarea {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
  }

  input:focus, select:focus, textarea:focus {
    background-color: var(--bg-primary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
  }

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

  /* 深色模式下的按钮增强 */
  .btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
  }

  .btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-hover);
  }

  /* 深色模式下的状态标签 */
  .status-pending {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
  }

  .status-processing {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2) 0%, rgba(34, 211, 238, 0.1) 100%);
    color: #22d3ee;
    border-color: rgba(34, 211, 238, 0.3);
  }

  .status-done {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, rgba(52, 211, 153, 0.1) 100%);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
  }

  .status-cancel {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2) 0%, rgba(248, 113, 113, 0.1) 100%);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
  }

  /* 深色模式下的图片上传区域 */
  .upload-area {
    background: var(--bg-secondary);
    border-color: var(--border-color);
  }

  .upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
  }

  /* 深色模式下的二维码容器 */
  .qr-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
  }
}

/* PWA 支持样式 */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--gray-200);
  z-index: 1000;
  display: none;
}

.pwa-install-prompt.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pwa-install-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.pwa-install-text {
  flex: 1;
}

.pwa-install-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.pwa-install-description {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.pwa-install-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pwa-install-actions .btn {
  flex: 1;
  font-size: 0.875rem;
  padding: 0.5rem;
}

/* 离线状态指示 */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning-color);
  color: white;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.offline-indicator.show {
  transform: translateY(0);
}

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

.skeleton-text {
  height: 1rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

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

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

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

/* 虚拟键盘适配 */
@media (max-height: 500px) {
  /* 当虚拟键盘弹出时的样式调整 */
  .card {
    margin-bottom: 0.5rem;
  }

  .form-group {
    margin-bottom: 0.5rem;
  }

  header {
    position: static; /* 避免被虚拟键盘遮挡 */
  }
}

/* 安全区域适配 (iPhone X 等) */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  header {
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }

  main {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  #backToTop {
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 10px));
    right: max(20px, calc(env(safe-area-inset-right) + 10px));
  }
}
/* 小屏幕设备优化 (< 480px) */
@media (max-width: 480px) {
  /* 更紧凑的布局 */
  header {
    padding: 0.5rem 0.75rem;
  }

  header h1 {
    font-size: 1.125rem;
  }

  main {
    padding: 0 0.5rem;
  }

  .card {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--border-radius);
  }

  /* 表单优化 */
  .form-group {
    margin-bottom: 0.75rem;
  }

  input, select, textarea {
    padding: 0.75rem;
    font-size: 16px; /* 防止缩放 */
  }

  .btn {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* 两列布局改为单列 */
  .two-col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* 统计卡片单列显示 */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* 操作按钮更紧凑 */
  .actions .btn {
    font-size: 0.8rem;
    padding: 0.5rem;
    min-height: 40px;
  }

  /* 表格卡片更紧凑 */
  tbody tr {
    padding: 0.75rem;
  }

  tbody td {
    padding: 0.375rem 0;
    font-size: 0.875rem;
  }

  tbody td:before {
    font-size: 0.75rem;
    width: 35%;
  }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
  /* 减少垂直间距 */
  header {
    padding: 0.5rem 1rem;
  }

  .card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

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

  /* 表单字段横向排列 */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  /* 统计卡片横向显示 */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.75rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }
}

/* 触摸设备特定优化 */
@media (hover: none) and (pointer: coarse) {
  /* 移除悬停效果，使用点击效果 */
  .btn:hover {
    transform: none;
    box-shadow: none;
  }

  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }

  .card:active {
    transform: scale(0.99);
    transition: transform 0.1s ease;
  }

  /* 表格行点击效果 */
  tbody tr:hover {
    background-color: var(--bg-primary);
    transform: none;
  }

  tbody tr:active {
    background-color: var(--bg-secondary);
    transform: scale(0.99);
    transition: all 0.1s ease;
  }

  /* 链接点击效果 */
  a:active {
    opacity: 0.7;
    transition: opacity 0.1s ease;
  }

  /* 状态标签点击效果 */
  .status-option:active .status-badge {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 优化边框和阴影 */
  .card, .btn, input, select, textarea {
    border-width: 0.5px;
  }

  /* 优化图标和小元素 */
  .status-badge, .btn-sm {
    font-size: 0.8rem;
  }

  /* 更精细的阴影 */
  .card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  }
}

/* PWA 支持样式 - 增强版 */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  z-index: 1000;
  display: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pwa-install-prompt.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pwa-install-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.pwa-install-text {
  flex: 1;
}

.pwa-install-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.pwa-install-description {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.pwa-install-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pwa-install-actions .btn {
  flex: 1;
  font-size: 0.875rem;
  padding: 0.5rem;
}

/* 离线状态指示 - 增强版 */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--warning-color) 0%, var(--warning-hover) 100%);
  color: white;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-md);
}

.offline-indicator.show {
  transform: translateY(0);
}

.offline-indicator::before {
  content: '📡 ';
  margin-right: 0.5rem;
}

/* 虚拟键盘适配 */
@media (max-height: 500px) {
  /* 当虚拟键盘弹出时的样式调整 */
  .card {
    margin-bottom: 0.5rem;
  }

  .form-group {
    margin-bottom: 0.5rem;
  }

  header {
    position: static; /* 避免被虚拟键盘遮挡 */
  }

  /* 减少间距以适应小屏幕 */
  main {
    padding: 0 0.5rem;
  }
}

/* 安全区域适配 (iPhone X 等) */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  header {
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }

  main {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .pwa-install-prompt {
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 10px));
    left: max(20px, calc(env(safe-area-inset-left) + 10px));
    right: max(20px, calc(env(safe-area-inset-right) + 10px));
  }
}

/* 移动端特殊交互优化 */
@media (max-width: 768px) {
  /* 增强点击区域 */
  .btn {
    position: relative;
  }

  .btn::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
  }

  /* 表格行点击区域优化 */
  tbody tr {
    cursor: pointer;
    position: relative;
  }

  tbody tr::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    z-index: -1;
  }

  /* 状态标签点击优化 */
  .status-option {
    position: relative;
  }

  .status-option::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    z-index: -1;
  }

  /* 输入框聚焦优化 */
  input:focus, select:focus, textarea:focus {
    transform: scale(1.02);
    z-index: 10;
    position: relative;
  }
}

/* 深色模式移动端特殊优化 */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
  /* 深色模式下的卡片增强 */
  .card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  /* 深色模式下的按钮增强 */
  .btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
  }

  /* 深色模式下的表格行 */
  tbody tr {
    background: var(--bg-primary);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  /* 深色模式下的输入框 */
  input, select, textarea {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
  }

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

  /* 深色模式下的离线指示器 */
  .offline-indicator {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  }

  /* 深色模式下的PWA提示 */
  .pwa-install-prompt {
    background: var(--bg-primary);
    border-color: var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }
}