/* Fund comparison workspace. Existing theme tokens remain the only palette. */
.fund-panel-open{overflow:hidden}
.fund-selection{display:flex;align-items:center;gap:10px;position:sticky;top:62px;z-index:12;margin:0 10px;padding:9px 12px;background:var(--panel);border-bottom:1px solid var(--line2);box-shadow:0 3px 8px var(--line)}
.fund-selection-count{font-size:12px;color:var(--muted);white-space:nowrap}
.fund-selection-items{display:flex;flex:1;min-width:0;gap:6px;overflow-x:auto;padding:2px}
.fund-selection .fd-chip{white-space:nowrap;background:var(--panel2);color:var(--txt);cursor:pointer;border-color:var(--line2)}
.fund-selection small{color:var(--muted);font-size:10px}
.fund-selection .fd-btn{white-space:nowrap;padding:6px 11px}
.fund-selection .fd-btn[disabled]{background:var(--panel2);border-color:var(--line);color:var(--muted);cursor:default}
#tab-prem .prem-group,#tab-compare .prem-group{margin-top:12px;margin-bottom:16px}
#tab-prem .prem-group-title,#tab-compare .prem-group-title{padding:11px 14px;font-size:15px}
#tab-prem table,#tab-compare table{border-collapse:separate;border-spacing:0}
#tab-prem .tablebox th,#tab-compare .otc-tablebox th{padding:7px 9px}
#tab-prem .tablebox td,#tab-compare .otc-tablebox td{padding:6px 9px;line-height:1.4}
#tab-prem .tablebox tr.sel td,#tab-compare .otc-tablebox tr.sel td{background:var(--bg2)}
#tab-prem table :is(th,td):nth-child(1),#tab-compare table :is(th,td):nth-child(1){position:sticky;left:0;width:42px;min-width:42px;max-width:42px;background:var(--panel);box-sizing:border-box;z-index:3}
#tab-prem table :is(th,td):nth-child(2),#tab-compare table :is(th,td):nth-child(2){position:sticky;left:42px;width:110px;min-width:110px;max-width:110px;background:var(--panel);box-sizing:border-box;z-index:3;box-shadow:none}
#tab-prem table :is(th,td):nth-child(3),#tab-compare table :is(th,td):nth-child(3){position:sticky;left:152px;width:190px;min-width:190px;max-width:190px;background:var(--panel);box-sizing:border-box;z-index:3;box-shadow:1px 0 var(--line2)}
#tab-prem table thead th:nth-child(-n+3),#tab-compare table thead th:nth-child(-n+3){z-index:6;background:var(--panel2)}
.fd-mask .fd-panel{width:min(1120px,98vw);color:var(--txt)}
.fd-mask.page .fd-panel{width:min(1120px,98vw);left:auto;right:0}
.fd-mask .fd-head{padding:10px 20px;background:var(--panel);min-height:50px;box-sizing:border-box}
.fd-mask .fd-title{gap:12px;overflow:hidden}
.fd-mask .fd-code{font-size:12px;white-space:nowrap;color:var(--muted)}
.fd-mask .fd-close{min-height:32px;white-space:nowrap}
.fd-mask .fd-body,.fd-mask.page .fd-body{padding:10px 20px 24px;scrollbar-gutter:stable;overscroll-behavior:contain}
.fd-mask .fd-picks{margin:0;padding:8px 10px;gap:8px;border-radius:7px;background:var(--panel2)}
.fd-mask .fd-chip{border-radius:5px;padding:4px 7px;font-size:12px;max-width:100%;white-space:nowrap}
.fd-mask .fd-chip small{color:var(--muted);font-variant-numeric:tabular-nums;font-size:10px}
.fd-mask .fd-chip-x{padding:2px 3px;color:var(--muted);min-width:22px;min-height:22px}
.fd-mask .fd-add{min-width:160px;width:190px;min-height:30px;box-sizing:border-box}
.fd-mask .fd-picker-status{margin:0;font-size:12px;color:var(--warn)}
.fd-mask .fd-picker-status:not(:empty){padding:6px 0}
.fd-mask .fd-sec,.fd-mask .fd-overview{margin:12px 0 16px}
.fd-mask .fd-overview h4,.fd-mask .fd-sec>h4{font-size:13px;margin:0 0 8px;color:var(--txt);display:flex;align-items:center;gap:10px}
.fd-mask .fd-overview h4>span{font-size:11px;font-weight:400;color:var(--muted)}
.fd-mask .fd-scroll{max-width:100%;overflow:auto;border:1px solid var(--line);border-radius:7px;overscroll-behavior-x:contain}
/* 网格线：单元格给右+下，表格本身补上+左，合计正好 1px（separate 模式下全给 border 会双线） */
.fd-mask .fd-table{width:100%;font-size:12px;border-collapse:separate;border-spacing:0;border-top:1px solid var(--line);border-left:1px solid var(--line)}
.fd-mask .fd-table :is(th,td){padding:7px 10px;white-space:nowrap;font-variant-numeric:tabular-nums;vertical-align:middle;text-align:center;border-right:1px solid var(--line);border-bottom:1px solid var(--line);line-height:1.35}
.fd-mask .fd-table th{position:static;font-weight:500;color:var(--muted);background:var(--panel2);cursor:default}
.fd-mask .fd-table tbody th{font-weight:500;color:var(--txt);background:var(--panel);text-align:center}
.fd-mask .fd-table tbody th small{font-size:10px;color:var(--muted);margin-left:5px}
.fd-mask .fd-table :is(th,td):first-child{position:sticky;left:0;z-index:1;background:var(--panel);box-shadow:1px 0 var(--line)}
.fd-mask .fd-table thead th:first-child{background:var(--panel2);z-index:2}
.fd-mask .fd-table tr:last-child :is(th,td){border-bottom:0}
.fd-mask .fd-ret th.fd-grp{background:var(--panel2);color:var(--txt);font-weight:600;padding:5px 10px}
.fd-mask .fd-ret thead tr:last-child th{font-size:11px}
.fd-mask .fd-period-active :is(td,th){background:var(--bg2)!important}
.fd-mask .fd-stat-block{margin:0 0 12px}
.fd-mask .fd-stat-block h5{margin:0 0 6px;font-size:12px;font-weight:600;color:var(--txt)}
.fd-mask .fd-disclosure{border-top:1px solid var(--line);padding:11px 0}
.fd-mask .fd-disclosure>summary{font-size:13px;font-weight:600;cursor:pointer;color:var(--txt)}
.fd-mask .fd-disclosure>summary span{font-weight:400;font-size:11px;color:var(--muted);margin-left:8px}
.fd-mask .fd-disclosure[open]>summary{margin-bottom:12px}
.fd-mask .fd-intros{grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:14px}
.fd-mask .fd-dl{font-size:12px;grid-template-columns:95px 1fr}
.fd-mask .fd-dl dd{white-space:normal;overflow-wrap:anywhere;line-height:1.6}
.fd-mask .fd-note{font-size:11px;color:var(--muted)}
.fd-mask :focus-visible,.fund-selection :focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:760px){
 .fund-selection{position:static;flex-wrap:wrap;margin:0 2px;padding:8px}
 .fund-selection-items{order:3;flex-basis:100%}.fund-selection-count{margin-right:auto}
 #tab-prem table :is(th,td):nth-child(3),#tab-compare table :is(th,td):nth-child(3){position:static;min-width:160px;max-width:none}
 .fd-mask .fd-panel{width:100vw}
 .fd-mask .fd-body,.fd-mask.page .fd-body{padding:8px 10px 20px}
 .fd-mask .fd-head{padding:8px 10px;gap:5px}
 .fd-mask .fd-title{display:grid;gap:2px;min-width:0}.fd-mask .fd-name{font-size:14px}
 .fd-mask .fd-picks{gap:5px}.fd-mask .fd-add{flex:1;min-width:155px}
 .fd-mask .fd-overview h4{display:block;line-height:1.8}
 .fd-mask .fd-overview h4>span{display:block}
 .fd-mask .fd-overview .fd-table :is(th,td):first-child{min-width:135px;max-width:155px;white-space:normal}
 .fd-mask .fd-sec>h4>span:last-child{display:flex;flex-wrap:wrap;gap:5px;margin-left:0!important;width:100%}
 .fd-mask .fd-btn{min-height:30px;padding:4px 9px}.fd-mask .fd-disclosure>summary span{display:block;margin:5px 0 0 16px}
}

.fd-mask .fd-ret{width:max-content;min-width:100%}
.fd-mask .fd-ret :is(th,td){padding:6px 9px}
.fd-mask .fd-ret thead th{white-space:normal;min-width:76px;text-align:center}
/* 分隔线按指标组画（表头层级是 品类→指标→品种，不再是"品种-指标"成对，
   nth-child(odd) 那套会画错位置 → 由 statTable 显式标 .fd-sep） */
.fd-mask .fd-ret :is(th,td).fd-sep{border-right:1px solid var(--line2)}
.fd-mask .fd-ret thead tr:last-child th:first-child{position:static}
.fd-mask .fd-ret .fd-rowhead{min-width:72px}
.fd-mask .fd-sec>h4{flex-wrap:wrap}

.fd-mask .fd-limits .fd-table th{white-space:normal}
.fd-mask .fd-limit-date{display:block;margin-top:3px;font-size:10px;white-space:normal}
.fd-mask .fd-limits .fd-limit-history{min-width:640px}
.fd-mask .fd-limits .fd-limit-current{min-width:600px}
.fd-mask .fd-limits .fd-table td{white-space:normal;min-width:68px}
.fd-mask .fd-limits .fd-table td:last-child{min-width:105px}
