.textbook-library{--tb-ink:#363048;--tb-muted:#8c859b;--tb-line:#ede9f3;box-sizing:border-box;position:fixed;inset:88px 28px 28px auto;margin:0;width:min(880px,calc(100vw - 56px));height:calc(100vh - 116px);height:calc(100dvh - 116px);border:1px solid #e5def1;border-radius:20px;background:#fff;box-shadow:0 18px 70px #29204026;color:var(--tb-ink);z-index:170;padding:0;font:14px/1.5 system-ui,-apple-system,sans-serif;overflow:hidden}
.textbook-library[open]{display:flex;flex-direction:column}.textbook-library *{box-sizing:border-box}.textbook-library [hidden]{display:none!important}
.textbook-library button{font:inherit;cursor:pointer;min-height:38px;border:1px solid #e6e0ee;border-radius:9px;background:#fff;color:var(--tb-ink);padding:7px 12px;transition:background .15s}.textbook-library button:hover{background:#f5f1fc}.textbook-library button:focus-visible,.textbook-library input:focus-visible,.textbook-library select:focus-visible{outline:2px solid #8d77d6;outline-offset:2px}.textbook-library button:disabled{opacity:.5;cursor:default}.textbook-head{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 14px}.textbook-heading{display:flex;align-items:center;gap:12px}.textbook-heading>svg{width:38px;height:38px;padding:7px;background:#f1edfc;border-radius:11px;color:#7b65c4}.textbook-heading strong{display:block;font-size:19px;letter-spacing:.4px}.textbook-heading small{display:block;color:var(--tb-muted);font-size:12px;margin-top:3px}.textbook-library .textbook-close{border:0;font-size:26px;line-height:1;width:40px;height:40px;padding:0;color:#9991a5}.textbook-connection{display:flex;align-items:center;gap:8px;margin:0 24px 14px;padding:10px 12px;border-radius:10px;background:#f8f6fc;font-size:12px;min-height:48px}.textbook-connection>span{flex:1;min-width:0}.textbook-connection button{font-size:12px;min-height:32px;padding:4px 9px;flex-shrink:0}.textbook-search{display:flex;flex-wrap:wrap;gap:8px;padding:0 24px}.textbook-search-input{display:flex;align-items:center;flex:1;min-width:120px;gap:8px;padding:0 11px;border:1px solid #e6e0ee;border-radius:9px}.textbook-search-input>span{font-size:25px;color:#a198b0}.textbook-library input{border:0;outline:0;font:inherit;background:transparent;color:var(--tb-ink);height:38px;min-width:0;width:100%}.textbook-filters{display:flex;gap:8px;width:100%}.textbook-filters input,.textbook-filters select{border:1px solid #e6e0ee;border-radius:9px;padding:0 11px;flex:1;width:0;font-size:12px;height:34px;background:#fff;color:var(--tb-ink)}.textbook-breadcrumb{display:flex;gap:6px;align-items:center;padding:12px 24px;overflow-x:auto;min-height:50px;white-space:nowrap}.textbook-breadcrumb>span{color:#c6bdd5}.textbook-breadcrumb button{border:0;background:transparent;min-height:28px;font-size:12px;padding:2px 4px;color:#80748e}.textbook-breadcrumb button:last-child{color:#6f55b2;font-weight:600}.textbook-body{display:grid;grid-template-columns:260px minmax(0,1fr);flex:1;min-height:0;border-top:1px solid var(--tb-line)}.textbook-catalog{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--tb-line);background:#fbfafd}.textbook-catalog>[data-list]{flex:1;min-height:0;overflow:auto;padding:10px}.textbook-library .textbook-row{display:flex;width:100%;align-items:center;gap:10px;text-align:left;background:transparent;border:1px solid transparent;border-radius:10px;padding:12px 10px;margin-bottom:4px;min-height:66px}.textbook-row.is-selected{background:#f0eafa!important;border-color:#e2d7f6!important}.textbook-row-icon{color:#9584ba;flex-shrink:0}.textbook-row-icon svg{width:27px;height:27px}.textbook-row-text{min-width:0;flex:1}.textbook-row-text strong{font-size:13px;display:block;overflow-wrap:anywhere}.textbook-row-text small{display:block;margin-top:4px;font-size:11px;color:var(--tb-muted)}.textbook-row-arrow{color:#b3a8c5}.textbook-pagination{display:flex;gap:8px;align-items:center;justify-content:center;padding:8px;font-size:12px}.textbook-pagination button{font-size:12px;min-height:30px;padding:3px 7px}.textbook-detail{display:flex;flex-direction:column;min-width:0;min-height:0}.textbook-detail-head{display:flex;align-items:center;gap:12px;padding:12px 18px;border-bottom:1px solid var(--tb-line);min-height:53px}.textbook-detail-head strong{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.textbook-detail-head select{background:#fff;color:var(--tb-ink);border:1px solid #e6e0ee;border-radius:7px;font:inherit;font-size:12px;padding:6px}.textbook-preview{flex:1;min-height:0;overflow:auto;background:#fff;display:flex;align-items:center;justify-content:center;color:#8d829d}.textbook-preview iframe{width:100%;height:100%;border:0;min-height:220px}.textbook-preview>img,.textbook-preview>video{max-width:100%;max-height:100%;object-fit:contain}.textbook-preview>audio{width:90%}.textbook-preview>pre{align-self:stretch;width:100%;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;padding:24px;color:#3d374a;font:15px/1.8 system-ui}.textbook-empty{display:flex;flex-direction:column;align-items:center;padding:28px;text-align:center;gap:12px;color:#9a90a8}.textbook-empty>svg{width:60px;height:60px;color:#c7badb}.textbook-empty strong{font-size:16px;font-weight:500}.textbook-empty p{font-size:12px;line-height:1.8;margin:0}.textbook-list-message{padding:18px 12px;font-size:13px;color:#9a90a8;line-height:1.8}.textbook-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:10px 16px;border-top:1px solid var(--tb-line);max-height:120px;overflow:auto}.textbook-attachments strong{width:100%;font-size:12px;color:#8d819f}.textbook-attachments button{font-size:12px;min-height:30px;padding:4px 8px}.textbook-footer{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:14px 20px;border-top:1px solid var(--tb-line);min-height:72px}.textbook-footer>div{min-width:0;display:flex;flex-direction:column;gap:4px;font-size:12px;color:#94899f}.textbook-footer [data-operation]{color:#7054b5}.textbook-library .textbook-primary{background:#7d66c5;border-color:#7d66c5;color:#fff;min-width:122px;min-height:42px;flex-shrink:0}.textbook-library .textbook-primary:hover{background:#6e57b7}
@media(max-width:720px){.textbook-library{inset:72px 12px 12px;width:calc(100vw - 24px);height:calc(100vh - 84px);height:calc(100dvh - 84px);border-radius:16px}.textbook-head{padding:14px 16px 10px}.textbook-connection{margin:0 16px 10px;flex-wrap:wrap}.textbook-connection>span{flex-basis:100%}.textbook-search{padding:0 16px}.textbook-breadcrumb{padding:8px 16px;min-height:40px}.textbook-body{grid-template-columns:150px minmax(0,1fr)}.textbook-catalog>[data-list]{padding:5px}.textbook-library .textbook-row{padding:10px 7px;gap:7px}.textbook-row-icon{display:none}.textbook-row-text strong{font-size:12px}.textbook-detail-head{padding:10px;gap:6px;flex-wrap:wrap}.textbook-detail-head strong{font-size:12px;flex-basis:100%}.textbook-detail-head select{max-width:100%}.textbook-empty{padding:16px 10px}.textbook-empty strong{font-size:13px}.textbook-empty p{font-size:11px}.textbook-footer{padding:10px 12px;gap:8px}.textbook-library .textbook-primary{min-width:96px}.textbook-preview iframe{min-height:160px}.textbook-heading small{font-size:11px}.textbook-filters input,.textbook-filters select{font-size:12px}.textbook-library button{min-height:44px}.textbook-preview>pre{padding:12px;font-size:13px}}
@media(max-width:500px){.textbook-body{display:flex;flex-direction:column}.textbook-catalog{max-height:150px;min-height:80px;border-right:0;border-bottom:1px solid var(--tb-line);flex-shrink:0}.textbook-catalog>[data-list]{min-height:60px}.textbook-detail{flex:1}.textbook-detail-head{flex-wrap:nowrap}.textbook-detail-head strong{flex-basis:auto}.textbook-empty{padding:16px}.textbook-preview iframe{min-height:100px}.textbook-footer [data-operation]{font-size:11px}.textbook-row-icon{display:block}}
.homework-library{width:min(900px,calc(100vw - 56px))}.hw-search{display:flex;align-items:end;gap:10px;padding:0 24px 16px}.hw-search label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:#80748e}.hw-search select,.hw-search input{height:38px;border:1px solid #e6e0ee;border-radius:8px;padding:0 10px;background:#fff;color:#363048;font:inherit}.hw-search .hw-query{flex:1;min-width:140px}.hw-table-wrap{flex:1;min-height:0;overflow:auto;border-top:1px solid #ede9f3}.hw-table{border-collapse:collapse;width:100%;font-size:13px}.hw-table th,.hw-table td{text-align:left;padding:13px 16px;border-bottom:1px solid #f0edf4;vertical-align:middle}.hw-table th{position:sticky;top:0;background:#fbfafd;color:#817891;font-size:12px;font-weight:600}.hw-table td:first-child{min-width:220px}.hw-table td strong,.hw-table td small{display:block}.hw-table td small{margin-top:4px;color:#9790a2;font-size:11px}.hw-table button{min-height:32px;padding:4px 12px;background:#7963c3;color:#fff;border-color:#7963c3}.hw-table button:disabled{background:#f6f5f8;border-color:#ebe9ee;color:#8d8795}.hw-table .hw-empty{text-align:center;padding:44px 14px;color:#8d829d}.hw-badge{display:inline-block;border-radius:99px;padding:4px 9px;background:#eef0f5;color:#616978;font-size:11px}.hw-badge[data-state="DRAFT"]{background:#fff2d5;color:#8f6510}.hw-badge[data-state="PUBLISHED"]{background:#e2f5e9;color:#1a7a42}.hw-pages{display:flex;align-items:center;gap:8px;flex-shrink:0}.hw-pages button{min-height:32px;font-size:12px;padding:4px 9px}.hw-pages span{font-size:12px;color:#817891}
.homework-library [data-confirmation]{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:6px}.homework-library [data-confirmation][hidden]{display:none}.homework-library [data-confirmation] a{color:#6955b7;font-weight:600}.homework-library [data-confirmation] button{min-height:32px;padding:4px 10px;background:#7963c3;color:#fff;border-color:#7963c3;font-size:12px}
@media(max-width:600px){.hw-search{padding:0 16px 12px;flex-wrap:wrap}.hw-search .hw-query{flex-basis:100%}.hw-table{min-width:600px}.homework-library .textbook-footer{align-items:flex-start;flex-direction:column}.homework-library .hw-pages{align-self:flex-end}}
.homework-library .textbook-connection [data-connect]{background:#7963c3;border-color:#7963c3;color:#fff}

/* Textbook chooser: filters and a scrolling catalog on the left, full-height preview on the right. */
.textbook-library:not(.homework-library){--tb-ink:#252b40;--tb-muted:#737b90;--tb-line:#e8eaf1;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(1240px,calc(100vw - 48px));height:min(900px,calc(100dvh - 48px));border-radius:18px;font-size:14px}
.textbook-library:not(.homework-library) .textbook-head{padding:14px 18px;gap:12px;border-bottom:1px solid var(--tb-line);flex-shrink:0}
.textbook-library:not(.homework-library) .textbook-heading{flex:1;min-width:0}.textbook-library:not(.homework-library) .textbook-heading strong{font-size:18px}.textbook-library:not(.homework-library) .textbook-heading small{font-size:12px}
.textbook-library:not(.homework-library) .textbook-connection{margin:0;padding:0;min-height:32px;background:transparent;gap:10px;flex-shrink:0}.textbook-library:not(.homework-library) [data-connection]{font-size:12px;max-width:220px}.textbook-library:not(.homework-library) [data-connection][data-connected=true]{color:#247951}.textbook-library:not(.homework-library) [data-connection][data-connected=true]:before{content:'●';font-size:9px;margin-right:6px}
.textbook-library:not(.homework-library) .textbook-close{font-size:22px;width:32px;height:32px;min-height:32px;padding:0}
.textbook-library:not(.homework-library) .textbook-body{grid-template-columns:minmax(280px,36%) minmax(0,1fr);overflow:hidden;border-top:0}
.textbook-sidebar{display:flex;flex-direction:column;min-height:0;min-width:0;border-right:1px solid var(--tb-line);overflow:hidden}
.textbook-library:not(.homework-library) .textbook-search{padding:12px 14px 8px;gap:7px;flex-shrink:0}
.textbook-library:not(.homework-library) .textbook-search-input{background:#f9fafc;min-width:80px}.textbook-library:not(.homework-library) .textbook-search-input input{border:0!important;box-shadow:none!important;border-radius:0;background:transparent;height:34px;font-size:13px;padding:0}
.textbook-library:not(.homework-library) .textbook-search>button{font-size:12px;min-height:34px;padding:5px 10px}
.textbook-library:not(.homework-library) .textbook-filters{display:grid;grid-template-columns:1fr 1fr;gap:7px}.textbook-library:not(.homework-library) .textbook-filters select{width:100%;height:32px;min-width:0;font-size:12px;border-color:#e1e5ed;border-radius:7px;padding:0 8px}
.textbook-library:not(.homework-library) [data-clear]{grid-column:1/-1;justify-self:end;border:0;color:#737b90;font-size:11px;min-height:24px;padding:0 2px}
.textbook-library:not(.homework-library) .textbook-breadcrumb{padding:0 14px 7px;min-height:30px;flex-shrink:0;gap:4px}.textbook-library:not(.homework-library) .textbook-breadcrumb button{font-size:11px;max-width:190px;overflow:hidden;text-overflow:ellipsis;min-height:26px}.textbook-library:not(.homework-library) [data-back]{border:1px solid var(--tb-line);margin-right:3px}
.textbook-library:not(.homework-library) .textbook-catalog{flex:1;min-height:0;max-height:none;border-right:0;overflow:hidden;background:#fafbfe}
.textbook-catalog-head{display:flex;align-items:center;justify-content:space-between;padding:9px 14px;border-top:1px solid var(--tb-line);border-bottom:1px solid var(--tb-line);flex-shrink:0}.textbook-catalog-head strong{font-size:12px;font-weight:600}.textbook-catalog-head span{font-size:11px;color:var(--tb-muted)}
.textbook-library:not(.homework-library) .textbook-catalog>[data-list]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding:4px 7px}
.textbook-library:not(.homework-library) .textbook-row{padding:7px 8px;min-height:48px;margin:1px 0;gap:8px;border-radius:7px}.textbook-library:not(.homework-library) .textbook-row-text strong{font-size:12px;line-height:1.45;font-weight:550;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.textbook-library:not(.homework-library) .textbook-row-text small{font-size:11px;line-height:1.4;margin-top:2px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#737b90}.textbook-library:not(.homework-library) .textbook-row-icon svg{width:20px;height:20px}.textbook-library:not(.homework-library) .textbook-row[aria-pressed=true]{background:#eeedff;border-color:#d7d5fb}
.textbook-library:not(.homework-library) .textbook-pagination{border-top:1px solid var(--tb-line);justify-content:space-between;padding:7px 12px;min-height:42px;background:#fff;flex-shrink:0}.textbook-library:not(.homework-library) .textbook-pagination button{min-height:28px;font-size:11px;padding:3px 8px}
.textbook-library:not(.homework-library) .textbook-detail{overflow:hidden}.textbook-library:not(.homework-library) .textbook-detail-head{padding:12px 16px;min-height:52px;gap:10px;border-bottom:1px solid var(--tb-line);flex-shrink:0}.textbook-library:not(.homework-library) .textbook-detail-head strong{font-size:14px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.textbook-library:not(.homework-library) .textbook-format-select{font:inherit;font-size:12px;max-width:130px;height:32px;border:1px solid #e1e5ed;border-radius:7px;background:#fff;padding:0 8px}
.textbook-library:not(.homework-library) .textbook-preview{background:#f3f5f9;min-height:0;flex:1;overflow:auto}.textbook-library:not(.homework-library) .textbook-preview iframe{height:100%;min-height:0;width:100%;border:0}.textbook-library:not(.homework-library) .textbook-preview>pre{align-self:stretch;margin:16px;padding:20px;border:1px solid var(--tb-line);border-radius:10px;background:#fff;font:14px/1.8 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.textbook-library:not(.homework-library) .textbook-empty{height:100%;padding:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:#737b90}.textbook-library:not(.homework-library) .textbook-empty svg{width:44px;height:44px;color:#aaa6d0}.textbook-library:not(.homework-library) .textbook-empty strong{font-size:15px;color:#5c6479}.textbook-library:not(.homework-library) .textbook-empty p{font-size:12px;margin:0;max-width:300px;line-height:1.7}
.textbook-library:not(.homework-library) .textbook-footer{padding:10px 18px;min-height:56px;flex-shrink:0;background:#fff;gap:12px}.textbook-library:not(.homework-library) .textbook-footer>div{gap:3px;font-size:11px;flex:1}.textbook-library:not(.homework-library) [data-operation]{font-size:12px;font-weight:550}.textbook-library:not(.homework-library) .textbook-primary{min-height:36px;min-width:108px;padding:7px 14px;background:#655fd3;border-color:#655fd3;font-size:13px;flex-shrink:0}
@media(max-width:760px){.textbook-library:not(.homework-library){width:calc(100vw - 20px);height:calc(100dvh - 20px);border-radius:12px}.textbook-library:not(.homework-library) .textbook-head{padding:10px 12px;gap:8px}.textbook-library:not(.homework-library) .textbook-heading small{display:none}.textbook-library:not(.homework-library) .textbook-connection{gap:6px}.textbook-library:not(.homework-library) [data-connection]{max-width:100px}.textbook-library:not(.homework-library) .textbook-body{grid-template-columns:minmax(240px,38%) minmax(0,1fr)}.textbook-library:not(.homework-library) .textbook-detail-head{padding:10px;flex-wrap:wrap}.textbook-library:not(.homework-library) .textbook-row-icon{display:none}}
@media(max-width:620px){.textbook-library:not(.homework-library) .textbook-head{flex-wrap:wrap}.textbook-library:not(.homework-library) .textbook-body{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(230px,46%) minmax(100px,1fr)}.textbook-sidebar{border-right:0;border-bottom:1px solid var(--tb-line)}.textbook-library:not(.homework-library) .textbook-search{padding:8px 12px 5px}.textbook-library:not(.homework-library) .textbook-filters{gap:5px}.textbook-library:not(.homework-library) [data-clear]{min-height:20px}.textbook-library:not(.homework-library) .textbook-breadcrumb{padding:0 12px 4px;min-height:24px}.textbook-library:not(.homework-library) .textbook-catalog-head{padding:6px 12px}.textbook-library:not(.homework-library) .textbook-footer{padding:8px 12px}.textbook-library:not(.homework-library) .textbook-pagination{min-height:32px;padding:3px 12px}}
.textbook-filter-panel{width:100%;min-width:0}.textbook-filter-panel>summary{display:none;cursor:pointer;font-size:12px;color:#655fd3;padding:4px 0}
@media(max-width:620px),(max-height:600px){.textbook-filter-panel>summary{display:list-item;list-style-position:inside}.textbook-library:not(.homework-library) .textbook-sidebar{overflow-y:auto;overscroll-behavior:contain}.textbook-library:not(.homework-library) .textbook-catalog{flex:1 0 140px;min-height:140px}.textbook-library:not(.homework-library) .textbook-head{padding-top:8px;padding-bottom:8px}.textbook-library:not(.homework-library) .textbook-footer{min-height:46px;padding-top:6px;padding-bottom:6px}}
@media(max-width:620px){.textbook-library:not(.homework-library) .textbook-body{grid-template-rows:minmax(300px,50%) minmax(100px,1fr)}}
