:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(16, 31, 49, 0.76);
  --panel-hover: rgba(22, 42, 64, 0.92);
  --text: #f3f7fb;
  --muted: #8da0b5;
  --line: rgba(171, 201, 225, 0.12);
  --cyan: #65e7d4;
  --cyan-deep: #21b9ad;
  --blue: #74b8ff;
  --radius: 24px;
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 6%, rgba(43, 119, 151, 0.16), transparent 34rem),
    linear-gradient(180deg, #07111f 0%, #091523 55%, #07111f 100%);
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.aurora {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .22;
  pointer-events: none;
}
.aurora-one { width: 30rem; height: 30rem; top: -18rem; left: -8rem; background: #1cc8b2; }
.aurora-two { width: 24rem; height: 24rem; top: 28rem; right: -15rem; background: #338fea; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { padding: 28px 0 74px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-weight: 750; text-decoration: none; letter-spacing: .04em; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(101, 231, 212, .45);
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(101, 231, 212, .08);
  box-shadow: 0 0 24px rgba(101, 231, 212, .08);
}
.top-actions { display: flex; gap: 10px; }
.unit-toggle, .refresh-button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(17, 33, 51, .7);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.unit-toggle { width: 48px; font-weight: 700; }
.refresh-button { display: flex; gap: 7px; align-items: center; padding: 0 15px; }
.unit-toggle:hover, .refresh-button:hover { border-color: rgba(101, 231, 212, .42); background: rgba(28, 50, 72, .9); }
.unit-toggle:active, .refresh-button:active { transform: translateY(1px); }
.refresh-icon { display: inline-block; font-size: 1.15rem; }
.is-spinning { animation: spin .8s linear infinite; }

.hero-copy { padding-top: 98px; max-width: 750px; }
.eyebrow, .section-kicker {
  margin: 0 0 20px;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .22em;
}
.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow span { width: 36px; height: 1px; background: var(--cyan); }
h1 { margin: 0; font-size: clamp(3.2rem, 8vw, 6.6rem); line-height: .98; letter-spacing: -.065em; font-weight: 760; }
h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px rgba(243, 247, 251, .42); }
.intro { max-width: 510px; margin: 28px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.8; }
.status-line { display: flex; gap: 9px; align-items: center; margin-top: 28px; color: #9fb1c4; font-size: .82rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.status-dot.error { background: #ff806f; box-shadow: 0 0 10px #ff806f; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; width: min(290px, 100%); gap: 9px; padding: 0 16px; height: 46px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: rgba(14, 29, 46, .64); }
.search-box:focus-within { border-color: rgba(101, 231, 212, .48); box-shadow: 0 0 0 3px rgba(101, 231, 212, .06); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-box input::placeholder { color: #6f8296; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { padding: 9px 14px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; transition: .2s; }
.filter:hover { color: var(--text); background: rgba(255,255,255,.04); }
.filter.active { color: #06221f; background: var(--cyan); font-weight: 750; }

.section-heading { display: flex; align-items: end; justify-content: space-between; padding: 66px 0 25px; }
.section-kicker { margin-bottom: 11px; }
h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.45rem); letter-spacing: -.035em; }
.result-count { margin: 0 0 4px; color: var(--muted); font-size: .85rem; }

.weather-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.weather-card {
  position: relative;
  overflow: hidden;
  min-height: 294px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 39, 59, .82), rgba(11, 25, 41, .8));
  box-shadow: 0 18px 55px rgba(0, 0, 0, .12);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.weather-card::before { content: ""; position: absolute; width: 140px; height: 140px; top: -65px; right: -55px; border-radius: 50%; background: var(--card-glow, rgba(101, 231, 212, .12)); filter: blur(4px); }
.weather-card:hover { transform: translateY(-3px); border-color: rgba(132, 184, 216, .26); background: linear-gradient(145deg, var(--panel-hover), rgba(12, 28, 45, .9)); }
.card-top { display: flex; justify-content: space-between; gap: 15px; }
.location { margin: 0; font-size: 1.28rem; font-weight: 750; letter-spacing: -.02em; }
.region-label { display: inline-block; margin-top: 7px; color: var(--muted); font-size: .72rem; letter-spacing: .06em; }
.weather-symbol { font-size: 2.25rem; filter: drop-shadow(0 7px 12px rgba(0,0,0,.2)); }
.temperature-row { display: flex; align-items: end; justify-content: space-between; margin-top: 26px; }
.temperature { font-size: 3.75rem; line-height: 1; font-weight: 300; letter-spacing: -.07em; }
.condition { padding-bottom: 7px; color: #c7d4df; font-size: .9rem; }
.range { margin-top: 8px; color: var(--muted); font-size: .77rem; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.metric-label { display: block; margin-bottom: 6px; color: #71859a; font-size: .66rem; }
.metric-value { font-size: .88rem; font-weight: 650; }

.skeleton-card { display: flex; flex-direction: column; gap: 20px; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-short { width: 34%; height: 20px; }
.skeleton-large { width: 48%; height: 58px; margin-top: 18px; }
.skeleton-medium { width: 58%; height: 14px; }
.skeleton-line { width: 100%; height: 58px; margin-top: auto; }
.empty-state { padding: 80px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-state div { font-size: 2rem; }.empty-state h3 { margin: 14px 0 5px; color: var(--text); }.empty-state p { margin: 0; }

footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 72px; padding: 28px 0 38px; border-top: 1px solid var(--line); color: #71859a; font-size: .75rem; }
footer p { margin: 0; } footer a:hover { color: var(--cyan); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .weather-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
}
@media (max-width: 600px) {
  .page-shell { width: min(100% - 28px, 1180px); }
  .hero { padding-top: 18px; padding-bottom: 52px; }
  .hero-copy { padding-top: 78px; }
  h1 { font-size: clamp(3rem, 17vw, 4.5rem); }
  .refresh-button span:last-child { display: none; }
  .refresh-button { width: 42px; justify-content: center; padding: 0; }
  .filter-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter { flex: 0 0 auto; }
  .section-heading { padding-top: 48px; }
  .weather-grid { grid-template-columns: 1fr; }
  .weather-card { min-height: 280px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
