* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  color: #eef1f4;
  background: #171d26;
  overflow-x: hidden;
}
a { color: inherit; }

/* ---------- 天空场景背景 ---------- */
.scene {
  position: fixed; inset: 0; z-index: -1;
  transition: background 1.2s ease;
  background: linear-gradient(180deg, #232b36 0%, #171d26 60%, #10141b 100%);
}
.scene .cl {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  transition: background 1.2s ease;
}
.cl.c1 { width: 55vw; height: 38vh; top: -12vh; left: -8vw; background: #2e3947; }
.cl.c2 { width: 45vw; height: 32vh; top: 8vh; right: -10vw; background: #222b38; }
.cl.c3 { width: 60vw; height: 30vh; bottom: -10vh; left: 15vw; background: #1a222d; }

.scene-clear .scene { background: linear-gradient(180deg, #2b5d9e 0%, #234a80 55%, #1a3055 100%); }
.scene-clear .c1 { background: #4a7fc0; } .scene-clear .c2 { background: #d9a45c; opacity: .28; } .scene-clear .c3 { background: #2b5d9e; }
.scene-night .scene { background: linear-gradient(180deg, #131a2b 0%, #0e1322 60%, #090d18 100%); }
.scene-night .c1 { background: #1f2b4a; } .scene-night .c2 { background: #26355c; opacity: .4; } .scene-night .c3 { background: #141c33; }
.scene-rain .scene { background: linear-gradient(180deg, #1f2732 0%, #182029 60%, #11161d 100%); }
.scene-rain .c1 { background: #2a3644; } .scene-rain .c2 { background: #223040; } .scene-rain .c3 { background: #1b242f; }
.scene-storm .scene { background: linear-gradient(180deg, #23242c 0%, #191a21 60%, #101116 100%); }
.scene-storm .c1 { background: #35363f; } .scene-storm .c2 { background: #2b2c37; } .scene-storm .c3 { background: #1e1f27; }
.scene-snow .scene { background: linear-gradient(180deg, #39434f 0%, #2b333d 60%, #1e242c 100%); }
.scene-snow .c1 { background: #4d5966; } .scene-snow .c2 { background: #424e5c; } .scene-snow .c3 { background: #333d48; }

/* ---------- 布局 ---------- */
.shell { max-width: 1180px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 22px) 22px calc(env(safe-area-inset-bottom) + 30px); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 34px; flex-wrap: wrap; }
.brand { font-size: 14px; letter-spacing: .08em; color: rgba(238,241,244,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.brand .dot { margin: 0 8px; opacity: .4; }
.brand #locName { color: #fff; font-weight: 600; }

.searchwrap { position: relative; flex: 0 1 320px; min-width: 220px; }
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 99px; padding: 9px 16px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: rgba(238,241,244,.7);
}
.searchbox input { flex: 1; border: 0; outline: 0; background: transparent; color: #fff; font-size: 14px; min-width: 0; }
.searchbox input::placeholder { color: rgba(238,241,244,.45); }
.searchbox button { border: 0; background: transparent; color: rgba(238,241,244,.7); cursor: pointer; display: flex; padding: 2px; }
.searchbox button:hover { color: #fff; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30;
  background: rgba(30,37,48,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px; overflow: hidden;
}
.search-results div { padding: 11px 16px; font-size: 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.06); }
.search-results div:last-child { border-bottom: 0; }
.search-results div:hover, .search-results div:active { background: rgba(255,255,255,.08); }

/* ---------- 通用 ---------- */
.cap {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(238,241,244,.5); margin-bottom: 14px;
}
.glass {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}

/* ---------- 主网格 ---------- */
.grid { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }

/* 左侧玻璃卡 */
.side { padding: 26px 24px; }
.side-temp { font-size: 84px; font-weight: 200; line-height: 1; letter-spacing: -.02em; }
.side-temp i { font-style: normal; font-weight: 200; color: rgba(238,241,244,.6); }
.side-desc { font-size: 15px; color: rgba(238,241,244,.75); margin: 6px 0 20px; display: flex; align-items: center; gap: 8px; }
.side-desc svg { opacity: .85; }
.side-metrics { display: grid; gap: 9px; font-size: 13px; color: rgba(238,241,244,.6); }
.side-metrics .row { display: flex; justify-content: space-between; }
.side-metrics b { color: #eef1f4; font-weight: 500; }
.side-sec { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.side-aq { font-size: 12.5px; line-height: 1.7; color: rgba(238,241,244,.55); }
.side-aq b { color: #eef1f4; font-weight: 600; }

.nowcast-wrap { position: relative; }
.nowcast-bar { display: flex; gap: 2px; height: 40px; }
.nowcast-bar .bcol { flex: 1; display: flex; align-items: flex-end; cursor: pointer; min-width: 0; }
.nowcast-bar .bcol:hover, .nowcast-bar .bcol.active { background: rgba(255,255,255,.07); border-radius: 3px; }
.nowcast-bar i { width: 100%; border-radius: 2px 2px 0 0; min-height: 2px; background: linear-gradient(180deg, #7db3e8, #4a86c8); pointer-events: none; }
.nowcast-bar .bcol.dry i { background: rgba(255,255,255,.12); }
.nowcast-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: rgba(238,241,244,.4); margin-top: 6px; }
.bartip {
  position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: rgba(238,241,244,.96); color: #171d26; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 5;
}
.bartip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgba(238,241,244,.96);
}

/* 右侧主区 */
.hero { min-width: 0; }
.headline {
  font-size: clamp(44px, 6.5vw, 76px); font-weight: 200; line-height: 1.12;
  letter-spacing: .01em; margin: 2px 0 18px;
}
.nowcast-line { font-size: 16px; color: rgba(238,241,244,.85); line-height: 1.7; max-width: 560px; }
.nowcast-line .horn { color: #e8a25c; margin-right: 9px; font-size: 12px; vertical-align: 2px; }
.hero-meta { font-size: 13px; color: rgba(238,241,244,.5); margin-top: 14px; line-height: 1.9; }
.hero-btns { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.pill {
  display: inline-block; padding: 10px 22px; border-radius: 99px;
  background: #eef1f4; color: #171d26; font-size: 13.5px; letter-spacing: .04em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.pill.ghost { background: transparent; color: #eef1f4; border-color: rgba(255,255,255,.28); }
.pill.ghost:hover { border-color: rgba(255,255,255,.55); }

/* 温度曲线 */
.curve-wrap { margin-top: 42px; }
#tempCurve svg { width: 100%; height: auto; display: block; overflow: visible; }

/* 7 日预报 */
.days { margin-top: 52px; }
.day-row-wrap {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px;
}
.day-cell { min-width: 0; }
.day-cell .dtemp { font-size: clamp(26px, 3.4vw, 42px); font-weight: 200; line-height: 1.1; }
.day-cell .dtemp small { font-size: .55em; color: rgba(238,241,244,.45); font-weight: 300; margin-left: 4px; }
.day-cell .dname { font-size: 12.5px; color: rgba(238,241,244,.6); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.day-cell .dname svg { opacity: .8; flex: none; }
.day-cell .ddesc { font-size: 11.5px; color: rgba(238,241,244,.42); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-cell .bar { height: 3px; border-radius: 2px; margin-top: 10px; width: 70%; opacity: .85; }

.foot { text-align: center; font-size: 12px; color: rgba(238,241,244,.4); padding: 44px 0 6px; }
.foot a { color: rgba(238,241,244,.65); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.2); }

/* 加载 */
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 110px 0; color: rgba(238,241,244,.75); font-size: 14px; }
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2); border-top-color: #eef1f4;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(8,11,16,.6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-box { padding: 26px; width: 100%; max-width: 430px; background: rgba(30,37,48,.92); }
.modal-box h3 { margin-bottom: 10px; font-weight: 500; }
.modal-box .hint { font-size: 13px; color: rgba(238,241,244,.6); line-height: 1.7; margin-bottom: 16px; }
.modal-box .hint a { color: #9cc3ee; text-decoration: none; }
.modal-box label { display: block; font-size: 12.5px; color: rgba(238,241,244,.65); margin-bottom: 13px; }
.modal-box input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 10px; font-size: 14px; outline: none;
  background: rgba(255,255,255,.06); color: #fff;
}
.modal-box input:focus { border-color: rgba(255,255,255,.45); }
.modal-btns { display: flex; gap: 10px; margin-top: 8px; justify-content: flex-end; }

.hidden { display: none !important; }

.toast {
  position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%);
  background: rgba(238,241,244,.95); color: #171d26; font-size: 13.5px;
  padding: 10px 22px; border-radius: 99px; z-index: 200; white-space: nowrap;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .shell { padding-left: 18px; padding-right: 18px; }
  .topbar { margin-bottom: 24px; }
  .grid { grid-template-columns: 1fr; gap: 26px; }
  .hero { order: -1; }
  .headline { font-size: clamp(40px, 11vw, 56px); }
  .day-row-wrap { display: flex; overflow-x: auto; gap: 22px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .day-row-wrap::-webkit-scrollbar { display: none; }
  .day-cell { flex: none; width: 84px; }
  .day-cell .dtemp { font-size: 30px; }
  .searchwrap { flex: 1 1 100%; order: 2; }
}
