/* ===== CSS 变量 ===== */
:root {
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-300: #f9a8d4;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;
  --pink-700: #be185d;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pink-100);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.sakura-icon {
  font-size: 28px;
  animation: sway 3s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--pink-700);
  line-height: 1.2;
}

.year-tag {
  font-size: 12px;
  color: var(--pink-500);
  font-weight: 600;
  letter-spacing: 1px;
}

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link:hover { background: var(--pink-50); color: var(--pink-600); }
.nav-link.active { background: var(--pink-100); color: var(--pink-700); }

.update-info {
  font-size: 12px;
  color: var(--gray-400);
  flex-shrink: 0;
}

/* ===== 英雄区域 ===== */
.hero-banner {
  background: linear-gradient(135deg, #fff0f6 0%, #fce7f3 40%, #fdf4ff 100%);
  border-bottom: 1px solid var(--pink-100);
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: "🌸";
  position: absolute;
  font-size: 200px;
  opacity: 0.04;
  right: -20px;
  top: -40px;
  transform: rotate(15deg);
  pointer-events: none;
}

.hero-banner::after {
  content: "🌸";
  position: absolute;
  font-size: 120px;
  opacity: 0.04;
  left: 10%;
  bottom: -20px;
  transform: rotate(-10deg);
  pointer-events: none;
}

.hero-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-text h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--pink-700);
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 15px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.prediction-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  box-shadow: var(--shadow);
  min-width: 90px;
}

.summary-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--pink-600);
  line-height: 1;
}

.summary-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* 图例 */
.legend-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  min-width: 200px;
}

