/* 扁平化UI设计 - 发票对比系统 */

/* CSS变量定义 */
:root {
  /* 主色调 */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  /* 辅助色 */
  --secondary-color: #64748b;
  --secondary-hover: #475569;
  
  /* 成功/警告/错误 */
  --success-color: #10b981;
  --success-bg: #f0fdf4;
  --warning-color: #f59e0b;
  --warning-bg: #fffbeb;
  --error-color: #ef4444;
  --error-bg: #fef2f2;
  
  /* 中性色 */
  --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-muted: #64748b;
  
  /* 边框 */
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* 间距 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  
  /* 字体 */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  
  /* 字重 */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* 过渡 */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 主容器 */
.app-container {
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-6);
}

/* 头部样式 */
.app-header {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.header-content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo {
  width: 64px;
  height: 64px;
  background: var(--primary-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-2xl);
}

.header-text h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  font-weight: var(--font-weight-normal);
}

/* 进度指示器 */
.progress-container {
  display: flex;
  justify-content: space-between;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  position: relative;
}

.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -50%;
  width: 100%;
  height: 2px;
  background: var(--gray-200);
  transform: translateY(-50%);
  z-index: 1;
}

.progress-step.active::after {
  background: var(--primary-color);
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  color: var(--gray-500);
  transition: all var(--transition-normal);
  z-index: 2;
}

.progress-step.active .step-icon {
  background: var(--primary-color);
  color: white;
}

.step-content {
  display: flex;
  flex-direction: column;
}

