:root {
  color-scheme: dark;
  --bg: #0a0b16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hi: rgba(255, 255, 255, 0.075);
  --surface-solid: #171a2c;
  --line: rgba(255, 255, 255, 0.10);
  --line-hi: rgba(255, 255, 255, 0.18);
  --text: #eeecf5;
  --muted: #9298b4;
  --muted-dim: #6b7091;

  --good: #4ecb8f;
  --ok: #e2b04a;
  --bad: #e5697a;
  --error-text: #f0a8b3;

  --ember: #ff7a29;
  --ember-hot: #ff3b30;
  --focus: rgba(255, 140, 70, 0.55);
  --here: rgba(255, 140, 70, 0.45);

  --overlay: rgba(255, 255, 255, .08);
  --track: rgba(255, 255, 255, .08);
  --track-ring: rgba(255, 255, 255, .09);
  --hairline: rgba(255, 255, 255, .045);
  --path-line: rgba(255, 255, 255, .10);
  --trend-line: rgba(255, 255, 255, .13);
  --dot-ring: rgba(255, 255, 255, .12);
  --ghost: rgba(255, 255, 255, .16);
  --cloud-inset: rgba(255, 255, 255, .035);
  --cloud-high: linear-gradient(90deg, #b8b4d4, #eeecf5);
  --cloud-mid: linear-gradient(90deg, #d4925a, #f0c9a0);
  --skeleton: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 70%);

  --shadow: 0 18px 44px rgba(0, 0, 0, .55);
  --shadow-tip: 0 10px 26px rgba(0, 0, 0, .5);
  --card-shadow: none;
  --brand-glow: 0 0 22px rgba(255, 110, 40, 0.55);
  --glow-mix: 26%;
  --horizon:
    radial-gradient(120% 100% at 50% 118%, rgba(255, 92, 40, 0.22) 0%, rgba(255, 92, 40, 0) 62%),
    radial-gradient(90% 80% at 22% 122%, rgba(255, 176, 64, 0.14) 0%, rgba(255, 176, 64, 0) 58%),
    radial-gradient(80% 90% at 82% 128%, rgba(151, 71, 255, 0.14) 0%, rgba(151, 71, 255, 0) 60%);

  --radius: 18px;
  --radius-sm: 11px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe8;
  --surface: #fffdf9;
  --surface-hi: #fff6ec;
  --surface-solid: #fffdf9;
  --line: rgba(48, 38, 28, 0.10);
  --line-hi: rgba(48, 38, 28, 0.18);
  --text: #2a261f;
  --muted: #6f6a62;
  --muted-dim: #8e887e;

  --good: #1f9a62;
  --ok: #b57a14;
  --bad: #c43d52;
  --error-text: #b53d50;

  --focus: rgba(210, 96, 36, 0.55);
  --here: rgba(210, 96, 36, 0.40);

  --overlay: rgba(48, 38, 28, .06);
  --track: rgba(48, 38, 28, .08);
  --track-ring: rgba(48, 38, 28, .10);
  --hairline: rgba(48, 38, 28, .07);
  --path-line: rgba(48, 38, 28, .12);
  --trend-line: rgba(48, 38, 28, .16);
  --dot-ring: rgba(48, 38, 28, .10);
  --ghost: rgba(48, 38, 28, .16);
  --cloud-inset: rgba(48, 38, 28, .04);
  --cloud-high: linear-gradient(90deg, #8a84b0, #5e5a78);
  --cloud-mid: linear-gradient(90deg, #d4925a, #c47a3e);
  --skeleton: linear-gradient(100deg, rgba(48,38,28,.04) 30%, rgba(48,38,28,.09) 50%, rgba(48,38,28,.04) 70%);

  --shadow: 0 18px 44px rgba(60, 40, 20, .12);
  --shadow-tip: 0 10px 26px rgba(60, 40, 20, .14);
  --card-shadow: 0 1px 2px rgba(40, 30, 20, .04), 0 10px 28px rgba(40, 30, 20, .06);
  --brand-glow: 0 0 14px rgba(255, 110, 40, 0.28);
  --glow-mix: 14%;
  --horizon:
    radial-gradient(120% 100% at 50% 118%, rgba(255, 120, 60, 0.12) 0%, rgba(255, 120, 60, 0) 62%),
    radial-gradient(90% 80% at 22% 122%, rgba(255, 176, 64, 0.08) 0%, rgba(255, 176, 64, 0) 58%),
    radial-gradient(80% 90% at 82% 128%, rgba(170, 110, 200, 0.07) 0%, rgba(170, 110, 200, 0) 60%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: clip;
}

/* 底部地平线余晖 */
.horizon {
  position: fixed;
  inset: auto 0 0 0;
  height: 62vh;
  pointer-events: none;
  z-index: 0;
  background: var(--horizon);
}

main { position: relative; z-index: 1; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px 72px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 13px; }

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--muted-dim);
  letter-spacing: 0.04em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: block;
  filter: drop-shadow(var(--brand-glow));
}

/* ---------- 搜索 ---------- */

.search { position: relative; display: flex; gap: 8px; }

.search input {
  width: 290px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .18s, background .18s;
}

.search input::placeholder { color: var(--muted-dim); }

.search input:focus {
  border-color: var(--focus);
  background: var(--surface-hi);
}

button {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 15px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  white-space: nowrap;
}

button:hover { background: var(--surface-hi); border-color: var(--line-hi); }
button:disabled { opacity: .5; cursor: default; }

.theme-btn {
  width: 42px;
  padding-left: 0;
  padding-right: 0;
  display: grid;
  place-items: center;
  flex: none;
}

.theme-btn svg { width: 18px; height: 18px; display: none; }
html[data-theme="dark"] .theme-btn .icon-sun,
html:not([data-theme]) .theme-btn .icon-sun { display: block; }
html[data-theme="light"] .theme-btn .icon-moon { display: block; }

.suggest {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--surface-solid);
  border: 1px solid var(--line-hi);
  border-radius: 13px;
  box-shadow: var(--shadow);
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
}

.suggest li {
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--overlay); }
.suggest li span.sub { color: var(--muted-dim); font-size: 12.5px; }
.suggest li.empty { color: var(--muted-dim); cursor: default; }
.suggest li.empty:hover { background: none; }

