/**
 * 采购全流程 AI 智能体工作流 - 统一样式
 * Ant Design 风格，响应式设计
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: #f5f5f5;
  color: rgba(0, 0, 0, 0.85);
  font-size: 14px;
  line-height: 1.5715;
}

/* ==================== 工具类 ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex {
  display: flex;
}

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

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* ==================== 卡片样式 ==================== */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}

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

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
}

.card-body {
  padding: 24px;
}

/* ==================== 统计卡片 ==================== */
.stat-card {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
}

.stat-card.green {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
}

.stat-card.gold {
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.stat-card.red {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.gold { background: #fffbeb; color: #d97706; }
.stat-icon.red { background: #fff1f2; color: #e11d48; }

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: #111827;
  margin-top: 8px;
}

.stat-label {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}

/* ==================== Hero Section ==================== */
.hero-section {
  background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
  border-radius: 16px;
  padding: 32px;
  color: white;
  margin-bottom: 32px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hero-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 16px;
  opacity: 0.9;
}

/* ==================== 按钮样式 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  text-decoration: none;
}

.btn-primary {
  background: #1677ff;
  color: white;
}

.btn-primary:hover {
  background: #4096ff;
}

.btn-default {
  background: #fff;
  border-color: #d9d9d9;
  color: rgba(0, 0, 0, 0.85);
}

.btn-default:hover {
  color: #4096ff;
  border-color: #4096ff;
}

.btn-success {
  background: #52c41a;
  color: white;
}

.btn-danger {
  background: #ff4d4f;
  color: white;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* ==================== 标签样式 ==================== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid;
}

.tag-green {
  background: #f6ffed;
  border-color: #b7eb8f;
  color: #52c41a;
}

.tag-gold {
  background: #fffbe6;
  border-color: #ffe58f;
  color: #faad14;
}

.tag-red {
  background: #fff2f0;
  border-color: #ffccc7;
  color: #ff4d4f;
}

.tag-blue {
  background: #e6f7ff;
  border-color: #91d5ff;
  color: #1890ff;
}

/* ==================== 表格样式 ==================== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.table thead {
  background: #fafafa;
}

.table th,
.table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.table th {
  font-weight: 600;
  color: #1f2937;
}

.table tbody tr:hover {
  background: #fafafa;
}

/* ==================== 表单样式 ==================== */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1f2937;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: #4096ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ==================== 进度条 ==================== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1677ff 0%, #4096ff 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ==================== 步骤条 ==================== */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
}

.step-item {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #f0f0f0;
  z-index: 1;
}

.step-item.finished:not(:last-child)::after {
  background: #52c41a;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  position: relative;
  z-index: 2;
  font-weight: 600;
}

.step-item.process .step-icon {
  background: #1677ff;
  color: white;
  animation: pulse 2s infinite;
}

.step-item.finished .step-icon {
  background: #52c41a;
  color: white;
}

.step-title {
  font-size: 14px;
  font-weight: 500;
  color: #666;
}

.step-item.process .step-title {
  color: #1677ff;
  font-weight: 700;
}

.step-item.finished .step-title {
  color: #52c41a;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 119, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 119, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 119, 255, 0);
  }
}

/* ==================== 供应商卡片 ==================== */
.supplier-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.supplier-card:hover {
  border-color: #1677ff;
  box-shadow: 0 4px 12px 0 rgba(22, 119, 255, 0.15);
}

.supplier-card.selected {
  border-color: #52c41a;
  background: #f6ffed;
}

.supplier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.supplier-name {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.supplier-score {
  font-size: 18px;
  font-weight: 700;
  color: #1677ff;
}

.supplier-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.supplier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== 政策卡片 ==================== */
.policy-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.policy-card.pass {
  border-left: 4px solid #52c41a;
}

.policy-card.warning {
  border-left: 4px solid #faad14;
}

.policy-card.na {
  border-left: 4px solid #d9d9d9;
}

.policy-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.policy-content {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

/* ==================== Alert 样式 ==================== */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-success {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #52c41a;
}

.alert-warning {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  color: #faad14;
}

.alert-error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #ff4d4f;
}

.alert-info {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #1890ff;
}

/* ==================== 时间线 ==================== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-dot {
  position: absolute;
  left: -26px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1677ff;
  z-index: 1;
}

.timeline-item.completed .timeline-dot {
  background: #52c41a;
  border-color: #52c41a;
}

.timeline-content {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* ==================== 搜索框 ==================== */
.search-box {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination-item {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-item:hover {
  border-color: #1677ff;
  color: #1677ff;
}

.pagination-item.active {
  background: #1677ff;
  border-color: #1677ff;
  color: white;
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .hero-section {
    padding: 24px 16px;
  }

  .hero-title {
    font-size: 20px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  .steps {
    flex-wrap: wrap;
  }

  .step-item {
    flex: 0 0 50%;
    margin-bottom: 16px;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 12px 8px;
  }
}

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

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

/* ==================== 加载动画 ==================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top-color: #1677ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ==================== 页面容器 ==================== */
.page-container {
  min-height: 100vh;
  background: #f5f5f5;
}

.page-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ==================== Grid 布局 ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
