:root {
  --bg: #f6f6f3;
  --panel: #ffffff;
  --line: #e6e5df;
  --line-soft: #f0efea;
  --text: #201f1c;
  --muted: #7c7b74;
  --faint: #a5a49c;
  --accent: #c2410c;
  --accent-soft: #fbefe9;
  --s1: #0f6e56;
  --s1-soft: #e3f2ed;
  --s2: #185fa5;
  --s2-soft: #e6f1fb;
  --s4: #6b6a63;
  --s4-soft: #f1efe8;
  --warn: #b2650c;
  --warn-soft: #fdf1e3;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  border-color: var(--line);
  color: var(--muted);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: #a8360a;
  border-color: #a8360a;
  color: #fff;
}

.btn.primary:disabled {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 22px 0 0;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
}

.status b {
  font-weight: 500;
  color: var(--text);
}

.status .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s1);
  margin-right: 7px;
  vertical-align: 1px;
}

.status .dot.stale {
  background: var(--accent);
}

.notice {
  margin-top: 12px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #8a3210;
  font-size: 13px;
  display: none;
}

.notice.show {
  display: block;
}

.notice .btn.tiny {
  margin-left: 10px;
  font-size: 12px;
  padding: 4px 12px;
  vertical-align: 1px;
}

/* ---------- 日期历史条 ---------- */

.historybar {
  margin-top: 12px;
  padding: 12px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hb-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hb-row[hidden] {
  display: none;
}

.hb-row + .hb-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.hb-label {
  flex: none;
  font-size: 12px;
  color: var(--faint);
  line-height: 26px;
  width: 26px;
}

.hb-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.hb-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 3px 10px 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 56px;
  transition: all 0.15s;
  color: var(--muted);
}

.hb-chip b {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.hb-chip i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1.35;
  white-space: nowrap;
}

.hb-chip:hover {
  border-color: var(--faint);
}

.hb-chip.on {
  background: var(--accent);
  border-color: var(--accent);
}

.hb-chip.on b,
.hb-chip.on i {
  color: #fff;
}

.hb-chip.none {
  border-style: dashed;
  border-color: var(--line-soft);
  cursor: default;
  opacity: 0.55;
}

.hb-chip.more {
  justify-content: center;
  font-size: 12px;
  padding: 3px 12px;
  min-width: 0;
  line-height: 26px;
}

.hb-chip.live {
  color: var(--text);
  font-size: 13px;
  justify-content: center;
  line-height: 1.9;
  min-width: 58px;
  padding: 3px 14px;
}

.hb-chip.live i {
  display: none;
}

.hb-chip.live.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.hb-chip.time {
  min-width: 0;
  padding: 3px 12px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  color: var(--text);
}

.hb-chip.time.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.hb-empty {
  font-size: 12px;
  color: var(--faint);
  line-height: 26px;
}

.dot.hist {
  background: var(--s2);
}

.tag-new {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.5;
  padding: 0 6px;
  margin-right: 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: 1.5px;
}

/* 单个源本次没抓到、临时沿用上一次结果时的标记 */
.tag-deg {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.6;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--warn-soft);
  color: var(--warn);
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 8px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: var(--faint);
  color: var(--text);
}

.chip.on {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.group {
  margin-top: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.group-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.group-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.s1 {
  background: var(--s1-soft);
  color: var(--s1);
}

.badge.s2 {
  background: var(--s2-soft);
  color: var(--s2);
}

.badge.s4 {
  background: var(--s4-soft);
  color: var(--s4);
}

.count {
  font-size: 12px;
  color: var(--faint);
}

.group-note {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.items li {
  padding: 13px 20px;
  border-top: 1px solid var(--line-soft);
}

.items li:first-child {
  border-top: 0;
}

.items li:hover {
  background: #fbfbf9;
}

.item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.item-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.item-title:hover {
  color: var(--accent);
}

.heat {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-desc {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--faint);
}

.loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.skeleton {
  height: 13px;
  border-radius: 4px;
  background: var(--line-soft);
  margin: 12px 0;
}

.foot {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.foot p {
  margin: 0 0 8px;
}

.foot code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--line-soft);
  padding: 1px 6px;
  border-radius: 4px;
}

@media (max-width: 620px) {
  .wrap {
    padding: 26px 14px 56px;
  }
  h1 {
    font-size: 22px;
  }
  .item-top {
    flex-direction: column;
    gap: 3px;
  }
  .historybar {
    padding: 10px 12px 12px;
  }
  .hb-items {
    gap: 5px;
  }
  .hb-chip {
    min-width: 50px;
    padding: 3px 8px 4px;
  }
  .hb-chip b {
    font-size: 11.5px;
  }
}
