/* 天气组件样式 */

/* 天气小部件 */
.weather-widget {
  position: relative;
  cursor: pointer;
}

.weather-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 80px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.weather-mini:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.weather-mini-content {
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-icon {
  font-size: 18px;
  line-height: 1;
  display: block;
  flex-shrink: 0;
}

.weather-mini-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.weather-location-mini {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

.weather-temp {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}

/* 天气弹窗内容样式 */
.weather-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.weather-update-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-right: 8px;
}

.weather-layout {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

/* 上方：当前天气 + 环境信息 */
.weather-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
}

.weather-main-icon {
  font-size: 56px;
  line-height: 1;
}

.weather-main-temp {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.weather-main-text {
  font-size: 16px;
  color: var(--text-secondary);
}

.weather-location-info {
  text-align: center;
}

.weather-location-info .weather-location {
  font-size: 16px;
  justify-content: center;
}

.weather-time {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* 详情信息 */
.weather-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .weather-details {
    grid-template-columns: repeat(2, 1fr);
  }
}

.weather-detail-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

.detail-label,
.weather-detail-label {
  font-size: 12px;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 4px;
}

.detail-value,
.weather-detail-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* 下方：预报信息 */
.weather-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 空气质量 */
.weather-section {
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.weather-aqi {
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.weather-aqi.aqi-excellent,
.weather-aqi.aqi-1 {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.weather-aqi.aqi-good,
.weather-aqi.aqi-2 {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.2), rgba(132, 204, 22, 0.1));
  border: 1px solid rgba(132, 204, 22, 0.3);
}

.weather-aqi.aqi-moderate,
.weather-aqi.aqi-3 {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(234, 179, 8, 0.1));
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.weather-aqi.aqi-unhealthy,
.weather-aqi.aqi-4 {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.1));
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.weather-aqi.aqi-very-unhealthy,
.weather-aqi.aqi-5 {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.weather-aqi.aqi-hazardous,
.weather-aqi.aqi-6 {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.3), rgba(127, 29, 29, 0.2));
  border: 1px solid rgba(127, 29, 29, 0.4);
}

.aqi-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.aqi-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
}

.aqi-level {
  font-size: 16px;
  color: var(--text-secondary);
}

.aqi-detail {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* 预警 */
.warning-title {
  color: #f59e0b;
}

.weather-alert {
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.weather-alert.alert-red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.weather-alert.alert-orange {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.weather-alert.alert-yellow {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.weather-alert.alert-blue {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-header {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.alert-level {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.alert-type {
  font-size: 12px;
  color: var(--text-secondary);
}

.alert-title {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

/* 逐小时预报 */
.hourly-forecast {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.hourly-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  min-width: 60px;
}

.hourly-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.hourly-icon {
  font-size: 24px;
}

.hourly-temp {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.hourly-pop {
  font-size: 11px;
  color: #60a5fa;
}

/* 7天预报 */
.daily-forecast {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daily-item {
  display: grid;
  grid-template-columns: 50px 24px 24px 80px 60px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.daily-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.daily-item.today {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.daily-date {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.daily-icon-day,
.daily-icon-night {
  font-size: 20px;
}

.daily-temp {
  font-size: 14px;
  color: var(--text-primary);
}

.temp-high {
  font-weight: 600;
}

.temp-low {
  color: var(--text-secondary);
}

.temp-divider {
  color: var(--text-tertiary);
  margin: 0 2px;
}

.daily-wind {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: right;
}

/* 生活指数 */
.indices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.index-item {
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  text-align: center;
  transition: background 0.2s;
}

.index-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.index-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.index-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.index-level {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.index-brief {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 分钟级降水 */
.minutely-precip {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

.precip-summary {
  font-size: 13px;
  color: var(--text-primary);
}

/* 底部：更新时间 + 来源 */
.weather-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.weather-update {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.weather-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.weather-refresh:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.weather-refresh.loading {
  animation: spin 1s linear infinite;
  pointer-events: none;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 600px) {
  .weather-modal {
    padding: 10px;
    align-items: flex-start;
  }

  .weather-modal-content {
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 20px);
  }

  .weather-main {
    flex-direction: column;
    gap: 8px;
  }

  .weather-main-icon {
    font-size: 48px;
  }

  .weather-main-temp {
    font-size: 36px;
  }

  .daily-item {
    grid-template-columns: 40px 20px 20px 60px;
    font-size: 12px;
  }

  .daily-wind {
    display: none;
  }

  .indices-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* AI 助手按钮样式 */
.ai-assistant-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ai-assistant-mini:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.ai-assistant-mini .ai-icon {
  font-size: 16px;
  line-height: 1;
}

.ai-assistant-mini .ai-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
