/* R8.9.0 — scoped to the homework workspace; preserves other panels. */
[hidden]{display:none!important}
.hw-workspace-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.hw-workspace-head h2{font-family:"Noto Serif TC",serif;font-size:25px;margin:0}
.hw-switch{display:inline-flex;gap:4px;padding:5px;border-radius:18px;background:#edf3f5;border:1px solid rgba(89,116,130,.12);flex-wrap:wrap}
.hw-switch button{border:0;background:transparent;color:#657985;border-radius:13px;padding:10px 16px;cursor:pointer;font-size:14px;font-weight:800;min-height:42px}
.hw-switch button.active{background:#fff;color:#395b6b;box-shadow:0 2px 8px #48667714}
.hw-switch.major button.active{background:#f9d9a8;color:#574332}
.hw-tracking-toolbar{display:grid;grid-template-columns:160px 150px 150px minmax(190px,1fr);gap:9px;margin:13px 0}
.hw-tracking-toolbar input,.hw-tracking-toolbar select{min-width:0;width:100%;height:44px;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink)}
.hw-toolbar-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0}
.hw-only-pending{display:inline-flex;gap:9px;align-items:center;cursor:pointer;font-size:15px;font-weight:800;min-height:42px;padding:8px 11px;border-radius:12px;background:#fff5e6}
.hw-only-pending input{width:20px;height:20px;accent-color:#567e92}
.hw-top-summary{display:flex;gap:9px;flex-wrap:wrap;margin:12px 0}
.hw-top-summary span{display:inline-flex;gap:7px;align-items:baseline;padding:9px 13px;border:1px solid var(--line);border-radius:14px;background:#f6fafc;font-size:13px;color:#677781}
.hw-top-summary strong{font-size:22px;color:#3f5c6a}
.hw-data-note{font-size:12px;color:#77818a;line-height:1.65;margin:8px 0}
.hw-rule-help{font-size:13px;color:#6c797f;line-height:1.8;margin:10px 0}
.hw-rule-help summary{cursor:pointer;font-weight:800;min-height:30px}
.hw-rule-help p{margin:7px 0}
.hw-set{margin-top:13px;border:1px solid #dedfe0;border-radius:20px;background:#fffdfa;overflow:hidden}
.hw-set>summary{list-style:none;cursor:pointer;display:flex;gap:16px;justify-content:space-between;align-items:center;padding:18px 19px;background:linear-gradient(110deg,#fff6e7,#edf6fa)}
.hw-set>summary::-webkit-details-marker{display:none}
.hw-set-title{font-size:18px;font-weight:850;color:#3f5966;overflow-wrap:anywhere}
.hw-set-meta{font-size:12px;color:#71808a;line-height:1.7;margin-top:4px}
.hw-set-status{display:flex;gap:7px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.hw-tag{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:800;padding:6px 10px;border-radius:999px;background:#eff5f8;color:#526e7e;white-space:nowrap}
.hw-tag.good{background:#eaf6ef;color:#36704f}.hw-tag.todo{background:#fff0da;color:#925b2d}.hw-tag.off{background:#edeceb;color:#6a6969}
.hw-set-arrow{font-size:12px;font-weight:800;color:#546e7d;margin-left:4px;white-space:nowrap}
.hw-set[open] .hw-set-arrow:after{content:'收起 ▴'}.hw-set:not([open]) .hw-set-arrow:after{content:'查看完成表 ▾'}
.hw-set-body{padding:15px 18px 17px}
.hw-matrix-wrap{max-height:540px;overflow:auto;border:1px solid #e0e5e7;border-radius:14px;background:#fff;overscroll-behavior:contain}
.hw-matrix{width:100%;border-collapse:separate;border-spacing:0;font-size:14px;text-align:center}
.hw-matrix th,.hw-matrix td{padding:12px 10px;border-bottom:1px solid #e6ebee;border-right:1px solid #e9eef0;min-width:140px;max-width:240px;vertical-align:middle}
.hw-matrix thead th{position:sticky;top:0;z-index:3;background:#eef5f8;font-weight:800;color:#45606e;font-size:13px;line-height:1.6}
.hw-matrix thead th small{display:block;color:#7a8c96;font-size:11px;font-weight:500}
.hw-matrix .hw-name-col{position:sticky;left:0;z-index:2;background:#fffdfa;text-align:left;min-width:125px;max-width:170px;box-shadow:2px 0 3px #4c637c0b}
.hw-matrix thead .hw-name-col{z-index:4;background:#edf3f5}
.hw-matrix .hw-count-col{min-width:78px;width:90px;font-variant-numeric:tabular-nums;font-weight:850;font-size:16px}
.hw-matrix tbody tr:last-child>*{border-bottom:0}
.hw-matrix .hw-cell{padding:8px}
.hw-student-link{border:0;background:none;color:#375e73;font-size:15px;font-weight:850;padding:3px 0;cursor:pointer;text-align:left;text-decoration:underline;text-decoration-color:#bdd2db;text-underline-offset:4px}
.hw-cell-button{width:100%;border:1px solid transparent;border-radius:12px;background:#f7f9fa;min-height:57px;cursor:pointer;padding:8px 7px;display:flex;flex-direction:column;justify-content:center;gap:3px;color:#65747d;font:inherit}
.hw-cell-button strong{font-size:17px;font-weight:850}.hw-cell-button small{font-size:11px}
.hw-cell-button.done{background:#edf7f1;color:#3c7356;border-color:#d7ebdf}
.hw-cell-button.partial{background:#fff4e7;color:#8c632f;border-color:#f1dfc3}
.hw-cell-button.missing{background:#f5f6f7;color:#6b7982;border-color:#e6e9ec}
.hw-cell-button.missing strong{font-size:13px}.hw-unassigned{color:#9da5aa;font-size:12px}
.hw-manage{border-top:1px dashed #dce2e6;margin-top:15px;padding-top:11px;font-size:13px}
.hw-manage>summary{cursor:pointer;color:#6b7b84;font-weight:800;min-height:30px}
.hw-manage-toolbar{display:flex;gap:7px;flex-wrap:wrap;margin:7px 0 12px}
.hw-manage-item{padding:10px 12px;margin:8px 0;border:1px solid #e6e9eb;border-radius:12px;background:#fcfdfd}
.hw-manage-item>summary{cursor:pointer;line-height:1.8;font-weight:700}
.hw-manage-person{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-top:1px dashed #e0e6e9}
.hw-pending-table{width:100%;border-collapse:collapse;table-layout:fixed}
.hw-pending-table th,.hw-pending-table td{text-align:left;padding:13px 12px;border-bottom:1px solid #e5e9ec;vertical-align:top;font-size:14px;line-height:1.7}
.hw-pending-table th{background:#f2f7fa;font-size:13px;color:#5a7280}
.hw-pending-table th:first-child{width:150px}.hw-pending-table th:last-child{width:120px}
.hw-pending-items{display:grid;gap:6px}
.hw-pending-item{display:flex;gap:7px;align-items:baseline;flex-wrap:wrap}
.hw-pending-item .hw-inline-button{border:0;background:none;text-align:left;color:#6d553d;padding:2px 0;cursor:pointer;font:inherit}
.hw-inline-status{font-size:12px;color:#889098}
.hw-mobile-students{display:none}
.hw-mobile-student{padding:13px;border:1px solid #e1e7ea;border-radius:14px;background:#fff;margin-bottom:10px}
.hw-mobile-head{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:8px}
.hw-mobile-cell{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:7px 0;border-top:1px solid #eff2f4;font-size:14px}
.hw-mobile-cell>span{flex:1;min-width:0;line-height:1.6}.hw-mobile-cell>.hw-cell-button{width:128px;flex:0 0 128px}
.hw-person-card{border:1px solid #dde5e9;border-radius:18px;padding:17px;margin-top:12px;background:#fffdfa}
.hw-person-card h3{margin:0 0 9px;font-size:17px;font-family:inherit}
.hw-person-work{border-top:1px solid #e9edf0;padding:10px 0}
.hw-person-work-title{font-size:14px;font-weight:800;margin-bottom:5px;color:#536e7c}
.hw-dialog{width:min(820px,calc(100% - 24px));max-height:85dvh;border:1px solid #d5e0e5;border-radius:22px;background:#fffdfa;color:var(--ink);padding:0;box-shadow:0 24px 90px #18354640}
.hw-dialog::backdrop{background:#19384966;backdrop-filter:blur(2px)}
.hw-dialog-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#edf5f8;padding:16px 19px;border-bottom:1px solid #dce6eb}
.hw-dialog-head h2{font-size:19px;margin:0;line-height:1.6}
.hw-dialog-body{padding:19px;line-height:1.75}
.hw-dialog-body table{width:100%;border-collapse:collapse;font-size:14px}
.hw-dialog-body th,.hw-dialog-body td{padding:10px 8px;border-bottom:1px solid #e3e9ec;text-align:left;white-space:nowrap}
.hw-dialog-body th{color:#567181;font-size:13px;background:#f3f7f9}
.hw-dialog-overflow{overflow:auto;max-height:390px;border:1px solid #e1e7eb;border-radius:13px}
.hw-dialog-task{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;padding:12px;border:1px solid #e1e7eb;border-radius:13px}
.hw-dialog-task>div{min-width:0;overflow-wrap:anywhere}
.hw-dialog-task .hw-cell-button{width:135px;flex:0 0 135px}
.hw-copy-msg{font-size:13px;color:#4d785f;min-height:23px;line-height:1.7;margin-top:9px}
.hw-copy-area{width:100%;min-height:170px;padding:12px;border:1px solid #dbe4e9;border-radius:12px;font:inherit;font-size:15px;line-height:1.8;resize:vertical}
.hw-publish-summary{margin-top:13px;padding:13px 15px;border:1px solid #cbdde7;border-radius:14px;background:#edf6fb;font-size:14px;color:#496778;line-height:1.8}
.hw-publish-summary strong{font-size:16px;color:#365467}.hw-publish-summary .small{display:block;margin-top:3px;color:#6f808b}
.hw-composer-controls{display:flex;gap:8px;margin:0 0 10px}
#hwComposerPanel>.grid2{grid-template-columns:minmax(260px,.72fr) minmax(0,1.28fr)}
#hwComposerPanel .hw-target-student-box{min-width:0}
#hwComposerPanel .hw-target-student-checks{grid-template-columns:1fr}
#hwComposerPanel .hw-target-mode{flex-wrap:wrap}
#hwComposerPanel .hw-target-student-checks input{width:23px;height:23px;flex:0 0 auto}
#hwComposerPanel .hw-target-toolbar{grid-template-columns:1fr}
#hwTrackingPanel button:focus-visible,#hwComposerPanel button:focus-visible,.hw-dialog button:focus-visible{outline:3px solid #7caabd;outline-offset:3px}
#hwTrackingPanel summary:focus-visible{outline:3px solid #7caabd;outline-offset:-3px}
/* Student dashboard additions. */
.hw-student-set{padding:16px;border:1px solid #dce6eb;border-radius:18px;background:#ffffffad}
.hw-student-set+.hw-student-set{margin-top:12px}
.hw-student-set-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.hw-student-set-head h3{margin:0;font-size:18px;color:#435f6c;line-height:1.6}
.hw-student-period{font-size:12px;color:#76828a;margin-top:3px}
.hw-student-section-title{font-size:14px;color:#866242;font-weight:800;margin:12px 0 9px}
.hw-student-set .homework-item{margin-top:8px;box-shadow:none;border-color:#e4e9ec}
.hw-student-done{margin-top:13px;border-top:1px dashed #cfdde3;padding-top:11px}
.hw-student-done summary{cursor:pointer;font-weight:800;color:#4a735a;font-size:14px;min-height:30px}
.hw-student-complete{padding:12px 14px;border-radius:12px;background:#edf7f0;color:#3f7353;font-size:14px;font-weight:750}
.hw-student-path{font-size:12px;line-height:1.7;color:#6c8391;margin-top:4px;overflow-wrap:anywhere}
.hw-student-total{font-size:13px;color:#577484;background:#fff;border-radius:13px;padding:10px 13px;margin-bottom:3px;border:1px solid #e1e9ed}
.hw-student-read-note{font-size:12px;color:#77858d;line-height:1.8;padding:8px 3px}
@media(max-width:1000px){.hw-tracking-toolbar{grid-template-columns:1fr 1fr}.hw-set>summary{gap:10px}.hw-set-status{max-width:270px}}
@media(max-width:820px){#hwComposerPanel>.grid2{grid-template-columns:1fr}#hwComposerPanel .hw-target-student-checks{grid-template-columns:1fr 1fr}}
@media(max-width:640px){.hw-workspace-head{align-items:stretch}.hw-switch.major{width:100%}.hw-switch.major button{flex:1;padding:9px 10px}.hw-tracking-toolbar{grid-template-columns:1fr 1fr}.hw-tracking-toolbar input{grid-column:1/-1}.hw-set>summary{flex-direction:column;align-items:flex-start;padding:14px}.hw-set-status{max-width:none;justify-content:flex-start}.hw-set-body{padding:12px}.hw-matrix-desktop{display:none}.hw-mobile-students{display:block}.hw-pending-table,.hw-pending-table tbody,.hw-pending-table tr,.hw-pending-table td{display:block;width:100%}.hw-pending-table thead{display:none}.hw-pending-table tr{border:1px solid #e1e6e9;border-radius:13px;margin:10px 0;padding:9px}.hw-pending-table td{border:0;padding:5px}.hw-pending-table td:last-child{text-align:right}.hw-dialog-body{padding:14px}.hw-dialog-task{align-items:flex-start}.hw-dialog-task .hw-cell-button{width:110px;flex-basis:110px}.hw-student-set{padding:12px}.hw-student-set-head h3{font-size:17px}.hw-top-summary span{padding:8px 10px}.hw-tracking-toolbar select{font-size:13px}.hw-data-note{font-size:12px}#hwComposerPanel .hw-target-student-checks{grid-template-columns:1fr}.hw-person-card{padding:13px}.hw-switch button{padding:9px 13px}}
@media print{.nav,.top-actions,.hw-switch,.hw-tracking-toolbar,.hw-toolbar-bottom,.hw-manage{display:none!important}.hw-matrix-wrap{max-height:none;overflow:visible}.hw-set{break-inside:avoid}}

/* Keep the target picker full-width, not squeezed beside the attempts field. */
#hwComposerPanel>.grid2{align-items:start}
#hwComposerPanel .hw-composer-target-row{grid-template-columns:1fr;gap:0}
#hwComposerPanel .hw-composer-target-row>.field:first-child{max-width:180px}
#hwComposerPanel .hw-target-mode label{display:inline-flex;align-items:center;gap:8px;margin:0;padding:9px 13px}
#hwComposerPanel .hw-target-mode input[type="radio"]{width:20px;height:20px;min-width:20px;padding:0;flex:0 0 20px}
#hwComposerPanel .hw-target-student-checks{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:640px){#hwComposerPanel .hw-target-student-checks{grid-template-columns:1fr}}

/* R8.9.1 date editor */
.hw-date-sync{display:flex;gap:10px;align-items:flex-start;margin-top:14px;padding:12px 14px;border:1px solid var(--line,#ddd5cb);border-radius:14px;background:#f7fafb;cursor:pointer}.hw-date-sync input{margin-top:3px;transform:scale(1.12)}.hw-date-sync span{display:grid;gap:3px}.hw-date-sync small{color:var(--muted,#6f7478);line-height:1.5}.hw-date-warning{margin-top:12px;padding:11px 13px;border-radius:12px;background:#fff7e8;border:1px solid #ead8b6;color:#735d41;font-size:13px;line-height:1.6}
