/* 天气（weather.js）：画布垫在文字后面，和极光一层（.sky 也是 -1，天气挂得晚，压在极光上面——雨在近处）；点不到 */
.weather-cv { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
/* 起雾时贴在文字前面的那层薄雾：在正文、照片之上，在风筝、顶栏、各种小纸条之下 */
.weather-cv.weather-front { z-index: 12; }

/* 提示：顶栏下面一张小纸条，七秒后自己淡掉，点一下就收 */
.weather-note { position: fixed; z-index: 25; left: 50%; top: calc(var(--nav-h) + 12px); width: max-content; max-width: min(320px, calc(100vw - 24px)); margin: 0; padding: 8px 15px;
  transform: translateX(-50%); border: 1.5px solid var(--ink); border-radius: 12px; background: var(--card); box-shadow: 3px 3px 0 var(--shadow);
  color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.55; text-align: center; cursor: pointer; animation: weather-note .35s ease; transition: opacity .6s ease; }
.weather-note[hidden] { display: none; }
.weather-note.fade { opacity: 0; }
@keyframes weather-note { from { opacity: 0; transform: translate(-50%, -6px); } }

/* 右下角只显示识别位置、天气和小信息图标；完整来源放在说明弹层。 */
.weather-status { position: absolute; right: max(12px, var(--pad)); bottom: 14px; z-index: 6; width: max-content; max-width: calc(100% - 24px); color: var(--ink-2); text-align: right; }
.weather-summary { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.weather-readout { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; font-size: 12px; line-height: 1.6; }
#weatherPlace { min-width: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#weatherCurrent { flex-shrink: 0; white-space: nowrap; font-weight: 600; }
.weather-info, .weather-close { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* 图形与文字同心且相隔6px；外扩的透明命中区仍为44px。 */
.weather-info { margin: -15.5px; padding: 0; align-items: center; }
.weather-info span { display: grid; place-items: center; width: 13px; height: 13px; border: 1px solid currentColor; border-radius: 50%; font: 600 9px/1 Georgia, serif; }
.weather-info:hover, .weather-info[aria-expanded="true"], .weather-close:hover { color: var(--sea); }
.weather-info:focus-visible, .weather-close:focus-visible, .weather-status a:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 4px; }

/* 非模态说明：打开时浮在入口上方，不锁定页面，也不影响小屋与梯子的点击。 */
.weather-details { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(320px, calc(100vw - 24px)); max-height: min(420px, calc(100dvh - 110px)); overflow-y: auto; overscroll-behavior: contain; padding: 8px 14px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 8px 28px rgba(6, 14, 20, .15); color: var(--ink-2); text-align: left; font-size: 12px; line-height: 1.65; }
.weather-details[hidden] { display: none; }
.weather-details-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.weather-details h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.weather-close { margin-right: -10px; font-size: 22px; }
.weather-details dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 12px; margin: 0 0 12px; }
.weather-details dt { color: var(--ink-3); }
.weather-details dd { margin: 0; overflow-wrap: anywhere; }
.weather-details p { margin: 7px 0 0; }
.weather-details .weather-effect-note { margin: 0 0 12px; color: var(--ink-2); }
.weather-details a { color: var(--sea); text-decoration: underline; text-underline-offset: 2px; }

/* 下雨、下雪、雷雨、起雾：夜里的星被云遮着，淡下去；要整片干净夜空的特效来了，weather.js 先把这个记号拿掉，星就回来 */
:root[data-theme="dark"][data-weather] .night-sky { opacity: .3; }

/* 测试日期面板「天气」那一栏：左边小标题，右边一行字；模拟和按钮各占一行 */
.td-wx { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; max-width: min(560px, calc(100vw - 110px)); }
.td-wx > b { font-weight: 400; color: var(--ink-3); white-space: nowrap; }
.td-wx > span { color: var(--ink); overflow-wrap: anywhere; }
.td-wx > .td-days { margin-left: -7px; }
.td-wx button.td-day { background: none; font: inherit; letter-spacing: inherit; cursor: pointer; }
.td-wx button.td-day[aria-pressed="true"] { border-color: var(--ink); }
.td-wx-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; }
.td-wx-acts a:not([href]) { opacity: .35; }

@media (prefers-reduced-motion: reduce) { .weather-note { animation: none; transition: none; } }
