/* ============================================================
 *  AI 智能化系统样式
 *  真实数据卡 + 沉浸流 + 智能推送
 * ============================================================ */

/* ==== 通用：AI 系统 ==== */
:root {
  --aqi-good: #30d158;
  --aqi-mod: #fbbf24;
  --aqi-bad: #ef4444;
}

[data-section] {
  scroll-margin-top: 80px;
}

/* ==== 真实环境卡（天气/空气） ==== */
.env-card {
  position: relative;
  background: linear-gradient(145deg, rgba(45,45,55,0.55) 0%, rgba(25,25,32,0.75) 100%);
  border: 1px solid rgba(200,200,210,0.1);
  border-radius: 20px;
  backdrop-filter: blur(28px);
  padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  overflow: hidden;
  animation: fadeInUp 0.9s cubic-bezier(0.23,1,0.32,1) 0.5s both;
}
.env-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,118,0.5) 50%, transparent);
  opacity: 0.6;
}

.env-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.env-loc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.env-loc-icon { font-size: 12px; opacity: 0.7; }
.env-loc-country {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 7px;
  border: 1px solid rgba(200,200,210,0.12);
  border-radius: 8px;
  margin-left: 4px;
}
.env-time {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.env-main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}
.env-temp-block {
  display: flex;
  align-items: center;
  gap: 10px;
}
.env-temp-icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(201,168,118,0.3));
}
.env-temp {
  font-size: 42px;
  font-weight: 200;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  text-shadow: 0 0 20px rgba(255,255,255,0.1);
}
.env-info { flex: 1; min-width: 0; }
.env-desc {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: 1px;
  font-weight: 500;
}
.env-detail {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.7;
  letter-spacing: 0.3px;
}
.env-aqi {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--aqi-color);
  border-radius: 12px;
  background: color-mix(in srgb, var(--aqi-color) 8%, transparent);
  min-width: 60px;
}
.env-aqi-num {
  font-size: 20px;
  font-weight: 600;
  color: var(--aqi-color);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.env-aqi-label {
  font-size: 9px;
  color: var(--aqi-color);
  margin-top: 2px;
  letter-spacing: 0.5px;
}
.env-aqi-sub {
  font-size: 8px;
  color: var(--text-muted);
  margin-top: 2px;
}

.env-forecast {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(200,200,210,0.06);
}
.env-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border-radius: 8px;
  transition: background 0.3s;
}
.env-day:hover {
  background: rgba(201,168,118,0.05);
}
.env-day-name {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.env-day-icon {
  font-size: 18px;
  line-height: 1;
}
.env-day-temp {
  font-size: 10px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.env-day-temp-max {
  color: var(--text-primary);
  font-weight: 500;
}
.env-day-pop {
  font-size: 9px;
  color: rgba(94,159,255,0.8);
}

.env-loading, .env-error, .feed-loading {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* ==== 沉浸式新闻流 ==== */
.smart-feed {
  position: relative;
  background: linear-gradient(145deg, rgba(45,45,55,0.6) 0%, rgba(20,20,26,0.85) 100%);
  border: 1px solid rgba(201,168,118,0.2);
  border-radius: 20px;
  backdrop-filter: blur(28px);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  min-height: 200px;
  animation: fadeInUp 0.9s cubic-bezier(0.23,1,0.32,1) 0.65s both;
}
.smart-feed::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,118,0.6) 50%, transparent);
  opacity: 0.8;
}

.feed-card {
  position: relative;
  padding: 18px 20px 20px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  min-height: 160px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: transform 0.3s;
}
.feed-card:active { transform: scale(0.99); }

.feed-rank {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 32px;
  font-weight: 200;
  color: var(--gold);
  line-height: 1;
  min-width: 40px;
  text-shadow: 0 0 20px rgba(201,168,118,0.3);
  letter-spacing: -2px;
}

