﻿/* 銆岃。鏈嶅拫绌裤€嶁€?澶╂皵鍗?绗竴灞?*/

:root {
  --bg: #FAF8F5;
  --ink: #1C1B1A;
  --ink-2: #97928B;
  --ink-3: #C3BEB6;
  --c1: #7C93A8;
  --c2: #4E6779;
  --c3: #38505F;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 20px) 18px calc(env(safe-area-inset-bottom) + 26px);
}

.app { width: 100%; max-width: 460px; margin: auto 0; }

/* ---------- 椤舵爮 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 16px;
}

.city-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .18s ease;
}
.city-btn:active { background: rgba(0, 0, 0, .05); }

.pin, .chev { color: var(--ink-2); flex: none; }

.date {
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .02em;
}

/* ---------- 澶╂皵鍗?---------- */

.card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(158deg, var(--c1) 0%, var(--c2) 58%, var(--c3) 100%);
  box-shadow:
    0 2px 6px rgba(28, 27, 26, .04),
    0 22px 44px -22px rgba(28, 27, 26, .34);
  transition: background .8s ease;
  isolation: isolate;

  /* 鍗￠潰鏂囧瓧鑹诧細澶滈噷鐧藉瓧锛岀櫧澶╂繁澧?*/
  --card-ink: #fff;
  --card-ink-rgb: 255, 255, 255;
  color: var(--card-ink);
}

.card.is-light {
  --card-ink: #22303C;
  --card-ink-rgb: 34, 48, 60;
  box-shadow:
    0 2px 6px rgba(28, 27, 26, .05),
    0 20px 40px -24px rgba(48, 66, 84, .38);
}

/* 椤跺厜 + 搴曢儴鍘嬫殫锛岃绾壊娓愬彉鏈夊眰娆★紱鍏夋斁鍦ㄥ彸涓婏紝鍒帇鍦ㄥぇ鏁板瓧涓?*/
.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(64% 52% at 82% 6%, rgba(255, 255, 255, .22), transparent 72%),
    linear-gradient(to top, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0) 58%);
}

/* 澶╂皵鍔ㄧ敾灞傦細闆ㄣ€侀洩銆佷簯銆佸厜鐐归兘鐢诲湪杩欏潡鐢诲竷涓?*/
.wx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .9;
}

/* 娴呰壊鍗′笉瑕佸帇鏆楋紝鍙湪椤堕儴鍔犱竴灞傛煍鍏?*/
/* 娴呰壊鍗′笉瑕佸帇鏆楋紝鍙湪椤堕儴鍔犱竴灞傛煍鍏?*/
.card.is-light .sheen {
  background:
    radial-gradient(72% 56% at 78% 2%, rgba(255, 255, 255, .7), transparent 72%);
}

.card.is-light .metric {
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
}

.card-body { position: relative; padding: 32px 22px 2px; }

.temp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.temp {
  font-size: clamp(88px, 27vw, 110px);
  font-weight: 200;
  line-height: .86;
  letter-spacing: -.05em;
  color: var(--card-ink);
  font-variant-numeric: tabular-nums;
  transition: opacity .3s ease;
}
.temp .deg {
  font-size: .33em;
  font-weight: 200;
  line-height: 1;
  vertical-align: top;
  margin-left: 3px;
  letter-spacing: 0;
}

.icon { width: 78px; height: 78px; flex: none; color: var(--card-ink); opacity: .92; animation: floaty 7s ease-in-out infinite; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .icon { animation: none; }
}
.icon svg { width: 100%; height: 100%; display: block; }

.desc {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 500;
  color: rgba(var(--card-ink-rgb), .96);
  letter-spacing: .04em;
}

.range {
  margin-top: 5px;
  font-size: 13px;
  color: rgba(var(--card-ink-rgb), .68);
  font-variant-numeric: tabular-nums;
}
.range .sep { opacity: .6; margin: 0 1px; }

.feels {
  display: inline-flex;
  align-items: center;
  margin-top: 13px;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--card-ink-rgb), .24);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: rgba(var(--card-ink-rgb), .8);
  font-variant-numeric: tabular-nums;
}
.feels b { font-weight: 600; color: var(--card-ink); margin-left: 2px; }

.divider {
  display: none;
  height: 1px;
  margin: 16px 0 0;
  background: linear-gradient(90deg, transparent, rgba(var(--card-ink-rgb), .18) 12%, rgba(var(--card-ink-rgb), .18) 88%, transparent);
}

/* ---------- 娓╁害鏇茬嚎 ---------- */