/* ---------- 地点 / 状态 ---------- */

.place-line {
  display: flex;
  align-items: baseline;
  gap: 11px;
  padding: 6px 2px 20px;
  flex-wrap: wrap;
}

.place-name { font-size: 26px; font-weight: 620; letter-spacing: .01em; }
.place-meta { font-size: 13px; color: var(--muted-dim); }

.place-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-open-btn {
  padding: 8px 13px;
  border-color: color-mix(in srgb, var(--ember) 35%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--ember) 10%, var(--surface));
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  transition: background .18s, border-color .18s, transform .15s;
}

.cal-open-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ember) 20%, var(--surface-hi));
  border-color: var(--ember);
}

.cal-open-btn:disabled {
  opacity: .45;
  cursor: wait;
}

.map-open-btn {
  padding: 8px 13px;
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.map-open-btn:disabled {
  opacity: .45;
  cursor: wait;
}

.status {
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.status.error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--error-text); }

/* ---------- 评分卡 ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 18px;
}

.card {
  --glow: #59617d;
  position: relative;
  background:
    radial-gradient(120% 90% at 88% -20%, color-mix(in srgb, var(--glow) var(--glow-mix), transparent), transparent 66%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--glow), transparent);
  opacity: .85;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.card-kind { font-size: 15px; font-weight: 600; letter-spacing: .04em; }
.card-when { font-size: 12.5px; color: var(--muted-dim); }

.card-time {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-main {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 14px 0 18px;
}

.ring { flex: none; position: relative; width: 116px; height: 116px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .track { stroke: var(--track-ring); }
.ring .fill { stroke: var(--glow); stroke-linecap: round; transition: stroke-dashoffset .7s cubic-bezier(.22,.85,.3,1); }

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.ring-score {
  font-size: 34px;
  font-weight: 660;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--glow);
}

.ring-unit { font-size: 11px; color: var(--muted-dim); letter-spacing: .12em; margin-top: 3px; }

.verdict { min-width: 0; }
.verdict-title { font-size: 21px; font-weight: 620; color: var(--glow); line-height: 1.3; }
.verdict-note { font-size: 13.5px; color: var(--muted); margin-top: 5px; }

/* 高 / 中 / 低云量 */

