/* 智能分析平台专用样式 */

.analysis-header {
  text-align: center;
  padding: 40px 60px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 20px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
  animation: slideIn 0.6s ease-out;
}

.analysis-grid {
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* 状态徽章 */
.status-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge.realtime {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.15),
    rgba(245, 158, 11, 0.08)
  );
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulse 2s infinite;
}

.status-badge.ai {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.15),
    rgba(239, 68, 68, 0.08)
  );
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.success {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.15),
    rgba(16, 185, 129, 0.08)
  );
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 图表图例 */
.chart-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.氨氮 {
  background: #ef4444;
}

.legend-dot.ph {
  background: #3b82f6;
}

.legend-dot.溶解氧 {
  background: #10b981;
}

.legend-dot.浊度 {
  background: #f59e0b;
}

/* 警报框 */
.alert-box {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fbbf24;
  border-radius: 12px;
  margin-top: 16px;
  animation: slideIn 0.5s ease-out;
}

.alert-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  font-size: 15px;
  color: #92400e;
  margin-bottom: 4px;
}

.alert-desc {
  font-size: 13px;
  color: #78350f;
  margin-bottom: 4px;
}

.alert-time {
  font-size: 12px;
  color: #a16207;
}

/* 分析部分 */
.analysis-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #f59e0b;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #fbbf24;
}

.reason-list {
  display: grid;
  gap: 16px;
}

.reason-item {
  animation: slideIn 0.5s ease-out backwards;
}

.reason-item:nth-child(1) {
  animation-delay: 0.1s;
}
.reason-item:nth-child(2) {
  animation-delay: 0.2s;
}
.reason-item:nth-child(3) {
  animation-delay: 0.3s;
}
.reason-item:nth-child(4) {
  animation-delay: 0.4s;
}

.reason-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reason-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.reason-percent {
  font-size: 16px;
  font-weight: 700;
}

.reason-percent.high {
  color: #f59e0b;
}

.reason-percent.medium {
  color: #f59e0b;
}

.reason-percent.low {
  color: #f59e0b;
}

.reason-bar {
  height: 12px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.reason-progress {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 999px;
  transition: width 1s ease-out;
  animation: progressGrow 1s ease-out;
}

@keyframes progressGrow {
  from {
    width: 0;
  }
}

/* 预测天气 */
.forecast-days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.forecast-day {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.forecast-day:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.day-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
}

.day-weather {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* 风险指示器 */
.risk-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.risk-thermometer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.thermometer-bg {
  width: 40px;
  height: 200px;
  background: linear-gradient(180deg, #fee2e2, #fef3c7, #d1fae5);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--border);
}

.thermometer-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(180deg, #ef4444, #f59e0b);
  border-radius: 20px;
  animation: fillUp 1.5s ease-out;
}

.thermometer-fill.high {
  height: 70%;
}

.thermometer-fill.medium {
  height: 50%;
}

.thermometer-fill.low {
  height: 30%;
}

@keyframes fillUp {
  from {
    height: 0;
  }
}

.risk-label {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.risk-label.high {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.15),
    rgba(239, 68, 68, 0.08)
  );
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.risk-label.medium {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.15),
    rgba(245, 158, 11, 0.08)
  );
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.risk-label.low {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.15),
    rgba(16, 185, 129, 0.08)
  );
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 质量对比 */
.quality-comparison {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.comparison-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.comparison-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.comparison-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.comparison-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.comparison-value.success {
  color: var(--ok);
}

/* 质量表格 */
.quality-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.quality-table thead {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.quality-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  border-bottom: 2px solid var(--border);
}

.quality-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.quality-table tbody tr {
  transition: all 0.2s ease;
}

.quality-table tbody tr:hover {
  background: linear-gradient(90deg, #f0f7ff 0%, #f8fafc 100%);
}

.status-normal {
  color: var(--ok);
  font-weight: 600;
}

.status-warning {
  color: var(--warn);
  font-weight: 600;
}

.status-error {
  color: var(--error);
  font-weight: 600;
}

/* 操作按钮 */
.action-btn {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.action-btn.primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.action-btn.primary:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* 响应式 */
@media (max-width: 1200px) {
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .forecast-days {
    grid-template-columns: repeat(3, 1fr);
  }

  .quality-comparison {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .forecast-days {
    grid-template-columns: 1fr;
  }
}
