/* 今天穿什么：在 Apple Minimal 之上的页面样式。 */
:root {
  --wx-sun: #f5a524;
  --wx-cloud: #d9dde4;
  --wx-cloud-back: #c3c9d2;
  --wx-cloud-line: #9aa3af;
  --wx-rain: #2f80ed;
  --wx-band: #0071e310;
  --wx-feels: #f08a24;
  --wx-warn-bg: #fff4e5;
  --wx-warn-text: #8a4b00;
}
:root[data-theme="dark"] {
  --wx-sun: #ffc04d;
  --wx-cloud: #5d636d;
  --wx-cloud-back: #474c55;
  --wx-cloud-line: #8d95a1;
  --wx-rain: #64adff;
  --wx-band: #64adff1c;
  --wx-feels: #ffa957;
  --wx-warn-bg: #3a2a12;
  --wx-warn-text: #ffcf8a;
}

.wx-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wx-mark { background: var(--am-text); position: relative; }
.wx-mark::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--wx-sun); }

.wx-ic { display: inline-grid; place-items: center; color: var(--am-muted); }
.wx-ic-sm .am-icon { width: 16px; height: 16px; }

/* 演示条 */
.wx-demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 20px; padding: 10px 14px; border: 1px dashed var(--am-line); border-radius: 14px; font-size: 13px; color: var(--am-muted); }
.wx-demo-label { flex: 1 1 200px; }
.wx-demo-select { width: auto; min-height: 38px; padding: 6px 12px; font-size: 13px; flex: 0 1 220px; }

/* 第一屏：左边天气，右边人物舞台 */
.wx-hero { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: 40px; align-items: center; padding: 40px 0; }
.wx-place { display: inline-flex; align-items: center; gap: 6px; color: var(--am-link); margin-bottom: 12px; }
.wx-place .wx-ic { color: var(--am-link); }
.wx-now-main { display: flex; align-items: center; gap: 14px; }
.wx-icon-wrap { width: 108px; height: 108px; flex-shrink: 0; }
.wx-big { width: 100%; height: 100%; overflow: visible; }
.wx-temp { font-size: clamp(64px, 9vw, 104px); font-weight: 600; letter-spacing: -.05em; line-height: 1; margin: 0 0 8px; }
.wx-deg { font-weight: 300; color: var(--am-muted); }
.wx-cond { font-size: 18px; margin: 0; }
.wx-updated { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; font-size: 13px; color: var(--am-muted); }
.wx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--am-success); flex-shrink: 0; box-shadow: 0 0 0 0 var(--am-success); animation: wx-pulse 2.4s ease-out infinite; }
.wx-who { font-size: 12px; color: var(--am-muted); }
/* 傍晚以后：“现在”缩成一条小胶囊，再用一条分隔线引出“明天” */
.wx-nowbar[hidden], .wx-daylabel[hidden] { display: none; }
.wx-nowbar { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--am-surface); font-size: 13px; color: var(--am-muted); margin-bottom: 14px; }
.wx-nowbar-ic { display: inline-grid; place-items: center; color: var(--am-muted); }
.wx-nowbar-ic .am-icon { width: 18px; height: 18px; }
.wx-nowbar-label { font-size: 12px; }
.wx-nowbar b { font-size: 15px; color: var(--am-text); font-weight: 650; }
.wx-daylabel { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 13px; font-weight: 650; color: var(--am-link); letter-spacing: .02em; }
.wx-daylabel::after { content: ""; flex: 1; height: 1px; background: var(--am-soft-line); }
.wx-temp-range { font-size: clamp(56px, 7.4vw, 88px); letter-spacing: -.04em; }
.wx-acc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.wx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--am-raised); border: 1px solid var(--am-soft-line); font-size: 13px; }
.wx-chip .wx-ic { color: var(--am-link); }