.cloud-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 16px;
}

.cloud-stat {
  background: var(--cloud-inset);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cloud-stat-name {
  font-size: 11.5px;
  color: var(--muted-dim);
  letter-spacing: .06em;
}

.cloud-stat-val {
  font-size: 20px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cloud-stat-val.q-good { color: var(--good); }
.cloud-stat-val.q-ok { color: var(--ok); }
.cloud-stat-val.q-bad { color: var(--bad); }

.cloud-stat-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
  margin-top: 5px;
}

.cloud-stat-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
}

.cloud-stat-bar i.is-high { background: var(--cloud-high); }
.cloud-stat-bar i.is-mid { background: var(--cloud-mid); }

/* 分项条 */

.bars { display: grid; gap: 9px; }

.bar-row {
  display: grid;
  grid-template-columns: 56px 1fr 40px;
  align-items: center;
  gap: 11px;
  font-size: 12.5px;
}

.bar-name { color: var(--muted); }

.bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--track);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--ember);
  transition: width .7s cubic-bezier(.22,.85,.3,1);
}

.bar-val {
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* 详情 */

.details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }

.details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "▾"; font-size: 10px; transition: transform .2s; }
.details[open] summary::after { transform: rotate(180deg); }
.details summary:hover { color: var(--text); }

.factors { margin-top: 12px; display: grid; gap: 2px; }

.factor {
  display: grid;
  grid-template-columns: 74px 78px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--hairline);
}

.factor:last-child { border-bottom: none; }
.factor-name { color: var(--muted); }
.factor-value { font-variant-numeric: tabular-nums; font-weight: 560; }
.factor-note { color: var(--muted-dim); font-size: 12.5px; }

.factor-value.q-good { color: var(--good); }
.factor-value.q-ok { color: var(--ok); }
.factor-value.q-bad { color: var(--bad); }

/* ---------- 面板 ---------- */

.panel {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  box-shadow: var(--card-shadow);
}

.panel-head h2 { margin: 0; font-size: 16px; font-weight: 620; }
.panel-head p { margin: 5px 0 0; font-size: 13px; color: var(--muted-dim); max-width: 62ch; }

.cal-dialog {
  width: min(680px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.cal-dialog::backdrop {
  background: rgba(12, 14, 22, .58);
  backdrop-filter: blur(4px);
}

.cal-modal {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid var(--line-hi);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

.cal-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.cal-modal-head h2 { margin: 0; font-size: 17px; }
.cal-modal-head p { margin: 5px 0 0; color: var(--muted-dim); font-size: 13px; }

.cal-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cal-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cloud-inset);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cal-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cal-setting-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 550;
  white-space: nowrap;
}

.cal-seg {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}

.cal-seg button {
  padding: 5px 10px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  transition: all .15s;
}

.cal-seg button.is-on {
  background: var(--surface-hi);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.cal-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

.cal-toggle-all-btn {
  padding: 4px 9px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
}

.cal-toggle-all-btn:hover {
  color: var(--text);
  background: var(--overlay);
}

.cal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.cal-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .15s, background .15s;
  cursor: pointer;
  user-select: none;
}

.cal-item:hover {
  background: var(--surface-hi);
  border-color: var(--line-hi);
}

.cal-item.is-checked {
  border-color: color-mix(in srgb, var(--ember) 50%, var(--line));
  background: color-mix(in srgb, var(--ember) 6%, var(--surface));
}

.cal-item-checkbox {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--ember);
  cursor: pointer;
}

.cal-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-item-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-item-date {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.cal-item-kind {
  font-size: 12px;
  color: var(--muted-dim);
}

.cal-item-time {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cal-item-meta {
  font-size: 12px;
  color: var(--muted-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-item-score-badge {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.cal-item-score-num {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cal-item-score-level {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--overlay);
}

.cal-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted-dim);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.cal-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-solid);
}

.cal-summary {
  font-size: 13px;
  color: var(--muted);
}

.cal-export-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--ember), var(--ember-hot));
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 90, 40, .32);
  transition: opacity .18s, transform .15s;
}

.cal-export-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 90, 40, .42);
}

.cal-export-btn:disabled {
  opacity: .45;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.map-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.map-dialog::backdrop {
  background: rgba(12, 14, 22, .58);
  backdrop-filter: blur(4px);
}

.map-modal {
  overflow: hidden;
  border: 1px solid var(--line-hi);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

.map-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 14px;
}

.map-modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.map-modal-head p {
  margin: 5px 0 0;
  color: var(--muted-dim);
  font-size: 13px;
}

.map-close-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 28px;
}

.map-close-btn:hover {
  color: var(--text);
  background: var(--overlay);
}

.map-modal-body { padding: 0 14px 14px; }

.map-stage { position: relative; }

/* ---------- 雷达时序播放器 ---------- */
.radar-player {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--cloud-inset);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.radar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}

.radar-ctrl-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  flex: none;
  cursor: pointer;
  transition: all .15s;
}

.radar-ctrl-btn:hover {
  background: var(--surface-hi);
  border-color: var(--line-hi);
}

.radar-timeline-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 130px;
  gap: 4px;
}

.radar-slider, .radar-opacity-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--track);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.radar-slider::-webkit-slider-thumb, .radar-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 6px rgba(255, 120, 40, .6);
  cursor: pointer;
  border: 2px solid #fff;
}

.radar-slider::-moz-range-thumb, .radar-opacity-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 6px rgba(255, 120, 40, .6);
  cursor: pointer;
  border: 2px solid #fff;
}

.radar-time-label {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.radar-opacity-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.radar-opacity-label {
  font-size: 12px;
  color: var(--muted-dim);
  white-space: nowrap;
}

.radar-opacity-slider {
  width: 70px;
}

.radar-opacity-val {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.map-loading {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid var(--line-hi);
  border-radius: 9px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-tip);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.map-loading.error { color: var(--bad); }

.map-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.map-seg {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--cloud-inset);
}

.map-seg button {
  padding: 6px 11px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.map-seg button:hover {
  background: var(--overlay);
  border-color: transparent;
  color: var(--text);
}

.map-seg button.is-on {
  background: var(--surface-hi);
  color: var(--text);
  font-weight: 600;
}

.map-canvas {
  height: min(68vh, 560px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cloud-inset);
  cursor: default;
}

.map-canvas .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: inherit;
  background: var(--cloud-inset);
}

.map-canvas .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  color: var(--muted-dim);
  font-size: 10px;
}
.map-canvas .leaflet-control-attribution a { color: var(--muted); }

.map-canvas .leaflet-bar {
  border: 1px solid var(--line-hi);
  box-shadow: var(--shadow-tip);
}
.map-canvas .leaflet-bar a,
.map-canvas .leaflet-bar a:hover {
  background: var(--surface-solid);
  color: var(--text);
  border-bottom-color: var(--line);
  width: 30px;
  height: 30px;
  line-height: 30px;
}
.map-canvas .leaflet-bar a:hover { background: var(--surface-hi); }

.map-canvas .leaflet-tooltip {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--line-hi);
  border-radius: 8px;
  box-shadow: var(--shadow-tip);
  font-family: inherit;
  font-size: 12px;
}
.map-canvas .leaflet-tooltip-top:before { border-top-color: var(--surface-solid); }

.map-heat-surface {
  pointer-events: none;
  filter: saturate(.9) contrast(.94);
  mix-blend-mode: screen;
}

html[data-theme="light"] .map-heat-surface {
  filter: saturate(.84) contrast(.92);
  mix-blend-mode: multiply;
}

.map-cell {
  background: none !important;
  border: none !important;
}

.map-cell-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff8f2;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--point-color) 82%, #161720);
  box-shadow: 0 0 0 3px rgba(255, 248, 242, .2), 0 3px 14px rgba(0, 0, 0, .42);
  border: 2px solid #fff8f2;
  cursor: pointer;
}

.map-cell.is-here .map-cell-inner {
  width: 44px;
  height: 44px;
  font-size: 13px;
  box-shadow: 0 0 0 3px rgba(255, 248, 242, .24), 0 4px 16px rgba(0, 0, 0, .45);
}

.map-legend {
  width: 156px;
  padding: 8px 10px 7px;
  border: 1px solid var(--line-hi);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  box-shadow: var(--shadow-tip);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.map-legend-title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 650;
}

.map-legend-ramp {
  height: 7px;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.map-legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.map-canvas .map-data-tip {
  max-width: 280px;
  padding: 0;
  border-radius: 11px;
  pointer-events: none;
}

.map-inspect { padding: 9px 11px 10px; }

.map-inspect-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 22px;
}

.map-inspect-main span {
  color: var(--muted);
  font-size: 11.5px;
}

.map-inspect-main strong {
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.map-inspect-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.map-canvas .leaflet-popup-content-wrapper {
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 14px;
  box-shadow: var(--shadow-tip);
  border: 1px solid var(--line-hi);
}

.map-canvas .leaflet-popup-content { margin: 12px 14px 13px; }
.map-canvas .leaflet-popup-tip { background: var(--surface-solid); }

.map-pop { min-width: 198px; font-size: 13px; }
.map-pop-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.map-pop-clouds { color: var(--muted); font-size: 12.5px; margin: 8px 0 10px; line-height: 1.5; }
.map-pop-here { font-size: 12.5px; color: var(--ember); }

html[data-theme="light"] .map-cell-inner {
  color: #fff;
  border-color: #2a261f;
  background: color-mix(in srgb, var(--point-color) 86%, #35312b);
  box-shadow: 0 0 0 3px rgba(42, 38, 31, .18), 0 3px 12px rgba(45, 39, 29, .26);
}

@media (max-width: 640px) {
  .map-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
  .map-modal-head { padding: 16px 16px 12px; }
  .map-modal-body { padding: 0 8px 8px; }
  .map-canvas { height: 320px; }
  .map-inspect-meta {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* 上游光路 */

.upstream-panel {
  background:
    radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--ember) 8%, transparent), transparent 65%),
    var(--surface);
}

.upstream-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 28px;
}

.path-explainer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cloud-inset);
  color: var(--muted);
}

.path-explainer-step {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 58px;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.path-explainer-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--overlay);
}

.path-explainer-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.path-explainer-icon.is-sun { color: var(--ember); }
.path-explainer-icon.is-cloud { color: var(--bad); }
.path-explainer-icon.is-lit { color: var(--ok); }
.path-explainer-arrow { color: var(--muted-dim); font-size: 14px; }

.upstream-body { margin-top: 20px; display: grid; gap: 22px; }

.path-group {
  padding: 15px 16px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cloud-inset);
}

.path-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.path-kind { font-size: 14px; font-weight: 600; }
.path-dir { font-size: 12.5px; color: var(--muted-dim); }

.path-verdict { font-size: 12.5px; margin-left: auto; }
.path-verdict.q-good { color: var(--good); }
.path-verdict.q-ok { color: var(--ok); }
.path-verdict.q-bad { color: var(--bad); }

.path-line { display: flex; align-items: flex-start; gap: 0; }

.path-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  position: relative;
  min-width: 0;
}

.path-node::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--path-line);
}

