@charset "UTF-8";
/* 通用表格增强样式（配 tbl-grid.js；同 Flux grid.js 内联样式 + table-scroll.css 的宽表提示）。
 * 只有被脚本装饰的表（.tg-on）才受影响；不改表格自己的列宽 / 字号 / 内边距。
 * 排序箭头与漏斗是绝对定位的小图标，落在表头右侧的内边距里，不撑宽列。 */
:where(.tg-th) { position: relative; }
.tg-th { cursor: pointer; user-select: none; }
.tg-th:hover { color: var(--brand); }
.tg-th:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.tg-ctl { position: absolute; top: 0; bottom: 0; right: 1px; width: 12px; pointer-events: none; }
.tg-ctl > i { position: absolute; display: block; }
/* 漏斗：悬停 / 键盘聚焦才出现；该列有筛选时常显 */
.tg-fn { right: 0; top: 50%; width: 12px; height: 12px; margin-top: -6px; pointer-events: auto; cursor: pointer; opacity: 0; border-radius: 3px;
  background: currentColor; -webkit-mask: var(--tg-funnel) center / 10px 10px no-repeat; mask: var(--tg-funnel) center / 10px 10px no-repeat; color: var(--muted-2); }
:root { --tg-funnel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M0.6 1.2h8.8L6 5.4v3.4L4 9.4V5.4z' fill='black'/%3E%3C/svg%3E"); }
.tg-th:hover .tg-fn, .tg-th:focus-visible .tg-fn, .tg-fn:hover { opacity: 1; }
.tg-fn:hover { color: var(--brand); }
.tg-filtered .tg-fn { opacity: 1; color: var(--brand); }
/* 排序箭头：有排序时常显 */
.tg-ind { right: 1px; top: 50%; width: 0; height: 0; margin-top: -3px; border: 4px solid transparent; opacity: 0; }
.tg-sorted .tg-ind { opacity: 1; }
.tg-sorted[data-tg-dir="asc"] .tg-ind { border-bottom: 6px solid var(--brand); border-top: 0; margin-top: -3px; }
.tg-sorted[data-tg-dir="desc"] .tg-ind { border-top: 6px solid var(--brand); border-bottom: 0; margin-top: -3px; }
.tg-sorted { color: var(--brand); }
/* 箭头与漏斗同时出现时，漏斗让到箭头左边 */
.tg-sorted:hover .tg-fn, .tg-sorted.tg-filtered .tg-fn { right: 11px; }
.tg-hide { display: none !important; }

/* 底栏：只在排序 / 筛选生效、或表格横向放不下时出现 */
.tg-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; min-height: 28px; font-size: 12px; color: var(--muted); }
.tg-bar[hidden], .tg-bar [hidden] { display: none !important; }
.tg-count b { color: var(--text); }
.tg-reset { color: var(--brand); cursor: pointer; text-decoration: none; }
.tg-reset:hover { text-decoration: underline; }
.tg-hint { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.tg-hint > span { margin-right: 2px; }
.tg-step { min-width: 32px; height: 26px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer; }
.tg-step:hover { border-color: var(--brand); color: var(--brand); }

/* 宽表：右侧渐隐提示还有内容；已向右滚动时首列（本来就固定）右侧出一道阴影 */
.tg-edge { position: sticky; top: 0; left: 0; width: 100%; height: 0; z-index: 6; pointer-events: none; }
.tg-edge::after { content: ''; position: absolute; top: 0; right: 0; width: 22px; height: var(--tg-h, 0); opacity: 0; transition: opacity .15s;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 16%, transparent)); }
.tg-r > .tg-edge::after { opacity: 1; }
.tg-l .tg-on :is(th, td):first-child { box-shadow: 6px 0 8px -6px color-mix(in srgb, var(--text) 35%, transparent); }
/* 还有更多行在下面时：底部渐隐一条（同 Flux table-bottom-fade，24px）；横向有溢出时滚动吸附到列起点，proximity 不抢触控板手感，首列固定宽度记在 --tg-first */
.tg-edge::before { content: ''; position: absolute; left: 0; right: 0; top: calc(var(--tg-h, 0px) - 24px); height: 24px; opacity: 0; transition: opacity .15s;
  background: linear-gradient(transparent, color-mix(in srgb, var(--text) 12%, transparent)); }
