/* 基础变量定义 */
:root {
  --primary-color: #4361ee;
  --primary-light: #4895ef;
  --secondary-color: #3f37c9;
  --accent-color: #4cc9f0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4bb543;
  --warning-color: #f8961e;
  --danger-color: #f94144;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 基础样式重置 */
body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #e35656 0%, #e4e8f0 100%);
  color: var(--dark-color);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* 容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* 头部样式 */
header {
  margin-bottom: 3rem;
  text-align: center;
  animation: fadeInDown 0.8s ease-out;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

header p {
  font-size: 1.1rem;
  color: #6c757d;
  font-weight: 400;
}

/* 卡片样式 */
section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(67, 97, 238, 0.1);
}

/* 表单样式 */
form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
  display: block;
}

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background-color: #f8f9fa;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
  background-color: white;
}

button[type="submit"] {
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 1rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
  background: linear-gradient(to right, var(--primary-light), var(--primary-color));
}

/* 结果区域样式 */
#resultContainer {
  animation: fadeIn 0.8s ease-out;
}

.result-highlight {
  text-align: center;
  margin-bottom: 1.5rem;
}

.result-highlight p:first-child {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.result-highlight p:last-child {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-item {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.result-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.result-item p:first-child {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.result-item p:last-child {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-color);
}

/* 图表容器 */
#chart {
  height: 300px;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

tr:hover td {
  background-color: #f8f9fa;
}

/* AI分析区域 */
#aiAnalysis {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

#aiAnalysis h3 {
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

#aiAnalysis p {
  margin-bottom: 1rem;
  color: #495057;
}

/* 加载动画 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* 页脚样式 */
footer {
  margin-top: 3rem;
  text-align: center;
  color: #6c757d;
  font-size: 0.9rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e9ecef;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  section {
    padding: 1.5rem;
  }
  
  .result-highlight p:last-child {
    font-size: 1.75rem;
  }
  
  .result-item p:last-child {
    font-size: 1.1rem;
  }
  
  #chart {
    height: 250px;
  }
  /* 卡片样式 */
    section {
      background: white;
      border-radius: var(--border-radius);
      box-shadow: var(--box-shadow);
      padding: 2rem;
      margin-bottom: 2rem;
      transition: var(--transition);
      border: 1px solid rgba(255, 255, 255, 0.2);
      backdrop-filter: blur(10px);
      overflow-x: auto; /* 添加这行 */
      max-width: 100%; /* 确保不会超出父容器 */
    }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.75rem;
  }
  
  section h2 {
    font-size: 1.3rem;
  }
  
  input, select, button {
    padding: 0.65rem 0.9rem;
  }
  
  .result-grid {
    grid-template-columns: 1fr;
  }
  
  th, td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* 特殊效果增强 */
.prose {
  max-width: 100%;
}

.prose h3 {
  color: var(--primary-color);
  position: relative;
  padding-left: 1.25rem;
}

.prose h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4em;
  height: 1em;
  width: 0.35em;
  background: var(--accent-color);
  border-radius: 0.2em;
}

/* 增强图表区域 */
.echarts-for-react {
  border-radius: var(--border-radius);
  overflow: hidden;
}

/* 增强表格滚动体验 */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

/* 打印样式 */
@media print {
  body {
    background: none;
    padding: 0;
  }
  
  section {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
  
  button, footer {
    display: none;
  }
  .shadow-md{padding:0rem;}
  .px-4 {
    padding-left: .5rem;
    padding-right: .5rem;
}
}