/* 条款矩阵：行＝评分条款，列＝头部中标人，格子＝大盘倍数。表格撑满视口，页面本身不滚动。 */
/* 本页覆盖：--muted 原值对 10px 小字只有 3.7:1，这里提到 5.2:1；最深档配白字提到 6.6:1。 */
:root{--muted:#5f706b}
html,body{height:100%}
body{display:flex;flex-direction:column;overflow:hidden}
.app-header{flex-shrink:0}
main{flex:1;min-height:0;max-width:none;margin:0;padding:10px 16px 12px;display:flex;flex-direction:column;gap:8px}
.toolbar{flex-shrink:0;display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}
.toolbar-fields{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.toolbar-fields label{font-size:11px}
.toolbar-fields input,.toolbar-fields select{padding:6px 8px;margin-top:3px}
.toolbar-fields>label:first-child{width:230px}
.toolbar-fields .check{display:flex;align-items:center;gap:6px;white-space:nowrap;padding-bottom:7px;color:var(--ink)}
.toolbar-fields .check input{width:15px;margin:0;accent-color:var(--green)}
.hint{display:inline-grid;place-items:center;width:14px;height:14px;border-radius:50%;background:var(--soft);color:var(--green);font-size:10px;cursor:help}
.toolbar .pill{margin-bottom:5px}
.legend{display:flex;align-items:center;gap:5px;font-size:11px;color:var(--muted);padding-bottom:6px;flex-wrap:wrap}
.legend i{width:15px;height:11px;border-radius:3px;border:1px solid var(--line);margin-left:5px}
.legend-note{margin-left:10px}
.caliber{margin:0 0 0 10px;font-size:11px}
.caliber summary{color:var(--green)}
.caliber p{position:absolute;right:16px;max-width:560px;background:white;border:1px solid var(--line);border-radius:9px;padding:10px 12px;box-shadow:0 10px 30px #173c3922;z-index:9;line-height:1.6}
.s0{background:#fbf4f0}.s1{background:#f3f7f4}.s2{background:#dcecdf}.s3{background:#8dbf9f}.s4{background:#26684f;color:#fff}
.matrix-panel{flex:1;min-height:0;display:flex;overflow:hidden}
.matrix-scroll{flex:1;min-height:0;overflow:auto;border-radius:12px}
#matrix{width:100%;min-width:max-content;border-collapse:separate;border-spacing:0;table-layout:fixed}
#matrix th,#matrix td{border-bottom:1px solid var(--line);border-right:1px solid #eef2ef}
#matrix thead th{position:sticky;top:0;z-index:3;background:#edf3ee;padding:6px 3px;vertical-align:bottom;font-size:11px;font-weight:550}
#matrix thead th.corner{left:0;z-index:5;width:250px;min-width:250px;text-align:left;padding:10px 12px;vertical-align:bottom}
#matrix thead th.vendor{width:44px;min-width:44px}
#matrix thead th.vendor span{writing-mode:vertical-rl;text-orientation:mixed;display:inline-block;height:86px;overflow:hidden;text-align:right;line-height:1.15}
#matrix thead th.vendor small{display:block;writing-mode:horizontal-tb;color:var(--muted);font-weight:400;font-size:9px;margin-top:3px}
#matrix tbody th{position:sticky;left:0;z-index:2;background:white;text-align:left;padding:6px 12px;font-weight:450;font-size:12px;border-block:0;border-bottom:1px solid var(--line)}
#matrix tbody th small{display:block;color:var(--muted);font-size:10px;margin-top:1px}
#matrix td{padding:0;text-align:center;font-size:11px;font-variant-numeric:tabular-nums}
#matrix td button{width:100%;height:100%;min-height:28px;border:0;border-radius:0;background:transparent;padding:3px 2px;font-size:11px;color:inherit}
#matrix td button:hover{outline:2px solid var(--green);outline-offset:-2px;background:transparent}
#matrix td.empty{background:#fcfdfc;color:#c8d2cc}
#matrix td.thin button::after{content:"*";font-size:9px;vertical-align:super;margin-left:1px}
#matrix tr.group-row th{background:#f7faf7;color:var(--green);font-size:11px;font-weight:600;padding:5px 12px}
#matrix tr.group-row td{background:#f7faf7}
#matrix tbody tr:hover th{background:#f6faf7}
.cell-dialog-row{border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:8px 0;font-size:13px}
.cell-dialog-row b{display:block}
.cell-dialog-row small{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.cell-clause{background:#f5f8f6;border-left:2px solid #c6d8cc;padding:6px 8px;font-size:12px;color:#4d5f58;margin:6px 0 0;white-space:pre-wrap}
#cellStat{font-size:12px;color:var(--muted);margin:4px 0 0}
@media(max-width:900px){
  main{padding:8px}
  .toolbar-fields{gap:8px}.toolbar-fields>label:first-child{width:150px}
  .legend{display:none}
  #matrix thead th.corner{width:140px;min-width:140px;padding:8px}
  #matrix tbody th{padding:6px 8px;font-size:11px}
}
#matrix thead tr:first-child th.family{top:0;background:#e3ede6;color:var(--green);text-align:center;padding:4px 3px;font-size:11px;vertical-align:middle}
#matrix thead tr:first-child th.family small{display:block;color:var(--muted);font-weight:400;font-size:9px}
#matrix thead tr:nth-child(2) th{top:38px}
#matrix .family-start{border-left:2px solid #b9cfc2}
#matrix tr.group-row th{white-space:nowrap;overflow:visible}
/* 无页头：工具栏就是页面顶部，导出按钮收在图例右侧 */
main{padding-top:12px}
.legend #export{margin-left:14px;padding:5px 10px;font-size:12px}
.how{flex-shrink:0;margin:0;font-size:11px;line-height:1.7;color:var(--muted)}
.how b{color:var(--ink);font-weight:600}
@media(max-width:900px){.how{display:none}}

/* 可读性：十字定位、分区标识、键盘焦点、首列分隔 */
#matrix thead th.vendor.hot{background:#d6e6db;color:var(--green)}
#matrix tbody th.hot{background:#eef6f1}
#matrix tbody th{border-right:1px solid #d3ded7;box-shadow:inset 3px 0 0 var(--accent,transparent)}
#matrix tbody th[data-section="技术部分"]{--accent:#9dc9ae}
#matrix tbody th[data-section="商务部分"]{--accent:#cfdccd}
#matrix thead th.corner{border-right:1px solid #d3ded7}
#matrix td button:focus-visible{outline:2px solid var(--green);outline-offset:-2px}
#matrix td.empty{color:#9fada6}
#matrix tr.group-row th{box-shadow:inset 3px 0 0 var(--green)}
.legend-note b{color:var(--ink)}
#matrix tr.group-row th{position:sticky;left:0;top:var(--head,0px);z-index:4}

/* 企查查核到的有效证书：格子右上角一个小勾，列头小字后面带勾和张数。 */
#matrix td{position:relative}
#matrix td .held{position:absolute;top:1px;right:2px;font-style:normal;font-size:9px;line-height:1;font-weight:700;color:var(--green);pointer-events:none}
#matrix td.s4 .held{color:#fff}
#matrix thead th.vendor small .held{font-style:normal;color:var(--green);font-weight:700;margin-left:2px}
.legend .held-legend{color:var(--green);font-weight:700;margin-left:10px}
