/* ============================================================
   首页右上角的小天气（配合 assets/weather.js）
   墨鲸，2026-12-01
   ============================================================ */

#wxCard {
  position: fixed;
  top: 88px;
  right: 20px;
  z-index: 120;

  min-width: 172px;
  padding: 10px 14px;

  background: rgba(254, 252, 247, .86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);

  border: 1px solid rgba(140, 120, 90, .22);
  border-radius: 14px;
  box-shadow:
    0 2px 4px rgba(120, 100, 72, .08),
    0 14px 32px -16px rgba(96, 76, 50, .35),
    inset 0 1px 0 rgba(255, 255, 255, .9);

  font-size: .82rem;
  color: #3A342B;
  cursor: pointer;
  user-select: none;

  transition:
    border-color 180ms cubic-bezier(.22, 1, .36, 1),
    box-shadow 180ms cubic-bezier(.22, 1, .36, 1),
    transform 180ms cubic-bezier(.22, 1, .36, 1);
}

#wxCard:hover {
  border-color: rgba(140, 120, 90, .38);
  box-shadow:
    0 2px 4px rgba(120, 100, 72, .10),
    0 18px 40px -18px rgba(96, 76, 50, .45),
    inset 0 1px 0 rgba(255, 255, 255, .95);
}

#wxCard:focus-visible {
  outline: 2px solid rgba(120, 100, 75, .55);
  outline-offset: 3px;
}

/* ---------- 收起那一行 ---------- */
.wx-head {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.wx-ico {
  font-size: 1.05rem;
  line-height: 1;
  flex: 0 0 auto;
}

.wx-city {
  font-weight: 600;
  letter-spacing: .04em;
}

.wx-temp {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #2E2A24;
}

.wx-desc {
  color: #8A8070;
  font-size: .78rem;
}

.wx-arrow {
  margin-left: auto;
  color: #A08A6E;
  font-size: .7rem;
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

#wxCard.is-open .wx-arrow {
  transform: rotate(180deg);
}

/* ---------- 展开面板 ---------- */
.wx-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 260ms cubic-bezier(.22, 1, .36, 1),
    opacity 200ms ease,
    margin-top 260ms cubic-bezier(.22, 1, .36, 1);
  margin-top: 0;
}

#wxCard.is-open .wx-body {
  max-height: 320px;
  opacity: 1;
  margin-top: 10px;
}

/* 体感 / 湿度 / 风向 */
.wx-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(140, 120, 90, .16);
}

.wx-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .78rem;
}

.wx-meta-k {
  color: #A08A6E;
}

.wx-meta-v {
  color: #3A342B;
  font-variant-numeric: tabular-nums;
}

/* 未来三天 */
.wx-forecast {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.wx-fc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
}

.wx-fc-date {
  color: #A08A6E;
  font-variant-numeric: tabular-nums;
  min-width: 2.8em;
}

.wx-fc-ico {
  font-size: .9rem;
  line-height: 1;
}

.wx-fc-desc {
  color: #6F6455;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-fc-temp {
  color: #3A342B;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 更新时间 */
.wx-updated {
  font-size: .7rem;
  color: #A89C88;
  text-align: right;
  padding-top: 4px;
}

/* ---------- 窄屏：挪到左上，别挡住内容 ---------- */
@media (max-width: 860px) {
  #wxCard {
    top: 12px;
    left: 12px;
    right: auto;
    min-width: 148px;
    padding: 8px 12px;
    font-size: .76rem;
  }
  .wx-desc {
    display: none;
  }
}

/* 系统开了减少动效，就别让展开有过渡 */
@media (prefers-reduced-motion: reduce) {
  #wxCard,
  .wx-body,
  .wx-arrow {
    transition: none;
  }
}