.chart {
  margin: 10px 0 0;
  color: var(--card-ink);
}
.chart svg { display: block; width: 100%; }

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: left;
  padding: 11px 11px 12px 13px;
  border-radius: 14px;
  background: rgba(var(--card-ink-rgb), .07);
}

.m-txt {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

/* 鍙充晶灏忓渾鐜細鎶婄瓑绾х敾鍑烘潵锛屽埆鍙暀涓€鍧楃┖鐧?*/
.gauge {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--card-ink);
}
.gauge > svg { width: 40px; height: 40px; display: block; transform: rotate(-90deg); }
.gauge .gt {
  fill: none;
  stroke: rgba(var(--card-ink-rgb), .17);
  stroke-width: 3;
}
.gauge .gf {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100.5;
  stroke-dashoffset: 100.5;
  opacity: .9;
  transition: stroke-dashoffset .9s cubic-bezier(.4, 0, .2, 1);
}

/* 鍥涗釜鎸囨爣鍚勭敤涓€绉嶉鑹诧紝鎵竴鐪煎氨鐭ラ亾鏄摢涓?*/
#windGauge { color: #6C97B9; }
#humGauge  { color: #4E8CBE; }
#popGauge  { color: #6E8AA5; }
#uvGauge   { color: #CE8F45; }
.gauge .gi {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: .78;
}
.gauge .gi svg { width: 15px; height: 15px; display: block; }

.label {
  font-size: 10px;
  letter-spacing: .14em;
  color: rgba(var(--card-ink-rgb), .55);
  white-space: nowrap;
}
.value {
  font-size: 16.5px;
  font-weight: 500;
  color: var(--card-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hint {
  font-size: 10.5px;
  line-height: 1.3;
  letter-spacing: .02em;
  color: rgba(var(--card-ink-rgb), .48);
  white-space: nowrap;
}

.sunline {
  padding: 14px 0 18px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(var(--card-ink-rgb), .55);
  font-variant-numeric: tabular-nums;
}

/* 鍔犺浇鎬?*/
.card.is-loading .temp,
.card.is-loading .icon { opacity: .45; }

/* 鍙湅鍗＄墖鏃讹紙?mock= 婕旂ず椤碉級鎶婁笅闈㈢殑鎯呭鍜屾惌閰嶈棌鎺?*/
.cardonly .scene,
.cardonly .outfits,
.cardonly .src { display: none; }
.cardonly .app { padding-bottom: 24px; }

/* 鎺掔増鍙樹綋锛?card=1 涓€琛屽洓椤?/ ?card=2 鏋佺畝锛岀敤浜庡姣旓級 */
body.v1 .divider { display: block; }
body.v1 .metrics {
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 -22px;
}
body.v1 .metric {
  align-items: center;
  text-align: center;
  padding: 16px 6px 18px;
  border-radius: 0;
  background: none;
}
body.v1 .metric + .metric { border-left: 1px solid rgba(var(--card-ink-rgb), .13); }

body.v2 .metrics,
body.v2 .divider { display: none; }
body.v2 .chart { margin-top: 18px; }
body.v2 .sunline { padding-top: 16px; }

/* ---------- 搴曢儴鎻愮ず ---------- */

/* ---------- 浠婃棩鎯呭 ---------- */

.scene { margin-top: 24px; }

.scene-q {
  font-size: 15px;
  font-weight: 500;
  color: #5E574D;
  letter-spacing: .01em;
  margin-bottom: 12px;
}

.scene-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px;
  padding: 2px 18px 4px;
}
.scene-chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid #E7E1D7;
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  color: #5E574D;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}
.chip:active { transform: scale(.97); }
.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- 涓夊鎼厤 ---------- */

.outfits {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.outfit {
  background: #fff;
  border: 1px solid #EDE8DF;
  border-radius: 18px;
  padding: 16px 17px 14px;
  box-shadow: 0 1px 2px rgba(28, 27, 26, .035);
}

.outfit-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.outfit-h h3 {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .07em;
  color: #8A8378;
}
.outfit-h .hint {
  font-size: 11.5px;
  color: #B3ABA0;
}

.items {
  list-style: none;
  margin-top: 8px;
}
.items li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 15.5px;
  line-height: 1.45;
}
.items .k {
  flex: 0 0 34px;
  font-size: 11.5px;
  color: #B0A99E;
  padding-top: 4px;
}
.items .v { flex: 1; color: var(--ink); }

/* 鍙充晶琛ｇ墿绾跨锛氳涓€琛屽瓧鐪嬪緱鍑烘槸鍝欢涓滆タ */
.items .ri {
  flex: none;
  align-self: center;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-left: 2px;
  opacity: 0;
  animation: riIn .5s ease forwards;
}
.items .ri svg { width: 52px; height: 52px; display: block; }
@keyframes riIn {
  from { opacity: 0; transform: translateX(-3px); }
  to   { opacity: 1; transform: none; }
}

.why {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #F1ECE4;
  font-size: 12.5px;
  line-height: 1.65;
  color: #8A8378;
}

.src {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

/* ---------- 鍩庡競閫夋嫨 ---------- */

.sheet { position: fixed; inset: 0; z-index: 10; }
.sheet[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 26, .28);
  backdrop-filter: blur(2px);
  animation: fade .2s ease;
}

.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 -10px 40px -12px rgba(28, 27, 26, .3);
  animation: rise .26s cubic-bezier(.22, .9, .3, 1);
  max-width: 460px;
  margin: 0 auto;
}

