:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #60707f;
  --line: rgba(23, 33, 43, 0.12);
  --paper: rgba(255, 255, 255, 0.82);
  --paper-strong: #ffffff;
  --gold: #f6c84d;
  --coral: #ec6f66;
  --mint: #5fc7a2;
  --blue: #62a8e8;
  --plum: #665b88;
  --shadow: 0 24px 60px rgba(44, 62, 80, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f6f8f3;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.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;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 22% 7%, rgba(246, 200, 77, 0.38), transparent 29%),
    linear-gradient(180deg, #dff1f7 0%, #f8f4e8 43%, #f7faf7 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  backdrop-filter: blur(16px);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(31, 57, 77, 0.1);
}

.icon-button:focus-visible,
.search input:focus-visible {
  outline: 3px solid rgba(236, 111, 102, 0.34);
  outline-offset: 2px;
}

.search {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  min-width: 0;
}

.search input {
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 24px rgba(31, 57, 77, 0.08);
}

.hero {
  position: relative;
  min-height: clamp(410px, 72vh, 620px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.84)),
    linear-gradient(140deg, #bfe8ef 0%, #f8d46b 52%, #f29b72 100%);
  box-shadow: var(--shadow);
}

.sky-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 13%;
  right: 12%;
  width: clamp(96px, 25vw, 160px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff2a8;
  box-shadow:
    0 0 0 22px rgba(255, 242, 168, 0.2),
    0 0 70px rgba(255, 219, 92, 0.5);
}

.cloud,
.cloud::before,
.cloud::after {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.cloud {
  width: 150px;
  height: 48px;
  filter: drop-shadow(0 14px 20px rgba(63, 91, 110, 0.12));
}

.cloud::before,
.cloud::after {
  content: "";
}

.cloud::before {
  left: 24px;
  bottom: 14px;
  width: 62px;
  height: 62px;
}

.cloud::after {
  right: 24px;
  bottom: 10px;
  width: 48px;
  height: 48px;
}

.cloud-one {
  top: 29%;
  left: 9%;
}

.cloud-two {
  top: 43%;
  right: -18px;
  transform: scale(0.78);
}

.rain-lines {
  position: absolute;
  left: 14%;
  bottom: 20%;
  width: 220px;
  height: 110px;
  opacity: 0.32;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(98, 168, 232, 0.72) 43% 47%, transparent 48%) 0 0 / 46px 60px,
    linear-gradient(110deg, transparent 0 52%, rgba(95, 199, 162, 0.66) 53% 56%, transparent 57%) 20px 18px / 54px 70px;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 26px;
}

.eyebrow,
.section-kicker,
.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(2.5rem, 14vw, 5.2rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.location-line {
  margin: 0;
  max-width: 28rem;
  color: #3c4d58;
  font-size: 1rem;
  line-height: 1.5;
}

.temperature-row {
  display: grid;
  grid-template-columns: minmax(112px, 1.1fr) 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
  align-items: stretch;
}

.current-temp {
  margin: 4px 0 0;
  font-size: clamp(3rem, 18vw, 5rem);
  line-height: 0.9;
  font-weight: 800;
}

.range-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.range-card p:last-child {
  margin: 10px 0 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.advice-panel,
.forecast-section {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 16px 42px rgba(37, 54, 70, 0.1);
}

.advice-panel h2,
.section-heading h2 {
  margin: 4px 0 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.advice-text {
  margin: 18px 0 0;
  font-size: clamp(1.25rem, 7vw, 2.1rem);
  line-height: 1.14;
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag-list span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  color: #21313b;
  background: rgba(95, 199, 162, 0.18);
  font-size: 0.9rem;
  font-weight: 700;
}

.tag-list span:nth-child(2n) {
  background: rgba(246, 200, 77, 0.22);
}

.tag-list span:nth-child(3n) {
  background: rgba(98, 168, 232, 0.18);
}

.morning-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.morning-strip article {
  min-width: 0;
  padding: 14px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(37, 54, 70, 0.08);
}

.morning-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--coral);
  font-size: 1.28rem;
}

.morning-strip p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.morning-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.2;
}

.section-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.section-heading > p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.forecast-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.forecast-item {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) 42px minmax(74px, 1fr) 66px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.forecast-item:first-child {
  border-top: 0;
}

.forecast-day strong,
.forecast-day span {
  display: block;
}

.forecast-day strong {
  font-size: 0.98rem;
}

.forecast-day span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.weather-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(98, 168, 232, 0.14);
  font-size: 1.45rem;
}

.mini-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(96, 112, 127, 0.16);
}

.mini-bar span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--coral));
}

.forecast-temp {
  justify-self: end;
  font-size: 0.95rem;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(92vw, 420px);
  transform: translate(-50%, 120%);
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  background: rgba(23, 33, 43, 0.9);
  box-shadow: 0 14px 34px rgba(23, 33, 43, 0.22);
  font-size: 0.92rem;
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.is-loading .hero,
.is-loading .advice-panel,
.is-loading .morning-strip,
.is-loading .forecast-section {
  animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    filter: saturate(0.94) brightness(0.99);
  }

  to {
    filter: saturate(1.04) brightness(1.02);
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding-inline: 10px;
  }

  .hero-content {
    padding: 20px;
  }

  .temperature-row {
    grid-template-columns: 1fr;
  }

  .range-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .range-card p:last-child {
    margin: 0;
  }

  .forecast-item {
    grid-template-columns: minmax(70px, 1fr) 38px 52px;
  }

  .mini-bar {
    display: none;
  }
}

@media (min-width: 760px) {
  body {
    background:
      linear-gradient(90deg, rgba(95, 199, 162, 0.18), transparent 28%),
      linear-gradient(270deg, rgba(236, 111, 102, 0.13), transparent 30%),
      #eef5f6;
  }

  .app-shell {
    box-shadow: 0 0 80px rgba(28, 44, 58, 0.14);
  }
}
