#wdg-root {
  --w-width: 360px;
  --w-bg: rgba(30,30,30,.85);
  --w-border: rgba(255,255,255,.12);
  --w-text: #fff;
  --w-sub: rgba(255,255,255,.75);
  /* 新增：日夜模式CSS变量，方便统一切换 */
  --w-btn-bg: rgba(255,255,255,.1);
  --w-btn-border: rgba(255,255,255,.12);
  --w-icon-color: #333;
  /* 核心：日间角标默认变量（保持原有样式不变，不改动默认文字/背景） */
  --w-badge-bg: #2563eb;
  --w-badge-text: #333; /* 日间默认文字颜色，保持你原有样式不变 */
  --w-badge-border: #fff;
  --w-badge-shadow: 0 2px 4px rgba(37,99,235,.3);
  /* 新增：日间hover专属角标文字变量（悬浮时文字变白） */
  --w-badge-hover-text: #ffffff;
  font-family: 'Roboto',sans-serif;
  position: fixed;
  bottom: 130px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
  pointer-events: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* 夜间模式全局样式（假设body添加.dark类触发夜间模式） */
body.dark #wdg-root {
  --w-btn-bg: rgba(0,0,0,.3);
  --w-btn-border: rgba(255,255,255,.2);
  --w-icon-color: #f0f0f0;
  /* 夜间角标变量（保持优化后高对比度样式） */
  --w-badge-bg: #ECECEC;
  --w-badge-text: #1a1a1a;
  --w-badge-border: rgba(0,0,0,.2);
  --w-badge-shadow: 0 2px 4px rgba(0,0,0,.3);
  --w-badge-hover-text: #0f0f0f;
}

.wdg-btn {
  padding: 8px 16px;
  height: 44px;
  border-radius: 22px;
  background: var(--w-btn-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--w-btn-border);
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: background .3s cubic-bezier(.4,0,.2,1), 
              box-shadow .3s cubic-bezier(.4,0,.2,1),
              border-color .3s cubic-bezier(.4,0,.2,1);
  pointer-events: auto;
  overflow: hidden;
  color: var(--w-icon-color);
}

.wdg-btn:hover {
  background: rgba(255,255,255,.15);
  box-shadow: 0 15px 35px rgba(0,0,0,.3);
}

/* 夜间模式下wdg-btn hover样式 */
body.dark .wdg-btn:hover {
  background: rgba(0,0,0,.4);
}

.wdg-btn.wdg-active {
  background: var(--w-badge-bg);
  border-color: var(--w-badge-bg);
  color: #fff;
  box-shadow: 0 10px 25px rgba(99,102,241,.4);
}

/* 父容器：圆形按钮基础样式 + 相对定位（角标定位参考） */
#wdg-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--w-btn-bg);
  border: 1px solid var(--w-btn-border);
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  cursor: pointer;
  line-height: 1;
  transition: background .3s cubic-bezier(.4,0,.2,1),
              box-shadow .3s cubic-bezier(.4,0,.2,1),
              border-color .3s cubic-bezier(.4,0,.2,1);
}

/* 天气图标样式 */
.wdg-btn-icon {
  font-size: 13px;
  color: var(--w-icon-color) !important;
  line-height: 1;
  transform: translateZ(0);
  animation: none !important;
  transition: color .3s cubic-bezier(.4,0,.2,1) !important;
}

/* 右上角角标核心样式（默认样式不变，仅hover时文字变白） */
.wdg-btn-temp {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  padding: 0 4px;
  margin: 0;
  border-radius: 10px;
  background: var(--w-badge-bg);
  color: var(--w-badge-text) !important; /* 日间默认文字颜色，保持原有样式 */
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--w-badge-shadow);
  border: 1px solid var(--w-badge-border);
  transition: background .3s cubic-bezier(.4,0,.2,1),
              box-shadow .3s cubic-bezier(.4,0,.2,1),
              border-color .3s cubic-bezier(.4,0,.2,1),
              color .3s cubic-bezier(.4,0,.2,1); /* 文字颜色过渡，保证hover流畅 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 核心：日间模式 - 鼠标悬浮到按钮上，角标文字变为白色，背景加深 */
#wdg-btn:hover {
  background: rgba(255,255,255,.18);
  box-shadow: 0 4px 12px rgba(37,99,235,.2);
}

#wdg-btn:hover .wdg-btn-temp {
  --w-badge-bg: #1d4ed8; /* 日间hover背景加深，保持原有风格 */
  --w-badge-text: #fff; /* 关键：悬浮时文字切换为白色 */
  --w-badge-shadow: 0 2px 6px rgba(37,99,235,.4);
}

/* 夜间模式下hover效果（保持高对比度，不破坏夜间风格） */
body.dark #wdg-btn:hover {
  background: rgba(236,236,236,.45);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

body.dark #wdg-btn:hover .wdg-btn-temp {
  --w-badge-bg: #f5f5f5;
  --w-badge-text: var(--w-badge-hover-text);
  --w-badge-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.wdg-card {
  width: var(--w-width);
  background: var(--w-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--w-border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(20px) scale(.9);
  transform-origin: bottom right;
  transition: all .45s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
  color: var(--w-text);
  pointer-events: none;
}

/* 夜间模式下卡片样式优化 */
body.dark .wdg-card {
  --w-bg: rgba(20,20,20,.9);
  --w-border: rgba(255,255,255,.15);
  box-shadow: 0 30px 60px rgba(0,0,0,.7);
}

.wdg-card.wdg-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wdg-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,#667eea,#764ba2);
  opacity: .25;
  z-index: 0;
  transition: background .6s ease;
}

