/* 數學練習卷（/edu/*）：選項面板、練習卷版面（螢幕與 A4 列印共用） */
.ws-panel { background: #f7faf9; border: 1px solid #dde7e5; border-radius: 12px; padding: 16px 18px; }
.ws-panel .ws-label { font-size: 13px; font-weight: 600; color: #2c403d; margin: 0 0 6px; }
.ws-digits { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ws-digits label { margin: 0; }
.ws-digits input { position: absolute; opacity: 0; pointer-events: none; }
.ws-digits span { display: inline-block; min-width: 40px; padding: 6px 0; text-align: center; border: 1px solid #b9ccc9; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; color: #2c403d; user-select: none; }
.ws-digits input:checked + span { background: #0f6256; border-color: #0f6256; color: #fff; }
.ws-digits input:focus-visible + span { box-shadow: 0 0 0 3px rgba(15,98,86,.25); }
.ws-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.ws-panel select { display: block; height: 38px; padding: 0 10px; border: 1px solid #cfdcda; border-radius: 8px; background: #fff; font-size: 15px; }
.ws-check { display: flex; align-items: center; gap: 6px; height: 38px; margin: 0; font-size: 15px; cursor: pointer; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ws-actions .btn { margin: 0; }
.ws-note { font-size: 13px; color: #6c757d; margin: 8px 0 0; }
.ws-note:empty { display: none; }

.ws-wrap { overflow-x: auto; }
.ws-page { width: 100%; max-width: 780px; margin: 0 auto 24px; background: #fff; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 32px 36px; color: #111; }
.ws-title { font-size: 26px; font-weight: 700; text-align: center; margin: 0 0 4px; letter-spacing: 2px; }
.ws-sub { text-align: center; font-size: 14px; color: #555; margin: 0 0 16px; }
.ws-info { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 15px; margin-bottom: 18px; }
.ws-info span { white-space: nowrap; }
.ws-grid { --ws-cols: 4; display: grid; grid-template-columns: repeat(var(--ws-cols), minmax(0, 1fr)); gap: 10px 18px; min-height: 300px; }
.ws-q { font-size: 20px; line-height: 1.9; padding: 6px 4px; border-bottom: 1px solid #aaa; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ws-q .ws-n { color: #888; font-size: 12px; margin-right: 6px; }
/* Bootstrap 的 sup 也有 position/top，這裡統一蓋掉 */
.ws-q sup { position: relative; top: -.6em; vertical-align: baseline; font-size: .6em; line-height: 0; margin: 0 0 0 .5px; }
.ws-blank { display: inline-block; min-width: 34px; border-bottom: 2px solid #333; height: 1em; vertical-align: -2px; }
sup .ws-blank { min-width: 18px; border-bottom-width: 1.5px; }
.ws-fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .85em; line-height: 1.15; margin: 0 2px; }
.ws-fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }
.ws-fr > span { padding: 0 3px; }
.ws-a { color: #0f6256; }
/* 直式 */
.ws-qv { border-bottom: 0; display: flex; align-items: flex-start; }
.ws-v { display: inline-flex; flex-direction: column; align-items: flex-end; min-width: 5.2em; margin-left: auto; margin-right: auto; line-height: 1.4; }
.ws-v i { font-style: normal; margin-right: .6em; }
.ws-v > span:nth-child(2) { border-bottom: 2px solid #333; width: 100%; text-align: right; }
.ws-v .ws-vr { min-height: 1.4em; }
 /* 短除法 */
.ws-sdbox { padding: 4px 0 8px; }
.ws-q.ws-tall { min-height: 230px; border-bottom: 1px dashed #bbb; }
#wsAnswers .ws-q.ws-tall { min-height: 0; }
.ws-sd { border-collapse: collapse; font-size: 20px; margin: 4px 0 10px 4px; }
.ws-sd td { min-width: 2.6em; height: 1.75em; padding: 0 .35em; text-align: center; }
.ws-sd td.ws-sd-d { min-width: 1.6em; text-align: right; padding-right: .3em; }
.ws-sd td.ws-sd-n { border-bottom: 1.5px solid #222; }
.ws-sd td.ws-sd-first { border-left: 1.5px solid #222; }
.ws-sd tr.ws-sd-blank td { height: 4.6em; }
.ws-sd-ans { font-size: 17px; line-height: 2.2; }
.ws-foot { margin-top: 20px; font-size: 12px; color: #888; text-align: right; }
@media (max-width: 575px) {
  .ws-page { padding: 18px 12px; }
  .ws-grid { grid-template-columns: repeat(min(var(--ws-cols), 2), minmax(0, 1fr)); gap: 8px 12px; }
  .ws-q { font-size: 17px; }
}
@media print {
  .ws-q { break-inside: avoid; page-break-inside: avoid; }
  .ws-grid { grid-template-columns: repeat(var(--ws-cols), minmax(0, 1fr)) !important; min-height: 0; }
  .ws-q { font-size: 18px !important; }
}
