/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 16px 80px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 40%, #2c5364 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(102,126,234,.25), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(118,75,162,.2), transparent 50%);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,.08)"/></svg>');
  opacity: .5;
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center;
  padding: 0 24px;
  animation: heroFadeUp .8s ease-out;
}
.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  color: rgba(255,255,255,.8);
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}
.hero-title {
  font-size: clamp(48px, 14vw, 96px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 8px;
  text-shadow: 0 4px 30px rgba(0,0,0,.3);
  line-height: 1.1;
}
.hero-subtitle {
  font-size: clamp(13px, 3.5vw, 17px);
  color: rgba(255,255,255,.7);
  margin-top: 10px;
  letter-spacing: 3px;
  font-weight: 300;
}
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}
.hero-meta-item { display: flex; flex-direction: column; align-items: center; }
.hero-meta-value {
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 700;
  color: #fff;
}
.hero-meta-label {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  letter-spacing: 1px;
  margin-top: 4px;
}
.hero-meta-divider {
  width: 1px; height: 32px;
  background: rgba(255,255,255,.2);
}
.scroll-hint {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  animation: bounce 2s infinite;
}
.scroll-hint span {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  letter-spacing: 1px;
}
.scroll-arrow {
  width: 20px; height: 20px;
  margin: 8px auto 0;
  border-right: 2px solid rgba(255,255,255,.4);
  border-bottom: 2px solid rgba(255,255,255,.4);
  transform: rotate(45deg);
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ===== Status Bar ===== */
.status-bar {
  position: sticky;
  top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: 12px 16px;
}
.status-bar-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.status-clock {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-clock span:first-child {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}
.status-clock-time {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  font-variant-numeric: tabular-nums;
}
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.refresh-btn:active { transform: scale(.96); }
.refresh-btn.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-progress {
  max-width: 640px;
  margin: 8px auto 0;
}

/* Departure Picker (in hero-content) */
.departure-picker {
  max-width: 300px;
  margin: 20px auto 0;
  padding: 10px 14px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
}
.departure-picker-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.departure-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.9);
  white-space: nowrap;
}
.departure-date-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  color: #fff;
  background: rgba(255,255,255,.1);
  outline: none;
  transition: border-color .2s;
  color-scheme: dark;
}
.departure-date-input:focus {
  border-color: rgba(255,255,255,.6);
}
.departure-confirm-btn {
  padding: 7px 14px;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.departure-confirm-btn:active { background: rgba(255,255,255,.35); }
.departure-display {
  display: none;
  align-items: center;
  justify-content: space-between;
}
.departure-display-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.departure-edit-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: rgba(255,255,255,.9);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
}
.departure-edit-btn:active { background: rgba(255,255,255,.2); }
.departure-picker.has-date .departure-picker-input { display: none; }
.departure-picker.has-date .departure-display { display: flex; }
.status-progress-text {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}
.status-progress-bar {
  height: 3px;
  background: rgba(0,0,0,.06);
  border-radius: 2px;
  overflow: hidden;
}
.status-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
  transition: width .4s ease;
}