/* 舞台 */
.wx-scene { position: relative; height: 470px; border-radius: 26px; overflow: hidden; isolation: isolate; --wx-ink: #1d1d1f; transition: background .8s ease; }
:root[data-theme="dark"] .wx-scene { --wx-ink: #f5f5f7; }
.wx-scene[data-wx="cloudy"] { background: linear-gradient(180deg, #e6ebf1, #d3dbe5); }
.wx-scene[data-wx="sunny"] { background: linear-gradient(180deg, #fff1cf, #ffdea0); }
.wx-scene[data-wx="rain"] { background: linear-gradient(180deg, #d9e2ec, #c2cedb); }
.wx-scene[data-wx="snow"] { background: linear-gradient(180deg, #d3deeb, #b5c5d9); }
.wx-scene[data-wx="haze"] { background: linear-gradient(180deg, #e0dbcf, #cec6b6); }
.wx-scene[data-wx="indoor"] { background: linear-gradient(180deg, #f6efe4, #eadfcd); }
:root[data-theme="dark"] .wx-scene[data-wx="cloudy"] { background: linear-gradient(180deg, #242b34, #1b2028); }
:root[data-theme="dark"] .wx-scene[data-wx="sunny"] { background: linear-gradient(180deg, #3a2f18, #2a2212); }
:root[data-theme="dark"] .wx-scene[data-wx="rain"] { background: linear-gradient(180deg, #1f2833, #161c24); }
:root[data-theme="dark"] .wx-scene[data-wx="snow"] { background: linear-gradient(180deg, #243142, #1a2433); }
:root[data-theme="dark"] .wx-scene[data-wx="haze"] { background: linear-gradient(180deg, #2d2a23, #211e18); }
:root[data-theme="dark"] .wx-scene[data-wx="indoor"] { background: linear-gradient(180deg, #2e2921, #231e17); }
/* 傍晚整体压暗一点（在人物后面） */
.wx-scene::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, #1b2440, #3a2f55); opacity: 0; transition: opacity .9s ease; }
.wx-scene[data-moment="pm"]::after { opacity: .34; } /* 21:00 已经天黑 */

.wx-sky { position: absolute; inset: 0; z-index: 0; }
.wx-sky-sun { position: absolute; left: 8%; top: 30%; width: 64px; height: 64px; border-radius: 50%; background: var(--wx-sun); box-shadow: 0 0 0 12px color-mix(in srgb, var(--wx-sun) 22%, transparent); opacity: 0; transition: left 1.1s cubic-bezier(.4, 0, .2, 1), top 1.1s cubic-bezier(.4, 0, .2, 1), opacity .8s; }
.wx-scene[data-wx="sunny"] .wx-sky-sun { opacity: .9; }
.wx-scene[data-wx="cloudy"] .wx-sky-sun { opacity: .3; }
.wx-scene[data-moment="pm"] .wx-sky-sun { left: calc(92% - 64px); top: 40%; opacity: 0; }

.wx-skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 30%; fill: none; stroke: var(--wx-ink); stroke-width: 2; opacity: .18; z-index: 0; transition: opacity .6s; }
.wx-officebg { position: absolute; inset: 0; z-index: 0; opacity: 0; transition: opacity .6s; }
.wx-window { position: absolute; left: 7%; top: 10%; width: 30%; fill: #ffffff99; stroke: var(--wx-ink); stroke-width: 2.5; opacity: .45; }
:root[data-theme="dark"] .wx-window { fill: #ffffff10; }
.wx-desk { position: absolute; left: 0; right: 0; bottom: 0; height: 9%; background: #c9a77c; opacity: .5; }
.wx-scene[data-moment="office"] .wx-skyline { opacity: 0; }
.wx-scene[data-moment="office"] .wx-officebg { opacity: 1; }

/* 天气层：雨在人物后面，雪和雾在前面 */
.wx-layer { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s ease; z-index: 3; }
.wx-rain { inset: -20% 0 0; z-index: 1;
  background-image: repeating-linear-gradient(105deg, transparent 0 18px, color-mix(in srgb, var(--wx-rain) 50%, transparent) 18px 19.5px, transparent 19.5px 46px),
                    repeating-linear-gradient(105deg, transparent 0 31px, color-mix(in srgb, var(--wx-rain) 30%, transparent) 31px 32px, transparent 32px 71px);
  background-size: 100% 90px, 100% 140px;
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 26px, transparent 26px 44px);
  mask-image: repeating-linear-gradient(180deg, #000 0 26px, transparent 26px 44px);
  animation: wx-rainfall .55s linear infinite; }
.wx-snow { background-image: radial-gradient(circle, #fff 0 3px, transparent 3.5px), radial-gradient(circle, #fff 0 2px, transparent 2.5px);
  background-size: 70px 70px, 45px 45px; background-position: 0 0, 20px 30px; animation: wx-snowfall 6s linear infinite; filter: drop-shadow(0 0 1px #0003); }
.wx-fog i { position: absolute; width: 90%; height: 40%; border-radius: 50%; background: #9a9aa0; filter: blur(30px); opacity: .3; animation: wx-fogdrift 9s ease-in-out infinite alternate; }
.wx-fog i:nth-child(1) { left: -20%; top: 10%; }
.wx-fog i:nth-child(2) { left: 30%; top: 45%; animation-duration: 12s; }
.wx-fog i:nth-child(3) { left: -10%; top: 70%; animation-duration: 10s; animation-direction: alternate-reverse; }
.wx-scene[data-wx="rain"] .wx-rain, .wx-scene[data-wx="snow"] .wx-snow, .wx-scene[data-wx="haze"] .wx-fog { opacity: 1; }

/* 人物：1024×1536 透明画布，贴底显示，所有图位置一致 */
.wx-people { position: absolute; inset: 70px 3% 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2%; z-index: 2; }
.wx-person { position: relative; }
.wx-fig { position: absolute; inset: 0; transition: opacity .5s ease; }
/* 按高度铺满，左右透明边可以伸到旁边那一格里，手机上人物不会被宽度压小 */
.wx-fig img { position: absolute; bottom: 0; left: 50%; height: 100%; width: auto; max-width: none; transform: translateX(-50%); user-select: none; -webkit-user-drag: none; }
.wx-entering { opacity: 0; }
.wx-leaving { opacity: 0; transition: opacity .2s ease .4s; }
:root[data-theme="dark"] .wx-fig img { filter: drop-shadow(0 0 1px #ffffff55) drop-shadow(0 0 10px #ffffff14); }

/* 人物下面的一句话 */
.wx-says { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.wx-say { padding: 0 6px; text-align: center; }
.wx-say p { margin: 2px 0 0; font-size: 16px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }

/* 时段切换：叠在舞台顶部，不额外占高度 */
.wx-moments { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 4; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 16px; background: color-mix(in srgb, var(--am-raised) 62%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 #ffffff40 inset, 0 4px 18px #0000000f; }
.wx-moments button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 44px; padding: 5px 4px; border-radius: 12px; border: 0; background: transparent; color: var(--am-text); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.25; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.wx-moments small { font-size: 11.5px; font-weight: 500; color: var(--am-muted); }
.wx-moments button:hover { background: color-mix(in srgb, var(--am-raised) 55%, transparent); }
.wx-moments button[aria-pressed="true"] { background: var(--am-raised); color: var(--am-link); box-shadow: 0 1px 6px #00000018; }
.wx-moments button[aria-pressed="true"] small { color: var(--am-link); }
.wx-moments button:focus-visible { outline: 2px solid var(--am-link); outline-offset: 1px; }
.wx-moment-cap { margin: 12px 2px 0; font-size: 14px; color: var(--am-muted); min-height: 1.5em; }

@keyframes wx-rainfall { to { background-position: -24px 90px, -36px 140px; } }
@keyframes wx-snowfall { to { background-position: 30px 70px, -20px 75px; } }
@keyframes wx-fogdrift { to { transform: translateX(25%); } }
@media (prefers-reduced-motion: reduce) { .wx-rain, .wx-snow, .wx-fog i { animation: none; } }

/* 要点 */
.wx-factors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding-bottom: 40px; }
.wx-factor { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--am-soft-line); border-radius: 16px; background: var(--am-raised); min-width: 0; }
.wx-factor .wx-ic { justify-content: start; margin-bottom: 6px; }
.wx-f-label { font-size: 12px; color: var(--am-muted); }
.wx-f-value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.wx-f-note { font-size: 12px; color: var(--am-muted); }
.wx-warn { background: var(--wx-warn-bg); border-color: transparent; }
.wx-warn .wx-f-note, .wx-warn .wx-ic { color: var(--wx-warn-text); }

/* 逐小时 */
.wx-hours-section { padding-bottom: 56px; }
.wx-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.wx-h2 { font-size: 28px; margin: 0; }
.wx-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--am-muted); }
.wx-legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--wx-band); border: 1px solid var(--am-link); opacity: .7; }
.wx-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.wx-band { fill: var(--wx-band); }
.wx-line { fill: none; stroke: var(--am-text); stroke-width: 2.5; stroke-linejoin: round; }
.wx-line-feels { fill: none; stroke: var(--wx-feels); stroke-width: 2; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.wx-pt-dot { fill: var(--am-raised); stroke: var(--am-text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.wx-pt { font-size: 13px; font-weight: 600; fill: var(--am-text); text-anchor: middle; }
.wx-axis { font-size: 11px; fill: var(--am-muted); text-anchor: middle; }
.wx-chart-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--am-muted); margin: 6px 0 12px; }
.wx-key { width: 18px; height: 0; border-top: 2.5px solid var(--am-text); display: inline-block; }
.wx-key-feels { border-top: 2px dashed var(--wx-feels); margin-left: 12px; }
.wx-hours { list-style: none; margin: 0; padding: 4px 2px 10px; display: grid; grid-auto-flow: column; grid-auto-columns: 64px; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; }
.wx-hour { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; scroll-snap-align: start; font-size: 12px; }
.wx-commute { background: var(--wx-band); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--am-link) 35%, transparent); }
.wx-h-time { color: var(--am-muted); }
.wx-h-temp { font-size: 16px; font-weight: 600; }
.wx-h-pop { color: var(--wx-rain); min-height: 1.2em; }

/* 穿衣卡片 */
.wx-outfit-head { margin-bottom: 24px; }
.wx-outfit-head h2 { margin-bottom: 0; }
.wx-cards { margin-top: 4px; }
.wx-card { display: flex; flex-direction: column; gap: 18px; }
.wx-card-head { display: flex; gap: 14px; align-items: center; }
.wx-card-head h3 { margin: 0; font-size: 22px; }
.wx-card-sub { margin: 2px 0 0; font-size: 13px; }

.wx-card-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--am-accent-soft); color: var(--am-link); flex-shrink: 0; }
.wx-items { list-style: none; margin: 0; padding: 0; }
.wx-item { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--am-soft-line); animation: wx-rise .45s ease both; }
.wx-item:nth-child(2) { animation-delay: .04s; } .wx-item:nth-child(3) { animation-delay: .08s; } .wx-item:nth-child(4) { animation-delay: .12s; } .wx-item:nth-child(5) { animation-delay: .16s; } .wx-item:nth-child(6) { animation-delay: .2s; }
.wx-item-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--am-surface); color: var(--am-text); flex-shrink: 0; }
.wx-item-ic .am-icon { width: 26px; height: 26px; stroke-width: 1.4; }
.wx-item-text { display: flex; flex-direction: column; min-width: 0; }
.wx-layer { font-size: 11px; color: var(--am-muted); letter-spacing: .04em; }
.wx-name { font-size: 15px; font-weight: 500; }
.wx-optional .wx-item-ic { background: transparent; border: 1px dashed var(--am-line); }
.wx-acc-in { margin-top: 0; }
.wx-acc-in .wx-chip { background: var(--am-surface); }
.wx-tips { margin: 0; padding: 0 0 0 18px; color: var(--am-muted); font-size: 14px; display: grid; gap: 6px; }
.wx-tips:empty { display: none; }

.wx-feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 24px; padding: 26px 30px; }
.wx-feedback h3 { font-size: 19px; margin-bottom: 4px; }
.wx-feedback p { margin: 0; }
.wx-fb-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.wx-calc { margin-top: 12px; }
.wx-strong dt, .wx-strong dd { color: var(--am-text); font-weight: 600; }

/* 天气图标 */
.wx-sun-core { fill: var(--wx-sun); }
.wx-rays line { stroke: var(--wx-sun); stroke-width: 4; stroke-linecap: round; }
.wx-rays { animation: wx-spin 24s linear infinite; }
.wx-moon { fill: var(--wx-sun); opacity: .9; }
.wx-cloud { fill: var(--wx-cloud); stroke: var(--wx-cloud-line); stroke-width: 1.5; }
.wx-cloud-back { fill: var(--wx-cloud-back); }
.wx-drift { animation: wx-drift 6s ease-in-out infinite; }
.wx-drift-slow { animation: wx-drift 9s ease-in-out infinite reverse; }
.wx-drops line { stroke: var(--wx-rain); stroke-width: 4; stroke-linecap: round; animation: wx-fall 1.2s linear infinite; }
.wx-drops line:nth-child(2) { animation-delay: .4s; }
.wx-drops line:nth-child(3) { animation-delay: .8s; }
.wx-flakes circle { fill: var(--wx-cloud-line); animation: wx-fall 2.4s linear infinite; }
.wx-flakes circle:nth-child(2) { animation-delay: .8s; }
.wx-flakes circle:nth-child(3) { animation-delay: 1.6s; }

@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-drift { 50% { transform: translateX(5px); } }
@keyframes wx-fall { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes wx-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--am-success) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes wx-rise { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 900px) {
  .wx-hero { grid-template-columns: 1fr; gap: 22px; }
  .wx-factors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  /* 手机首屏：天气压缩成几行，留出位置给人物、时段和一句话 */
  .wx-hero { padding: 10px 0 24px; gap: 14px; }
  .wx-place { margin-bottom: 6px; }
  .wx-nowbar { margin-bottom: 10px; padding: 4px 10px 4px 6px; }
  .wx-daylabel { margin-bottom: 2px; }
  .wx-now-main { gap: 10px; }
  .wx-icon-wrap { width: 56px; height: 56px; }
  .wx-temp { font-size: 54px; margin-bottom: 2px; }
  .wx-temp-range { font-size: 46px; }
  .wx-updated { margin-top: 6px; }
  .wx-acc { margin-top: 8px; gap: 6px; }
  .wx-chip { padding: 4px 10px; font-size: 12px; }
  .wx-scene { height: 380px; border-radius: 22px; }
  .wx-moments { top: 8px; left: 8px; right: 8px; gap: 4px; padding: 3px; border-radius: 14px; }
  .wx-moments button { min-height: 42px; font-size: 12.5px; border-radius: 11px; }
  .wx-moments small { font-size: 11px; }
  .wx-people { inset: 60px 2% 0; }
  .wx-says { margin-top: 10px; gap: 8px; }
  .wx-say p { font-size: 14px; }
  .wx-moment-cap { margin-top: 6px; font-size: 13px; }
  .wx-cond { font-size: 15px; }
  .wx-updated { align-items: flex-start; font-size: 11.5px; }
  .wx-dot { margin-top: 5px; }
  .wx-factors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wx-factor { padding: 14px; }
  .wx-f-value { font-size: 21px; }
  .wx-feedback { padding: 22px 20px; }
  .wx-fb-buttons { width: 100%; }
  .wx-fb-buttons .am-btn { flex: 1; padding-inline: 8px; }
  .wx-demo-select { flex: 1 1 100%; }
}

.wx-demo-bar[hidden], .wx-stale[hidden] { display: none; }
.wx-stale { margin: 8px 0 0; font-size: 12px; color: var(--wx-warn-text); }