.sheet-grab {
  width: 38px; height: 4px;
  border-radius: 999px;
  background: #E2DED8;
  margin: 0 auto 14px;
}

.sheet-panel h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

.locate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 15px;
  background: #1C1B1A;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.locate-btn:active { background: #33312F; }
.locate-btn[disabled] { opacity: .6; }

.city-search {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: #F5F2ED;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.city-search::placeholder { color: #A9A39B; }
.city-search:focus { background: #EFEAE2; }

.tls-hint {
  display: block;
  margin: -4px 0 14px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: #9C968E;
  text-decoration: none;
}
.tls-hint[hidden] { display: none; }

.city-hint {
  grid-column: 1 / -1;
  margin: 6px 0;
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
}

.city-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.city-item {
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: #F5F2ED;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.city-item:active { background: #EAE5DD; }
.city-item[aria-current="true"] { background: #1C1B1A; color: #fff; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { transform: translateY(14px); opacity: .6 } to { transform: none; opacity: 1 } }

/* ---- 澶╂皵鍗℃姌鍙犳垚涓€鏉★紙鐪嬪畬澶╂皵锛岀炕鍒扮┛琛ｏ級 ---- */
.card-body {
  max-height: 760px;
  overflow: hidden;
  transition: max-height .52s cubic-bezier(.4, 0, .2, 1),
              opacity .3s ease,
              padding .52s cubic-bezier(.4, 0, .2, 1);
}
.card.is-mini .card-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 22px;
  border: 0;
  background: none;
  color: var(--card-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: max-height .42s cubic-bezier(.4, 0, .2, 1) .06s,
              opacity .3s ease .12s,
              padding .42s cubic-bezier(.4, 0, .2, 1) .06s;
}
.card.is-mini .mini-row {
  max-height: 92px;
  opacity: 1;
  padding: 15px 22px;
}
.mini-temp { font-size: 26px; font-weight: 200; letter-spacing: -.03em; }
.mini-desc { font-size: 14px; opacity: .9; }
.mini-range { font-size: 12.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.mini-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 12.5px;
  opacity: .75;
}

/* ---- 鎼厤鍗″叆鍦?---- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.995); }
  to   { opacity: 1; transform: none; }
}
.outfit { animation: cardIn .44s cubic-bezier(.22, .7, .3, 1) both; }

/* 鎶樺彔鍚庢儏澧冨尯鍧楀線涓婃敹涓€鐐癸紝鍒暀鐧?*/
.card.is-mini ~ .scene { margin-top: 4px; }
.scene { transition: margin .4s ease; }

/* 鎯呭鍋氭垚 iOS 閭ｇ鍒嗘閫夋嫨鍣細涓€涓祬鑹叉Ы锛岄€変腑鐨勯偅鍧楁诞璧锋潵 */
.scene-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 5px;
  overflow: visible;
  border-radius: 18px;
  background: #F1ECE3;
  box-shadow: inset 0 1px 2px rgba(28, 27, 26, .05);
  -webkit-mask-image: none;
  mask-image: none;
}
.scene-chips .chip {
  width: 100%;
  padding: 10px 6px;
  text-align: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-size: 13.5px;
  color: #6E675C;
  box-shadow: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease,
              transform .12s ease;
}
.scene-chips .chip:active { transform: scale(.98); }
.scene-chips .chip.is-on {
  background: #fff;
  color: #1C1B1A;
  font-weight: 500;
  box-shadow:
    0 1px 3px rgba(28, 27, 26, .10),
    0 8px 16px -12px rgba(28, 27, 26, .55);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
