/* ============================================================
 * 天气组件样式 weather-widget.css v3
 * 依赖：weather-widget.js 自动创建的 .wx-root DOM
 * 所有类名 wx- 前缀隔离，不影响宿主页面样式
 * ============================================================ */

/* ---------- 右上角容器 ---------- */
.wx-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

/* ---------- 右上角玻璃图标按钮 ---------- */
.wx-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 4px 18px rgba(30,64,120,.14), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  cursor: pointer;
  font-size: 14px;
  color: #1f2d3d;
  transition: transform .22s ease, box-shadow .22s ease;
}
.wx-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(30,64,120,.22), inset 0 1px 0 rgba(255,255,255,.8);
}
.wx-trigger:active { transform: translateY(0) scale(.98); }
.wx-trigger .wx-ico-slot { display: flex; align-items: center; }
.wx-trigger .wx-temp { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.wx-trigger .wx-arrow {
  font-size: 10px; color: #64748b; margin-left: 2px;
  transition: transform .25s ease;
}
.wx-trigger.active .wx-arrow { transform: rotate(180deg); }

/* ---------- 弹出面板 ---------- */
.wx-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 440px;
  max-width: calc(100vw - 36px);
  max-height: 82vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px;
  box-shadow:
    0 24px 70px rgba(15,40,90,.22),
    0 2px 8px rgba(15,40,90,.08),
    inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  display: none;
  transform-origin: top right;
  animation: wx-pop .26s cubic-bezier(.34,1.4,.64,1);
}
.wx-panel.open { display: block; }
@keyframes wx-pop {
  from { opacity: 0; transform: scale(.92) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.wx-panel::-webkit-scrollbar { width: 6px; }
.wx-panel::-webkit-scrollbar-thumb { background: #c3d2e5; border-radius: 3px; }
.wx-panel::-webkit-scrollbar-track { background: transparent; }

/* ---------- 渐变头部 ---------- */
.wx-head {
  position: relative;
  margin: 10px;
  padding: 22px 22px 18px;
  border-radius: 16px;
  background:
    radial-gradient(320px 160px at 88% 8%, rgba(255,255,255,.35) 0%, transparent 60%),
    radial-gradient(260px 200px at 8% 100%, rgba(255,255,255,.18) 0%, transparent 55%),
    linear-gradient(135deg, #2f7de1 0%, #4f9df5 55%, #6fb6f9 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(47,110,190,.35), inset 0 1px 0 rgba(255,255,255,.35);
  overflow: hidden;
}
.wx-head::after {  /* 底部波浪装饰 */
  content: "";
  position: absolute; left: -20%; right: -20%; bottom: -34px; height: 60px;
  background:
    radial-gradient(60px 40px at 10% 100%, rgba(255,255,255,.16) 60%, transparent 61%),
    radial-gradient(60px 40px at 30% 100%, rgba(255,255,255,.16) 60%, transparent 61%),
    radial-gradient(60px 40px at 50% 100%, rgba(255,255,255,.16) 60%, transparent 61%),
    radial-gradient(60px 40px at 70% 100%, rgba(255,255,255,.16) 60%, transparent 61%),
    radial-gradient(60px 40px at 90% 100%, rgba(255,255,255,.16) 60%, transparent 61%);
  pointer-events: none;
}
.wx-head-top { display: flex; justify-content: space-between; align-items: flex-start; }
.wx-city {
  font-size: 14px; opacity: .92; display: flex; align-items: center; gap: 4px;
  text-shadow: 0 1px 4px rgba(0,40,90,.25);
}
.wx-now-temp {
  font-size: 52px; font-weight: 700; line-height: 1.05; letter-spacing: -1px;
  text-shadow: 0 3px 12px rgba(0,40,90,.25);
}
.wx-now-temp sup { font-size: 22px; font-weight: 500; opacity: .85; }
.wx-now-desc { font-size: 14px; opacity: .95; margin-top: 2px; }
.wx-now-ico {
  display: flex; align-items: center;
  filter: drop-shadow(0 8px 14px rgba(0,30,70,.35));
  animation: wx-float 3.6s ease-in-out infinite;
}
@keyframes wx-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.wx-chips { display: flex; gap: 8px; margin-top: 14px; position: relative; z-index: 1; flex-wrap: wrap; }
.wx-chip {
  padding: 5px 12px; border-radius: 999px; font-size: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(4px);
}
.wx-update { font-size: 11px; opacity: .7; margin-top: 10px; position: relative; z-index: 1; }

/* ---------- 区块标题 ---------- */
.wx-section {
  padding: 14px 22px 8px;
  font-size: 13px; font-weight: 700; color: #33475b;
  display: flex; align-items: center; gap: 8px;
}
.wx-section .wx-sec-icon { font-size: 14px; }
.wx-section .wx-sec-sub { font-weight: 400; font-size: 11px; color: #94a3b8; margin-left: auto; }
.wx-subsec { padding: 6px 24px 4px; font-size: 12px; color: #7a8ca0; }

/* ---------- 7 日横滑卡片 ---------- */
.wx-days {
  display: flex; gap: 10px;
  padding: 6px 22px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.wx-days::-webkit-scrollbar { height: 4px; }
.wx-days::-webkit-scrollbar-thumb { background: #c3d2e5; border-radius: 2px; }
.wx-daycard {
  flex: 0 0 66px;
  scroll-snap-align: start;
  padding: 10px 4px 12px;
  border-radius: 14px;
  background: #f4f8fd;
  border: 1px solid #e8eef6;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  cursor: default;
}
.wx-daycard:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(30,64,120,.14);
  background: #fff;
}
.wx-daycard.today {
  background: linear-gradient(160deg, #3b82f6, #6fb0f8);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(59,130,246,.4);
}
.wx-daycard .dc-label { font-size: 11px; font-weight: 700; }
.wx-daycard .dc-date { font-size: 10px; opacity: .6; margin-top: 1px; }
.wx-daycard .dc-ico { display: flex; justify-content: center; margin: 7px 0 5px; }
.wx-daycard .dc-tmax { font-size: 13px; font-weight: 700; }
.wx-daycard .dc-tmin { font-size: 11px; color: #7a8ca0; margin-top: 1px; }
.wx-daycard.today .dc-tmin { color: rgba(255,255,255,.8); }

/* ---------- 温度趋势图 ---------- */
.wx-chart { padding: 4px 14px 2px; }
.wx-chart svg { width: 100%; height: 110px; display: block; }

/* ---------- 31 天列表 ---------- */
.wx-row {
  display: grid;
  grid-template-columns: 92px 36px 1fr 96px;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  font-size: 13px;
  color: #33475b;
  border-radius: 10px;
  margin: 1px 10px;
}
.wx-row:hover { background: rgba(59,130,246,.07); }
.wx-row.today { background: rgba(59,130,246,.1); }
.wx-row .wx-date { font-weight: 600; }
.wx-row .wx-date small { display: block; font-size: 11px; font-weight: 400; color: #9aa8b7; }
.wx-row.today .wx-date { color: #2f6fd6; }
.wx-row .wx-ico-slot { display: flex; justify-content: center; }
.wx-row .wx-desc { font-size: 12px; color: #5b6b7d; margin-bottom: 4px; }
.wx-row .wx-rain { font-size: 11px; color: #4a90d9; }

.wx-range { display: flex; align-items: center; justify-content: flex-end; gap: 7px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.wx-range .tmin { color: #4a7fb5; font-weight: 600; }
.wx-range .tmax { color: #e05252; font-weight: 600; }
.wx-bar-track {
  flex: 1; height: 7px; border-radius: 4px;
  background: #eaf0f7; position: relative; overflow: hidden;
}
.wx-bar-fill {
  position: absolute; top: 0; height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6aaef0 0%, #8ec5f4 45%, #f4b06a 100%);
  box-shadow: 0 1px 3px rgba(30,64,120,.25);
}

/* ---------- 底部 / 加载 / 错误 ---------- */
.wx-foot {
  padding: 14px 22px 18px;
  font-size: 11px;
  color: #a8b4c2;
  text-align: center;
  border-top: 1px solid #eef2f7;
  margin-top: 8px;
}
.wx-loading { padding: 50px 20px; text-align: center; color: #8a97a8; font-size: 14px; }
.wx-loading .wx-spin {
  display: inline-block; width: 26px; height: 26px; margin-bottom: 12px;
  border: 3px solid #d6e4f5; border-top-color: #3b82f6;
  border-radius: 50%; animation: wx-rotate .8s linear infinite;
}
@keyframes wx-rotate { to { transform: rotate(360deg); } }
.wx-error { padding: 50px 20px; text-align: center; color: #8a97a8; font-size: 14px; }
.wx-error button {
  margin-top: 12px; padding: 8px 26px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6fb0f8);
  color: #fff; cursor: pointer; font-size: 13px;
  box-shadow: 0 4px 14px rgba(59,130,246,.35);
  transition: transform .18s ease;
}
.wx-error button:hover { transform: translateY(-1px); }

/* ---------- 自绘 SVG 天气图标 ---------- */
.wx-ico { filter: drop-shadow(0 2px 3px rgba(30,60,100,.2)); }