/* 夜间模式下背景渐变优化 */
body.dark .wdg-bg {
  background: linear-gradient(135deg,#4338ca,#7e22ce);
  opacity: .3;
}

.wdg-anim {
  position: absolute;
  top: -20px;
  right: -10px;
  width: 160px;
  height: 160px;
  opacity: .8;
  z-index: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 100px;
  color: rgba(255,255,255,.2);
}

/* 夜间模式下动画图标颜色 */
body.dark .wdg-anim {
  color: rgba(255,255,255,.3);
}

.wdg-icon-big {
  filter: drop-shadow(0 0 20px rgba(255,255,255,.3));
}

body.dark .wdg-icon-big {
  filter: drop-shadow(0 0 20px rgba(255,255,255,.4));
}

.wdg-inner {
  position: relative;
  z-index: 2;
}

.wdg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--w-sub);
  font-weight: 500;
  margin-bottom: 20px;
  letter-spacing: .5px;
}

.wdg-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.wdg-temp-box {
  display: flex;
  align-items: flex-start;
}

.wdg-val {
  font-size: 64px;
  font-weight: 100;
  line-height: .9;
  letter-spacing: -3px;
}

.wdg-unit {
  font-size: 24px;
  margin-top: 5px;
  font-weight: 300;
  opacity: .8;
}

.wdg-weather-info {
  text-align: right;
}

.wdg-pill {
  font-size: 18px;
  font-weight: 700;
  background: rgba(255,255,255,.1);
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: inline-block;
  margin-bottom: 8px;
}

/* 夜间模式下pill样式 */
body.dark .wdg-pill {
  background: rgba(0,0,0,.2);
  border-color: rgba(255,255,255,.15);
}

.wdg-range {
  font-size: 13px;
  color: var(--w-sub);
}

.wdg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 15px;
}

.wdg-cell {
  background: rgba(255,255,255,.05);
  padding: 12px 16px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.05);
}

/* 夜间模式下cell样式 */
body.dark .wdg-cell {
  background: rgba(0,0,0,.2);
  border-color: rgba(255,255,255,.1);
}

.wdg-k {
  font-size: 11px;
  color: var(--w-sub);
  text-transform: uppercase;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wdg-v {
  font-size: 15px;
  font-weight: 600;
}

.wdg-full {
  background: rgba(255,255,255,.05);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.05);
}

/* 夜间模式下full样式 */
body.dark .wdg-full {
  background: rgba(0,0,0,.2);
  border-color: rgba(255,255,255,.1);
}

.wdg-gg {
  background: rgba(255,255,255,.05);
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 11px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.05);
  width: 160px;
  height: 26px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--w-sub);
}

/* 夜间模式下gg样式 */
body.dark .wdg-gg {
  background: rgba(0,0,0,.2);
  border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
}

.wdg-alert-box {
  background: rgba(220,38,38,.15);
  border: 1px solid rgba(220,38,38,.3);
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 15px;
}

/* 夜间模式下alert样式 */
body.dark .wdg-alert-box {
  background: rgba(220,38,38,.2);
  border-color: rgba(220,38,38,.4);
}

.alert-item {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

body.dark .alert-item {
  border-bottom-color: rgba(255,255,255,.15);
}

.alert-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.alert-title {
  font-size: 13px;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 4px;
}

.alert-desc {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255,255,255,.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wdg-tip {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,.9);
}

.lazy-load {
  opacity: 0;
  transition: opacity .5s ease-in-out;
  min-height: 1px;
}

.lazy-load.is-loaded {
  opacity: 1;
}

@media (max-width: 480px) {
  #wdg-root {
    right: 15px;
    bottom: 100px;
  }
  .wdg-card {
    width: calc(100vw - 30px);
  }
}

@media (min-width: 1024px) {
  main {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 24px;
    align-items: start;
  }
  main>div:nth-child(3) {
    grid-column: 2/3;
    grid-row: 1;
    margin-bottom: 0;
  }
  main>div:nth-child(4) {
    grid-column: 2/3;
    grid-row: 2;
    margin-bottom: 0;
  }
  main>div:nth-child(5) {
    grid-column: 1/2;
    grid-row: 4;
    grid-template-columns: repeat(1,minmax(0,1fr))!important;
  }
  main>div:nth-child(6) {
    grid-column: 2/3;
    grid-row: 3/5;
    height: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
  }
  main>div:nth-child(6)>div.h-64 {
    flex: 1;
    height: auto!important;
    min-height: 350px;
  }
  main>div:nth-child(7) {
    grid-column: 1/-1;
    grid-row: 5;
  }
  main>footer {
    grid-column: 1/-1;
    grid-row: 6;
  }
  .swiper-container {
    grid-column: 1/2;
    grid-row: 1/3;
    height: 100%!important;
    min-height: 30px;
    margin-bottom: 0;
  }
  .notice-bar {
    grid-column: 1/2;
    grid-row: 3;
    margin-bottom: 0;
  }
}

@keyframes wdg-spin-slow {
  100% {
    transform: rotate(360deg);
  }
}

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

@keyframes wdg-rain {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(20px);
    opacity: 0;
  }
}