/* 图标颜色 */
.wi-sunny   { color: #4a7c59 !important; }
.wi-cloudy  { color: #4a7c59 !important; }
.wi-overcast{ color: #90A4AE !important; }
.wi-rain    { color: #42A5F5 !important; }
.wi-storm   { color: #AB47BC !important; }
.wi-snow    { color: #81D4FA !important; }
.wi-fog     { color: #B0BEC5 !important; }
.wi-haze    { color: #BCAAA4 !important; }
.wi-hot     { color: #EF5350 !important; }
.wi-cold    { color: #4DD0E1 !important; }
.wi-wind    { color: #81C784 !important; }
.wi-unknown { color: #BDBDBD !important; }

/* 文本颜色 */
.wt-sunny   { color: #4a7c59 !important; }
.wt-cloudy  { color: #4a7c59 !important; }
.wt-overcast{ color: #607D8B !important; }
.wt-rain    { color: #1976D2 !important; }
.wt-storm   { color: #6A1B9A !important; }
.wt-snow    { color: #0288D1 !important; }
.wt-fog     { color: #757575 !important; }
.wt-haze    { color: #6D4C41 !important; }
.wt-hot     { color: #D32F2F !important; }
.wt-cold    { color: #0097A7 !important; }
.wt-wind    { color: #388E3C !important; }
.wt-unknown { color: #616161 !important; }

/* 暗色模式适配（更柔和、更高对比度） */
@media (prefers-color-scheme: dark) {
  .wi-sunny   { color: #a8e063 !important; }
  .wi-cloudy  { color: #a8e063 !important; }
  .wi-overcast{ color: #B0BEC5 !important; }
  .wi-rain    { color: #64B5F6 !important; }
  .wi-storm   { color: #CE93D8 !important; }
  .wi-snow    { color: #B3E5FC !important; }
  .wi-fog     { color: #CFD8DC !important; }
  .wi-haze    { color: #D7CCC8 !important; }
  .wi-hot     { color: #E57373 !important; }
  .wi-cold    { color: #80DEEA !important; }
  .wi-wind    { color: #A5D6A7 !important; }
  .wi-unknown { color: #E0E0E0 !important; }

  .wt-sunny   { color: #a8e063 !important; }
  .wt-cloudy  { color: #a8e063 !important; }
  .wt-overcast{ color: #B0BEC5 !important; }
  .wt-rain    { color: #64B5F6 !important; }
  .wt-storm   { color: #CE93D8 !important; }
  .wt-snow    { color: #B3E5FC !important; }
  .wt-fog     { color: #CFD8DC !important; }
  .wt-haze    { color: #D7CCC8 !important; }
  .wt-hot     { color: #E57373 !important; }
  .wt-cold    { color: #80DEEA !important; }
  .wt-wind    { color: #A5D6A7 !important; }
  .wt-unknown { color: #E0E0E0 !important; }
}

/* ============================================
   逐小时滚动（标题栏与天气页共用）
   ============================================ */
.hourly-scroll {
  flex: 1;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.hourly-scroll::-webkit-scrollbar {
  display: none;
}

.hourly-scroll:active {
  cursor: grabbing;
}

.hourly-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  scroll-snap-align: center;
  min-width: 44px;
  height: 100%;
}

.hourly-item.current .hourly-time,
.hourly-item.current .hourly-temp {
  font-weight: 700;
  color: var(--text);
}

.hourly-time {
  font-size: 11px;
  color: var(--subtext);
  font-weight: 500;
}

.hourly-icon {
  font-size: 22px;
}

.hourly-temp {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   天气页面样式
   ============================================ */
.weather-page-content {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 4px;
}

/* 实时天气卡片 */
.weather-now-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.5s ease, color 0.5s ease;
}

.weather-now-card.sunny   { border-color: #4a7c59; }
.weather-now-card.cloudy  { border-color: #4a7c59; }
.weather-now-card.overcast{ border-color: #90A4AE; }
.weather-now-card.rain    { border-color: #42A5F5; }
.weather-now-card.storm   { border-color: #AB47BC; }
.weather-now-card.snow    { border-color: #81D4FA; }
.weather-now-card.fog     { border-color: #B0BEC5; }
.weather-now-card.haze    { border-color: #BCAAA4; }
.weather-now-card.hot     { border-color: #EF5350; }
.weather-now-card.cold    { border-color: #4DD0E1; }
.weather-now-card.wind    { border-color: #81C784; }
.weather-now-card.unknown { border-color: #BDBDBD; }

.weather-now-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.weather-now-icon {
  font-size: 64px;
  line-height: 1;
}

.weather-now-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.weather-now-temp {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.weather-now-desc {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.weather-now-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--subtext);
  margin-top: 4px;
}

.weather-now-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 逐小时天气卡片 */
.weather-hourly-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.5s ease;
}

.weather-hourly-card.sunny   { border-color: #4a7c59; }
.weather-hourly-card.cloudy  { border-color: #4a7c59; }
.weather-hourly-card.overcast{ border-color: #90A4AE; }
.weather-hourly-card.rain    { border-color: #42A5F5; }
.weather-hourly-card.storm   { border-color: #AB47BC; }
.weather-hourly-card.snow    { border-color: #81D4FA; }
.weather-hourly-card.fog     { border-color: #B0BEC5; }
.weather-hourly-card.haze    { border-color: #BCAAA4; }
.weather-hourly-card.hot     { border-color: #EF5350; }
.weather-hourly-card.cold    { border-color: #4DD0E1; }
.weather-hourly-card.wind    { border-color: #81C784; }
.weather-hourly-card.unknown { border-color: #BDBDBD; }

.weather-hourly-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding-left: 4px;
}

/* 暗色模式卡片边框 */
@media (prefers-color-scheme: dark) {
  .weather-now-card.sunny   { border-color: #64B5F6; }
  .weather-now-card.cloudy  { border-color: #64B5F6; }
  .weather-now-card.rain    { border-color: #64B5F6; }
  .weather-hourly-card.sunny   { border-color: #64B5F6; }
  .weather-hourly-card.cloudy  { border-color: #64B5F6; }
  .weather-hourly-card.rain    { border-color: #64B5F6; }
}
/* 天气页元素颜色过渡 */
.weather-now-temp,
.weather-now-desc,
.weather-hourly-title,
#weather-page .sub-page-title,
#weather-page .sub-page-back,
#weather-page .sub-page-back i {
  transition: color 0.3s ease, border-color 0.5s ease;
}

/* ============================================
   今日火烧云卡片
   ============================================ */
.weather-sunset-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass);
  border: 1.5px solid #FF9800;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.5s ease;
}

.weather-sunset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.weather-sunset-title {
  font-size: 15px;
  font-weight: 600;
  color: #FF9800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-sunset-title i {
  color: #FF9800;
}

.weather-sunset-link {
  font-size: 12px;
  color: var(--subtext);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.weather-sunset-link:hover {
  opacity: 1;
  color: #FF9800;
}

.weather-sunset-link i {
  font-size: 10px;
}

.weather-sunset-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 今日/明日分卡片 */
.sunset-day-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sunset-day-card.tomorrow {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.sunset-day-title {
  font-size: 14px;
  font-weight: 700;
  color: #FF9800;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.sunset-day-title i {
  color: #FF9800;
  font-size: 14px;
}

/* 朝霞/晚霞子卡片 */
.sunset-event-item {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (prefers-color-scheme: dark) {
  .sunset-event-item {
    background: rgba(255, 255, 255, 0.08);
  }
}

.sunset-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sunset-event-name {
  font-size: 14px;
  font-weight: 600;
  color: #FF9800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sunset-event-name i {
  font-size: 16px;
}

.sunset-event-name .sunrise-icon {
  color: #FF9800;
}

.sunset-event-name .sunset-icon {
  color: #FF9800;
}

.sunset-event-time {
  font-size: 13px;
  font-weight: 500;
  color: var(--subtext);
}

/* 事件详情（鲜艳度 + 气溶胶） */
.sunset-event-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sunset-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sunset-detail-label {
  font-size: 11px;
  color: var(--subtext);
  opacity: 0.7;
}

.sunset-detail-value {
  font-size: 13px;
  font-weight: 600;
  color: #FF9800;
}

/* 鲜艳度等级颜色 */
.sunset-quality-burn   { color: #D32F2F !important; }
.sunset-quality-light  { color: #FF9800 !important; }
.sunset-quality-slight { color: #FFC107 !important; }
.sunset-quality-none   { color: var(--subtext) !important; }

/* 加载状态 */
.sunset-loading {
  text-align: center;
  padding: 16px 0;
  font-size: 14px;
  color: var(--subtext);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sunset-error {
  text-align: center;
  padding: 12px 0;
  font-size: 13px;
  color: var(--subtext);
  opacity: 0.7;
}

/* ============================================
   预测解释折叠卡片
   ============================================ */
.sunset-explain-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 4px;
}

@media (prefers-color-scheme: light) {
  .sunset-explain-card {
    background: rgba(0, 0, 0, 0.03);
  }
}

.sunset-explain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.sunset-explain-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: light) {
  .sunset-explain-header:hover {
    background: rgba(0, 0, 0, 0.03);
  }
}

.sunset-explain-title {
  font-size: 14px;
  font-weight: 600;
  color: #FF9800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sunset-explain-title i {
  color: #FF9800;
  font-size: 14px;
}

.sunset-explain-icon {
  font-size: 12px;
  color: #FF9800;
  transition: transform 0.3s ease;
}

.sunset-explain-body {
  padding: 0 14px 14px;
  animation: fadeIn 0.3s ease;
}

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

.explain-section {
  margin-bottom: 16px;
}

.explain-section:last-child {
  margin-bottom: 0;
}

.explain-text {
  font-size: 13px;
  color: var(--subtext);
  line-height: 1.7;
  margin: 0 0 10px 0;
}

.explain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.explain-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  color: #FF9800;
  line-height: 1.5;
}

.explain-table tr:last-child td {
  border-bottom: none;
}

.explain-range {
  white-space: nowrap;
  width: 1px;
  font-weight: 600;
  color: #FF9800;
}

/* 数据来源 */
.weather-data-source {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0 8px;
}

.weather-data-source span {
  font-size: 11px;
  color: var(--subtext);
  opacity: 0.5;
}
