@charset "utf-8";
/* ============================================================
   河南天气 · 单城市卡（可切换城市 + 今明后三天）
   iyunsou.com  2026-11
   ============================================================ */

.hnwx {
  position: relative;
  width: 1200px;
  max-width: 100%;
  margin: 16px auto 20px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 8px;
  padding: 11px 16px 12px;
  box-shadow: 0 1px 3px rgba(160, 120, 60, .06);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  color: #2b2b2b;
}
.hnwx *, .hnwx *::before, .hnwx *::after { box-sizing: border-box; }

/* ---------- 头部 ---------- */
.hnwx-hd {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px solid #f6ece0;
}
.hnwx-t {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: #2b2b2b;
  letter-spacing: .3px;
  flex: none;
}
.hnwx-t i {
  display: block;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: #c8101a;
}
.hnwx-sub {
  font-size: 12px;
  color: #b3a89b;
  line-height: 1.2;
  white-space: nowrap;
}
.hnwx-time {
  margin-left: auto;
  font-size: 12px;
  color: #a89c8e;
  white-space: nowrap;
}
.hnwx-time b { color: #c8101a; font-weight: 600; }

/* ---------- 城市选择 ---------- */
.hnwx-pick { position: relative; flex: none; }

.hnwx-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #c8101a;
  background: #fff6f6;
  border: 1px solid #f6d3d5;
  border-radius: 12px;
  cursor: pointer;
  transition: background .16s, border-color .16s;
  -webkit-appearance: none;
  appearance: none;
}
.hnwx-btn:hover { background: #fdeff0; border-color: #eab9bd; }
.hnwx-btn:focus-visible { outline: 2px solid #f0a9ae; outline-offset: 1px; }
.hnwx-arrow {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s;
}
.hnwx-btn[aria-expanded="true"] .hnwx-arrow { transform: rotate(180deg); }

.hnwx-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 272px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e8dcd0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(90, 60, 30, .16);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.hnwx-pop[hidden] { display: none; }
/* 靠近视口底部时向上展开，避免被裁切 */
.hnwx-pop.is-up { top: auto; bottom: calc(100% + 6px); }
.hnwx-pop button {
  height: 28px;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  color: #4a423b;
  background: #fffdfa;
  border: 1px solid #f2e9de;
  border-radius: 5px;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  -webkit-appearance: none;
  appearance: none;
}
.hnwx-pop button:hover { background: #fff6f6; border-color: #eab9bd; color: #c8101a; }
.hnwx-pop button.is-on {
  background: #c8101a;
  border-color: #c8101a;
  color: #fff;
  font-weight: 600;
}

/* ---------- 主体 ---------- */
.hnwx-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hnwx-now {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}
.hnwx-nowic {
  width: 44px;
  height: 44px;
  flex: none;
  display: block;
}
.hnwx-nowic svg { width: 100%; height: 100%; display: block; }

.hnwx-nowtx {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hnwx-line1 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}
.hnwx-temp {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.5px;
  color: #2f2f2f;
  font-variant-numeric: tabular-nums;
}
.hnwx-temp em {
  font-style: normal;
  font-size: 15px;
  font-weight: 600;
  margin-left: 1px;
  vertical-align: 8px;
}
.hnwx-temp.is-hot { color: #d2381f; }
.hnwx-temp.is-cold { color: #2b76c0; }
.hnwx-txt {
  font-size: 14px;
  color: #5c534a;
  line-height: 1.2;
}
.hnwx-sub2 {
  font-size: 12px;
  line-height: 1.2;
  color: #a89c8e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hnwx-sub2 .hnwx-meta { color: #b8ada0; display: none; }

/* ---------- 中部指标（体感 / 湿度 / 风力） ---------- */
.hnwx-metrics {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 10px 0 14px;
  padding-left: 18px;
  border-left: 1px solid #f4ebe0;
}
.hnwx-m {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.hnwx-m i {
  font-style: normal;
  font-size: 12px;
  color: #b3a89b;
}
.hnwx-m b {
  font-size: 14px;
  font-weight: 600;
  color: #4a423b;
  font-variant-numeric: tabular-nums;
}

/* ---------- 三天预报 ---------- */
.hnwx-days {
  margin-left: auto;
  flex: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 96px;
  align-items: center;
  border-left: 1px solid #f4ebe0;
  padding-left: 18px;
}
.hnwx-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 2px;
}
.hnwx-day .k {
  font-size: 12px;
  line-height: 1.1;
  color: #8d8378;
  white-space: nowrap;
}
.hnwx-day.is-today .k { color: #c8101a; font-weight: 600; }
.hnwx-day .ic {
  width: 26px;
  height: 26px;
  display: block;
}
.hnwx-day .tp {
  font-size: 13px;
  line-height: 1.1;
  color: #6b6259;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hnwx-day .tp b { font-weight: 600; color: #2b2b2b; }
.hnwx-day .tp i { font-style: normal; color: #b4a99c; }

/* 占位/加载态 */
.hnwx.is-wait .hnwx-temp,
.hnwx.is-wait .hnwx-txt,
.hnwx.is-wait .hnwx-sub2,
.hnwx.is-wait .hnwx-day .tp { color: #cfc6ba; }

/* 窄屏隐藏指标，湿度回落到高低温那行 */
@media screen and (max-width: 1023px) {
  .hnwx-metrics { display: none; }
  .hnwx-sub2 .hnwx-meta { display: inline; }
  /* 窄屏没有指标条，当前天气区吃掉剩余宽度并允许收缩 */
  .hnwx-now { flex: 1 1 auto; }
}

/* ---------- 平板 ---------- */
@media screen and (max-width: 1099px) {
  .hnwx {
    width: auto;
    margin: 12px 10px;
    border-radius: 6px;
    padding: 10px 13px 11px;
  }
  .hnwx-days { grid-auto-columns: 76px; padding-left: 13px; }
}

/* ---------- 手机 ---------- */
@media screen and (max-width: 760px) {
  .hnwx { margin: 10px 10px 4px; padding: 9px 11px 10px; }
  .hnwx-hd { gap: 7px; padding-bottom: 8px; margin-bottom: 8px; }
  .hnwx-t { font-size: 14px; gap: 6px; }
  .hnwx-t i { width: 3px; height: 13px; }
  .hnwx-sub { display: none; }
  .hnwx-time { font-size: 11px; }

  .hnwx-btn { height: 22px; padding: 0 8px; font-size: 12px; }
  .hnwx-pop { width: 232px; padding: 6px; gap: 3px; }
  .hnwx-pop button { height: 26px; font-size: 11px; }

  .hnwx-body { gap: 10px; }
  .hnwx-now { gap: 7px; }
  .hnwx-nowic { width: 34px; height: 34px; }
  .hnwx-temp { font-size: 25px; letter-spacing: -.5px; }
  .hnwx-temp em { font-size: 12px; vertical-align: 6px; }
  .hnwx-txt { font-size: 12px; }
  .hnwx-sub2 { font-size: 11px; }
  .hnwx-sub2 .hnwx-meta { display: inline; }

  .hnwx-days { grid-auto-columns: 54px; padding-left: 8px; }
  .hnwx-day { gap: 2px; }
  .hnwx-day .k { font-size: 11px; }
  .hnwx-day .ic { width: 19px; height: 19px; }
  .hnwx-day .tp { font-size: 11px; }
}

/* ---------- 小屏 ---------- */
@media screen and (max-width: 359px) {
  .hnwx { padding: 8px 9px 9px; }
  .hnwx-sub2 .hnwx-meta { display: none; }
  .hnwx-nowic { width: 28px; height: 28px; }
  .hnwx-temp { font-size: 22px; }
  .hnwx-txt { font-size: 11px; }
  .hnwx-line1 { gap: 4px; }
  .hnwx-days { grid-auto-columns: 46px; padding-left: 6px; }
  .hnwx-day .ic { width: 17px; height: 17px; }
  .hnwx-day .k, .hnwx-day .tp { font-size: 10px; }
}
