/* 多周期趋势 / 遗漏分位 / 转移矩阵 / 状态回测 (js/pages/jfadv/freq.js). Scoped under .pg-jiufa .adv-….
   Tables (遗漏分位 / 状态回测) reuse the page's .table.jf-ft look; the matrix shades with the 时间热力图 amber steps. */

.pg-jiufa .adv-ttl { font-size: 12px; font-weight: 600; color: var(--text); }
.pg-jiufa .adv-bar .meta.adv-cov { color: var(--accent); }
.pg-jiufa .adv-insight .jf-chip { vertical-align: -3px; }
.pg-jiufa .adv-insight .mono { font-variant-numeric: tabular-nums; }

/* ---------- 多周期趋势 ---------- */
.pg-jiufa .adv-multi { container: advtr / inline-size; }
.pg-jiufa .adv-tr-chart { position: relative; height: clamp(220px, 32vh, 320px); padding: 8px 8px 0; }
.pg-jiufa .adv-tr-chart canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
.pg-jiufa .adv-tr-tip {
  position: absolute; top: 18px; left: 0; z-index: 3; min-width: 150px; padding: 6px 8px; pointer-events: none;
  border: 1px solid var(--line-2); border-radius: var(--r-1); background: rgba(10, 13, 18, .94); box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  font-size: 12px; color: var(--text-2);
}
.pg-jiufa .adv-tr-tip[hidden] { display: none; }
.pg-jiufa .adv-tt-h { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.pg-jiufa .adv-tt-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.pg-jiufa .adv-tt-l li { display: grid; grid-template-columns: 12px 16px minmax(0, 1fr) auto; align-items: center; gap: 5px; height: 18px; }
.pg-jiufa .adv-tt-l li i { width: 12px; height: 3px; border-radius: 2px; background: var(--lc); }
.pg-jiufa .adv-tt-l li .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-jiufa .adv-tt-l li b { font-size: 12px; font-weight: 600; color: var(--text); text-align: right; }
.pg-jiufa .adv-tt-l li.is-q { color: var(--text); }
.pg-jiufa .adv-tt-l li.is-q b { color: var(--accent); }
.pg-jiufa .adv-tt-e { margin: 0; color: var(--text-3); }

.pg-jiufa .adv-tr-legend { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; padding: 8px 10px; }
.pg-jiufa .adv-tr-lg {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-width: 0; min-height: 44px;
  padding: 4px 5px; border: 1px solid var(--line-2); border-radius: var(--r-1); background: transparent; color: var(--text-2); text-align: left;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.pg-jiufa .adv-tr-lg:hover { border-color: var(--text-3); color: var(--text); }
.pg-jiufa .adv-tr-lg.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.pg-jiufa .adv-tr-r1, .pg-jiufa .adv-tr-r2 { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.pg-jiufa .adv-tr-nm { min-width: 0; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a 4-character name (「派对企鹅」): tighter letters, card and row (12 px stays the floor), so the narrow legend cards show it whole */
.pg-jiufa .adv-tr-lg.is-long { padding-left: 3px; padding-right: 3px; }
.pg-jiufa .adv-tr-lg.is-long .adv-tr-r1 { gap: 2px; }
.pg-jiufa .adv-tr-lg.is-long .adv-tr-nm { font-size: 12px; letter-spacing: -0.5px; }
.pg-jiufa .adv-tr-sw { flex: none; width: 12px; height: 3px; border-radius: 2px; background: var(--lc); }
.pg-jiufa .adv-tr-lg.is-on .adv-tr-sw { height: 4px; box-shadow: 0 0 6px var(--lc); }
.pg-jiufa .adv-tr-v { font-family: var(--mono); font-size: 11px; line-height: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
@container advtr (max-width: 619px) {
  .pg-jiufa .adv-tr-legend { grid-template-columns: repeat(var(--nh), minmax(0, 1fr)); }
}

/* ---------- 遗漏分位 / 状态回测 tables ---------- */
.pg-jiufa .adv-om-w, .pg-jiufa .adv-bt-w { max-width: 100%; }
.pg-jiufa .adv .adv-om tbody th, .pg-jiufa .adv .adv-bt tbody th { text-align: left; font-weight: 400; }
.pg-jiufa .adv .adv-om td b { color: var(--text); font-weight: 700; }
.pg-jiufa .adv .adv-om tbody tr.is-warn td, .pg-jiufa .adv .adv-om tbody tr.is-warn th { background: rgba(245, 165, 36, .07); }
.pg-jiufa .adv .adv-om tbody tr.is-danger td, .pg-jiufa .adv .adv-om tbody tr.is-danger th { background: rgba(255, 93, 93, .09); }
.pg-jiufa .adv .adv-om tbody tr.is-danger th { box-shadow: inset 2px 0 0 var(--alert); }
.pg-jiufa .adv .adv-om tbody tr.is-warn th { box-shadow: inset 2px 0 0 var(--accent); }
.pg-jiufa .adv-om-c { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.pg-jiufa .adv-om-bar { position: relative; flex: 1; min-width: 56px; height: 8px; border-radius: 2px; background: var(--line-soft); }
.pg-jiufa .adv-om-bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--info); }
.pg-jiufa .adv-om-bar > i { position: absolute; left: 90%; top: -3px; bottom: -3px; width: 1px; background: var(--text-3); }
.pg-jiufa .is-warn .adv-om-bar > span { background: var(--accent); }
.pg-jiufa .is-danger .adv-om-bar > span { background: var(--alert); }
.pg-jiufa .adv-om-c > b { width: 38px; flex: none; text-align: right; font-size: 12px; font-weight: 600; color: var(--text-2); }
.pg-jiufa .is-warn .adv-om-c > b { color: var(--accent); }
.pg-jiufa .is-danger .adv-om-c > b { color: var(--alert-soft); }

.pg-jiufa .adv-st-fire { color: var(--alert-soft); border-color: var(--alert-line); background: rgba(255, 93, 93, .10); font-weight: 700; }
.pg-jiufa .adv-bt-cf { font-size: 12px; letter-spacing: 1px; color: var(--accent); white-space: nowrap; }
.pg-jiufa .adv-bt-cf .off { color: var(--text-3); }
.pg-jiufa .adv-bt-rule { border-top: 1px solid var(--line-soft); }
.pg-jiufa .adv-bt-u { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; white-space: nowrap; }
.pg-jiufa .adv-bt-u .mono { color: var(--text-2); }
.pg-jiufa .adv-bt-rule sup { font-size: 11px; line-height: 0; }

/* ---------- 转移矩阵 ---------- */
.pg-jiufa .adv-matrix { container: advmx / inline-size; }
.pg-jiufa .adv-mx-w { overflow-x: auto; padding: 8px 10px 0; }
.pg-jiufa .adv-mx {
  width: 100%; min-width: 300px; table-layout: fixed; border-collapse: separate; border-spacing: 2px;
  font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums;
}
.pg-jiufa .adv-mx .adv-mx-c0 { width: 54px; }
.pg-jiufa .adv-mx th { height: 24px; padding: 0; text-align: center; font-weight: 400; color: var(--text-3); }
.pg-jiufa .adv-mx thead th.adv-mx-corner { font-family: var(--font); font-size: 12px; white-space: nowrap; }
.pg-jiufa .adv-mx td { height: 30px; padding: 0 2px; text-align: center; border-radius: 2px; color: var(--text); white-space: nowrap; overflow: hidden; }
.pg-jiufa .adv-mx td.is-zero { background: rgba(255, 255, 255, .02); color: var(--text-3); }
.pg-jiufa .adv-mx td.lv0 { background: rgba(245, 165, 36, .04); color: var(--text-2); }
.pg-jiufa .adv-mx td.lv1 { background: rgba(245, 165, 36, .14); }
.pg-jiufa .adv-mx td.lv2 { background: rgba(245, 165, 36, .26); }
.pg-jiufa .adv-mx td.lv3 { background: rgba(245, 165, 36, .40); }
.pg-jiufa .adv-mx td.lv4 { background: rgba(245, 165, 36, .82); color: var(--on-accent); font-weight: 700; }
.pg-jiufa .adv-mx td .u { opacity: .7; }
/* selected row Q (前一个号码) and its column (后一期 = Q) */
.pg-jiufa .adv-mx tr.is-q td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.pg-jiufa .adv-mx tr.is-q th { color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.pg-jiufa .adv-mx td.is-qc { box-shadow: inset 1px 0 0 rgba(77, 163, 255, .55), inset -1px 0 0 rgba(77, 163, 255, .55); }
.pg-jiufa .adv-mx tr.is-q td.is-qc { box-shadow: inset 0 0 0 1px var(--accent); }
.pg-jiufa .adv-mx thead th.is-qc { box-shadow: inset 0 -2px 0 var(--info); }

.pg-jiufa .adv-mx-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--panel-3); }
.pg-jiufa .adv-mx-pk { font-size: 12px; color: var(--text-2); }
.pg-jiufa .adv-mx-pk .faint { font-size: 12px; }
.pg-jiufa .adv-mx-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.pg-jiufa .adv-mx-b {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px;
  border: 1px solid var(--line-2); border-radius: var(--r-1); background: transparent;
}
.pg-jiufa .adv-mx-b:hover { border-color: var(--text-3); }
.pg-jiufa .adv-mx-b.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

@container advmx (max-width: 520px) {
  .pg-jiufa .adv-mx-w { padding: 6px 4px 0; }
  .pg-jiufa .adv-mx { border-spacing: 1px; }
  .pg-jiufa .adv-mx .adv-mx-c0 { width: 30px; }
  .pg-jiufa .adv-mx td { height: 34px; padding: 0 1px; }
  .pg-jiufa .adv-mx td .u { display: none; } /* the caption / note say the cells are % */
  .pg-jiufa .adv-mx thead th.adv-mx-corner { font-size: 0; }
  .pg-jiufa .adv-mx thead th.adv-mx-corner::before { content: "%"; font-family: var(--mono); font-size: 11px; }
  .pg-jiufa .adv-mx-pick { flex-direction: column; align-items: stretch; }
  .pg-jiufa .adv-mx-btns { display: grid; grid-template-columns: repeat(var(--nh), minmax(0, 1fr)); }
  .pg-jiufa .adv-mx-b { height: 44px; }
}

/* ---------- phones ---------- */
@media (max-width: 767px) {
  .pg-jiufa .adv-tr-chart { height: 240px; padding: 6px 4px 0; }
  .pg-jiufa .adv-tr-legend { padding: 8px; }
  .pg-jiufa .adv-om-c { min-width: 0; gap: 4px; }
  .pg-jiufa .adv-om-bar { min-width: 28px; }
  .pg-jiufa .adv-om-c > b { width: 34px; }
  .pg-jiufa .adv-bt-cf { letter-spacing: 0; }
}
