/* 阿桀老師後台：使用期間欄、可玩的遊戲改為分類按鈕（3 個一列）＋滑過浮出的授權視窗。 */
#students .cat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-width:330px;max-width:420px}
#students .cat-btn{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:34px!important;padding:4px 8px!important;border-radius:10px!important;border:1px solid #B7BFB5!important;background:#fff!important;color:#2d322f!important;font-size:13px!important;font-weight:700;line-height:1.2;text-align:left;cursor:pointer;box-shadow:none!important}
#students .cat-btn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#students .cat-btn b{flex:none;font-size:12px;padding:1px 6px;border-radius:999px;background:#eef0ec;color:#5b635d}
#students .cat-btn.all{border-color:#8fbf3a!important;background:#f3f9e6!important}#students .cat-btn.all b{background:#6B9C09;color:#fff}
#students .cat-btn.some{border-color:#e7c35a!important;background:#fffaea!important}#students .cat-btn.some b{background:#f2c94c;color:#5a4300}
#students .cat-btn.none{color:#8a918c!important}
#students .cat-btn:hover,#students .cat-btn.open{outline:3px solid #cfe7a0;outline-offset:0}
#students .period{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-variant-numeric:tabular-nums}#students .period i{font-style:normal;color:#8a918c}
#students .soon{display:block;color:#c26a00;font-weight:700}
.tag.pending{background:#eef3ff;color:#35509c}.tag.expired{background:#fdecec;color:#b33a3a}
#grant-pop{position:fixed;z-index:1000;width:340px;max-height:min(70vh,560px);display:flex;flex-direction:column;background:#fff;border:1px solid #B7BFB5;border-radius:14px;box-shadow:0 14px 34px rgba(45,50,47,.22);padding:12px 14px;font-size:14px;color:#2d322f}
#grant-pop.wide{width:min(560px,calc(100vw - 16px))}
#grant-pop[hidden]{display:none}
#grant-pop .gp-head{display:flex;flex-direction:column;gap:2px;padding-bottom:8px;border-bottom:1px solid #e3e6e1}
#grant-pop .gp-head b{font-size:16px;color:#3f6b0a}#grant-pop .gp-head small{color:#6b726d}
#grant-pop .gp-tools{display:flex;align-items:center;gap:6px;padding:8px 0}
#grant-pop .gp-count{flex:1;font-weight:700}
#grant-pop .gp-tools button{min-height:30px!important;padding:2px 10px!important;font-size:13px!important;border-radius:8px!important}
#grant-pop .gp-list{display:grid;grid-template-columns:1fr;align-content:start;gap:4px;overflow:auto;min-height:0;padding-right:2px}
#grant-pop.wide .gp-list{grid-template-columns:1fr 1fr}
#grant-pop .gp-list label{display:flex;align-items:center;gap:8px;margin:0!important;min-height:0;font-weight:700;font-size:14px;padding:6px 8px;border-radius:8px;border:1px solid #e3e6e1;cursor:pointer;line-height:1.3}
#grant-pop .gp-list label.on{background:#f3f9e6;border-color:#bcdc7f}
#grant-pop .gp-list input{width:18px;height:18px;flex:none;accent-color:#6B9C09}
#grant-pop .gp-msg{margin:6px 0 0;min-height:1.2em;font-size:13px;color:#5b635d}
#student-form .date-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}

@media(max-width:1300px){#students .cat-grid{min-width:0;max-width:330px;gap:5px}#students .cat-btn{flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;padding:4px 6px!important;font-size:12px!important}#students .cat-btn span{white-space:normal;overflow:visible}#students .cat-btn b{font-size:11px;padding:0 5px}}
@media(max-width:1300px){#students .period{flex-direction:column;gap:0;white-space:nowrap;line-height:1.25}#students .period i{display:block;transform:rotate(90deg);font-size:12px}#students td,#students th{padding-left:8px;padding-right:8px}}

/* 繪本顯示設定 */
html body.fun-portal dialog.books-dialog{width:min(760px,calc(100vw - 24px))}
#books-list{display:flex;flex-direction:column;gap:10px;margin:10px 0}
.book-row{display:grid;grid-template-columns:120px 1fr auto auto;align-items:center;gap:14px;padding:10px 12px;border:1px solid #B7BFB5;border-radius:14px;background:#fff}
.book-row.off{background:#f4f5f3}.book-row.off img{filter:grayscale(1);opacity:.55}
.book-row img{width:120px;height:68px;object-fit:cover;border-radius:10px;border:1px solid #e3e6e1}
.book-name{display:flex;flex-direction:column;gap:2px;min-width:0}.book-name b{font-size:17px}.book-name small{color:#6b726d;font-weight:700}
.switch{display:flex!important;flex-direction:column;align-items:center;gap:4px;margin:0!important;cursor:pointer;font-size:13px;font-weight:800;color:#3d4440;white-space:nowrap}
.switch input{position:absolute;opacity:0;width:1px;height:1px}
.switch .track{position:relative;width:52px;height:30px;border-radius:999px;background:#c9cec8;transition:background .2s}
.switch .track::after{content:'';position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 2px 4px rgba(0,0,0,.2);transition:transform .2s}
.switch input:checked+.track{background:#6B9C09}.switch input:checked+.track::after{transform:translateX(22px)}
.switch input:focus-visible+.track{outline:3px solid #cfe7a0;outline-offset:2px}
.switch input:disabled+.track{opacity:.45}.switch:has(input:disabled){cursor:not-allowed;color:#9aa19b}
.books-msg{min-height:1.3em;margin:4px 0 0;font-weight:800;color:#3f6b0a}
@media(max-width:1100px){.book-row{grid-template-columns:90px 1fr auto auto;gap:10px}.book-row img{width:90px;height:52px}}
.cls-of{color:#3E8E46!important;font-weight:900}
