/* NameHot themes. Default (data-theme=light): ivory + seal red. Alternate (dark): navy + red-gold.
   Contrast of text/price/muted/button meets WCAG AA (>= 4.5:1 for normal text). */

:root, [data-theme="dark"] {
  --bg: #0F234D;
  --wash: rgba(50, 100, 200, 0.28);
  --panel: #17305C;
  --panel2: #1E3C6E;
  --line: #3A5A8C;
  --text: #F4F0E8;
  --muted: #B8C6DC;
  --price: #F0C14B;
  --price-glow: rgba(240, 193, 75, 0.28);
  --hot: #E24A3A;
  --hot-btn: #C41E12;
  --hot-btn-text: #FFFFFF;
  --gold: #E0B03A;
  --gold-ink: #1A120C;
  --spark: #E0B03A;
  --new-border: #C41E12;
  --new-wash: rgba(196, 30, 18, 0.14);
  --ok: #3CCF8A;
  --warn: #E0B03A;
  --banner-bg: #1A2E58;
  --banner-fg: #F3DE9A;
  --banner-line: #3D5A8A;
  --shadow: 0 1px 0 rgba(180, 210, 255, 0.06);
  --hairline: rgba(224, 176, 58, 0.32);
  --tier-silver: #C5CDD8;
  --tier-gold: #F0C14B;
  --tier-fire: #3DFF8A;
  --tier-fire-glow: rgba(61, 255, 138, 0.62);
  --tier-fire-glow-2: rgba(30, 180, 90, 0.38);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F4EDE0;
  --wash: rgba(196, 30, 18, 0.05);
  --panel: #FFFbf4;
  --panel2: #F3E9D8;
  --line: #E0D2BC;
  --text: #1A120C;
  --muted: #5A4A3C;
  --price: #A31510;
  --price-glow: rgba(163, 21, 16, 0.08);
  --hot: #C41E12;
  --hot-btn: #C41E12;
  --hot-btn-text: #FFFFFF;
  --gold: #C9A227;
  --gold-ink: #1A120C;
  --spark: #FFF8F0;
  --new-border: #C41E12;
  --new-wash: rgba(196, 30, 18, 0.05);
  --ok: #1B8F5A;
  --warn: #8A6A12;
  --banner-bg: #C41E12;
  --banner-fg: #FFF8F0;
  --banner-line: #9A180E;
  --shadow: 0 1px 2px rgba(40, 20, 8, 0.06);
  --hairline: rgba(196, 30, 18, 0.45);
  --tier-silver: #6B7380;
  --tier-gold: #A07A12;
  --tier-fire: #0B7A3C;
  --tier-fire-glow: rgba(16, 160, 80, 0.42);
  --tier-fire-glow-2: rgba(11, 122, 60, 0.28);
  color-scheme: light;
}

* { box-sizing: border-box; }
html {
  background: var(--bg);
  scrollbar-color: var(--line) var(--bg);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--line) 70%, var(--text)); }

body {
  margin: 0;
  background: radial-gradient(900px 320px at 50% -100px, var(--wash), transparent 70%), var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }

.test-banner {
  background: var(--banner-bg);
  color: var(--banner-fg);
  text-align: center;
  padding: 6px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--banner-line);
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(14px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  letter-spacing: -0.3px;
}
.wordmark { font-weight: 700; font-size: 20px; }
.wordmark b { color: var(--hot); font-weight: 800; }
.mark { width: 22px; height: 22px; flex: none; }
.mark .flame-body { fill: var(--hot); }
.mark .flame-spark { fill: var(--spark); }

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  margin-left: 2px;
  min-width: 0;
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; flex: none; }
.status.live .dot { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
.status.poll .dot { background: var(--warn); }
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn, .icon-btn, .more {
  font: inherit;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.btn {
  padding: 7px 13px;
  font-weight: 700;
  background: var(--hot-btn);
  border-color: var(--hot-btn);
  color: var(--hot-btn-text);
}
.icon-btn { min-width: 36px; height: 34px; padding: 0 8px; font-size: 14px; }
.icon-btn[aria-pressed="false"] { opacity: 0.5; }
.btn:hover, .icon-btn:hover, .more:hover { filter: brightness(1.08); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

main { max-width: 760px; margin: 0 auto; padding: 6px max(12px, env(safe-area-inset-left)) 40px; }
.tagline { color: var(--muted); margin: 14px 4px 12px; font-size: 13.5px; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .4s ease, background .4s ease, box-shadow .4s ease;
}
.item:hover { filter: brightness(1.03); }
.item.is-new {
  border-color: var(--new-border);
  background: linear-gradient(90deg, var(--new-wash), transparent 55%), var(--panel);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent);
}
.item.leaving {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.item.enter { animation: enter .6s cubic-bezier(.2, .8, .2, 1); }
.item.flash { animation: enter .6s cubic-bezier(.2, .8, .2, 1), flash 3s ease-out; }
@keyframes enter {
  from { opacity: 0; transform: translateY(-14px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes flash {
  0% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 70%, transparent), 0 0 24px color-mix(in srgb, var(--gold) 25%, transparent); }
  100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent); }
}

.r1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dom {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.price {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--price);
  text-shadow: 0 0 16px var(--price-glow);
  white-space: nowrap;
}
.flags { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 2px 7px;
  line-height: 1.2;
  transition: opacity .4s ease, transform .4s ease;
}
.badge.new { color: var(--gold-ink); background: var(--gold); }
.badge.test { color: var(--banner-fg); background: var(--banner-bg); border: 1px solid var(--banner-line); }
.badge.gone { opacity: 0; transform: scale(.7); }

.r2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
}
.time { font-variant-numeric: tabular-nums; }
.src {
  margin-left: auto;
  color: var(--price);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.src:hover { text-decoration: underline; }
.ex {
  display: none;
  margin: 8px 0 0;
  padding: 8px 10px;
  border-left: 2px solid var(--gold);
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.item.open .ex { display: block; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }
.more { display: block; margin: 14px auto 0; padding: 9px 18px; }
.foot { max-width: 760px; margin: 0 auto; padding: 6px 16px 36px; color: var(--muted); font-size: 12px; text-align: center; opacity: 0.9; }

.dlg {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(440px, calc(100vw - 24px));
  box-shadow: var(--shadow);
}
.dlg::backdrop { background: color-mix(in srgb, var(--bg) 70%, black); }
.dlg-in { padding: 16px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; }
.chan {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  background: var(--panel2);
}
.chan h3 { margin: 0 0 4px; font-size: 14px; }
.chan p { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
.chan .btn { display: inline-block; text-decoration: none; }
.chan code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-all;
}
.chan .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (min-width: 640px) {
  .dom { font-size: 22px; }
  .price { font-size: 24px; }
  .top { padding-inline: 24px; }
}
@media (max-width: 420px) {
  .status span { display: none; }
  .dom { font-size: 18px; }
  .price { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .item.flash { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 50%, transparent); }
}

/* ---- USD price tiers (silver / gold / fluorescent). Override the New red border when both apply. ---- */
.heat {
  font-size: 14px;
  letter-spacing: -2px;
  line-height: 1;
  padding-left: 2px;
  filter: drop-shadow(0 0 2px rgba(255, 120, 40, 0.45));
}
.item.tier-1 { border-color: var(--tier-silver); box-shadow: 0 0 0 1px var(--tier-silver); }
.item.tier-2 { border-color: var(--tier-gold); box-shadow: 0 0 0 1px var(--tier-gold); }
.item.tier-3 {
  border-color: var(--tier-fire);
  box-shadow: 0 0 0 1px var(--tier-fire), 0 0 16px var(--tier-fire-glow), 0 0 36px var(--tier-fire-glow-2);
  animation: glow-breathe 2.4s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { box-shadow: 0 0 0 1px var(--tier-fire), 0 0 12px var(--tier-fire-glow), 0 0 24px var(--tier-fire-glow-2); }
  50% { box-shadow: 0 0 0 2px var(--tier-fire), 0 0 22px var(--tier-fire-glow), 0 0 48px var(--tier-fire-glow-2); }
}
@media (prefers-reduced-motion: reduce) {
  .item.tier-3 { animation: none !important; }
}
