@import url("/custom/fonts/qweather-icons.css");

/* ============================================================
   weather.css — 和风富数据组件 · 侧边栏行内版
   不再有悬浮面板：头部一行常显，点击后详情在原地展开。
   颜色承接侧边栏的灰墨体系；交互悬停用侧边栏同款天青蓝。
   图标字体本地自托管（/custom/fonts/），不依赖任何 CDN。
   ============================================================ */

#mw-weather {
  width: 100%;
  text-align: center;
  font-family: inherit;
  color: rgba(70, 75, 70, 0.7);
}

/* ———————————————— 头部 ———————————————— */
#mw-weather .mw-head {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .34em;
  font-size: 13px;
  letter-spacing: .04em;
  color: inherit;
  opacity: 0;
  transition: opacity .5s ease;
}
#mw-weather.mw-ready .mw-head { opacity: 1; }

#mw-weather .mw-ico {
  font-size: 1.1em;
  line-height: 1;
  transition: color .25s cubic-bezier(0.4, 0, 0.2, 1);
}
#mw-weather .mw-head:hover .mw-ico { color: #5BC2E7; }   /* 与侧边栏交互同语言 */
#mw-weather .mw-temp { font-variant-numeric: tabular-nums; }
#mw-weather .mw-sep  { opacity: .5; }

/* ———————————————— 行内展开详情（grid-rows 高度动画） ———————————————— */
#mw-weather .mw-detail {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .32s cubic-bezier(0.4, 0, 0.2, 1), opacity .28s ease;
}
#mw-weather.mw-open .mw-detail {
  grid-template-rows: 1fr;
  opacity: 1;
}
#mw-weather .mw-detail-inner {
  overflow: hidden;
  min-height: 0;
  padding-top: 2px;
}

#mw-weather .mw-line {
  font-size: 12px;
  letter-spacing: .05em;
  line-height: 2.1;
  white-space: normal;
}
#mw-weather .mw-pair { white-space: nowrap; }
#mw-weather .mw-k { opacity: .55; margin-right: .3em; }
#mw-weather .mw-v { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
#mw-weather .mw-dot { opacity: .3; margin: 0 .45em; }

/* ———————————————— 位置校正 ———————————————— */
#mw-weather .mw-fixrow { margin-top: 6px; }
#mw-weather .mw-fixlink {
  all: unset;
  cursor: pointer;
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: inherit;
  opacity: .5;
  transition: color .2s ease, opacity .2s ease;
}
#mw-weather .mw-fixlink:hover { color: #5BC2E7; opacity: 1; }
#mw-weather .mw-reset { margin-left: 1em; }

#mw-weather .mw-searchbox { margin: 6px auto 2px; }
#mw-weather .mw-input {
  width: 150px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  text-align: center;
  letter-spacing: .05em;
  color: inherit;
  caret-color: currentColor;
  background: transparent;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 0;
  outline: none;
  transition: border-color .25s ease;
}
#mw-weather .mw-input:focus { border-bottom-color: color-mix(in srgb, currentColor 48%, transparent); }
#mw-weather .mw-input::placeholder { color: inherit; opacity: .45; }

#mw-weather .mw-results {
  margin-top: 4px;
  max-height: 132px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, currentColor 22%, transparent) transparent;
}
#mw-weather .mw-result,
#mw-weather .mw-hint {
  padding: 4px 6px;
  font-size: 11.5px;
  letter-spacing: .04em;
  border-radius: 6px;
}
#mw-weather .mw-hint { opacity: .55; }
#mw-weather .mw-result { cursor: pointer; transition: color .15s ease; }
#mw-weather .mw-result:hover { color: #5BC2E7; }

#mw-weather .mw-head:focus-visible,
#mw-weather .mw-fixlink:focus-visible {
  outline: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ———————————————— 深色 ———————————————— */
[data-user-color-scheme="dark"] #mw-weather {
  color: rgba(200, 195, 190, 0.75);
}
[data-user-color-scheme="dark"] #mw-weather .mw-head:hover .mw-ico,
[data-user-color-scheme="dark"] #mw-weather .mw-fixlink:hover,
[data-user-color-scheme="dark"] #mw-weather .mw-result:hover {
  color: #5BC2E7;
}

@media (prefers-reduced-motion: reduce) {
  #mw-weather .mw-detail,
  #mw-weather .mw-head,
  #mw-weather .mw-ico { transition: none; }
}