.step-title {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.step-description {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* 主要内容区域 */
.main-content {
  display: grid;
  gap: var(--space-8);
}

/* 卡片样式 */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

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

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* 文件上传区域 */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.upload-card {
  background: var(--bg-primary);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.upload-card:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.upload-card.dragover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: scale(1.02);
}

.upload-icon {
  font-size: var(--font-size-3xl);
  color: var(--gray-400);
  margin-bottom: var(--space-4);
}

.upload-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.upload-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.upload-button {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upload-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* 文件信息 */
.file-info {
  background: var(--success-bg);
  border: 1px solid var(--success-color);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.file-info-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.file-name {
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.remove-file {
  background: none;
  border: none;
  color: var(--error-color);
  cursor: pointer;
  font-size: var(--font-size-sm);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.remove-file:hover {
  background: var(--error-bg);
}

/* 表单控件 */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--transition-fast);
}

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

.form-control:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

/* 复选框 */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.checkbox-item:hover {
  background: var(--bg-secondary);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.checkbox-item label {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

/* 对比控制区域 */
.compare-controls-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  border: 1px solid var(--border-color);
}

.controls-grid {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: var(--space-8);
  align-items: end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.control-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.control-label i {
  color: var(--primary-color);
}

.month-range-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.month-input {
  width: 80px !important;
  text-align: center;
}

.range-separator {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.option-item {
  padding: var(--space-2) 0;
}

.checkbox-compact {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.checkbox-compact input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.option-text {
  font-size: var(--font-size-sm);
}

.action-group {
  align-items: flex-end;
  justify-content: flex-end;
}

.compare-btn {
  min-width: 140px;
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .controls-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .action-group {
    align-items: stretch;
    justify-content: stretch;
  }
  
  .month-range-inputs {
    justify-content: center;
  }
}

/* 紧凑化优化 */
.upload-section {
  margin-bottom: var(--space-6);
}

.upload-card {
  padding: var(--space-6);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
}

.form-group {
  margin-bottom: var(--space-4);
}

.compare-controls-section {
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.controls-grid {
  gap: var(--space-6);
}

/* 增强视觉层次 */
.upload-card .card-header h3 {
  font-size: var(--font-size-lg);
  margin-bottom: 0;
}

.control-label {
  margin-bottom: var(--space-1);
}

.compare-btn {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 减少卡片阴影强度 */
.card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 横向列选择器 */
.column-selector-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
  max-height: 200px;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.column-selector-horizontal .checkbox-item {
  padding: var(--space-2) var(--space-3);
  margin: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
}

.column-selector-horizontal .checkbox-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
}

.column-selector-horizontal .checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin-right: var(--space-2);
}

.column-selector-horizontal .checkbox-item label {
  font-size: var(--font-size-xs);
  line-height: 1.3;
  word-break: break-word;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-300);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--gray-300);
}

/* 预览表格 */
.preview-container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
}

.preview-table th,
.preview-table td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.preview-table th {
  background: var(--bg-secondary);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.preview-table tr:hover {
  background: var(--gray-50);
}

.preview-info {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-align: center;
}

/* 结果展示 */
.results-section {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.results-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.results-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
}

.stat-item {
  text-align: center;
  padding: var(--space-4);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.stat-number {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

.result-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  border-left: 4px solid var(--warning-color);
}

.result-section h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.invoice-list {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: 'Courier New', monospace;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.results-table th,
.results-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.results-table th {
  background: var(--bg-secondary);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
}

.status-success {
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

/* 加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: var(--font-size-base);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--gray-600);
}

.modal-body {
  padding: var(--space-6);
}

.modal-body p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-6);
  border-top: 1px solid var(--border-color);
}

/* 通知消息 */
.notification {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-color);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 400px;
  z-index: 10001;
  animation: slideInRight 0.3s ease-out;
}

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

.notification-success {
  border-left-color: var(--success-color);
}

.notification-error {
  border-left-color: var(--error-color);
}

.notification-warning {
  border-left-color: var(--warning-color);
}

.notification-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  margin-left: auto;
}

.notification-close:hover {
  background: var(--bg-secondary);
  color: var(--gray-600);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .app-container {
    padding: var(--space-4);
  }
  
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .progress-container {
    flex-direction: column;
    gap: var(--space-4);
  }
  
  .progress-step:not(:last-child)::after {
    display: none;
  }
  
  .upload-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-content {
    width: 95%;
    margin: var(--space-4);
  }
  
  .notification {
    left: var(--space-4);
    right: var(--space-4);
    min-width: auto;
  }
}

/* 金额对比统计样式 */
.amount-comparison-summary {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
  border: 1px solid #d1e3ff;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.amount-comparison-summary h4 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.amount-types-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 6px;
  border-left: 4px solid var(--primary-color);
}

.amount-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.amount-type-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.amount-type-badge.tax-type {
  background: #e3f2fd;
  color: #1976d2;
}

.amount-type-badge.register-type {
  background: #f3e5f5;
  color: #7b1fa2;
}

.amount-statistics {
  margin: 20px 0;
}

.amount-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.amount-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.amount-table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
}

.amount-table tr:hover {
  background: #f8f9fa;
}

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

.amount-difference-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.amount-difference-warning h5 {
  color: #856404;
  margin: 0 0 10px 0;
  font-size: 14px;
}

.difference-amount {
  margin: 8px 0;
  font-size: 14px;
}

.difference-percentage {
  margin: 8px 0;
  font-size: 13px;
  color: #856404;
}

.amount-match-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 1px solid #28a745;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.amount-match-success h5 {
  color: #155724;
  margin: 0 0 10px 0;
  font-size: 14px;
}

.amount-match-success p {
  margin: 0;
  color: #155724;
  font-size: 13px;
}

/* 日期格式信息样式 */
.date-formats-info {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--primary-color);
  padding: 12px 16px;
  margin: 10px 0;
  border-radius: 4px;
  font-size: 14px;
}

.date-formats-info div {
  margin: 5px 0;
}

.date-formats-info strong {
  color: var(--primary-color);
  margin-right: 8px;
}

@media (max-width: 480px) {
  .app-header {
    padding: var(--space-6);
  }
  
  .card {
    padding: var(--space-6);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-footer {
    flex-direction: column;
  }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }

.bg-primary { background: var(--primary-color); }
.bg-secondary { background: var(--secondary-color); }
.bg-success { background: var(--success-color); }
.bg-warning { background: var(--warning-color); }
.bg-error { background: var(--error-color); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.hidden { display: none; }
.visible { display: block; }

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* === Neumorphism Design Overrides === */
:root {
  /* 基础色彩（低饱和度、低对比） */
  --neu-bg: #e0e5ec;
  --neu-bg-2: #edf1f5;
  --neu-shadow-dark: #a3b1c6;
  --neu-shadow-light: #ffffff;

  /* 映射现有变量以保持兼容 */
  --bg-primary: var(--neu-bg);
  --bg-secondary: var(--neu-bg-2);
  --primary-color: #6b7a90; /* 柔和灰蓝 */
  --primary-light: #f2f5f9;
  --text-primary: #2f3b4b; /* 对比度≥4.5:1 */
  --text-secondary: #5f6e84;
  --text-muted: #8391a4;
  --border-color: #dfe4ea;

  /* 复合阴影变量（统一管理） */
  --shadow-sm: 2px 2px 8px var(--neu-shadow-dark), -2px -2px 8px var(--neu-shadow-light);
  --shadow-md: 6px 6px 12px rgba(163,177,198,0.6), -6px -6px 12px rgba(255,255,255,0.85);
  --shadow-lg: 10px 10px 20px rgba(163,177,198,0.55), -10px -10px 20px rgba(255,255,255,0.85);
}

/* 全局背景与文字对比度 */
body {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Header 与容器轻微凸起 */
.app-header,
.compare-controls-section {
  background: var(--bg-primary);
  border: none;
  box-shadow: var(--shadow-sm);
}

/* 卡片轻微凹陷（内阴影 1px/1px/4px） */
.card,
.upload-card,
.results-section,
.modal-content {
  background: var(--bg-primary);
  border: none;
  box-shadow:
    inset 1px 1px 4px var(--neu-shadow-dark),
    inset -1px -1px 4px var(--neu-shadow-light);
}

/* 上传卡片交互反馈（轻外阴影 + 过渡） */
.upload-card:hover,
.card:hover {
  box-shadow:
    inset 1px 1px 4px var(--neu-shadow-dark),
    inset -1px -1px 4px var(--neu-shadow-light),
    2px 2px 8px rgba(163,177,198,0.35),
    -2px -2px 8px rgba(255,255,255,0.7);
  transition: box-shadow 200ms ease, transform 120ms ease;
  transform: translateY(-1px);
}

/* 按钮：凸起效果（2px/2px/8px） */
.btn {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 120ms ease, color 120ms ease, background 120ms ease;
}

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

.btn:active {
  transform: translateY(0);
  box-shadow:
    inset 2px 2px 8px var(--neu-shadow-dark),
    inset -2px -2px 8px var(--neu-shadow-light);
}

.btn:disabled {
  opacity: .6;
  box-shadow: none;
}

/* 主要按钮的色彩保持低饱和度 */
.btn-primary {
  color: var(--primary-color);
}

/* 输入框：凹陷效果 */
.form-control,
.month-input,
select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"] {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: none;
  border-radius: 12px;
  box-shadow:
    inset 2px 2px 6px rgba(163,177,198,0.6),
    inset -2px -2px 6px rgba(255,255,255,0.85);
  transition: box-shadow 200ms ease, background 120ms ease, color 120ms ease;
}

.form-control:focus,
.month-input:focus,
select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
  outline: none;
  box-shadow:
    inset 2px 2px 6px rgba(163,177,198,0.7),
    inset -2px -2px 6px rgba(255,255,255,0.9),
    0 0 0 2px rgba(138,161,177,0.35);
}

/* 复选框与列选择：柔和凸起 */
.checkbox-item {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.checkbox-item input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--bg-primary);
  box-shadow:
    inset 2px 2px 6px rgba(163,177,198,0.6),
    inset -2px -2px 6px rgba(255,255,255,0.85);
  transition: box-shadow 160ms ease, background 160ms ease;
}

.checkbox-item input[type="checkbox"]:checked {
  background: radial-gradient(circle at 50% 50%, var(--primary-color) 45%, transparent 46%);
  box-shadow:
    2px 2px 6px rgba(163,177,198,0.35),
    -2px -2px 6px rgba(255,255,255,0.7),
    inset 1px 1px 3px rgba(163,177,198,0.6),
    inset -1px -1px 3px rgba(255,255,255,0.85);
}

.column-selector-horizontal {
  background: var(--bg-primary);
  border: none;
  box-shadow:
    inset 1px 1px 4px var(--neu-shadow-dark),
    inset -1px -1px 4px var(--neu-shadow-light);
}

.column-selector-horizontal .checkbox-item {
  border: none;
  box-shadow: var(--shadow-sm);
}

/* 进度步骤图标：微凸起，激活时凹陷 */
.step-icon {
  background: var(--bg-primary) !important;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.progress-step.active .step-icon {
  color: var(--primary-color);
  box-shadow:
    inset 2px 2px 8px var(--neu-shadow-dark),
    inset -2px -2px 8px var(--neu-shadow-light);
}

/* 结果区域头部与统计卡片 */
.stats-card,
.results-header,
.summary-card {
  background: var(--bg-primary);
  border: none;
  box-shadow:
    inset 1px 1px 4px var(--neu-shadow-dark),
    inset -1px -1px 4px var(--neu-shadow-light);
}

/* 无障碍与动效控制 */
* { -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 宽屏优化断点 */
@media (min-width: 1400px) {
  .app-container {
    max-width: 1600px;
    padding-left: var(--space-7);
    padding-right: var(--space-7);
  }
  .main-content { gap: var(--space-9); }
  .upload-grid { gap: var(--space-8); }
  .results-section { padding: var(--space-9); }
  .results-summary { padding: var(--space-7); }
}

/* 选中字段区域样式 */
.selected-fields {
  position: relative;
  border: 1px solid #e0e3eb;
  border-radius: 10px;
  padding: 12px;
  background: #fafbff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
}
.selected-list {
  display: contents; /* 将chip提升为父级flex项，便于与按钮同排换行 */
}
.selected-actions {
  display: inline-flex;
  flex: 0 0 120px;
  align-items: center;
  justify-content: center;
}
.selected-actions .btn {
  width: 120px;
}
.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef2ff;
  border: 1px solid #dbe2ff;
  color: #3b4a7b;
  cursor: grab;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex: 0 0 auto;
  max-width: 220px;
}
.selected-chip.dragging { opacity: 0.6; }
.selected-chip .chip-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-chip .chip-remove {
  cursor: pointer;
  border: none;
  background: transparent;
  color: #6b7bb4;
}
.selected-chip .chip-remove:hover { color: #2f3a69; }

@media (max-width: 768px) {
  .selected-actions { flex: 0 0 100px; }
  .selected-actions .btn { width: 100px; }
  .selected-chip { max-width: 180px; }
}

/* 可选字段折叠交互 */
.collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.collapse-content {
  border: 1px dashed #e0e3eb;
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  background: #fff;
}
.collapse-content[data-collapsed="true"] {
  display: none;
}

/* 可选字段列表每项样式 */
.column-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #eef0f7;
  background: #ffffff;
  transition: background 0.2s ease;
}
.column-item:hover {
  background: #f6f8ff;
}
.column-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.column-item .item-name {
  font-weight: 500;
}

/* 进入/离开动画 */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fadeOutScale {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.98); }
}
.animate-enter {
  animation: fadeInScale 180ms ease-out;
}
.animate-leave {
  animation: fadeOutScale 160ms ease-in;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .selected-list {
    gap: 6px;
  }
  .selected-chip {
    padding: 6px 8px;
  }
}