/* ============================================================
   天声计划 Skysong —— 样式
   编辑级排版 · 低饱和暖色基调 · 大量留白
   无蓝紫渐变、无渐变大字标题
   ============================================================ */

:root {
  --bg: #f4efe6;            /* 暖米 */
  --bg-panel: #fbf8f1;
  --ink: #3c3835;           /* 暖深灰 */
  --ink-soft: #7a736b;
  --line: #e2dacb;
  --accent: #a8442e;        /* 赭红 */
  --accent-soft: #c97f4a;   /* 暖橙 */
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 属性优先于任何 display 规则（.play-duo/.score-card-head 等 flex 布局会覆盖 UA 默认） */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  transition: background-color 1.2s ease;
  min-height: 100vh;
}

/* ---- 天气氛围：背景色随 weatherCode 分组切换 ---- */
body.wx-default { background-color: #f4efe6; }
body.wx-clear   { background-color: #f6efdc; } /* 晴：暖米黄 */
body.wx-cloudy  { background-color: #eeede6; } /* 多云：暖灰 */
body.wx-rain    { background-color: #e5e8e6; } /* 雨：灰蓝偏灰 */
body.wx-snow    { background-color: #f2f3f2; } /* 雪：冷白 */
body.wx-thunder { background-color: #e2dfdd; } /* 雷暴：深灰紫偏灰 */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -10%, rgba(255, 252, 244, 0.55), transparent 60%);
  transition: opacity 1.2s ease;
}
body.wx-thunder::before { background: radial-gradient(ellipse at 50% -10%, rgba(210, 205, 210, 0.4), transparent 60%); }
body.wx-rain::before    { background: radial-gradient(ellipse at 50% -10%, rgba(230, 236, 236, 0.5), transparent 60%); }

/* ---- 天气氛围粒子层（最底层，不响应交互；D4：切换时 opacity 0.6s 淡入淡出） ---- */
#ambience {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 72px 28px 96px;
  position: relative;
  z-index: 1;
}

/* ---- 顶部（D1：更大号衬线标题 + 拉开字距 + 细分隔线 + 天气/调式徽章） ---- */
.masthead { margin-bottom: 56px; }

.masthead h1 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.masthead .en {
  font-size: 21px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 10px;
}

.tagline {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14.5px;
  letter-spacing: 0.08em;
}

/* D1：副标题下方的极细分隔线 */
.masthead-rule {
  margin-top: 18px;
  width: 72px;
  height: 1px;
  background: var(--line);
}

/* D1：当日天气组 + 调式气质小徽章（生成结果就绪后由 JS 显示） */
.mood-badge {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent-soft);
  border: 1px solid rgba(201, 127, 74, 0.4);
  border-radius: 999px;
  padding: 3px 12px;
}
.mood-badge[hidden] { display: none; }

/* ---- 控制区 ---- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

#cityInput {
  font: inherit;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 14px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s ease;
}
#cityInput:focus { border-color: var(--accent-soft); }

/* ---- 城市搜索下拉（B6） ---- */
.city-combo { position: relative; }

.city-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: 240px;
  max-height: 288px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(60, 56, 53, 0.12);
  z-index: 30;
  padding: 4px 0;
}

.dd-group {
  padding: 8px 14px 3px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  user-select: none;
}

.dd-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--ink);
}
.dd-item .py {
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}
.dd-item.active { background: rgba(201, 127, 74, 0.13); }
.dd-item.active .py { color: var(--accent-soft); }

.dd-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- 日期输入（与文本输入同款） ---- */
#dateInput {
  font: inherit;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 12px;
  outline: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  transition: border-color 0.2s ease;
}
#dateInput:focus { border-color: var(--accent-soft); }

.field-actions {
  display: flex;
  align-items: center;
  gap: 14px 18px;
  flex-wrap: wrap;
}

/* F1：对比模式三连播放键，成组换行不溢出 */
.play-duo {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 9px 26px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease,
              transform 0.1s ease, border-color 0.2s ease;
}
.btn:hover:not(:disabled) { background: var(--ink); color: var(--bg-panel); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* 开关型按钮（⇄ 对比）的开启态：实心暖深灰 */
.btn-active,
.btn-active:hover:not(:disabled) { background: var(--ink); color: var(--bg-panel); }

/* 加载态（离线渲染等）：文字 + 尾部转圈 */
.btn.is-loading { pointer-events: none; opacity: 0.75; }
.btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 9px;
  vertical-align: -1px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* B1：去掉浏览器默认 focus 蓝框；键盘聚焦时改用暖棕描边（兼顾可访问性） */
button:focus { outline: none; }
button:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}
select:focus { outline: none; }
select:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

