:root {
  --ink: #1d1b19;
  --ink-2: #5c5751;
  --ink-3: #958e85;
  --line: rgba(29, 27, 25, .09);
  --card: rgba(255, 255, 255, .62);
  --card-solid: #fffdfa;
  --shadow: 0 1px 2px rgba(40, 30, 20, .05), 0 8px 28px -12px rgba(40, 30, 20, .18);
  --radius: 18px;
  --num: "Segoe UI Variable Display", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --cn: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --accent: #c4472d;
  --accent-soft: rgba(196, 71, 45, .1);
  --bg: #f6f0ea;
  --bg-2: #efe4d9;
  --warm: #c8502e;
  --cold: #2f6db5;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body {
  font-family: var(--cn);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 18% -10%, var(--bg-2), transparent 60%),
    radial-gradient(900px 600px at 110% 30%, var(--bg-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font: inherit; color: inherit; }

.page { max-width: 1280px; margin: 0 auto; padding: 24px 40px 48px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 18px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: .12em; color: var(--accent); transition: color .6s; }

.city-pick { position: relative; }
.city-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.55);
  border-radius: 999px; padding: 6px 12px 6px 11px; font-size: 15px; font-weight: 700; letter-spacing: .06em;
  transition: background .2s, box-shadow .2s;
}
.city-btn:hover, .city-btn[aria-expanded="true"] { background: #fff; box-shadow: var(--shadow); }
.city-btn .pin { width: 11px; height: 13px; color: var(--accent); transition: color .6s; }
.city-btn .caret { width: 10px; height: 6px; color: var(--ink-3); transition: transform .2s; }
.city-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.city-pop {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 320px; padding: 6px;
  background: var(--card-solid); border-radius: 16px; box-shadow: 0 2px 4px rgba(40,30,20,.06), 0 18px 48px -12px rgba(40,30,20,.28);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-height: 70vh; overflow: auto;
}
.city-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.cp-item {
  width: 100%; display: grid; grid-template-columns: 12px auto 1fr auto auto; align-items: baseline; gap: 10px;
  border: 0; background: transparent; border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left;
}
.cp-item:hover { background: rgba(0,0,0,.04); }
.cp-item.on { background: var(--accent-soft); }
.cp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); align-self: center; }
.cp-nm { font-weight: 700; font-size: 15px; letter-spacing: .06em; }
.cp-en { font-size: 10px; letter-spacing: .2em; color: var(--ink-3); }
.cp-rg { font-family: var(--num); font-size: 14px; font-variant-numeric: tabular-nums; }
.cp-tier { font-size: 12px; color: var(--ink-2); min-width: 4em; text-align: right; }
.cp-foot { font-size: 11.5px; color: var(--ink-3); padding: 8px 12px 6px; border-top: 1px solid var(--line); margin-top: 4px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); letter-spacing: .03em; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status[data-state="loading"] .dot { animation: blink 1s infinite; }
.status[data-state="ok"] .dot { background: #3aa26b; box-shadow: 0 0 0 3px rgba(58,162,107,.15); }
.status[data-state="error"] { cursor: pointer; color: #b0701f; text-decoration: underline dotted; text-underline-offset: 3px; }
.status[data-state="error"] .dot { background: #d08a2c; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- grid ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; margin-top: 18px; }

/* ---------- dial ---------- */
.dial { position: relative; width: 100%; max-width: 600px; margin: 0 auto; aspect-ratio: 1; }
#dial { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; outline: none; user-select: none; -webkit-user-select: none; }
#dial.grab { cursor: grab; }
#dial.grabbing { cursor: grabbing; }
#dial.resize { cursor: ew-resize; }
#dial .bars line { stroke-linecap: round; transition: opacity .35s ease; }
#dial .bars line.off { opacity: .3; }
#dial .ghosts line { stroke: #1d1b19; stroke-opacity: .13; stroke-linecap: round; transition: opacity .35s; }
#dial .ghosts line.off { opacity: .5; }
#dial .grid-ring { fill: none; stroke: var(--ink); stroke-opacity: .07; }
#dial .grid-ring.zero { stroke-opacity: .14; stroke-dasharray: 2 4; }
#dial .grid-lbl { font: 500 10px var(--num); fill: var(--ink-3); }
#dial .mon-lbl { font: 600 13px var(--cn); fill: var(--ink-2); }
#dial .mon-lbl.cur { fill: var(--accent); }
#dial .mon-tick { stroke: var(--ink); stroke-opacity: .18; }
#dial .sel-arc { fill: var(--accent); fill-opacity: .08; }
#dial .fc-arc { fill: none; stroke: #3aa26b; stroke-width: 3; stroke-linecap: round; stroke-opacity: .7; }
#dial .sel-edge { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
#dial .handle circle { fill: var(--card-solid); stroke: var(--accent); stroke-width: 2.5; }
#dial .handle .grip { stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
#dial .today-tick { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
#dial .today-lbl { font: 700 10.5px var(--cn); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
#dial .hover-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; transition: opacity .15s; }
#dial .hover-bar { stroke-linecap: round; opacity: 0; transition: opacity .15s; }
#dial .hover-ring { fill: var(--card-solid); stroke: var(--ink); stroke-width: 1.5; opacity: 0; transition: opacity .15s; }
#dial.hovering .hover-line, #dial.hovering .hover-bar, #dial.hovering .hover-ring { opacity: 1; }

.center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 31%; aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  pointer-events: none;
}
.c-date { font-size: clamp(11px, 1.1vw, 14px); color: var(--ink-2); letter-spacing: .03em; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.c-tag { font-size: 10px; background: #3aa26b; color: #fff; border-radius: 4px; padding: 1px 5px; letter-spacing: .05em; }
.c-temp { font-family: var(--num); font-weight: 200; font-size: clamp(30px, 4.1vw, 54px); line-height: 1.05; letter-spacing: -.03em; margin: 4px 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-temp i { font-style: normal; opacity: .55; font-size: .62em; vertical-align: .55em; margin-left: 1px; }
.c-temp .sep { opacity: .35; margin: 0 .08em; font-weight: 100; }
.c-meta { font-size: clamp(10px, .95vw, 12.5px); color: var(--ink-3); white-space: nowrap; }
.c-meta b { color: var(--accent); font-weight: 600; }

.legend { display: flex; justify-content: center; gap: 18px; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 16px; height: 4px; border-radius: 4px; }
.lg-fc { background: #3aa26b; }
.lg-cl { background: rgba(29,27,25,.18); height: 7px !important; }

.hint { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 8px 0 12px; }
.hint b { color: var(--ink-2); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: rgba(255,255,255,.55); cursor: pointer;
  border-radius: 999px; padding: 6px 13px; font-size: 13px; color: var(--ink-2); transition: all .2s ease;
}
.chip:hover { background: #fff; color: var(--ink); transform: translateY(-1px); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px var(--accent); }
.chip small { opacity: .6; margin-left: 5px; font-size: 11px; }

/* ---------- verdict ---------- */
.verdict { background: var(--card-solid); border-radius: 22px; box-shadow: var(--shadow); padding: 24px 28px 22px; position: relative; overflow: hidden; }
.verdict::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad, var(--accent)); }
.v-when { font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.v-when .pill { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: 12px; }
.basis { margin-left: auto; font-size: 11.5px; border-radius: 6px; padding: 2px 8px; background: rgba(0,0,0,.05); color: var(--ink-2); }
.basis.fc { background: rgba(58,162,107,.12); color: #23784c; }
.basis.mix { background: rgba(58,162,107,.08); color: #2f7350; }
.v-head { font-size: clamp(28px, 2.8vw, 38px); font-weight: 800; letter-spacing: .04em; margin: 12px 0 10px; line-height: 1.2; }
.v-night { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin: 0 0 12px; padding: 5px 14px 5px 10px; border-radius: 999px; background: var(--accent-soft); }
.v-night svg { width: 14px; height: 14px; color: var(--accent); }
.v-night b { color: var(--ink); font-size: 16px; letter-spacing: .04em; }
.v-sub { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; margin: 0; }
.v-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.v-stat .k { font-size: 11.5px; color: var(--ink-3); }
.v-stat .v { font-family: var(--num); font-size: 24px; font-weight: 300; margin-top: 2px; font-variant-numeric: tabular-nums; }
.v-stat .v small { font-size: 13px; opacity: .55; margin-left: 1px; }
.v-stat .v.warm { color: var(--warm); font-weight: 400; }
.v-stat .v.cold { color: var(--cold); font-weight: 400; }

/* ---------- dressing scale ---------- */
.scale { margin: 18px 4px 4px; position: relative; padding-top: 34px; }
.scale-track { position: relative; height: 12px; border-radius: 12px; }
.scale-seg { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bg); }
.scale-lbls { position: relative; height: 32px; margin-top: 38px; }
.scale-lbl { position: absolute; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; text-align: center; line-height: 1.3; }
.scale-lbl em { display: block; font-style: normal; font-family: var(--num); font-size: 10px; opacity: .7; }
.scale-lbl.hit { color: var(--ink); font-weight: 700; }
.scale-band { position: absolute; top: -5px; height: 22px; border-radius: 12px; border: 2px solid var(--ink); background: rgba(255,255,255,.18); transition: left .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1); }
.scale-mark { position: absolute; top: -34px; transform: translateX(-50%); transition: left .45s cubic-bezier(.2,.8,.2,1); text-align: center; }
.scale-mark span { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; font-family: var(--num); }
.scale-mark span svg { width: 12px; height: 12px; }
.scale-mark::after { content: ""; display: block; width: 0; height: 0; margin: 0 auto; border: 4px solid transparent; border-top-color: var(--ink); }
.scale-mark.night { top: 19px; }
.scale-mark.night span { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.scale-mark.night::after { display: none; }
.scale-mark.night::before { content: ""; display: block; width: 0; height: 0; margin: 0 auto; border: 4px solid transparent; border-bottom-color: var(--ink); }

.tips { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.tips li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 13px; line-height: 1.6; color: var(--ink-2); padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.42); }
.tips li .ti { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 12px; }
.tips li b { color: var(--ink); }

/* ---------- panels ---------- */
.panel { margin-top: 36px; }
.panel-head { display: flex; align-items: baseline; gap: 14px; margin: 0 2px 14px; }
.panel-head h2 { font-size: 17px; margin: 0; letter-spacing: .08em; font-weight: 700; white-space: nowrap; }
.panel-sub { font-size: 12.5px; color: var(--ink-3); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghost-btn { border: 1px solid var(--line); background: rgba(255,255,255,.6); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); transition: all .2s; white-space: nowrap; align-self: center; }
.ghost-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* pack: 5 列分组 */
.pack { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 12px; align-items: start; }
.pcol { display: grid; gap: 8px; }
.pcol-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--ink-2); font-weight: 700; letter-spacing: .2em; padding: 0 4px 4px; border-bottom: 2px solid var(--ink); }
.pcol-h span { font-family: var(--num); font-weight: 400; letter-spacing: 0; color: var(--ink-3); font-size: 11px; }
.pcol.empty .pcol-h { border-bottom-color: var(--line); color: var(--ink-3); }
.pnone { font-size: 12px; color: var(--ink-3); padding: 14px 6px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.item {
  background: var(--card); border: 1px solid rgba(255,255,255,.8);
  border-radius: 14px; padding: 10px; display: grid; grid-template-columns: 40px 1fr; gap: 1px 10px; align-items: center;
  transition: transform .2s ease, box-shadow .2s ease, background .2s;
}
.item:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: var(--card-solid); }
.item.enter { animation: pop .5s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
.item .ic { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; transition: all .6s; }
.item .ic svg { width: 29px; height: 29px; }
.item .nm { font-weight: 700; font-size: 13.5px; display: flex; align-items: baseline; gap: 5px; white-space: nowrap; overflow: hidden; }
.item .nm .q { font-family: var(--num); font-weight: 500; color: var(--accent); font-size: 12.5px; }
.item .why { font-size: 11px; color: var(--ink-3); line-height: 1.35; }
.item.key .ic { background: var(--accent); color: #fff; }

/* days: 收拢迷你图 */
.spark { display: grid; grid-template-columns: 30px 1fr; gap: 8px; background: var(--card); border: 1px solid rgba(255,255,255,.8); border-radius: 18px; padding: 24px 16px 6px 10px; }
.sp-axis { display: flex; flex-direction: column; justify-content: space-between; height: 110px; font-family: var(--num); font-size: 10px; color: var(--ink-3); text-align: right; }
.sp-cols { display: flex; height: 132px; }
.sp-col { position: relative; flex: 1; min-width: 0; height: 110px; cursor: default; border-radius: 6px; }
.sp-col::before { content: ""; position: absolute; inset: -6px 1px -4px; border-radius: 6px; background: transparent; transition: background .15s; }
.sp-col.hl::before, .sp-col:hover::before { background: rgba(0,0,0,.05); }
.sp-col.we .sp-lbl { color: var(--accent); font-weight: 600; }
.sp-v { position: absolute; left: 0; right: 0; text-align: center; font-family: var(--num); font-size: 11px; font-weight: 600; color: var(--ink); pointer-events: none; }
.sp-v.lo { font-weight: 400; color: var(--ink-3); }
.sp-rod { position: absolute; left: 50%; width: clamp(3px, 38%, 12px); transform: translateX(-50%); border-radius: 8px; transition: top .35s, height .35s; }
.sp-ghost { position: absolute; left: 50%; width: clamp(6px, 64%, 20px); transform: translateX(-50%); border-radius: 8px; background: rgba(29,27,25,.1); }
.sp-rain { position: absolute; top: -10px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #3b78c2; }
.sp-lbl { position: absolute; top: 114px; left: 50%; transform: translateX(-50%); font-family: var(--num); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

.tip-float {
  position: fixed; z-index: 50; pointer-events: none; min-width: 168px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 12px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip-float.show { opacity: 1; transform: none; }
.tf-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: rgba(255,255,255,.75); }
.tf-src { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.14); }
.tf-src.fc { background: #3aa26b; color: #fff; }
.tf-t { font-family: var(--num); font-size: 24px; font-weight: 300; margin: 4px 0 2px; }
.tf-t span { opacity: .4; }
.tf-r { display: flex; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.8); }
.tf-r svg { width: 8px; height: 10px; vertical-align: -1px; }
.tf-c { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.75); }
.tf-c b { color: #ffb38a; }

.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin-top: 12px; animation: pop .35s ease both; }
.day-grid[hidden] { display: none; }
.day { background: var(--card); border: 1px solid rgba(255,255,255,.85); border-radius: 14px; padding: 10px 12px; transition: transform .2s, background .2s, box-shadow .2s; }
.day:hover, .day.hl { transform: translateY(-2px); background: var(--card-solid); box-shadow: var(--shadow); }
.day.fc { box-shadow: inset 3px 0 0 #3aa26b; }
.day .dd { font-family: var(--num); font-weight: 600; font-size: 13px; }
.day .wk { font-family: var(--cn); font-weight: 400; font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.day .wk.we { color: var(--accent); font-weight: 600; }
.day .dt { font-family: var(--num); margin: 4px 0 6px; }
.day .dt b { font-size: 20px; font-weight: 400; }
.day .dt span { font-size: 13px; color: var(--ink-3); margin-left: 4px; }
.day .dbar { position: relative; height: 5px; border-radius: 5px; background: rgba(0,0,0,.06); }
.day .dbar i { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.day .dm { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11.5px; }
.day .rain { color: var(--ink-3); display: inline-flex; gap: 3px; align-items: center; font-family: var(--num); }
.day .rain svg { width: 8px; height: 10px; }
.day .wear { font-weight: 700; color: var(--ink-2); }
.day .dsrc { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.day.fc .dsrc { color: #2f7350; }

.foot { margin-top: 30px; color: var(--ink-3); font-size: 12px; text-align: center; line-height: 1.7; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 999px; transition: all .3s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .pack { grid-template-columns: repeat(min(var(--cols, 3), 3), minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .page { padding: 18px 16px 40px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .c-temp { font-size: clamp(28px, 8.5vw, 50px); }
  .c-date { font-size: clamp(11px, 2.8vw, 14px); }
  .c-meta { font-size: clamp(10px, 2.5vw, 12.5px); }
  .status span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 640px) {
  .pack { grid-template-columns: repeat(min(var(--cols, 2), 2), minmax(0, 1fr)); }
  .v-stats { grid-template-columns: repeat(2, 1fr); }
  .basis { margin-left: 0; }
  .panel-sub { display: none; }
  .panel-head h2 { flex: 1; }
  .city-pop { min-width: 290px; }
  .cp-en { display: none; }
  .status { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }
