/* 政府采购智能合规审计助手 Demo - 统一样式 */
/* 基于 TailwindCSS 设计系统 */

/* ==================== 基础样式 ==================== */
:root {
  /* 主色调 - 科技蓝 */
  --primary-900: #1E3A8A;
  --primary-800: #1E40AF;
  --primary-700: #1D4ED8;
  --primary-600: #2563EB;
  --primary-500: #3B82F6;
  --primary-400: #60A5FA;
  --primary-300: #93C5FD;
  --primary-200: #BFDBFE;
  --primary-100: #DBEAFE;
  
  /* 功能色 */
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  
  /* 中性色 */
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50: #F9FAFB;
  
  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

/* ==================== 布局 ==================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.min-h-screen {
  min-height: 100vh;
}

/* ==================== 导航栏 ==================== */
.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
  padding: 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  height: 2rem;
  width: 2rem;
  color: var(--primary-800);
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn:hover {
  transform: scale(1.02);
}

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

.btn-primary {
  background: linear-gradient(to right, var(--primary-900), var(--primary-600));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(to right, var(--primary-800), var(--primary-500));
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
}

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

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  color: var(--gray-600);
}

.btn-icon:hover {
  background: var(--gray-100);
}

/* ==================== 卡片 ==================== */
.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card-content {
  padding: 1.5rem;
}

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

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card-icon {
  height: 2.5rem;
  width: 2.5rem;
  margin-bottom: 1rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
}

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

/* ==================== 徽章 ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-destructive {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.badge-default {
  background: var(--primary-100);
  color: var(--primary-900);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ==================== 风险项卡片 ==================== */
.risk-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

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

.risk-card-l1 {
  border-left: 4px solid var(--danger);
}

.risk-card-l2 {
  border-left: 4px solid var(--warning);
}

.risk-card-l3 {
  border-left: 4px solid var(--info);
}

.risk-card-l4 {
  border-left: 4px solid var(--gray-500);
}

.risk-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.risk-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

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

.risk-description {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.risk-evidence {
  background: var(--gray-50);
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 1rem;
  border-left: 3px solid var(--primary-400);
}

.risk-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.risk-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
}

.risk-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

/* ==================== 进度条 ==================== */
.progress-container {
  margin: 2rem 0;
}

.progress-bar {
  height: 0.75rem;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary-600), var(--primary-500));
  transition: width 0.3s ease;
  border-radius: 9999px;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: 0.5rem;
}

.progress-step-icon {
  height: 1.5rem;
  width: 1.5rem;
}

.progress-step-icon.completed {
  color: var(--success);
}

.progress-step-icon.processing {
  color: var(--primary-600);
  animation: pulse 1.5s infinite;
}

.progress-step-icon.pending {
  color: var(--gray-400);
}

.progress-step-content {
  flex: 1;
}

.progress-step-title {
  font-weight: 500;
  color: var(--gray-900);
}

.progress-step-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
}

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

/* ==================== 上传区域 ==================== */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  background: white;
  transition: all 0.2s ease;
  cursor: pointer;
}

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

.upload-area-icon {
  height: 4rem;
  width: 4rem;
  color: var(--primary-500);
  margin: 0 auto 1.5rem;
}

.upload-area-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

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

/* ==================== 欢迎横幅 ==================== */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary-900), var(--primary-700), var(--primary-500));
  border-radius: 1rem;
  padding: 2rem;
  color: white;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.welcome-banner h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.welcome-banner p {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.welcome-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.welcome-stat {
  text-align: center;
}

.welcome-stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.welcome-stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ==================== 项目列表 ==================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.project-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.project-desc {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.project-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
}

/* ==================== 模态框 ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 32rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ==================== 表单 ==================== */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-textarea {
  min-height: 6rem;
  resize: vertical;
}

/* ==================== Toast 通知 ==================== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 20rem;
  animation: slideIn 0.3s ease;
}

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

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

/* ==================== 工具类 ==================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }
.text-center { text-align: center; }
.hidden { display: none; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .welcome-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .risk-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}