.legend-box h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.legend-items { display: flex; flex-direction: column; gap: 8px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-winter { background: #7c3aed; }
.dot-early { background: #f472b6; }
.dot-mid { background: #ec4899; }
.dot-peak { background: #db2777; }
.dot-late { background: #fbbf24; }
.dot-ended { background: #9ca3af; }

/* ===== 通知横幅 ===== */
.notice-bar {
  background: linear-gradient(90deg, var(--pink-600), var(--pink-500));
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.notice-icon { font-size: 16px; flex-shrink: 0; }

/* ===== 通用区域头部 ===== */
.section-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
  position: relative;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--pink-500);
  border-radius: 2px;
}

.section-desc {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ===== 过滤器 ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: white;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--pink-300); color: var(--pink-600); }
.filter-btn.active {
  background: var(--pink-500);
  border-color: var(--pink-500);
  color: white;
}

/* ===== 地图 ===== */
.map-section { background: white; }

.map-container {
  max-width: 1280px;
  margin: 0 auto 0;
  height: 560px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-left: 24px;
  margin-right: 24px;
  margin-bottom: 32px;
}

/* 地图标记 */
.sakura-marker {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sakura-marker:hover { transform: scale(1.3); }

.marker-petal {
  font-size: 10px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  animation: pulse 1.5s ease-out infinite;
  opacity: 0.6;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* 弹出框 */
.sakura-popup .leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: none;
  padding: 0;
  overflow: hidden;
}

.sakura-popup .leaflet-popup-content { margin: 0; }
.sakura-popup .leaflet-popup-tip { background: white; }

.map-popup { padding: 16px; min-width: 220px; }

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

.popup-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}

.popup-status {
  font-size: 11px;
  font-weight: 600;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
}

.popup-location, .popup-variety {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.popup-dates {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 8px;
}

.popup-date-item {
  flex: 1;
  text-align: center;
}

.date-label {
  display: block;
  font-size: 10px;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.date-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--pink-600);
}

.popup-days {
  font-size: 12px;
  color: var(--pink-600);
  text-align: center;
  margin-bottom: 6px;
}

.popup-note {
  font-size: 11px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-100);
  padding-top: 8px;
  margin-top: 4px;
}

/* ===== 花期表格 ===== */
.table-section {
  background: var(--gray-50);
  padding-bottom: 48px;
}

.region-tabs {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.region-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: white;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.region-tab:hover { border-color: var(--pink-300); color: var(--pink-600); }
.region-tab.active {
  background: var(--pink-600);
  border-color: var(--pink-600);
  color: white;
}

.table-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  overflow-x: auto;
}

.forecast-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  font-size: 14px;
}

.forecast-table thead tr {
  background: linear-gradient(135deg, var(--pink-600), var(--pink-500));
  color: white;
}

.forecast-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.forecast-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
  cursor: pointer;
}

.forecast-table tbody tr:last-child { border-bottom: none; }
.forecast-table tbody tr:hover { background: var(--pink-50); }

.forecast-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.city-name strong {
  display: block;
  font-weight: 600;
  color: var(--gray-800);
}

.province-tag {
  font-size: 11px;
  color: var(--gray-400);
}

.location-cell {
  font-size: 12px;
  color: var(--gray-500);
  max-width: 200px;
}

.region-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.region-southwest { background: #ede9fe; color: #7c3aed; }
.region-south { background: #fef3c7; color: #d97706; }
.region-central { background: #fce7f3; color: #db2777; }
.region-east { background: #dbeafe; color: #2563eb; }
.region-north { background: #d1fae5; color: #059669; }
.region-northeast { background: #e0f2fe; color: #0284c7; }
.region-northwest { background: #f3f4f6; color: #6b7280; }

.date-cell { color: var(--gray-600); white-space: nowrap; }
.peak-date { color: var(--pink-600); font-weight: 600; }
.duration-cell { color: var(--gray-500); }

.status-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* 行颜色 */
.row-peak { background: #fff0f6 !important; }
.row-blooming { background: #fff5f8 !important; }
.row-ended { opacity: 0.6; }

/* ===== 关于区域 ===== */
.about-section {
  background: white;
  padding: 48px 24px;
}

.about-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.about-inner h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 32px;
  position: relative;
  display: inline-block;
}

.about-inner h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--pink-500);
  border-radius: 2px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.about-card {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.2s, transform 0.2s;
}

.about-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.about-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.about-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.about-card p {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.7;
}


/* ===== 页脚 ===== */
.site-footer {
  background: var(--gray-800);
  color: var(--gray-400);
  padding: 24px;
  text-align: center;
}

.footer-inner p {
  font-size: 13px;
  line-height: 1.8;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header-inner {
    gap: 12px;
    padding: 0 16px;
  }

  .logo-text h1 { font-size: 15px; }
  .update-info { display: none; }

  .hero-banner { padding: 32px 16px; }
  .hero-text h2 { font-size: 22px; }
  .hero-content { flex-direction: column; gap: 24px; }

  .prediction-summary { gap: 12px; }
  .summary-item { padding: 12px 16px; min-width: 70px; }
  .summary-num { font-size: 28px; }

  .map-container {
    height: 380px;
    margin-left: 16px;
    margin-right: 16px;
    border-radius: var(--radius-lg);
  }

  .section-header { padding: 24px 16px 12px; flex-direction: column; align-items: flex-start; }
  .region-tabs { padding: 0 16px 12px; }
  .table-wrapper { padding: 0 16px; }

  .forecast-table th:nth-child(2),
  .forecast-table td:nth-child(2) { display: none; }

  .about-section { padding: 32px 16px; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .main-nav { display: none; }
  .filter-bar { gap: 6px; }
  .filter-btn { padding: 5px 12px; font-size: 12px; }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--pink-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--pink-400); }

/* ===== 加载动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-banner, .map-section, .table-section, .about-section {
  animation: fadeIn 0.5s ease-out;
}

/* ===== 樱花飘落动画 ===== */
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg) translateX(0); opacity: 0.8; }
  25% { transform: translateY(25vh) rotate(90deg) translateX(20px); }
  50% { transform: translateY(50vh) rotate(180deg) translateX(-15px); }
  75% { transform: translateY(75vh) rotate(270deg) translateX(10px); }
  100% { transform: translateY(105vh) rotate(360deg) translateX(-10px); opacity: 0; }
}

.sakura-fall {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}