.path-node:first-child::before { display: none; }

.path-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--dot-ring);
}

.path-dist { font-size: 11.5px; color: var(--muted-dim); }
.path-val { font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 800px) {
  .upstream-panel .panel-head { grid-template-columns: 1fr; }
  .path-explainer { width: fit-content; max-width: 100%; }
}

@media (max-width: 440px) {
  .path-explainer { width: 100%; justify-content: space-between; gap: 4px; }
  .path-explainer-step { min-width: 0; font-size: 10px; }
  .path-explainer-icon { width: 29px; height: 29px; }
  .path-explainer-arrow { font-size: 12px; }
  .path-group { padding-inline: 10px; }
}

/* 趋势 */

.trend-body {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.trend-day {
  position: relative;
  background: var(--cloud-inset);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px 13px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.trend-day.is-today {
  border-color: var(--here);
  background: var(--surface-hi);
}

.trend-day.is-peak {
  border-color: color-mix(in srgb, var(--ember) 55%, var(--line));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ember) 28%, transparent),
    0 10px 22px color-mix(in srgb, var(--ember) 16%, transparent);
}

.trend-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.2;
  color: #fff8f2;
  background: linear-gradient(155deg, #ffd166, var(--ember) 48%, var(--ember-hot));
  box-shadow:
    0 0 0 2px var(--surface),
    0 6px 14px rgba(255, 70, 20, .38);
  white-space: nowrap;
  pointer-events: none;
}

.trend-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35), 0 0 8px rgba(255, 230, 180, .9);
  flex: none;
}

.trend-label {
  font-size: 11.5px;
  color: var(--muted-dim);
  text-align: center;
  line-height: 1.3;
}

.trend-label strong {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 620;
  margin-bottom: 1px;
}

.trend-day.is-today .trend-label strong { color: var(--ember); }

.trend-slot-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 5px;
}

.trend-kind {
  flex: none;
  font-size: 11px;
  color: var(--muted-dim);
}

.trend-time {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.trend-score {
  flex: none;
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.trend-slot.is-empty .trend-score,
.trend-slot.is-empty .trend-time { color: var(--muted-dim); }

.trend-slot-track {
  height: 5px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}

.trend-slot-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
}

@media (max-width: 720px) {
  .trend-body {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .trend-day {
    display: grid;
    grid-template-columns: 64px 1fr 1fr;
    align-items: center;
    gap: 8px 14px;
    padding: 12px 14px;
  }

  .trend-label { text-align: left; }
  .trend-label strong { font-size: 13px; }

  .trend-badge {
    top: 8px;
    right: 10px;
    left: auto;
    transform: none;
  }
}

/* ---------- 页脚 ---------- */

.foot {
  margin-top: 34px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-dim);
}

.foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-hi); }
.foot a:hover { color: var(--text); }

.skeleton {
  background: var(--skeleton);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius);
  height: 348px;
  border: 1px solid var(--line);
}

@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 0; }
}

@media (max-width: 640px) {
  .topbar-inner { padding: 12px 16px; }
  main { padding: 4px 16px 56px; }
  .search { width: 100%; }
  .search input { width: 100%; flex: 1; }
  .card { padding: 20px 18px 18px; }
  .card-main { gap: 16px; }
  .place-name { font-size: 22px; }
  .factor { grid-template-columns: 68px 72px 1fr; }
  .place-actions { width: 100%; justify-content: flex-start; margin-left: 0; margin-top: 4px; }
  .cal-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .cal-modal { max-height: calc(100vh - 24px); }
  .cal-setting-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cal-seg { width: 100%; justify-content: space-between; }
  .cal-seg button { flex: 1; text-align: center; padding: 6px 4px; }
  .radar-player { flex-direction: column; align-items: stretch; gap: 10px; }
  .radar-controls { width: 100%; min-width: 0; }
  .radar-opacity-wrap { width: 100%; justify-content: space-between; }
  .radar-opacity-slider { flex: 1; max-width: none; }
}