/* D3：播放主键成为视觉焦点——加大一号、暖赭实心；分享/下载/对比等保持次级描边 */
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fdfaf4;
  padding: 11px 30px;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(168, 68, 46, 0.18);
}
.btn-primary:hover:not(:disabled) { background: #93391f; border-color: #93391f; color: #fdfaf4; }
/* D3：播放中变为深灰"停止" */
.btn-primary.is-stop,
.btn-primary.is-stop:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6f1e7;
  box-shadow: none;
}

.offline-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.offline-switch input { accent-color: var(--accent); }

/* B7：统一定制 select 样式（隐藏原生箭头，换暖色手绘感 chevron） */
.mock-select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg-panel)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a8442e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 32px 7px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.mock-select:hover { border-color: var(--accent-soft); }

/* ---- 状态条 ---- */
.status {
  min-height: 26px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  padding: 4px 2px;
  font-variant-numeric: tabular-nums;
}
.status-error { color: #9c3b28; }
.status-success { color: #647a52; } /* 低饱和暖绿，区别于错误红 */

/* ---- 天气小图标（面板标题旁，单色素描风） ---- */
.wx-icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  margin-right: 9px;
  vertical-align: -3px;
  color: var(--accent-soft);
}
.wx-icon svg { width: 100%; height: 100%; display: block; }
.wx-icon:empty { display: none; }

/* F1：对比模式下面板标题旁标注当前展示城市 */
.wx-city-tag {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-left: 10px;
}

/* ---- 面板 ---- */
.panel { margin-top: 52px; }

.panel-title {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* ---- 天气卡片 ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: border-color 0.3s ease, opacity 0.45s ease, transform 0.45s ease,
              box-shadow 0.3s ease;
}
.card.in { opacity: 1; transform: none; } /* F6：入场交错淡入（延迟由 JS 逐卡设置） */
/* D2：hover 轻微上浮 + 阴影 */
.card.in:hover {
  border-color: var(--accent-soft);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(60, 56, 53, 0.08);
}

.card-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

/* D2：卡片左上角的极简天气图标（单色素描 SVG，JS 注入） */
.card-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  color: var(--accent-soft);
  flex: none;
}
.card-icon svg { width: 100%; height: 100%; display: block; }

.card-value {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 8px;
  color: var(--ink);
}

/* F6：加载中骨架——呼吸的暖米色块 */
.cards.is-loading .card-value { color: transparent; position: relative; min-height: 26px; }
.cards.is-loading .card-value::after {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 72%;
  height: 22px;
  border-radius: 6px;
  background: #ece4d3;
  animation: breathe 1.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

.card-map {
  font-size: 11.5px;
  color: var(--accent-soft);
  letter-spacing: 0.04em;
}

/* ---- 乐曲信息 ---- */
.score-duo { display: block; }
.score-duo.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.score-info {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* F1：对比模式下卡片可点（切换天气面板/总谱） */
.score-info.clickable { cursor: pointer; }
.score-info.clickable:hover { border-color: var(--accent-soft); }
/* 非当前关注（非播放/未选中）的城市卡片降低透明度 */
.score-info.dim { opacity: 0.45; }
/* 播放中的卡片：克制的呼吸强调（reduced-motion 下关闭，见文末） */
.score-info.playing {
  border-color: var(--accent-soft);
  animation: card-breathe 2.6s ease-in-out infinite;
}
@keyframes card-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 127, 74, 0); }
  50% { box-shadow: 0 0 0 4px rgba(201, 127, 74, 0.13); }
}

/* F1：卡头 = 槽位标签 + 城市名 */
.score-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -2px 0 16px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.score-card-head .tag {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0;
  color: #fdfaf4;
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 2px 5px;
}

.score-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 32px;
}

.info-item { display: flex; flex-direction: column; gap: 4px; }