.feed-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-tag-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.feed-platform {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(201,168,118,0.15);
  border: 1px solid rgba(201,168,118,0.3);
  border-radius: 4px;
  color: var(--gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}
.feed-tag {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(200,200,210,0.05);
  border: 1px solid rgba(200,200,210,0.12);
  border-radius: 4px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.feed-ai-score {
  font-size: 9px;
  padding: 2px 6px;
  background: linear-gradient(135deg, rgba(94,158,255,0.15), rgba(94,158,255,0.08));
  border: 1px solid rgba(94,158,255,0.3);
  border-radius: 4px;
  color: rgba(94,158,255,0.95);
  letter-spacing: 0.3px;
  font-family: 'SF Mono', Monaco, monospace;
}
.feed-fallback {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(201,168,118,0.08);
  border: 1px solid rgba(201,168,118,0.25);
  border-radius: 4px;
  color: var(--gold);
  letter-spacing: 0.3px;
  font-family: 'SF Mono', Monaco, monospace;
}

.feed-title {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
}

.feed-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.feed-action {
  padding: 6px 12px;
  background: rgba(200,200,210,0.05);
  border: 1px solid rgba(200,200,210,0.1);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}
.feed-action:hover {
  background: rgba(201,168,118,0.1);
  border-color: rgba(201,168,118,0.3);
  color: var(--gold);
  transform: translateY(-1px);
}
.feed-action.liked {
  background: rgba(201,168,118,0.2);
  border-color: rgba(201,168,118,0.5);
  color: var(--gold);
  animation: heartBeat 0.5s ease;
}

.feed-tap-hint {
  position: absolute;
  bottom: 6px;
  right: 14px;
  font-size: 9px;
  color: rgba(200,200,210,0.25);
  font-style: italic;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.feed-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(200,200,210,0.05);
}
.feed-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), rgba(201,168,118,0.4));
  width: 0;
  transition: width 0.5s ease;
}

/* ==== AI 兴趣画像卡 ==== */
.ai-profile {
  position: relative;
  background: linear-gradient(145deg, rgba(45,45,55,0.55) 0%, rgba(25,25,32,0.75) 100%);
  border: 1px solid rgba(200,200,210,0.1);
  border-radius: 20px;
  backdrop-filter: blur(28px);
  padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  overflow: hidden;
  animation: fadeInUp 0.9s cubic-bezier(0.23,1,0.32,1) 0.7s both;
}
.ai-profile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,118,0.5) 50%, transparent);
  opacity: 0.6;
}
.ai-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ai-title {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-title-dot {
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--gold);
  animation: titlePulse 2s ease-in-out infinite;
}
.ai-stats {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
}
.ai-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-tag {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-tag-name {
  font-size: 11px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  min-width: 60px;
}
.ai-tag-bar {
  flex: 1;
  height: 4px;
  background: rgba(200,200,210,0.06);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.ai-tag-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), rgba(201,168,118,0.4));
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.23,1,0.32,1);
}
.ai-tag-score {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
  min-width: 30px;
  text-align: right;
}
.ai-persona {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(200,200,210,0.06);
}
.ai-persona-item {
  text-align: center;
}
.ai-persona-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.ai-persona-value {
  font-size: 14px;
  color: var(--gold);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ai-persona-bar {
  height: 2px;
  background: rgba(200,200,210,0.06);
  border-radius: 1px;
  margin-top: 4px;
  overflow: hidden;
}
.ai-persona-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 1px;
  transition: width 0.5s;
}

/* ==== AI 系统加载态 ==== */
.ai-loading-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,26,0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(200,200,210,0.1);
  border-radius: 24px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.ai-loading-overlay.show { opacity: 1; }
.ai-loading-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: aiLoadingPulse 1s ease-in-out infinite;
}
@keyframes aiLoadingPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ==== 响应式 ==== */
@media (max-width: 1100px) {
  .env-forecast { grid-template-columns: repeat(5, 1fr); gap: 4px; }
}
@media (max-width: 768px) {
  .env-main { flex-wrap: wrap; gap: 12px; }
  .env-temp { font-size: 36px; }
  .env-temp-icon { font-size: 30px; }
  .env-aqi { padding: 4px 10px; min-width: 50px; }
  .env-aqi-num { font-size: 16px; }
  .feed-card { padding: 14px 16px; }
  .feed-rank { font-size: 24px; min-width: 32px; }
  .feed-title { font-size: 13px; }
}