/* ===== Itinerary ===== */
.itinerary {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ===== Day Card ===== */
.day-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.day-card.visible { opacity: 1; transform: translateY(0); }

.day-card-header {
  padding: 20px 20px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.day-card-header::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.15), transparent 60%);
}
.day-card-header[data-theme="1"] { background: linear-gradient(135deg, #2c5364, #203a43); }
.day-card-header[data-theme="2"] { background: linear-gradient(135deg, #11998e, #38ef7d); }
.day-card-header[data-theme="3"] { background: linear-gradient(135deg, #f12711, #f5af19); }
.day-card-header[data-theme="4"] { background: linear-gradient(135deg, #c31432, #240b36); }
.day-card-header[data-theme="5"] { background: linear-gradient(135deg, #414d0b, #727a17); }
.day-card-header[data-theme="6"] { background: linear-gradient(135deg, #8e2de2, #e65c00); }
.day-card-header[data-theme="7"] { background: linear-gradient(135deg, #0f9b0f, #00b4db); }
.day-card-header[data-theme="8"] { background: linear-gradient(135deg, #2c5364, #0f9b0f); }

.day-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative; z-index: 1;
}
.day-card-day {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.day-card-day-label {
  font-size: 12px;
  opacity: .7;
  letter-spacing: 1px;
}
.day-card-day-num {
  font-size: 28px;
  font-weight: 900;
}
.day-card-date {
  font-size: 12px;
  opacity: .8;
  text-align: right;
}
.day-card-route {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 700;
  margin-top: 12px;
  position: relative; z-index: 1;
}
.day-card-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 13px;
  opacity: .85;
  position: relative; z-index: 1;
}
.day-card-meta span { display: flex; align-items: center; gap: 4px; }

/* Today Badge */
.today-badge {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
  vertical-align: middle;
}
.today-badge-departure {
  background: rgba(76,175,80,.35);
  border-color: rgba(76,175,80,.5);
  color: #c8f7c5;
}

/* Weather Widgets */
.weather-widgets {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.weather-widgets::-webkit-scrollbar { display: none; }

.weather-widget {
  flex-shrink: 0;
  min-width: 140px;
  background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid rgba(102,126,234,.1);
  cursor: pointer;
  transition: var(--transition);
}
.weather-widget:active { transform: scale(.97); }
.weather-widget.has-data {
  background: linear-gradient(135deg, #667eea15, #764ba215);
}
.weather-widget.location-primary {
  min-width: 160px;
  background: linear-gradient(135deg, #667eea20, #764ba220);
  border-color: rgba(102,126,234,.25);
}

.weather-widget-location {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}
.weather-widget-spots {
  font-size: 11px;
  color: #999;
  margin-bottom: 6px;
  line-height: 1.4;
}
.weather-widget-date {
  display: inline-block;
  font-size: 11px;
  color: #667eea;
  background: #667eea10;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.weather-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  color: #999;
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.weather-unavailable-icon {
  font-size: 20px;
  opacity: .6;
}
.weather-widget-temp {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.weather-widget-temp-now {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  font-variant-numeric: tabular-nums;
}
.weather-widget-temp-unit {
  font-size: 14px;
  color: #999;
}
.weather-widget-desc {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
}
.weather-widget-icon { font-size: 16px; }
.weather-widget-range {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
}
.weather-widget-range span { display: flex; align-items: center; gap: 2px; }
.weather-widget-extra {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: 11px;
  color: #aaa;
}

/* Loading Skeleton */
.weather-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skeleton-line {
  height: 10px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
.skeleton-line.lg { height: 28px; width: 80px; }
.skeleton-line.sm { height: 8px; width: 60%; }
.skeleton-line.md { height: 8px; width: 90%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error state */
.weather-error {
  font-size: 12px;
  color: #e74c3c;
  text-align: center;
  padding: 8px 0;
}

/* Schedule Timeline */
.day-card-body {
  padding: 0 20px 20px;
}
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, #667eea30, #764ba230);
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #667eea;
  z-index: 1;
}
.timeline-item-time {
  font-size: 12px;
  font-weight: 700;
  color: #667eea;
  font-variant-numeric: tabular-nums;
}
.timeline-item-activity {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
  margin-top: 2px;
}
.timeline-item-desc {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

/* Tips Box */
.day-card-tips {
  margin: 0 20px 20px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff9e6, #fff3e0);
  border-radius: var(--radius-sm);
  border-left: 3px solid #ffa726;
  font-size: 12px;
  color: #8d6e63;
  line-height: 1.6;
}
.day-card-tips-icon { margin-right: 4px; }

/* Collapse toggle */
.day-card-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  font-size: 12px;
  color: #999;
  cursor: pointer;
  border-top: 1px solid rgba(0,0,0,.04);
  transition: var(--transition);
  user-select: none;
}
.day-card-toggle:active { background: rgba(0,0,0,.02); }
.day-card-toggle-arrow {
  transition: var(--transition);
}
.day-card.collapsed .day-card-body { display: none; }
.day-card.collapsed .day-card-toggle-arrow { transform: rotate(-90deg); }

/* ===== Packing List ===== */
.packing-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
}
.section-title-icon { font-size: 22px; }
.packing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.packing-card {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
}
.packing-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.packing-card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.packing-card-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  user-select: none;
}
.packing-check {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 2px solid #ddd;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 10px;
  color: transparent;
}
.packing-card-list li.checked .packing-check {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}
.packing-card-list li.checked { color: #ccc; text-decoration: line-through; }

/* ===== Strategy Section ===== */
.strategy-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 40px;
}
.strategy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.strategy-item {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  align-items: flex-start;
}
.strategy-item-tag {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.strategy-tag-best { background: #e8f5e9; color: #2e7d32; }
.strategy-tag-warn { background: #ffebee; color: #c62828; }
.strategy-tag-info { background: #e3f2fd; color: #1565c0; }
.strategy-item-content h3 { font-size: 14px; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; }
.strategy-item-content p { font-size: 12px; color: #666; line-height: 1.6; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 40px 20px 60px;
  background: #1a1a2e;
}
.footer-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.footer-sub {
  font-size: 11px;
  color: rgba(255,255,255,.3);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp .3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  background: #fff;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body { padding: 20px; }

.forecast-day {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.forecast-day:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.forecast-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.forecast-day-date { font-size: 14px; font-weight: 700; color: #1a1a2e; }
.forecast-day-temp { font-size: 13px; color: #666; }
.forecast-hours {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.forecast-hours::-webkit-scrollbar { display: none; }
.forecast-hour {
  flex-shrink: 0;
  text-align: center;
  min-width: 52px;
  padding: 8px 4px;
  background: #f8f9ff;
  border-radius: 8px;
}
.forecast-hour-time { font-size: 11px; color: #999; }
.forecast-hour-icon { font-size: 18px; margin: 4px 0; }
.forecast-hour-temp { font-size: 13px; font-weight: 700; color: #1a1a2e; }
.forecast-hour-rain { font-size: 10px; color: #42a5f5; margin-top: 2px; }

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

/* ===== Responsive ===== */
@media (max-width: 374px) {
  .hero { padding: 50px 12px 70px; }
  .hero-title { font-size: 38px; letter-spacing: 4px; }
  .hero-meta { gap: 14px; margin-top: 16px; }
  .hero-meta-value { font-size: 20px; }
  .departure-picker { padding: 8px 10px; }
  .departure-label { font-size: 12px; }
  .departure-date-input { padding: 6px 8px; font-size: 13px; }
}
@media (max-height: 700px) {
  .hero { padding: 40px 16px 60px; }
  .hero-badge { margin-bottom: 8px; }
  .hero-meta { margin-top: 16px; }
  .departure-picker { margin-top: 12px; }
  .scroll-hint { bottom: 12px; }
}
@media (min-width: 768px) {
  .packing-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-title { letter-spacing: 12px; }
}