.info-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.info-value {
  font-size: 17px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.info-value.mono { font-family: "SF Mono", "Menlo", "Consolas", monospace; font-size: 15px; }

/* F1：双城差异项小标记（调式/和弦进行/BPM 不同时两卡同标） */
.info-item.diff .info-label::after {
  content: "≠";
  margin-left: 6px;
  font-size: 11px;
  color: var(--accent);
}
.info-item.diff .info-value { color: var(--accent); }

/* ---- 可视化 ---- */
.legend {
  float: right;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.legend .sw {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin: 0 5px 0 14px;
  vertical-align: baseline;
}
.sw-pad { background: #8fa0b3; }
.sw-melody { background: #c97f4a; }
.sw-drum { background: #57534c; }
.sw-noise { background: #a9b9a1; }

#viz {
  width: 100%;
  height: 240px; /* JS 会按 DPR 重设像素尺寸并覆盖高度 */
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius); /* D5：圆角 */
  box-shadow: inset 0 0 0 1px rgba(60, 56, 53, 0.04); /* D5：极浅内边框 */
  display: block;
}

/* F5：细进度条 + 小节计数 */
.play-progress {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}
.play-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
}
.play-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* 轻提示 toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #f6f1e7;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 50;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- v3.5：天声计数（页脚上方的双格计数带） ---- */
.stats {
  margin-top: 64px;
  padding: 26px 8px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 48px;
}
.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 260px;
}
.stats-num {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.stats-label { font-size: 13px; color: var(--ink); letter-spacing: 0.12em; }
.stats-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: 0.03em; }
.stats-divider { width: 1px; background: var(--line); }
.stats-item:first-child .stats-num { color: var(--accent); }
@media (max-width: 640px) {
  .stats { flex-direction: column; gap: 20px; }
  .stats-divider { width: auto; height: 1px; }
}

/* ---- 页脚 ---- */
.footer {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}
.footer a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.footer a:hover { border-bottom-color: var(--accent); }
.footer-author { margin-top: 10px; }
.footer-author strong { color: var(--ink); font-weight: 600; letter-spacing: 0.05em; }

/* ---- L1/L4/F2：城市行 + 图标按钮组（省市区 / 定位 / 随机） ---- */
.city-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* P2：36px 描边图标按钮，与实心播放主键形成主次层级 */
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent-soft); color: var(--accent-soft); }
.icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* 定位中：图标淡出 + 转圈 */
.icon-btn.is-loading { pointer-events: none; }
.icon-btn.is-loading svg { opacity: 0.25; }
.icon-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent-soft);
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

/* ---- F3：收藏星标（选中填充暖赭） ---- */
.icon-btn.fav-on { color: var(--accent-soft); border-color: rgba(201, 127, 74, 0.5); }
.icon-btn.fav-on svg path { fill: currentColor; }

/* ---- L1：省-市-区三级联动弹层（与下拉面板同一圆角/阴影/暖色系） ---- */
.region-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 56, 53, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}