.tg-b > .tg-edge::before { opacity: 1; }
.table-shell.tg-ovf { scroll-snap-type: x proximity; scroll-padding-left: var(--tg-first, 0px); overscroll-behavior-x: contain; }
.table-shell.tg-ovf .tg-on tbody tr:first-child > :not(:first-child) { scroll-snap-align: none start; }

/* 智能舱：吸顶表头与（横向滚动时的）首列固定格不许透字——面板是半透明玻璃，滚动的行会从表头底下透出来（实测叠字，.95 的半透明仍会留一层淡影）。
 * 底色取实底 --tg-solid（与站点「读字浮层」实底变量 --glass-solid 同色，只是不透明），暗色表头加顶边 1px 高光（同 Flux cabin-table；它那道逐格斜向渐变在每个 th 上会拼成条纹，没搬）；
 * 只换底色，不加 backdrop-filter，不改尺寸与内边距。经典风格表头本来就是实底，不动；首列平时仍是原来的半透明，只在表被横向滚动（.tg-l）时才压实。 */
html[data-cabin] { --tg-solid: #ffffff; }
html[data-cabin][data-theme="dark"] { --tg-solid: #0d1326; }
html[data-cabin] .table thead th { background-color: var(--tg-solid); }
html[data-cabin][data-theme="dark"] .table thead th { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
html[data-cabin] .table-shell.tg-l .table tbody td:first-child { background-color: var(--tg-solid); }
html[data-cabin] .table-shell.tg-l .table tbody tr:hover td:first-child { background-image: linear-gradient(var(--hover), var(--hover)); }

/* 合计行粘底（脚本给 <tfoot> 各行、tbody 末尾连续的合计行加 tg-pin，并按行高算好 --tg-sb 自下而上叠放；同 Flux table-scroll 的 tfoot 粘底）。
 * 底色必须不透明：先铺实底 --tg-solid（经典风格没有这个变量，退到不透明的 --panel），再叠一层 --panel-2 保持原来的深浅；
 * 选择器写得比 style.css 的 .table td:first-child / .table tfoot tr:first-child td / .table tbody tr:hover td 都高，
 * 否则首列会被刷回白底、「峰 / 谷」两行会被写死的 34px 偏移顶掉、悬停时会变回半透明。 */
:root tr.tg-pin.tg-pin > :is(td, th) { position: sticky; bottom: var(--tg-sb, 0px); z-index: 2; font-weight: 600;
  background-color: var(--tg-solid, var(--panel)); background-image: linear-gradient(var(--panel-2), var(--panel-2));
  box-shadow: inset 0 1px 0 var(--line-2); }
:root tr.tg-pin.tg-pin > :first-child { z-index: 3; left: 0; }
:root tr.tg-pin.tg-pin:hover > :is(td, th) { background-color: var(--tg-solid, var(--panel)); background-image: linear-gradient(var(--panel-2), var(--panel-2)); }
/* 底部渐隐条让到合计行上方，不把钉住的合计行压暗 */
.tg-b > .tg-edge::before { top: calc(var(--tg-h, 0px) - 24px - var(--tg-fh, 0px)); }

/* 经典风格：style.css 的 .table th:first-child 把表头首格刷成 --panel（白），其余表头是 --panel-2，粘顶时左上角比整行浅一格；首格同样取实底 --panel-2 */
html:not([data-cabin]) .table thead th:first-child { background-color: var(--panel-2); }

/* 筛选浮层 */
.tg-pop { position: fixed; z-index: 1000; width: 220px; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--text);
  box-shadow: var(--shadow); font-size: 12px; }
.tg-pop-t { margin-bottom: 8px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-pop-row { display: flex; gap: 6px; align-items: center; }
.tg-pop-row + .tg-pop-row { margin-top: 8px; justify-content: flex-end; }
.tg-pop select, .tg-pop input { height: 30px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 12px; outline: none; min-width: 0; }
.tg-pop select { width: 62px; padding: 0 4px; flex: none; }
.tg-pop input { flex: 1; padding: 0 8px; }
.tg-pop select:focus, .tg-pop input:focus { border-color: var(--brand); }
.tg-pop-clear { color: var(--brand); cursor: pointer; }

/* 平板版没有悬停：漏斗常显（同 Flux 平板版「悬停才出现的改为常显」） */
html.t .tg-fn { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tg-edge::after, .tg-edge::before { transition: none; } }
