/* 统计页（stats.js），类名统一 st- 前缀 */
.st-body { display: grid; gap: 16px; align-content: start; grid-auto-rows: max-content; transition: opacity .15s; }
.st-body.st-refreshing { opacity: .55; }

/* 6 张指标卡：用 1px 间隙画分隔线，列数变化时边框不会错位 */
.st-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
#pageStats .st-kpis .kpi { background: var(--panel); border: 0; }
.app[data-bp="tablet"] .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app[data-bp="phone"] .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app[data-bp="phone"] #pageStats .kpi-val { font-size: var(--fs-xl); }

.st-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.app:is([data-bp="tablet"], [data-bp="phone"]) .st-grid { grid-template-columns: minmax(0, 1fr); }
.st-col { display: grid; gap: 16px; min-width: 0; grid-auto-rows: max-content; }

.st-chart { padding: 6px 4px 4px; }
.st-chart-wrap { padding: 4px 8px 8px; }
.st-bar-mark { transition: opacity .12s; }
.st-bar-mark.on { opacity: 1 !important; fill: var(--accent-strong); }
.st-hit { outline: none; cursor: default; }
.st-hit:focus-visible { stroke: var(--accent); stroke-width: 1; }

.st-today { display: grid; gap: 4px; padding-bottom: 8px; }
.st-today .kv { font-size: var(--fs-md); }
.st-today-hint { display: flex; align-items: center; gap: 6px; padding: 0 14px; font-size: var(--fs-xs); color: var(--text-3); flex-wrap: wrap; }
.st-today-hint svg { width: 14px; height: 14px; }

.st-list { display: grid; gap: 12px; padding: 14px 16px 16px; }
.st-list > p { font-size: var(--fs-sm); }
.st-share { display: grid; gap: 6px; min-width: 0; }
.st-share-top { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); min-width: 0; }
.st-share-top > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-share-top > span:last-child { flex: none; color: var(--text-2); font-size: var(--fs-xs); }
.st-share-top .st-warn { color: var(--warn); }
.st-bar { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.st-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.st-bar.warn i { background: var(--warn); }
.st-kv { padding: 0; font-size: var(--fs-sm); }

.st-nodes { gap: 10px; max-height: 360px; overflow-y: auto; }
.st-node { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; font-size: var(--fs-sm); }
.st-node.idle { opacity: .55; }
.st-node-name { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.st-node-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-node-name .mono { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.st-node-meta { color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; }

.st-state { display: grid; place-items: center; min-height: 320px; }

/* 明细表 */
.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: var(--fs-sm); }
.st-table th { text-align: left; font-weight: 500; font-size: var(--fs-xs); color: var(--text-3); padding: 0 12px; height: 38px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.st-table th.r, .st-table td.r { text-align: right; }
.st-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.st-table th button:hover, .st-table th button.on { color: var(--text); }
.st-table th button svg { width: 12px; height: 12px; opacity: .35; }
.st-table th button.on svg { opacity: 1; color: var(--accent-strong); }
.st-table th button:focus-visible { box-shadow: var(--focus); border-radius: 3px; }
.st-table td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-table tbody tr:last-child td { border-bottom: 0; }
.st-table tbody tr:hover td { background: rgba(255,255,255,.015); }
.st-table .st-time { color: var(--text-2); font-size: 12px; }
.st-table .st-client { max-width: 200px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.st-cell-node { display: grid; gap: 1px; max-width: 240px; }
.st-cell-node > span:first-child { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.st-cell-node .mono { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.st-cell-node:has(.mono) { padding-block: 4px; }
.st-table-empty { text-align: center; color: var(--text-3); height: 80px; }

/* 明细表分页 */
.st-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); }
.st-pager-ctl { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-pager-size { display: inline-flex; align-items: center; gap: 6px; }
.st-pager-size .select { height: var(--h-sm); width: auto; padding: 0 26px 0 8px; font-size: var(--fs-xs); }
.st-pager-num { min-width: 52px; text-align: center; color: var(--text-2); }

/* 图片缓存 */
.st-cache-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; }
.st-cache-grid .st-cache-cell { background: var(--panel); border: 0; gap: 6px; }
.st-cache-cell .st-bar { margin-top: 2px; }
.st-cache-cell .st-warn { color: var(--warn); }
.app[data-bp="tablet"] .st-cache-grid, .app[data-bp="phone"] .st-cache-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-cache-off { display: flex; align-items: center; gap: 14px; padding: 16px; flex-wrap: wrap; }
.st-cache-off .empty-icon { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.st-cache-off-text { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; }
.st-cache-off-text b { font-weight: 600; font-size: var(--fs-sm); }
.st-cache-off-text span { font-size: var(--fs-xs); color: var(--text-3); }
.st-cache-note { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: var(--fs-xs); color: var(--text-2); background: var(--accent-wash); }
.st-cache-note svg { width: 13px; height: 13px; }
.st-spin { animation: spin 1s linear infinite; }
.st-state + .st-cache { margin-top: 4px; }
