/* ========== 现代化设计风格 - 参考 GitHub/Vercel ========== */

:root {
  /* Vercel 风格配色 */
  --primary: #0070f3;
  --primary-dark: #0051cc;
  --success: #0070f3;
  --warning: #f5a623;
  --danger: #e00;
  
  /* GitHub 风格配色 */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border-color: #30363d;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --text-white: #ffffff;
  
  /* Linear 风格渐变 */
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  
  /* 卡片阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ========== 全局重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #fafafa;
  color: #24292f;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ========== 现代化头部 ========== */
.header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 现代化搜索框 */
.search-box {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 12px 48px 12px 20px;
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1);
}

.search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.search-box button:hover {
  background: var(--primary-dark);
}

/* ========== 主内容区 ========== */
.main-content {
  padding: 40px 0;
}

/* 现代化卡片样式 */
.map-section,
.forecast-section,
.cities-grid {
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.section-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #24292f;
}

/* ========== 地图容器 ========== */
.map-container {
  width: 100%;
  height: 600px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ========== 现代化天气卡片 ========== */
.weather-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 48px;
  color: white;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.weather-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.weather-header {
  position: relative;
  z-index: 1;
  margin-bottom: 32px;
}

.weather-header h3 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.weather-date {
  font-size: 16px;
  opacity: 0.9;
}

.weather-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.temperature {
  display: flex;
  align-items: flex-start;
}

.temp-value {
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.temp-unit {
  font-size: 48px;
  margin-top: 16px;
  font-weight: 600;
}

.weather-info {
  flex: 1;
}

.weather-condition {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.weather-icon-large {
  font-size: 80px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.weather-condition span:last-child {
  font-size: 32px;
  font-weight: 600;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.detail-value {
  font-size: 20px;
  font-weight: 700;
}

/* ========== 现代化预报卡片 ========== */
.forecast-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.forecast-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.forecast-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.forecast-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.forecast-icon {
  font-size: 48px;
  margin: 16px 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.forecast-condition {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.forecast-temp {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.forecast-temp .high {
  color: #e00;
}

.forecast-temp .low {
  color: var(--primary);
}

/* ========== 现代化城市卡片 ========== */
.cities-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.city-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 24px;
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.city-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.city-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

.city-card:hover::before {
  opacity: 1;
}

.city-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.city-weather {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.city-icon {
  font-size: 36px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.city-temp {
  font-size: 28px;
  font-weight: 800;
}

.city-info {
  font-size: 13px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* ========== 现代化页脚 ========== */
.footer {
  background: #f6f8fa;
  border-top: 1px solid #d0d7de;
  padding: 32px 0;
  margin-top: 64px;
}

.footer .container {
  text-align: center;
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: 16px;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .weather-main {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .temp-value {
    font-size: 80px;
  }
  
  .weather-details {
    grid-template-columns: 1fr;
  }
  
  .map-container {
    height: 400px;
  }
  
  .forecast-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cities-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .temp-value {
    font-size: 64px;
  }
  
  .forecast-container {
    grid-template-columns: 1fr;
  }
}

/* ========== 现代化动画 ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.weather-card,
.forecast-card,
.city-card {
  animation: fadeInUp 0.6s ease-out;
}

/* ========== 加载状态 ========== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 112, 243, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== 搜索建议 ========== */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 1001;
}

.search-suggestions div {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 14px;
}

.search-suggestions div:hover {
  background: #f6f8fa;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f6f8fa;
}

::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}
