/* 七巧板板块: galleries drawn by tangram.js */
:root{
  --pL1:#C8553D; --pL2:#9A3A28; --pM:#3D78A8; --pS1:#5E9C6A; --pS2:#2F7A6B; --pQ:#DFA23A; --pP:#7B5CA8;
  --tg-line:var(--surface);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){--pL1:#D9705A; --pL2:#B5503C; --pM:#5B95C4; --pS1:#78B583; --pS2:#4E9C8B; --pQ:#E3B054; --pP:#9A7EC6}
}
:root[data-theme="dark"]{--pL1:#D9705A; --pL2:#B5503C; --pM:#5B95C4; --pS1:#78B583; --pS2:#4E9C8B; --pQ:#E3B054; --pP:#9A7EC6}

.pc{stroke:var(--tg-line); stroke-width:1.6; stroke-linejoin:round; vector-effect:non-scaling-stroke}
.pL1{fill:var(--pL1)} .pL2{fill:var(--pL2)} .pM1{fill:var(--pM)} .pS1{fill:var(--pS1)} .pS2{fill:var(--pS2)}
.pQ1{fill:var(--pQ)} .pP1{fill:var(--pP)}
.ol{fill:none; stroke:var(--ink); stroke-width:1.6; stroke-linejoin:round; vector-effect:non-scaling-stroke}
.tg-silhouette .pc{display:none}
.tg-silhouette .ol{fill:var(--ink)}

.tg-page{padding-bottom:1rem}
.tg-page .hero{padding-block:3rem 1.2rem}
.tg-text{max-width:46em}
.tg-text p{margin:0 0 1rem}
.tg-text h2{font-size:1.5rem; margin:2.6rem 0 .8rem; padding-top:.5rem; border-top:1px solid var(--rule)}
.tg-text .note{color:var(--muted); font-size:.92rem}
.tg-num{font-variant-numeric:tabular-nums}

.tg-tools{display:flex; flex-wrap:wrap; gap:.6rem 1rem; margin:1rem 0}
.tg-seg{display:inline-flex; border:1px solid var(--rule); border-radius:8px; overflow:hidden; background:var(--surface)}
.tg-seg button{font:inherit; font-size:.88rem; border:0; background:none; color:var(--muted); padding:.35rem .8rem; cursor:pointer}
.tg-seg button + button{border-left:1px solid var(--rule)}
.tg-seg button[aria-pressed="true"]{background:var(--tint); color:var(--accent-ink); font-weight:600}

.tg-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(122px,1fr)); gap:.6rem; margin:0 0 2rem}
.tg-grid.tg-champ{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.tg-card{display:flex; flex-direction:column; align-items:stretch; margin:0; padding:.5rem .5rem .4rem; background:var(--surface);
  border:1px solid var(--rule); border-radius:8px; font:inherit; color:inherit; text-align:center}
.tg-card[hidden]{display:none}
button.tg-card{cursor:pointer; transition:border-color .15s}
button.tg-card:hover{border-color:var(--accent)}
button.tg-card:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.tg-card svg{width:100%; height:auto; aspect-ratio:1; display:block}
.tg-champ .tg-card svg{aspect-ratio:auto}
.tg-card .cap,.tg-card figcaption{font-size:.8rem; color:var(--muted); line-height:1.4; margin-top:.25rem; font-variant-numeric:tabular-nums}
.tg-card .cap b{display:block; color:var(--ink); font-weight:600}

.tg-hero-fig{display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:1rem; margin:1.2rem 0 1.5rem}
.tg-hero-fig figure{margin:0; background:var(--surface); border:1px solid var(--rule); border-radius:10px; padding:1rem}
.tg-hero-fig .tg-one svg{width:100%; height:auto; max-height:260px; display:block}
.tg-hero-fig figcaption{font-size:.88rem; color:var(--muted); margin-top:.5rem; text-align:center}

.tg-legend{display:flex; flex-wrap:wrap; gap:.4rem 1rem; font-size:.85rem; color:var(--muted); margin:.4rem 0 0}
.tg-legend span{display:inline-flex; align-items:center; gap:.35rem}
.tg-legend i{width:.9rem; height:.9rem; border-radius:3px; display:inline-block}

.tg-table{border-collapse:collapse; font-size:.92rem; font-variant-numeric:tabular-nums; margin:0 0 1.2rem}
.tg-table th,.tg-table td{border:1px solid var(--rule); padding:.35rem .7rem; text-align:center}
.tg-table th{background:var(--rule-soft)}
.tg-tablewrap{overflow-x:auto}

.tg-dialog{border:1px solid var(--rule); border-radius:12px; background:var(--ground); color:var(--ink); padding:0;
  width:min(960px,calc(100vw - 24px)); max-height:calc(100vh - 32px)}
.tg-dialog::backdrop{background:rgba(0,0,0,.45)}
.tg-dialog[open]{display:flex; flex-direction:column}
.tg-dhead{display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.9rem 1rem 0}
.tg-dhead h2{margin:0; font-size:1.3rem}
.tg-close{font:inherit; font-size:1.6rem; line-height:1; border:0; background:none; color:var(--muted); cursor:pointer; padding:.2rem .5rem}
.tg-close:hover{color:var(--accent)}
.tg-dsub{margin:.3rem 1rem .8rem; color:var(--muted); font-size:.9rem}
.tg-dialog .tg-all{overflow:auto; padding:0 1rem 1rem; margin:0}
.tg-dialog .tg-card svg{aspect-ratio:auto}
