:root {
  --bg: #0b1020;
  --card: #121933;
  --card2: #0f1730;
  --line: rgba(255,255,255,.08);
  --text: #eef2ff;
  --muted: #9aa5ce;
  --accent: #7dd3fc;
  --accent-soft: rgba(125,211,252,.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Noto Sans TC", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #162042 0%, var(--bg) 48%);
  color: var(--text);
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 18px 48px; }
h1 { margin: 8px 0 8px; font-size: clamp(2rem, 4vw, 3rem); }
.eyebrow, .muted { color: var(--muted); }
.meta-lines { line-height: 1.7; }
.card { background: rgba(18,25,51,.86); border: 1px solid var(--line); border-radius: 22px; padding: 18px; margin-top: 16px; box-shadow: 0 20px 40px rgba(0,0,0,.20); }
.hero-card { padding: 22px; }
.pill { display: inline-block; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
.location-name { margin-top: 12px; font-size: 1rem; font-weight: 800; color: #dfe9ff; }
.headline { margin-top: 8px; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 850; line-height: 1.1; }
.summary-badges { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.summary-badge { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.06); color: #e7ebff; font-size: .8rem; font-weight: 800; border: 1px solid rgba(255,255,255,.06); }
.summary-notes { margin-top: 12px; display: grid; gap: 8px; }
.summary-note { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); color: #dfe5ff; font-size: .88rem; line-height: 1.45; }
.section-title { font-size: 1rem; font-weight: 800; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.overview-card, .forecast-card { background: var(--card2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.forecast-card { display: flex; flex-direction: column; min-height: 188px; }
.overview-label, .forecast-label { font-size: .86rem; color: var(--muted); }
.overview-value, .forecast-condition { margin-top: 8px; font-size: 1.2rem; font-weight: 850; }
.overview-meta, .forecast-meta { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.reason { margin-top: 10px; font-size: .94rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.top-gap { margin-top: 12px; }
@media (max-width: 760px) {
  .wrap { padding: 20px 14px 44px; }
  .hero-card { padding: 18px; }
  .summary-badges { gap: 6px; }
  .summary-badge { padding: 6px 10px; font-size: .76rem; }
  .grid.two { grid-template-columns: 1fr; }
  .forecast-card { min-height: auto; }
}
.location-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.city-select {
  background: rgba(255,255,255,.08);
  color: #e7ebff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e7ebff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  transition: border-color .15s, background-color .15s;
}
.city-select:hover { border-color: rgba(255,255,255,.3); background-color: rgba(255,255,255,.12); }
.city-select option { background: #1a1f35; color: #e7ebff; }
.location-selects { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }

/* === 現代 CSS 增強 ============================== */
/* 淺色模式 */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --card: #ffffff;
    --card2: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(0,0,0,.08);
  }
  body { background: radial-gradient(circle at top, #e0f2fe 0%, var(--bg) 48%); }
  .card { background: rgba(255,255,255,.9); }
  .summary-note, .summary-badge { background: rgba(0,0,0,.04); }
}

/* 減少動畫（眩光敏感） */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 高對比度 */
@media (prefers-contrast: high) {
  :root {
    --accent: #0369a1;
    --text: #000;
    --muted: #374151;
    --line: rgba(0,0,0,.2);
  }
  .card { border-width: 2px; }
}

/* color-mix 支援 */
@supports (background: color-mix(in srgb, #000 50%, #fff)) {
  .pill { background: color-mix(in srgb, var(--accent) 15%, transparent); }
}
