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

body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: #2c3e50;
  line-height: 1.6;
  overflow-x: hidden;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 添加平滑滚动 */
html {
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部样式 */
.header {
  text-align: center;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #667eea, #764ba2);
  background-size: 300% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.header-content .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.header-content .logo i {
  font-size: 2.5rem;
  color: #ff6b6b;
  animation: pulse 2s infinite;
}

.header-content h1 {
  font-size: 2.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #667eea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  margin: 0;
  position: relative;
  z-index: 1;
}

.subtitle {
  font-size: 1.2rem;
  color: #5a6c7d;
  font-weight: 400;
  margin-top: 8px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* 主要内容区域 */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* 控制面板 */
.control-panel {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.control-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4ecdc4, #44a08d);
}

.panel-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #333;
  font-size: 1.4rem;
}

.panel-card h2 i {
  color: #4ecdc4;
}

.control-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

/* 统一按钮风格 */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #45b8b0 0%, #3d8b7a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.btn-success:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(78, 205, 196, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #ffb300 0%, #ff7b00 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-warning:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #5a6268 0%, #3d4043 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(108, 117, 125, 0.3);
}

.btn-info {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
  background: linear-gradient(135deg, #138496 0%, #0f6674 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.btn-info:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(23, 162, 184, 0.3);
}

.btn-close {
  background: #ff4757;
  color: white;
  padding: 8px 12px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

.btn-close:hover {
  background: #ff3742;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.btn-close:active {
  transform: scale(0.95);
}

/* 推荐号码区域 */
.recommendations {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #333;
  font-size: 1.4rem;
}

.section-header h2 i {
  color: #ff6b6b;
}

/* 分析标签页样式 */
.analysis-tabs {
  display: flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.05);
  padding: 5px;
  border-radius: 25px;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tab-btn.active {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
  box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.tab-btn:hover:not(.active) {
  background: rgba(78, 205, 196, 0.1);
  color: #4ecdc4;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.confidence-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(78, 205, 196, 0.1);
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid rgba(78, 205, 196, 0.3);
}

.confidence-label {
  font-size: 0.9rem;
  color: #666;
}

.confidence-bar {
  width: 100px;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.confidence-value {
  font-weight: 600;
  color: #4ecdc4;
  min-width: 30px;
}

/* 推荐号码网格 */
.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.recommendation-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.recommendation-card:hover {
  transform: translateY(-5px);
}

.recommendation-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

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

.recommendation-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.confidence-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
}

.ball-container {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
  position: relative;
  animation: ballAppear 0.5s ease forwards;
  opacity: 0;
  transform: scale(0);
}

.ball.red {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
}

.ball.blue {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  box-shadow: 0 4px 10px rgba(78, 205, 196, 0.4);
}

.ball::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border-radius: 50%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), transparent);
}

/* 数据分析区域 */
.analysis {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.analysis-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(78, 205, 196, 0.3);
}

.card-header i {
  color: #4ecdc4;
  font-size: 1.2rem;
}

.card-header h3 {
  color: #333;
  font-size: 1.1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 0;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

.stat-value {
  font-weight: 600;
  color: #333;
}

/* 图表容器样式 */
.chart-container {
  width: 100%;
  height: 200px;
  margin: 15px 0;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  overflow: hidden;
}

.chart-container canvas {
  max-width: 100% !important;
  height: auto !important;
}

.distribution-chart {
  margin-top: 10px;
}

.dist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dist-item span {
  min-width: 60px;
  font-size: 0.9rem;
  color: #666;
}

.dist-value {
  min-width: 30px;
  font-weight: 600;
  color: #333;
  text-align: right;
}

.dist-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.dist-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
  min-width: 0;
}

.hot-numbers {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.hot-section h4 {
  color: #333;
  margin-bottom: 8px;
  font-size: 1rem;
}

.number-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.number-tag {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.number-tag.blue {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

/* 图表样式 */
.ratio-chart,
.prime-chart,
.consecutive-chart {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chart-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(78, 205, 196, 0.1);
  border-radius: 12px;
  font-size: 0.8rem;
  color: #333;
}

.chart-item .chart-bar {
  width: 30px;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.chart-item .chart-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4, #44a08d);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* 遗漏分析样式 */
.missing-section h4 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1rem;
  border-bottom: 2px solid rgba(78, 205, 196, 0.3);
  padding-bottom: 8px;
}

.missing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.missing-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

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

.missing-number {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.missing-value {
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.missing-value.low {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
}

.missing-value.medium {
  background: linear-gradient(45deg, #ffa726, #ff9800);
  color: white;
}

.missing-value.high {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
}

/* 统计卡片增强样式 */
.analysis-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.analysis-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.analysis-card .card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(78, 205, 196, 0.3);
}

.analysis-card .card-header i {
  color: #4ecdc4;
  font-size: 1.2rem;
}

.analysis-card .card-header h3 {
  color: #333;
  font-size: 1.1rem;
  margin: 0;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header {
    padding: 20px 15px;
    margin-bottom: 20px;
  }

  .header-content h1 {
    font-size: 1.8rem;
  }

  .header-content .logo i {
    font-size: 2rem;
  }

  .control-panel,
  .recommendations,
  .analysis,
  .history {
    padding: 15px;
    margin-bottom: 15px;
  }

  .control-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 15px 20px;
    font-size: 1.1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn-close {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
  }

  .analysis-tabs {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  .tab-btn {
    text-align: center;
    padding: 12px;
    font-size: 1rem;
  }

  .recommendations-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .ball-container {
    justify-content: center;
    gap: 6px;
  }

  .ball {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
  }

  .recommendation-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
  }

  .copy-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 38px;
    height: 30px;
  }

  .chart-container {
    height: 180px;
    margin: 10px 0;
    padding: 8px;
  }

  .chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* 移动端图表图标优化 */
  .card-header i {
    font-size: 1.4rem;
    min-width: 24px;
  }

  .card-header h3 {
    font-size: 1.2rem;
  }

  .missing-grid {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 6px;
  }

  .missing-item {
    padding: 6px;
  }

  .missing-number {
    font-size: 0.9rem;
  }

  .missing-value {
    font-size: 0.7rem;
    padding: 1px 4px;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .history-date {
    margin-left: 0;
  }

  .history-ball {
    width: 25px;
    height: 25px;
    font-size: 0.7rem;
  }

  .confidence-indicator {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .confidence-bar {
    width: 100%;
  }
}

/* 历史记录区域 */
.history {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
}

.history-content {
  max-height: 500px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  border-left: 4px solid #4ecdc4;
}

.history-period {
  font-weight: 600;
  color: #333;
  min-width: 80px;
}

.history-numbers {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.history-ball {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.history-ball.red {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.history-ball.blue {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.history-date {
  margin-left: auto;
  color: #666;
  font-size: 0.9rem;
}

/* 加载状态 */
.loading-placeholder {
  text-align: center;
  padding: 40px;
  color: #666;
}

.loading-placeholder i {
  font-size: 2rem;
  color: #4ecdc4;
  margin-bottom: 15px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  text-align: center;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #4ecdc4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

/* 通知提示 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification.show {
  transform: translateX(0);
}

/* 底部 */
.footer {
  margin-top: 40px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.footer-content p {
  margin-bottom: 8px;
  color: #666;
  font-size: 0.9rem;
}

.footer-content i {
  color: #4ecdc4;
  margin-right: 5px;
}

/* 动画 */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

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

@keyframes ballAppear {
  0% {
    opacity: 0;
    transform: scale(0) rotate(180deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* 添加页面加载动画 */
.page-loading {
  animation: fadeInUp 0.8s ease-out;
}

.card-animate {
  animation: slideInRight 0.6s ease-out;
}

.btn-animate {
  animation: bounce 0.6s ease-out;
}

/* 添加悬停动画 */
.analysis-card:hover {
  animation: pulse 0.6s ease-in-out;
}

.recommendation-card:hover {
  animation: bounce 0.6s ease-in-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header-content h1 {
    font-size: 2rem;
  }

  .control-buttons {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .recommendations-grid {
    grid-template-columns: 1fr;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .ball-container {
    justify-content: center;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .history-date {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 8px;
  }

  .header {
    padding: 15px 10px;
    margin-bottom: 15px;
  }

  .header-content h1 {
    font-size: 1.4rem;
  }

  .header-content .logo i {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .control-panel,
  .recommendations,
  .analysis,
  .history {
    padding: 12px;
    margin-bottom: 12px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .ball {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .history-ball {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
  }

  .chart-container {
    height: 120px;
    margin: 8px 0;
  }

  .analysis-card {
    padding: 15px;
  }

  .card-header h3 {
    font-size: 1rem;
  }

  .stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .missing-grid {
    grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
    gap: 4px;
  }

  .missing-item {
    padding: 4px;
  }

  .missing-number {
    font-size: 0.8rem;
  }

  .missing-value {
    font-size: 0.65rem;
    padding: 1px 3px;
  }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
  .header-content h1 {
    font-size: 1.2rem;
  }

  .ball {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .copy-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 32px;
    height: 26px;
  }

  .recommendation-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .chart-container {
    height: 120px;
    padding: 6px;
  }

  .chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* 超小屏幕图标优化 */
  .card-header i {
    font-size: 1.2rem;
    min-width: 20px;
  }

  .card-header h3 {
    font-size: 1rem;
  }
}

/* 复制按钮样式 */
.recommendation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 32px;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #ee5a24 0%, #ff5252 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.copy-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.copy-btn i {
  font-size: 0.9rem;
}
