/* ==========================================================================
   FT8 // HF 全波段接收站：首页播放器的 FT8 标签 + /ft8 接收记录页
   沿用站点设计语言：暗色 = 黑底霓虹黄 + 液晶负显绿；亮色 = 白底蓝 + 黄绿背光液晶
   ========================================================================== */

:root {
  /* 热度色阶：暗色用强调黄，亮色用强调蓝（与站点 --accent-yellow 同源） */
  --f8-heat: 255, 230, 0;
  --f8-local: #00d4ff;          /* VK / ZL 本地区台站 */
  --f8-cq: #ffe600;
}
[data-theme="light"] {
  --f8-heat: 0, 102, 204;
  --f8-local: #0e7490;
  --f8-cq: #0066cc;
}

/* ---------------- 首页小窗口（播放器第二个标签） ---------------- */

/* 液晶区压紧：面板总高和 MMDVM、RF 一样，省下来的高度都给下面的解码列表 */
.ft8-lcd { flex: none; display: flex; flex-direction: column; gap: 5px; padding: 8px 12px; }
/* 第一行：模式大字 + 周期进度（15 秒 / FT4 7.5 秒，和 WSJT-X 右下角的 13/15 一个意思） */
.f8-top { display: flex; align-items: center; gap: 10px; line-height: 1; }
.f8-mode { flex: none; font-size: 20px; font-weight: 900; letter-spacing: 0.06em; }
.f8-cycle { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--lcd-dim); }
.f8-cycle .bar { flex: 1; height: 3px; background-color: var(--lcd-seg); position: relative; }
.f8-cycle .bar i { position: absolute; left: 0; top: 0; bottom: 0; background-color: var(--lcd-fg); }
.f8-cycle .n { flex: none; width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* 十个波段格：数字 = 本周期解码条数，底色深浅 = 活跃度 */
.f8-bands { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.f8-bands .b {
  position: relative; text-align: center; padding: 2px 0 1px;
  border: 1px solid var(--lcd-rule); line-height: 1.1; cursor: pointer;
}
.f8-bands .b::before {
  content: ""; position: absolute; inset: 0; background-color: var(--lcd-fg);
  opacity: calc(var(--h, 0) * 0.32); pointer-events: none;
}
.f8-bands .b b { display: block; font-size: 9px; font-weight: 800; color: var(--lcd-dim); }
.f8-bands .b span { display: block; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.f8-bands .b.zero span { color: var(--lcd-faint); }
.f8-bands .b.sel { border-color: var(--lcd-fg); }
.f8-bands .b.na { cursor: default; opacity: 0.35; }   /* FT4 没有 160 m、60 m */

.f8-stats {
  display: flex; justify-content: space-between; gap: 6px; font-size: 10px; line-height: 1.3;
  color: var(--lcd-dim); white-space: nowrap; overflow: hidden;
}
.f8-stats b { color: var(--lcd-fg); font-weight: 800; }

/* FT8 标签的控制条：和 DMR 的守听控制条同一个组件（.ctl），高度一致，切标签时卡片不跳。
   没有声音可听，换成：模式切换（FT8 / FT4）、暂停滚动、只看 CQ */
#radio-player.src-ft8 .ctl:not(.f8-ctl) { display: none; }
#radio-player:not(.src-ft8) .f8-ctl { display: none; }
.f8-seg { display: inline-flex; flex: none; }
.f8-ctl .btn-listen { width: 52px; }
.f8-ctl .btn-off { background-color: transparent; color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border-color); }
.f8-ctl .btn-off:hover { color: var(--accent-yellow); }
.f8-ctl .f8-pause { width: 76px; }
.f8-ctl .f8-cq { margin-left: auto; width: 76px; }
.f8-empty { padding: 10px 4px; font-size: 10.5px; color: var(--text-muted); text-align: center; }

/* 最近解码：版式照 LAST HEARD，列换成 时间/波段/SNR/信息/旗/距离 */
.f8-row {
  flex: none; display: grid; grid-template-columns: 48px 22px 24px 1fr 16px 40px;
  gap: 5px; align-items: center; font-size: 10px; line-height: 1.5;
  padding: 1px 4px 1px 5px; background-color: var(--bg-secondary);
  color: var(--text-secondary); border-left: 2px solid transparent;
}
.f8-row:nth-child(odd) { background-color: var(--badge-bg); }
.f8-row .t { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.f8-row .bd { font-weight: 800; color: var(--accent-yellow); font-size: 9.5px; letter-spacing: -0.02em; }
.f8-row .snr { text-align: right; font-variant-numeric: tabular-nums; }
.f8-row .snr.good { color: var(--text-primary); font-weight: 700; }
.f8-row .m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f8-row .m b { color: var(--text-primary); font-weight: 700; }
.f8-row .m .cq { color: var(--f8-cq); font-weight: 800; }
.f8-row .m i { font-style: normal; color: var(--text-muted); }
.f8-row .flag { width: 16px; height: 12px; }
.f8-row .km { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.f8-row.local { border-left-color: var(--f8-local); }
.f8-row.me { border-left-color: var(--accent-yellow); }
.f8-row.me .m b { color: var(--accent-yellow); }
.f8-row.dx .km { color: var(--text-primary); font-weight: 700; }
.f8-row.fresh { animation: f8-in 0.6s ease-out; }
@keyframes f8-in { from { background-color: var(--accent-yellow-dim); } }

/* ---------------- 历史记录页 ft8.html ---------------- */

.f8-sub {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted);
  margin-top: 0.35rem; letter-spacing: 0.04em;
}
.f8-stats6 { grid-template-columns: repeat(6, 1fr); }
.lh-stat .v.acc { color: var(--accent-yellow); }
.lh-stat .s { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); margin-top: 0.15rem; }

/* 传播热力图：行 = 波段，列 = 最近 24 个 UTC 小时 */
.f8-heat {
  background-color: var(--bg-card); border: 1px solid var(--border-color);
  padding: 0.8rem 0.9rem 0.7rem; margin-bottom: 1rem;
}
.f8-heat-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em;
  color: var(--text-muted); margin-bottom: 0.6rem;
}
.f8-heat-head b { color: var(--text-primary); letter-spacing: 0.04em; }
.f8-heat-scroll { overflow-x: auto; }
.f8-grid {
  display: grid; grid-template-columns: 38px repeat(24, minmax(16px, 1fr)); gap: 2px;
  min-width: 520px; font-family: var(--font-mono);
}
.f8-grid .bl {
  font-size: 0.66rem; font-weight: 800; color: var(--text-secondary);
  display: flex; align-items: center;
}
.f8-grid .c {
  height: 16px; background-color: var(--badge-bg); position: relative; cursor: pointer;
}
.f8-grid .c::before {
  content: ""; position: absolute; inset: 0;
  background-color: rgba(var(--f8-heat), var(--v, 0));
}
.f8-grid .c:hover { outline: 1px solid var(--accent-yellow); z-index: 1; }
.f8-grid .c.now { box-shadow: inset 0 -2px 0 var(--accent-cyan); }   /* 当前这一小时还没收完 */
.f8-grid .hl {
  font-size: 0.58rem; color: var(--text-muted); text-align: left; white-space: nowrap;
}
.f8-legend {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem;
  margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted);
}
.f8-legend i { width: 14px; height: 9px; display: inline-block; background-color: var(--badge-bg); position: relative; }
.f8-legend i::before { content: ""; position: absolute; inset: 0; background-color: rgba(var(--f8-heat), var(--v)); }