.region-modal {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(60, 56, 53, 0.18);
  width: 620px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.region-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.region-title {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ---- R2b：弹层顶部筛选 + 热门城市 chips ---- */
.region-tools {
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.region-filter {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 12px;
  outline: none;
  transition: border-color 0.2s ease;
}
.region-filter:focus { border-color: var(--accent-soft); }

.region-hot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hot-chip {
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.hot-chip:hover { border-color: var(--accent-soft); color: var(--accent); }

/* ---- F3：下拉「我的收藏」分组的移除叉号 ---- */
.dd-fav-x {
  font-size: 15px;
  line-height: 1;
  color: var(--ink-soft);
  padding: 1px 3px;
  border-radius: 4px;
  flex: none;
}
.dd-fav-x:hover { color: var(--accent); background: rgba(168, 68, 46, 0.1); }

.region-cols {
  display: flex;
  min-height: 0;
}

.region-col-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.region-col-wrap + .region-col-wrap { border-left: 1px solid var(--line); }

/* 列头（桌面端也显示，弱化处理） */
.region-col-label {
  display: block;
  padding: 8px 14px 2px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  user-select: none;
}

.region-col {
  list-style: none;
  overflow-y: auto;
  max-height: 320px;
  padding: 4px 0 10px;
}

.rg-item {
  padding: 7px 14px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.rg-item:hover { background: rgba(201, 127, 74, 0.08); } /* P1：hover 态 */
.rg-item.active { background: rgba(201, 127, 74, 0.15); color: var(--accent); } /* P1：选中高亮 */

/* ---- F3：节气徽章（与 mood-badge 同款描边胶囊，赭红色以示区别） ---- */
.solar-badge {
  display: inline-block;
  margin-top: 12px;
  margin-left: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid rgba(168, 68, 46, 0.35);
  border-radius: 999px;
  padding: 3px 12px;
}
.solar-badge[hidden] { display: none; }

/* ---- F6：天气面板标题右侧的数据时间戳 ---- */
.wx-time {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-left: 10px;
  font-variant-numeric: tabular-nums;
}

/* ---- F4：「它是怎么工作的」折叠说明区 ---- */
.about { margin-top: 64px; }

.about-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0 10px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.about-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  transition: transform 0.25s ease;
}
.about-toggle.open svg { transform: rotate(180deg); }
.about-toggle:hover { color: var(--accent); }

.about-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease; /* 展开动画，高度由 JS 按内容设置 */
}

.about-inner { padding: 18px 2px 4px; }
.about-inner p {
  font-size: 13.5px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}
.about-inner b { color: var(--ink); font-weight: 600; }

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  .page { padding: 48px 18px 72px; }
  .masthead h1 { font-size: 30px; letter-spacing: 0.16em; }
  .masthead .en { font-size: 17px; }
  #cityInput, #cityInputB { width: 100%; }
  .city-combo { width: 100%; }
  .city-dropdown { width: 100%; }
  .field { width: 100%; }
  /* D6：按钮组可换行 */
  .field-actions { width: 100%; gap: 10px 14px; flex-wrap: wrap; }
  .btn { padding: 9px 18px; }
  .btn-primary { padding: 10px 22px; font-size: 15px; }
  .play-duo { width: 100%; }
  .play-duo .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
  /* F1/D6：对比模式双卡纵向堆叠 */
  .score-duo.duo { grid-template-columns: 1fr; }
  .legend { float: none; display: block; margin-top: 8px; }
  /* P3：城市行整行铺开，图标按钮组可换行 */
  .city-row { width: 100%; flex-wrap: wrap; }
  /* P3：三级弹层改全屏竖排三列（各自可滚动） */
  .region-overlay { padding: 0; }
  .region-modal {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  .region-cols { flex-direction: column; overflow-y: auto; }
  .region-col-wrap + .region-col-wrap { border-left: none; border-top: 1px solid var(--line); }
  .region-col { max-height: none; overflow: visible; flex: none; }
}

/* ---- v3.2 F4：音色皮肤分段控件（描边风格，与控制区按钮同一暖色系） ---- */
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}
.seg-btn {
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--accent); }
.seg-btn.is-on,
.seg-btn.is-on:hover { color: var(--accent); background: rgba(201, 127, 74, 0.13); }

/* ---- v3.2 F5：最近聆听（footer 上方；无记录时整区隐藏） ---- */
.history { margin-top: 48px; }
.history-title {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* chips 与弹层热门城市 hot-chip 同款描边胶囊 */
.history-chip {
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 13px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.history-chip:hover { border-color: var(--accent-soft); color: var(--accent); }

/* ---- v3.2 F1：天气音乐证书预览弹层（与省市区弹层同款遮罩/圆角/阴影） ---- */
.cert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 56, 53, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 20px;
}
.cert-modal {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(60, 56, 53, 0.18);
  width: 400px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.cert-title {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.cert-body {
  padding: 16px 18px 6px;
  overflow-y: auto;
  min-height: 0;
}
.cert-preview {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.cert-actions {
  display: flex;
  justify-content: center;
  padding: 12px 18px 18px;
}

/* ---- 减少动态：关闭入场/呼吸等动画（氛围粒子层在 JS 中降级为静态帧） ---- */
@media (prefers-reduced-motion: reduce) {
  .card { transition: border-color 0.3s ease; opacity: 1; transform: none; }
  .cards.is-loading .card-value::after { animation: none; opacity: 0.5; }
  .score-info.playing { animation: none; }
  .btn.is-loading::after { animation: none; }
  .icon-btn.is-loading::after { animation: none; }
  .toast { transition: none; }
  .about-body { transition: none; }
}