/* 表格：沿用 .lh-table，补 FT8 专有列 */
.f8-table td.band { font-weight: 800; color: var(--accent-yellow); }
.f8-table td.freq small { color: var(--text-muted); margin-left: 0.3rem; }
.f8-table td.snr { font-weight: 700; }
.f8-table td.snr.weak { color: var(--text-muted); font-weight: 400; }
.f8-table td.msg { color: var(--text-secondary); }
.f8-table td.msg b { color: var(--text-primary); }
.f8-table td.msg .cq { color: var(--f8-cq); font-weight: 800; }
.f8-table td.msg .rpt { color: var(--accent-cyan); }
.f8-table td.msg i { font-style: normal; color: var(--text-muted); }
.f8-table .call .cn { font-weight: 400; color: var(--text-muted); font-size: 0.68rem; }
.f8-table tr.local td:first-child { box-shadow: inset 2px 0 0 var(--f8-local); }
.f8-table tr.me td:first-child { box-shadow: inset 2px 0 0 var(--accent-yellow); }
.f8-table tr.me td.msg b.mine { color: var(--accent-yellow); }
.f8-table td.km { font-variant-numeric: tabular-nums; }
.f8-table tr.dx td.km { color: var(--text-primary); font-weight: 700; }
.f8-table .brg { display: inline-block; width: 0.8rem; text-align: center; color: var(--text-muted); }
.f8-table .grid { color: var(--text-muted); }
.f8-more {
  display: block; width: 100%; margin-top: 0.8rem; padding: 0.6rem; text-align: center;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  border: 1px dashed var(--border-color); background: transparent; color: var(--text-secondary); cursor: pointer;
}
.f8-more:hover { border-color: var(--accent-yellow); color: var(--accent-yellow); }

@media (max-width: 900px) {
  .f8-stats6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .f8-stats6 { grid-template-columns: repeat(2, 1fr); }
  .f8-table .hide-m { display: none; }
}

/* 手机：标题行放不下，副标题收起 */
@media (max-width: 480px) { .f8-span { display: none; } }

/* 接收记录页：状态行、加载更早、离线提示 */
.f8-live { display: inline-flex; align-items: center; gap: 0.35rem; }
.f8-note { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin: 0.4rem 0 0.8rem; }
.f8-more[disabled] { opacity: 0.5; cursor: default; }
.f8-table tr.sep td { background-color: var(--badge-bg); color: var(--text-muted); font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.08em; padding: 0.25rem 0.6rem; }
