.handout-workspace {
  --handout-accent: #287a66;
  color: #26364a;
}

.handout-toolbar,
.handout-panel,
.handout-editor-panel,
.handout-preview-panel {
  border: 1px solid #e2e9f3;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 36px rgba(38, 56, 86, .055);
}

.handout-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.handout-eyebrow {
  color: #71819a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.handout-toolbar h2 { margin: 5px 0 4px; color: #24334d; font-size: 24px; }
.handout-toolbar p { margin: 0; color: #78869c; font-size: 13px; }
.handout-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.handout-toolbar-status { align-self: center; color: #71819a; font-size: 11px; white-space: nowrap; }
.handout-toolbar-status + [data-handout-action="library-documents"] { margin-left: auto; }

.handout-button,
.handout-add-actions button {
  min-height: 38px;
  border: 1px solid #dce5f1;
  border-radius: 11px;
  padding: 0 13px;
  background: #fff;
  color: #52647f;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: .16s ease;
}
.handout-button:hover,
.handout-add-actions button:hover { border-color: #a9c0de; background: #f7faff; }
.handout-button.primary { border-color: var(--handout-accent, #287a66); background: var(--handout-accent, #287a66); color: #fff; }
.handout-button.primary:hover { filter: brightness(.95); }
.handout-button.compact { min-height: 32px; font-size: 12px; }

.handout-layout {
  display: grid;
  grid-template-columns: minmax(320px, var(--handout-preview-ratio, 62%)) 17px minmax(300px, 1fr);
  align-items: start;
  gap: 0;
}

.handout-column-resizer {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  width: 17px;
  min-width: 17px;
  min-height: 260px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}

.handout-column-resizer::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  border-radius: 999px;
  background: rgba(88, 106, 128, .28);
  transition: left .16s ease, width .16s ease, background .16s ease, box-shadow .16s ease;
}

.handout-column-resizer:hover::before,
.handout-column-resizer:focus-visible::before,
body.resizing-handout-layout .handout-column-resizer::before {
  left: 6px;
  width: 4px;
  background: rgba(40, 122, 102, .72);
  box-shadow: 0 0 0 3px rgba(40, 122, 102, .10);
}

.handout-column-resizer:focus-visible {
  outline: none;
}

body.resizing-handout-layout,
body.resizing-handout-layout * {
  cursor: col-resize !important;
  user-select: none !important;
}
.handout-sidebar { display: grid; align-content: start; gap: 12px; }
.handout-sidebar-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 5px; border: 1px solid #e2e9f3; border-radius: 13px; background: #f5f8fc; }
.handout-sidebar-tabs button { min-width: 0; min-height: 36px; padding: 0 5px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #71819a; font: inherit; font-size: 12px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.handout-sidebar-tabs button:hover { color: #40516b; background: rgba(255,255,255,.7); }
.handout-sidebar-tabs button.active { border-color: #dfe7f1; background: #fff; color: var(--handout-accent); box-shadow: 0 2px 8px rgba(38,56,86,.06); }
.handout-sidebar [data-handout-tab-panel][hidden] { display: none !important; }
.handout-panel, .handout-editor-panel, .handout-preview-panel { padding: 17px; min-width: 0; }
.handout-content-meta-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid #edf1f6; }
.handout-content-meta-fields .handout-field { min-width: 0; margin: 0; }
.handout-meta-input { display: flex; align-items: center; gap: 5px; min-width: 0; }
.handout-meta-input input { flex: 1 1 auto; min-width: 0; }
.handout-meta-input button { flex: 0 0 27px; width: 27px; height: 27px; padding: 0; border: 1px solid #e3e9f1; border-radius: 8px; background: #f8faff; color: #8794a8; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.handout-meta-input button:hover { border-color: #e6bcc0; background: #fff5f6; color: #b2525b; }
.handout-panel-heading, .handout-editor-heading, .handout-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.handout-panel-heading h3, .handout-editor-heading h3, .handout-preview-heading h3 { margin: 0; color: #2b3b55; font-size: 16px; }
.handout-panel-heading p, .handout-preview-heading span, .handout-editor-heading span { margin: 4px 0 0; color: #8794a8; font-size: 11px; }

.handout-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.handout-template-card {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 7px;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  background: white;
  color: #44536a;
  text-align: left;
  cursor: pointer;
}
.handout-template-card.selected { border-color: #7cae9f; box-shadow: 0 0 0 2px rgba(40, 122, 102, .11); }
.handout-template-card strong { font-size: 11px; white-space: nowrap; }
.handout-template-card small { color: #8a96a8; font-size: 9px; white-space: nowrap; }
.template-preview { display: grid; place-items: center; width: 100%; height: 56px; border-radius: 7px; font: 700 20px Georgia, serif; }
.classroom-preview { background: #edf6f2; color: #287a66; border-bottom: 3px solid #287a66; }
.focus-preview { background: #eef2ff; color: #315fd3; box-shadow: inset 4px 0 #315fd3; }
.notes-preview { background: repeating-linear-gradient(#fff, #fff 13px, #e8e3dc 14px); color: #8b6543; }
.minimal-preview { background: #f1f4f7; color: #536477; border-bottom: 2px solid #536477; }
.vibrant-preview { background: #fff1e8; color: #dc7138; box-shadow: inset 0 -4px #f2bc6b; }
.mint-preview { background: linear-gradient(135deg, #e7f5f1, #eef4ff); color: #16877d; border: 1px solid #cde7df; }
.editorial-preview { position: relative; display: block; border-radius: 3px; background: #f8f2ef; }
.editorial-preview i { position: absolute; top: 10px; left: 11px; width: 5px; height: 35px; border-radius: 3px; background: #a34d43; }
.editorial-preview b { position: absolute; top: 13px; left: 23px; width: 42%; height: 7px; border-top: 2px solid #a34d43; border-bottom: 1px solid #c8a6a0; }
.editorial-preview em { position: absolute; right: 10px; bottom: 10px; width: 30%; height: 24px; border-radius: 10px 0; background: #ead8d3; }
.workbook-preview { display: flex; align-items: center; justify-content: center; gap: 4px; background: #f1f5f9; }
.workbook-preview i { width: 21%; height: 32px; border: 1px solid #8ea4bc; border-radius: 3px; background: repeating-linear-gradient(to bottom, transparent 0 8px, #dce5ee 9px 10px); }
.workbook-preview i:first-child { border-top: 4px solid #456d9b; }
.classic-preview { display: flex; flex-direction: column; gap: 3px; border-radius: 2px; background: #f7f5ee; color: #334f75; }
.classic-preview i { width: 48%; height: 1px; background: #8d9caf; }
.classic-preview b { font: 700 16px Georgia, "Songti SC", serif; }
.handout-style-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 0 12px; padding: 4px; border: 1px solid #e5ebf4; border-radius: 11px; background: #f5f8fc; }
.handout-style-tabs button { min-height: 32px; border: 0; border-radius: 8px; background: transparent; color: #7d8ba0; font: 750 11px/1.2 system-ui, sans-serif; cursor: pointer; }
.handout-style-tabs button.active { background: #fff; color: var(--handout-accent); box-shadow: 0 1px 4px rgba(37,55,78,.1); }
.handout-style-panel[hidden] { display: none !important; }
.handout-style-panel > .handout-panel-heading { margin-bottom: 8px; }
.handout-style-category { padding: 8px 0; border-top: 1px solid #edf1f6; }
.handout-style-category:first-child { padding-top: 0; border-top: 0; }
.handout-style-category h4 { margin: 0 0 6px; color: #53647c; font-size: 11px; font-weight: 800; }
.handout-style-empty { margin: 0; color: #a1aabb; font-size: 10px; line-height: 1.5; }
.handout-saved-templates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.handout-saved-templates .handout-saved-style { display: grid; grid-template-rows: auto 42px; gap: 5px; min-width: 0; padding: 6px; border: 1px solid #e4eaf2; border-radius: 9px; background: #fff; color: #485b74; font: inherit; cursor: pointer; text-align: left; }
.handout-saved-style:hover { border-color: #9ebdad; box-shadow: 0 1px 5px rgba(40,122,102,.1); }
.handout-saved-style strong { overflow: hidden; color: #485b74; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.handout-saved-style-thumb { position: relative; display: block; overflow: hidden; border: 1px solid #e7ebf1; border-radius: 5px; background: #f8fafc; }
.handout-saved-style-thumb i { position: absolute; top: 7px; left: 7px; right: 7px; height: 3px; background: var(--saved-style-accent); opacity: .8; }
.handout-saved-style-thumb b { position: absolute; top: 16px; left: 7px; width: 58%; height: 4px; border-radius: 3px; background: var(--saved-style-text); opacity: .8; }
.handout-saved-style-thumb em { position: absolute; top: 25px; left: 7px; right: 7px; height: 9px; border-left: 3px solid var(--saved-style-accent); border-radius: 2px; background: color-mix(in srgb,var(--saved-style-accent) 12%,white); }
.handout-saved-user-templates { display: grid; gap: 6px; }
.handout-saved-user-template { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid #e4eaf2; border-radius: 8px; background: #fff; color: #485b74; font: inherit; text-align: left; cursor: pointer; }
.handout-saved-user-template:hover { border-color: #9ebdad; background: #fbfdfc; }
.handout-saved-user-template > span { display: grid; gap: 3px; min-width: 0; }
.handout-saved-user-template strong { overflow: hidden; color: #485b74; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.handout-saved-user-template small { color: #8a96a8; font-size: 9px; }
.handout-saved-user-template i { flex: none; color: var(--handout-accent); font-size: 10px; font-style: normal; font-weight: 750; }
.handout-saved-style-thumb[data-box="focus"] em { border-left-width: 5px; }
.handout-saved-style-thumb[data-box="notes"] em { background: repeating-linear-gradient(to bottom,#fff 0 3px,color-mix(in srgb,var(--saved-style-accent) 16%,white) 4px); }
.handout-saved-style-thumb[data-box="minimal"] em { border-left: 0; border-top: 1px solid var(--saved-style-accent); border-radius: 0; background: transparent; }
.handout-saved-style-thumb[data-box="workbook"] em { border: 1px solid color-mix(in srgb,var(--saved-style-accent) 35%,white); background: repeating-linear-gradient(to bottom,transparent 0 3px,#e6ebf1 4px); }
.handout-no-templates { margin: 0; color: #9aa5b5; font-size: 11px; line-height: 1.6; }
.handout-library-modal[hidden] { display: none !important; }
.handout-library-modal { position: fixed; z-index: 10040; inset: 0; display: grid; place-items: center; padding: 20px; }
.handout-library-backdrop { position: absolute; inset: 0; background: rgba(28,42,61,.32); }
.handout-library-dialog { position: relative; display: grid; grid-template-rows: auto minmax(0,1fr); width: min(1080px,calc(100vw - 40px)); height: min(820px,calc(100vh - 40px)); max-height: min(900px,calc(100vh - 40px)); overflow: hidden; border: 1px solid #dfe7f1; border-radius: 18px; background: #fff; box-shadow: 0 22px 70px rgba(24,39,61,.2); }
.handout-library-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #edf0f5; }
.handout-library-dialog h2 { margin: 0; color: #2b3b55; font-size: 18px; }
.handout-library-dialog header p { margin: 5px 0 0; color: #8491a4; font-size: 11px; }
.handout-library-dialog header > button { width: 32px; height: 32px; border: 1px solid #e0e7f0; border-radius: 50%; background: #f8faff; color: #64748a; font-size: 21px; cursor: pointer; }
.handout-library-dialog nav { display: flex; gap: 8px; padding: 12px 18px 0; border-bottom: 1px solid #edf0f5; }
.handout-library-dialog nav button { padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #71819a; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.handout-library-dialog nav button[aria-selected="true"] { border-bottom-color: var(--handout-accent); color: var(--handout-accent); }
.handout-library-list { overflow: auto; padding: 8px 18px 16px; }
.handout-library-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border-bottom: 1px solid #edf1f6; }
.handout-library-row:hover { background: #f8fafc; }
.handout-library-open { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 8px 6px; border: 0; background: transparent; color: #40516b; text-align: left; cursor: pointer; }
.handout-library-open > span { display: grid; gap: 4px; min-width: 0; }
.handout-library-open strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.handout-library-open small { color: #8794a8; font-size: 10px; }
.handout-library-open i { color: var(--handout-accent); font-size: 11px; font-style: normal; font-weight: 800; }
.handout-library-delete { flex: none; padding: 6px 10px; border: 1px solid #f0d6d8; border-radius: 8px; background: #fffafb; color: #b2525b; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.handout-library-delete:hover { border-color: #e6b6ba; background: #fff3f4; }
.handout-library-confirm-backdrop { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 18px; background: rgba(33, 48, 68, .24); }
.handout-library-confirm { width: min(360px, 100%); padding: 22px; border: 1px solid #e2e9f3; border-radius: 16px; background: #fff; box-shadow: 0 18px 48px rgba(28, 42, 62, .18); }
.handout-library-confirm h3 { margin: 0; color: #2b3b55; font-size: 17px; }
.handout-library-confirm p { margin: 10px 0 20px; color: #71819a; font-size: 13px; line-height: 1.6; }
.handout-library-confirm > div { display: flex; justify-content: flex-end; gap: 8px; }
.handout-button.danger { border-color: #bd5b63; background: #bd5b63; color: #fff; }
.handout-library-empty { padding: 34px 12px; color: #8794a8; text-align: center; font-size: 12px; }

.handout-field { display: grid; gap: 6px; margin: 11px 0; color: #63738d; font-size: 11px; font-weight: 750; }
.handout-range-field { gap: 8px; }
.handout-range-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.handout-range-label output { color: var(--handout-accent); }
.handout-field input:not([type="range"]):not([type="color"]):not([type="file"]), .handout-field select {
  width: 100%; min-height: 35px; box-sizing: border-box; border: 1px solid #dfe7f1; border-radius: 9px; padding: 0 9px; background: #fbfcff; color: #34445e; font: inherit; font-size: 12px;
}
.handout-field input[type="color"] { width: 100%; height: 35px; padding: 4px; border: 1px solid #dfe7f1; border-radius: 9px; background: #fbfcff; }
.handout-field input[type="file"] { width: 100%; min-width: 0; color: #65758e; font-size: 10px; }
.handout-field input[type="range"] { width: 100%; accent-color: var(--handout-accent); }
.handout-field output { color: var(--handout-accent); }
.handout-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.handout-text-button { padding: 0; border: 0; background: transparent; color: #8190a5; font: inherit; font-size: 11px; cursor: pointer; }

.handout-editor-heading { align-items: flex-start; flex-wrap: wrap; }
.handout-editor-heading > div:first-child { display: grid; gap: 3px; }
.handout-add-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.handout-add-actions button { min-height: 30px; padding: 0 9px; font-size: 11px; }
.handout-add-actions .handout-import-button { border-color: #c9e2d8; background: #eff8f4; color: #287a66; }
.handout-editor-list { display: none; }
.handout-block-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.handout-block-kind { color: var(--handout-accent); font-size: 11px; font-weight: 850; }
.handout-block-actions { display: flex; gap: 4px; }
.handout-block-actions button { min-width: 27px; height: 26px; border: 1px solid #e0e7f0; border-radius: 7px; background: #fff; color: #64748a; font: inherit; font-size: 11px; cursor: pointer; }
.handout-block-actions button:last-child { padding: 0 8px; color: #b25e65; }
.handout-block-actions button:disabled { opacity: .35; cursor: default; }
.handout-block-editor label { display: grid; gap: 5px; margin-top: 8px; color: #8290a3; font-size: 10px; font-weight: 750; }
.handout-block-editor input, .handout-block-editor textarea { box-sizing: border-box; width: 100%; border: 1px solid #e1e8f0; border-radius: 8px; padding: 8px; resize: vertical; color: #35455e; background: #fff; font: inherit; font-size: 12px; line-height: 1.55; }

.handout-preview-panel { position: sticky; top: 14px; }
.handout-preview-heading { margin-bottom: 12px; }
.handout-preview-scroll { height: calc(200vh - 380px); overflow-x: hidden; overflow-y: scroll; scrollbar-width: thin; scrollbar-color: #b8c8d5 #e9eef3; border-radius: 12px; padding: 14px; background: #eef2f7; }
.handout-preview-scroll::-webkit-scrollbar { width: 10px; }
.handout-preview-scroll::-webkit-scrollbar-track { border-radius: 8px; background: #e9eef3; }
.handout-preview-scroll::-webkit-scrollbar-thumb { border: 2px solid #e9eef3; border-radius: 8px; background: #b8c8d5; }
.handout-preview-pages { display: grid; justify-items: center; gap: 20px; }
.handout-preview-page-slot { position: relative; width: max-content; overflow: visible; }
.handout-paper {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: min(100%, var(--handout-page-width, 210mm));
  min-height: 430px;
  margin: 0 auto;
  padding: 30px 28px 24px;
  overflow: hidden;
  background: white;
  color: var(--handout-text, #26364a);
  font: 400 var(--handout-font-size, 14px)/1.72 "Noto Serif CJK SC", "Songti SC", serif;
  box-shadow: 0 4px 18px rgba(33, 48, 69, .12);
}
.handout-preview-page-slot > .handout-paper[data-preview-page] { width: var(--handout-page-width, 210mm); height: var(--handout-page-height, 297mm); min-height: 0; margin: 0; padding: 15mm; overflow: hidden; transform-origin: top left; }
.handout-preview-pages > .handout-preview-page-slot > .handout-paper[data-page-header="true"] { padding-top: 22mm; }
.handout-preview-pages > .handout-preview-page-slot > .handout-paper[data-page-header="true"] > h1 { margin-top: 4px; }
.handout-preview-pages > .handout-preview-page-slot > .handout-paper[data-page-header="true"] > h1.is-empty,
.handout-preview-pages > .handout-preview-page-slot > .handout-paper[data-page-header="true"] > .handout-paper-subtitle.is-empty { display: none; }
.handout-preview-pages > .handout-preview-page-slot > .handout-paper[data-page-footer="true"] { padding-bottom: 30mm; }
.handout-preview-pages > .handout-preview-page-slot > .handout-paper[data-preview-page] > .handout-page-header { position: absolute; top: 10mm; right: 15mm; left: 15mm; box-sizing: border-box; width: auto; margin: 0; }
.handout-preview-pages > .handout-preview-page-slot > .handout-paper[data-preview-page] > .handout-page-footer { position: absolute; right: 15mm; bottom: 10mm; left: 15mm; margin: 0; }
.handout-paper-header, .handout-paper-footer { display: flex; justify-content: space-between; gap: 12px; color: #8a96a8; font: 600 10px/1.4 system-ui, sans-serif; }
.handout-paper-header { padding-bottom: 9px; border-bottom: 1px solid #e7ebf1; }
.handout-page-header { min-height: 42px; align-items: center; padding-bottom: 8px; }
.handout-page-header-logo { display: flex; flex: 0 0 var(--handout-header-logo-width, 72px); width: var(--handout-header-logo-width, 72px); min-height: 28px; align-items: center; }
.handout-page-header-logo img { display: block; width: 100%; height: auto; object-fit: contain; object-position: left center; opacity: var(--handout-header-logo-opacity, 1); }
.handout-page-header-title { margin-left: auto; color: var(--handout-accent); font-size: 1em; font-weight: 700; text-align: right; }
.handout-paper > h1 { margin: 20px 0 2px; color: var(--handout-accent); text-align: center; font-size: 1.65em; line-height: 1.3; }
.handout-paper-subtitle { margin-bottom: 20px; color: #8a96a8; text-align: center; font: 11px system-ui, sans-serif; }
.handout-paper-meta-target { position: relative; }
.handout-paper-meta-target:hover { outline: 1px solid color-mix(in srgb, var(--handout-accent) 65%, white); outline-offset: 3px; }
.handout-paper-meta-target.is-empty::before { content: "点击添加"; color: #b6bfcb; font-size: .85em; }
.handout-paper-content { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--handout-columns, 1), minmax(0, 1fr)); gap: 14px; }
.handout-paper-content > section { break-inside: auto; }
.handout-preview-fragment-continuation { break-inside: auto !important; }
.handout-preview-continuation-label { margin-left: .45em; color: #8491a4; font-size: .78em; font-weight: 600; }
.handout-preview-content-continuation { break-inside: auto !important; }
.handout-preview-question .parse-choice-preview-grid,
.handout-preview-question img,
.handout-preview-box img,
.handout-preview-text img { break-inside: avoid; }
.handout-paper .handout-preview-question .latex-image,
.handout-paper .handout-preview-question .exam-source-image {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.handout-paper .handout-preview-question .latex-image img,
.handout-paper .handout-preview-question .exam-source-image img {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.handout-preview-heading-block { padding: 10px 12px; border-left: 4px solid var(--handout-accent); border-radius: 0 9px 9px 0; background: color-mix(in srgb, var(--handout-accent) 9%, white); }
.handout-preview-heading-block.heading-style-customized { border-left: var(--heading-bar-width,4px) solid var(--heading-bar-color,var(--handout-accent)); border-radius: var(--heading-bg-radius,0 9px 9px 0); background: var(--heading-bg,color-mix(in srgb,var(--handout-accent) 9%,white)); }
.handout-preview-heading-block.heading-style-customized h2 { color: var(--heading-color,var(--handout-accent)); font-size: var(--heading-font-size,1.17em); }
.handout-preview-heading-block.heading-style-customized .handout-heading-prefix { display: inline-block; padding: var(--heading-prefix-padding,0); border-radius: var(--heading-prefix-radius,.18em); background: var(--heading-prefix-bg,transparent); color: var(--heading-prefix-color,var(--handout-accent)); font-family: var(--heading-prefix-font-family,inherit); transform: translate(var(--heading-prefix-x,0px),var(--heading-prefix-y,0px)); }
.handout-preview-heading-block.heading-style-customized .handout-heading-title { font-family: var(--heading-title-font-family,inherit); }
.handout-preview-heading-block.heading-style-customized > p { font-family: var(--heading-content-font-family,inherit); }
.handout-preview-heading-block.heading-style-customized .handout-heading-title { display: inline-block; padding: var(--heading-title-padding,0); border-radius: var(--heading-title-radius,.18em); background: var(--heading-title-bg,transparent); }
.handout-preview-heading-block.heading-style-customized .handout-heading-title { transform: translate(var(--heading-title-x,0px),var(--heading-title-y,0px)); }
.handout-preview-heading-block.heading-style-customized .handout-heading-prefix { font-size: var(--heading-prefix-font-size,var(--heading-font-size,1.17em)); }
.handout-component-title.customized { display: flex; align-items: center; justify-content: var(--component-title-justify,flex-start); color: var(--component-title-color,var(--handout-accent)); border-radius: var(--component-title-radius,8px); font-size: var(--component-title-size,1em); font-family: var(--component-title-font,inherit); text-align: var(--component-title-align,left); }
.handout-component-title.customized.background-enabled { background: var(--component-title-bg,transparent); }
.handout-component-title-inner { display: inline-flex; align-items: center; }
.handout-component-title-text { display: inline-block; transform: translate(var(--component-title-x,0px),var(--component-title-y,0px)); }
.handout-paper .handout-preview-box h3.handout-component-title.customized,
.handout-paper .handout-preview-question h3.handout-component-title.customized,
.handout-paper .handout-preview-text h3.handout-component-title.customized { display: flex; align-items: center; justify-content: var(--component-title-justify,flex-start); color: var(--component-title-color,var(--handout-accent)); border-radius: var(--component-title-radius,8px); font-size: var(--component-title-size,1em); font-family: var(--component-title-font,inherit); text-align: var(--component-title-align,left); }
.handout-paper .handout-preview-box h3.handout-component-title.customized.background-enabled,
.handout-paper .handout-preview-question h3.handout-component-title.customized.background-enabled,
.handout-paper .handout-preview-text h3.handout-component-title.customized.background-enabled { background: var(--component-title-bg,transparent); }
.handout-paper-content > section[data-preview-block] { position: relative; }
.handout-paper-content > section[data-preview-block]:hover { outline: 1px solid color-mix(in srgb, var(--handout-accent) 65%, white); outline-offset: 3px; }
.handout-preview-actions { position: absolute; z-index: 3; top: 5px; right: 5px; display: flex; gap: 5px; opacity: 0; pointer-events: none; transition: opacity .14s ease; }
.handout-preview-actions button,
.handout-preview-edit { padding: 5px 10px; border: 1px solid #d4e0ef; border-radius: 8px; background: rgba(255,255,255,.96); color: #456286; font: 700 11px/1.2 system-ui, sans-serif; box-shadow: 0 2px 8px rgba(30,48,73,.12); }
.handout-preview-actions button, .handout-preview-edit { cursor: pointer; }
.handout-preview-actions .handout-preview-action-move { width: 28px; padding: 5px 0; font-size: 14px; line-height: 1; }
.handout-preview-actions .handout-preview-action-move:disabled { cursor: default; opacity: .38; }
.handout-preview-actions .handout-preview-action-delete { border-color: #efd5d7; color: #b2525b; }
.handout-paper-content > section[data-preview-block]:hover .handout-preview-actions,
.handout-paper-content > section[data-preview-block]:focus-within .handout-preview-actions,
.handout-paper-meta-target:hover .handout-preview-actions,
.handout-paper-meta-target:focus-within .handout-preview-actions,
.handout-preview-edit:focus-visible { opacity: 1; pointer-events: auto; }
.handout-preview-edit-modal { position: fixed; z-index: 10060; inset: 0; display: grid; place-items: center; padding: 20px; }
.handout-preview-edit-backdrop { position: absolute; inset: 0; background: rgba(28,42,61,.3); }
.handout-preview-edit-dialog { position: relative; display: flex; flex-direction: column; width: min(680px,calc(100vw - 40px)); max-height: min(720px,calc(100vh - 40px)); overflow: hidden; border: 1px solid #dfe7f1; border-radius: 18px; background: #fff; box-shadow: 0 22px 70px rgba(24,39,61,.2); }
.handout-preview-edit-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #edf0f5; }
.handout-preview-edit-dialog h2 { margin: 0; color: #2b3b55; font-size: 18px; }
.handout-preview-edit-dialog header p { margin: 5px 0 0; color: #8491a4; font-size: 11px; }
.handout-preview-edit-dialog header > button { width: 32px; height: 32px; border: 1px solid #e0e7f0; border-radius: 50%; background: #f8faff; color: #64748a; font-size: 21px; cursor: pointer; }
.handout-preview-edit-dialog form { display: grid; gap: 14px; min-height: 0; overflow: auto; padding: 18px 20px 20px; }
.handout-preview-edit-dialog label { display: grid; gap: 6px; color: #63738d; font-size: 12px; font-weight: 750; }
.handout-preview-edit-dialog input:not([type="range"]):not([type="color"]):not([type="checkbox"]):not([type="hidden"]), .handout-preview-edit-dialog textarea { box-sizing: border-box; width: 100%; border: 1px solid #dfe7f1; border-radius: 9px; padding: 10px; background: #fbfcff; color: #34445e; font: inherit; font-size: 13px; line-height: 1.6; }
.handout-preview-edit-dialog input[type="range"] { display: block; box-sizing: border-box; width: 100%; min-width: 0; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; accent-color: var(--handout-accent); cursor: pointer; }
.handout-preview-edit-dialog select { box-sizing: border-box; width: 100%; min-height: 38px; border: 1px solid #dfe7f1; border-radius: 9px; padding: 0 10px; background: #fbfcff; color: #34445e; font: inherit; font-size: 13px; }
.handout-preview-edit-dialog textarea { resize: vertical; }
.handout-preview-edit-fields { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.handout-preview-edit-check { display: flex !important; align-items: center; gap: 8px !important; }
.handout-preview-edit-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--handout-accent); }
.handout-pagination-options { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.handout-pagination-options .handout-preview-edit-check { white-space: nowrap; }
.handout-preview-edit-answer-fields { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.handout-heading-edit-dialog { width: min(980px,calc(100vw - 40px)); height: min(720px,calc(100vh - 40px)); }
.handout-component-edit-dialog { width: min(980px,calc(100vw - 40px)); height: min(720px,calc(100vh - 40px)); }
.handout-component-edit-dialog form { flex: 1; display: grid; grid-template-columns: minmax(240px,1.1fr) minmax(0,.9fr); grid-template-rows: minmax(0,1fr) auto; gap: 12px 16px; overflow: hidden; }
.handout-component-edit-layout { display: contents; }
.handout-component-preview-column { grid-column: 1; grid-row: 1; display: grid; align-content: start; gap: 9px; min-width: 0; color: #71819a; font-size: 12px; font-weight: 750; }
.handout-component-preview { min-height: 210px; box-sizing: border-box; padding: 18px; overflow: auto; border: 1px solid #e4eaf2; border-radius: 12px; background: #f5f7fa; color: var(--handout-text); }
.handout-component-preview.handout-paper { width: 100%; min-height: 210px; margin: 0; background: #fff; box-shadow: 0 4px 18px rgba(33,48,69,.12); }
.handout-component-preview.handout-paper .handout-preview-box h3 { margin: -12px -12px 9px; padding: 6px 10px; border-radius: 10px 10px 0 0; }
.handout-component-preview.handout-paper .handout-preview-question h3,
.handout-component-preview.handout-paper .handout-preview-text h3 { margin: 0 0 5px; }
.handout-component-preview [data-component-knowledge-meta][hidden] { display: none; }
.handout-component-preview h3 { margin: 0 0 9px; padding: 7px 9px; border-radius: var(--component-title-radius,8px); color: var(--component-title-color,var(--handout-accent)); font-family: var(--component-title-font,inherit); font-size: var(--component-title-size,1em); text-align: var(--component-title-align,left); }
.handout-component-preview h3.handout-component-title.customized { display: flex; align-items: center; justify-content: var(--component-title-justify,flex-start); }
.handout-component-preview h3.background-enabled { background: var(--component-title-bg,transparent); }
.handout-component-preview h3 .handout-component-title-inner > span:first-child { margin-right: 6px; }
.handout-component-editor-controls { grid-column: 2; grid-row: 1; display: grid; align-content: start; gap: 9px; min-height: 0; overflow: auto; padding-right: 5px; }
.handout-component-setting-group { display: grid; gap: 8px; padding: 10px; border: 1px solid #e2e9f2; border-radius: 11px; background: #fbfcff; }
.handout-component-setting-group > strong { color: #52647e; font-size: 12px; }
.handout-component-setting-group > label { display: grid; grid-template-columns: minmax(72px,.7fr) minmax(0,1.3fr); align-items: center; gap: 8px; color: #6a7b95; font-size: 11px; }
.handout-component-icon-options, .handout-component-shape-options { display: flex; flex-wrap: wrap; gap: 5px; }
.handout-component-icon-options button, .handout-component-shape-options button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid #dce5ef; border-radius: 8px; background: #fff; color: #52647e; cursor: pointer; }
.handout-component-icon-options button[aria-pressed="true"], .handout-component-shape-options button[aria-pressed="true"] { border-color: var(--handout-accent); background: color-mix(in srgb,var(--handout-accent) 10%,white); color: var(--handout-accent); box-shadow: inset 0 0 0 1px var(--handout-accent); }
.handout-component-preview.handout-paper .handout-preview-box h3.handout-component-title.customized { border-radius: var(--component-title-radius,8px); }
.handout-component-setting-group input[type="range"] { width: 100%; }
.handout-component-setting-group input[type="color"] { justify-self: end; width: 78px; height: 28px; padding: 3px; }
.handout-component-setting-group select { min-height: 31px !important; padding: 0 7px !important; font-size: 11px !important; }
.handout-component-background-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.handout-component-background-control input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--handout-accent); }
.handout-component-edit-controls-fields { display: grid; gap: 10px; min-width: 0; overflow: auto; }
.handout-component-edit-dialog form > footer { grid-column: 1 / -1; grid-row: 2; }
.handout-heading-edit-dialog form[data-heading-form="true"] { flex: 1; display: grid; grid-template-columns: minmax(240px,1.2fr) minmax(0,.8fr); grid-template-rows: minmax(0,1fr) auto; gap: 12px 16px; overflow: hidden; }
.handout-heading-editor-layout { display: contents; }
.handout-heading-editor-preview-column { grid-column: 1; grid-row: 1; display: grid; align-content: start; gap: 9px; min-width: 0; color: #71819a; font-size: 12px; font-weight: 750; }
.handout-heading-editor-preview { display: grid; align-content: start; min-height: 210px; box-sizing: border-box; padding: 18px; overflow: auto; border: 1px solid #e4eaf2; border-radius: 12px; background: #f5f7fa; }
.handout-heading-editor-preview .handout-preview-heading-block { min-width: 0; overflow-wrap: anywhere; }
.handout-heading-editor-controls { grid-column: 2; grid-row: 1; display: grid; align-content: start; gap: 8px; min-height: 0; overflow: auto; padding-right: 5px; }
.handout-heading-style-library { display: grid; gap: 6px; padding: 8px; border: 1px solid #e1e9f3; border-radius: 10px; background: #f8faff; }
.handout-heading-style-library > strong { display: flex; align-items: center; justify-content: space-between; color: #52647e; font-size: 11px; }
.handout-heading-style-library > strong span { color: #8795aa; font-size: 10px; font-weight: 650; }
.handout-heading-style-actions { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 6px; align-items: center; }
.handout-heading-style-actions select { min-width: 0; height: 32px; padding: 0 8px; border: 1px solid #dfe7f1; border-radius: 8px; background: #fbfcff; color: #52647e; font: inherit; font-size: 11px; }
.handout-heading-style-actions .handout-button { min-height: 32px; padding: 0 9px; font-size: 11px; }
.handout-heading-style-library [data-heading-style-message] { min-height: 14px; color: #287a66; font-size: 10px; }
.handout-heading-style-library [data-heading-style-message].is-error { color: #bd4c4c; }
.handout-heading-editor-controls > label { margin: 0; }
.handout-heading-setting-group { display: grid; gap: 7px; padding: 9px 10px; border: 1px solid #e5ebf3; border-radius: 10px; background: #fbfcfe; }
.handout-heading-setting-group > strong { color: #5e708a; font-size: 11px; font-weight: 800; }
.handout-heading-setting-group .handout-heading-color-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.handout-heading-color-field input[type="color"] { flex: 0 0 54px; width: 54px; height: 30px; box-sizing: border-box; padding: 3px; border: 1px solid #dfe7f1; border-radius: 8px; background: #fbfcff; cursor: pointer; }
.handout-heading-corner-field select { min-width: 76px; height: 30px; padding: 0 8px; border: 1px solid #dfe7f1; border-radius: 8px; background: #fbfcff; color: #52647e; font: inherit; font-size: 11px; cursor: pointer; }
.handout-heading-prefix-background-controls { display: inline-flex; align-items: center; gap: 8px; }
.handout-heading-prefix-background-controls input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--handout-accent); }
.handout-heading-range { display: flex !important; align-items: center; gap: 12px !important; }
.handout-heading-range > span { display: flex; flex: 0 0 118px; align-items: center; justify-content: space-between; gap: 8px; }
.handout-heading-range output { color: var(--handout-accent); }
.handout-heading-range input[type="range"] { flex: 1; width: 0; min-width: 70px; margin: 2px 0; }
.handout-heading-setting-group .handout-heading-text-field { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.handout-heading-text-field > span { flex: 0 0 118px; }
.handout-heading-text-field > input { flex: 1; min-width: 0; }
.handout-heading-setting-group .handout-heading-content-field { display: grid; gap: 6px; }
.handout-heading-font-field { display: flex !important; align-items: center; justify-content: space-between; gap: 10px !important; min-height: 32px; color: #6a7b95; font-size: 11px; font-weight: 700; }
.handout-heading-font-field select { min-width: 150px; max-width: 65%; height: 30px; padding: 0 8px; border: 1px solid #dfe7f1; border-radius: 7px; background: #fff; color: #34445e; font: inherit; }
.handout-heading-edit-dialog form[data-heading-form="true"] > footer { grid-column: 1 / -1; grid-row: 2; }
.handout-preview-edit-dialog form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid #edf0f5; }
.handout-preview-edit-footer-spacer { flex: 1; }
.handout-preview-heading-block h2 { margin: 0; color: var(--handout-accent); font-size: 1.17em; }
.handout-preview-heading-block p { margin: 3px 0 0; }
.handout-preview-box { padding: 12px; border-radius: 10px; background: #f3f7f5; }
.handout-preview-box h3 { margin: -12px -12px 9px; padding: 6px 10px; border-radius: 10px 10px 0 0; background: var(--handout-accent); color: white; font-size: .95em; }
.handout-preview-box h3 .handout-component-title-inner > span:first-child { margin-right: 7px; }
.handout-preview-knowledge-meta { display: block; margin: -3px 0 7px; color: #8491a4; font: 600 10px/1.4 system-ui, sans-serif; }
.handout-preview-box > div, .handout-preview-question > div, .handout-preview-text > div { overflow-wrap: anywhere; }
.handout-preview-question { padding: 10px 12px; border: 1px solid #e5eaf1; border-radius: 9px; }
.handout-preview-question h3, .handout-preview-text h3 { margin: 0 0 5px; color: var(--handout-accent); font-size: .98em; }
.handout-preview-question h3[hidden] { display: none !important; }
.handout-preview-question .handout-question-source { display: block; margin: -1px 0 4px; color: #8793a5; font: 500 .78em/1.35 system-ui, sans-serif; }
.handout-preview-question .handout-question-content-line { display: flex; align-items: baseline; gap: .42em; min-width: 0; }
.handout-preview-question .handout-question-number { flex: 0 0 auto; color: inherit; font-weight: 600; line-height: inherit; }
.handout-preview-question .handout-question-content { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.handout-preview-question .handout-question-content > :first-child { margin-block-start: 0; }
.handout-question-number-settings { display: grid; gap: 8px; padding: 10px; border: 1px solid #e2e9f3; border-radius: 9px; background: #f9fbfe; }
.handout-question-number-settings > strong { color: #596d89; font-size: 12px; }
.handout-question-number-settings [hidden] { display: none !important; }
.handout-paper .handout-preview-question .parse-choice-preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 12px 0;
}
.handout-paper .handout-preview-question .parse-choice-preview-item.is-static {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  text-align: left;
}
.handout-paper .handout-preview-question .parse-choice-preview-label {
  display: inline;
  width: auto;
  height: auto;
  flex: none;
  border-radius: 0;
  background: transparent;
  color: var(--blue, #4c6fff);
  font-weight: 850;
}
.handout-paper .handout-preview-question .parse-choice-preview-content { line-height: 1.75; }
.handout-preview-text { padding: 2px 1px; }
.handout-paper[data-box="focus"] .handout-preview-box { background: #eef2ff; border-left: 3px solid var(--handout-accent); }
.handout-paper[data-box="notes"] .handout-preview-box { border: 1px solid #e8e1d7; border-radius: 3px; background: #fffdf8; }
.handout-paper[data-box="notes"] .handout-preview-box h3 { border-radius: 0; background: #f1e9dc; color: var(--handout-accent); }
.handout-paper[data-box="minimal"] .handout-preview-box { border: 1px solid #e1e6eb; border-radius: 4px; background: #f7f8fa; }
.handout-paper[data-box="minimal"] .handout-preview-box h3 { border-radius: 0; background: transparent; color: var(--handout-accent); border-bottom: 1px solid #d9e0e7; }
.handout-paper[data-box="vibrant"] .handout-preview-box { border: 1px solid #f3d4bd; background: #fff7f0; }
.handout-paper[data-box="vibrant"] .handout-preview-box h3 { background: var(--handout-accent); }
.handout-paper[data-box="mint"] .handout-preview-box { border: 1px solid #d5ebe4; border-radius: 14px; background: #f0f8f5; }
.handout-paper[data-box="mint"] .handout-preview-box h3 { background: #e1f2ec; color: var(--handout-accent); }
.handout-paper[data-box="editorial"] { font-family: "Avenir Next", "PingFang SC", sans-serif; }
.handout-paper[data-box="editorial"] .handout-paper-header { border-bottom: 3px solid var(--handout-accent); }
.handout-paper[data-box="editorial"] > h1 { margin: 30px 0 4px; padding-left: 14px; border-left: 7px solid var(--handout-accent); text-align: left; letter-spacing: .04em; }
.handout-paper[data-box="editorial"] .handout-paper-subtitle { margin-left: 21px; text-align: left; }
.handout-paper[data-box="editorial"] .handout-preview-heading-block { padding: 12px 0; border: 0; border-top: 1px solid #ddc5bf; border-radius: 0; background: transparent; }
.handout-paper[data-box="editorial"] .handout-preview-heading-block h2::before { content: "SECTION"; margin-right: 10px; color: #a6a09a; font: 700 9px/1 system-ui, sans-serif; letter-spacing: .12em; }
.handout-paper[data-box="editorial"] .handout-preview-box { border-radius: 0 14px 14px 0; background: #f6efed; }
.handout-paper[data-box="editorial"] .handout-preview-box h3 { border-radius: 0; background: transparent; color: var(--handout-accent); border-bottom: 1px solid #e5d4d0; }
.handout-paper[data-box="workbook"] { background-color: #fffefa; }
.handout-paper[data-box="workbook"] > h1 { width: fit-content; margin: 18px auto 6px; padding: 7px 28px; border: 2px solid var(--handout-accent); border-radius: 4px; background: #f0f5fa; }
.handout-paper[data-box="workbook"] .handout-paper-subtitle { padding-bottom: 12px; border-bottom: 1px dashed #aebed0; }
.handout-paper[data-box="workbook"] .handout-preview-heading-block { border: 1px solid #9bacc0; border-left: 5px solid var(--handout-accent); border-radius: 3px; background: #f4f7fa; }
.handout-paper[data-box="workbook"] .handout-preview-question { border: 1px solid #afbdcc; border-radius: 3px; background: linear-gradient(#fff 30px, #f3f6f8 31px); }
.handout-paper[data-box="workbook"] .handout-preview-question h3::before { content: "□ "; color: var(--handout-accent); }
.handout-paper[data-box="workbook"] .handout-preview-box { border: 1px dashed #91a7be; border-radius: 4px; background: #f3f7fb; }
.handout-paper[data-box="workbook"] .handout-preview-box h3 { border-radius: 3px 3px 0 0; background: #e1eaf3; color: var(--handout-accent); }
.handout-paper[data-box="classic"] { font-family: Georgia, "Songti SC", "STSong", serif; }
.handout-paper[data-box="classic"] .handout-paper-header { border-bottom: 3px double var(--handout-accent); font-family: Georgia, serif; }
.handout-paper[data-box="classic"] > h1 { margin-top: 28px; padding-bottom: 11px; border-bottom: 1px solid #bdc8d5; letter-spacing: .08em; }
.handout-paper[data-box="classic"] .handout-preview-heading-block { padding: 8px 0; border: 0; border-bottom: 1px solid #bdc8d5; border-radius: 0; background: transparent; text-align: center; }
.handout-paper[data-box="classic"] .handout-preview-heading-block h2::before, .handout-paper[data-box="classic"] .handout-preview-heading-block h2::after { content: "◆"; margin: 0 9px; color: var(--handout-accent); font-size: .6em; vertical-align: .15em; }
.handout-paper[data-box="classic"] .handout-preview-box { border: 1px solid #b9c5d2; border-radius: 0; background: #f8fafc; }
.handout-paper[data-box="classic"] .handout-preview-box h3 { border-radius: 0; background: #e8edf3; color: var(--handout-accent); }
.handout-paper-footer { position: relative; z-index: 1; margin-top: 24px; padding-top: 8px; border-top: 1px solid #e7ebf1; }
.handout-paper-footer.handout-page-footer { color: var(--handout-footer-color, #8a96a8); font-size: var(--handout-footer-font-size, 10px); }
.handout-page-footer-right[data-mode="page"] { font-variant-numeric: tabular-nums; }
.handout-page-footer-right[data-mode="page"] { position: absolute; left: 50%; transform: translateX(-50%); }
.handout-watermark { position: absolute; z-index: 0; inset: 25% 10%; display: grid; place-items: center; pointer-events: none; color: var(--handout-accent); }
.handout-watermark-text { transform: rotate(-25deg); font: 800 34px/1 system-ui, sans-serif; white-space: nowrap; }
.handout-watermark-image { display: block; max-width: 65%; max-height: 70%; object-fit: contain; }
.handout-page-header-settings { display: grid; gap: 10px; margin: 14px 0; padding: 12px; border: 1px solid #e2e9f3; border-radius: 12px; background: #fbfcff; }
.handout-page-header-settings-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.handout-page-header-settings-title strong { color: #30415d; font-size: 14px; }
.handout-page-header-settings-title small { color: #8997ad; font-size: 11px; }
.handout-header-toggle { display: flex; align-items: center; gap: 8px; color: #536783; font-size: 13px; font-weight: 650; }
.handout-header-toggle input { accent-color: var(--handout-accent, #287a66); }
.handout-page-header-settings .handout-field:has(input:disabled) { opacity: .55; }
.handout-paper-content, .handout-paper-header, .handout-paper > h1, .handout-paper-subtitle, .handout-paper-footer { position: relative; z-index: 1; }


.handout-import-modal { position: fixed; z-index: 10030; inset: 0; display: grid; place-items: center; padding: 20px; }
.handout-import-backdrop { position: absolute; inset: 0; background: rgba(28, 42, 61, .42); }
.handout-import-dialog { position: relative; display: grid; grid-template-rows: auto auto minmax(180px, 1fr) auto; width: min(780px, 100%); max-height: min(760px, 90vh); overflow: hidden; border: 1px solid #dfe7f1; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(24, 39, 61, .22); }
.handout-import-dialog > header, .handout-import-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.handout-import-dialog > header { border-bottom: 1px solid #edf0f5; }
.handout-import-dialog > header h2 { margin: 0; color: #2b3b55; font-size: 19px; }
.handout-import-dialog > header p { margin: 5px 0 0; color: #8491a4; font-size: 12px; }
.handout-import-dialog > header > button { width: 34px; height: 34px; border: 1px solid #e0e7f0; border-radius: 50%; background: #f8faff; color: #64748a; font-size: 23px; cursor: pointer; }
.handout-import-filters { display: grid; grid-template-columns: 130px 150px minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 14px 22px; background: #fafcff; }
.handout-import-filters label { display: grid; gap: 5px; color: #71819a; font-size: 11px; font-weight: 750; }
.handout-import-filters input, .handout-import-filters select { box-sizing: border-box; width: 100%; height: 38px; border: 1px solid #dfe7f1; border-radius: 9px; padding: 0 10px; background: #fff; color: #34445e; font: inherit; font-size: 12px; }
.handout-import-results { min-height: 0; overflow: auto; padding: 8px 18px; }
.handout-import-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid #edf1f6; cursor: pointer; }
.handout-import-row input, .handout-import-answer-toggle input { accent-color: #287a66; }
.handout-import-row-copy { display: grid; min-width: 0; gap: 4px; }
.handout-import-row-copy strong { overflow: hidden; color: #40516b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.handout-import-row-copy > span { display: -webkit-box; overflow: hidden; color: #7b899d; font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.handout-import-row > small { color: #8794a8; font-size: 10px; }
.handout-import-empty { padding: 42px 16px; color: #8a96a8; text-align: center; font-size: 13px; }
.handout-import-dialog > footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 10px 14px; border-top: 1px solid #edf0f5; }
.handout-import-answer-toggle { display: inline-flex; align-items: center; gap: 7px; color: #63738d; font-size: 12px; white-space: nowrap; }
.handout-import-footer-actions { display: flex; grid-column: 1; grid-row: 2; align-items: center; flex-wrap: wrap; gap: 8px; color: #7b899d; font-size: 11px; white-space: nowrap; }
.handout-import-footer-actions button { min-height: 34px; }
.handout-import-footer-actions button:disabled { cursor: default; opacity: .5; }
.handout-import-confirm { grid-column: 2; grid-row: 1 / span 2; min-width: 112px; min-height: 40px; white-space: nowrap; }

.handout-knowledge-dialog { display: flex; flex-direction: column; width: min(1200px,calc(100vw - 40px)); height: min(900px,calc(100vh - 40px)); max-height: min(940px,calc(100vh - 40px)); }
.handout-knowledge-dialog > header { flex: 0 0 auto; }
.handout-knowledge-filters { display: grid; grid-template-columns: 150px minmax(180px, 1fr) auto auto; align-items: end; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #edf0f5; }
.handout-knowledge-filters label, .handout-knowledge-editor-fields label { display: grid; gap: 5px; min-width: 0; color: #63738d; font-size: 11px; font-weight: 750; }
.handout-knowledge-filters input, .handout-knowledge-filters select, .handout-knowledge-editor-fields input, .handout-knowledge-editor-fields select { width: 100%; min-width: 0; height: 36px; box-sizing: border-box; padding: 0 10px; border: 1px solid #dfe7f1; border-radius: 9px; background: #fbfcff; color: #34445e; font: inherit; font-size: 12px; }
.handout-knowledge-list { flex: 1 1 auto; min-height: 150px; overflow: auto; padding: 4px 18px 12px; }
.handout-knowledge-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid #edf1f6; }
.handout-knowledge-row.importable { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.handout-knowledge-row > input { width: 17px; height: 17px; accent-color: var(--handout-accent); }
.handout-knowledge-row > div { min-width: 0; }
.handout-knowledge-row strong { color: #34445e; font-size: 13px; }
.handout-knowledge-row small { display: block; margin-top: 3px; color: #8a96a8; font-size: 10px; }
.handout-knowledge-row p { margin: 5px 0 0; color: #687891; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.handout-knowledge-row > button { padding: 6px 10px; border: 1px solid #dfe7f1; border-radius: 8px; background: #fff; color: #52647f; font: inherit; font-size: 11px; cursor: pointer; }
.handout-knowledge-row > button.danger { border-color: #f0d6d8; background: #fffafb; color: #b2525b; }
.handout-knowledge-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid #edf0f5; }
.handout-knowledge-footer > span { margin-right: auto; color: #8491a4; font-size: 11px; }
.handout-knowledge-editor-form { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding: 16px 20px 20px; }
.handout-knowledge-editor-fields { display: grid; grid-template-columns: 1.4fr .8fr .7fr 1fr; gap: 10px; }
.handout-knowledge-format-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 7px; border: 1px solid #e2e8f1; border-radius: 10px; background: #f8faff; }
.handout-knowledge-format-toolbar > button, .handout-knowledge-symbols > button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid #dfe7f1; border-radius: 7px; background: #fff; color: #465773; font: inherit; font-size: 12px; cursor: pointer; }
.handout-knowledge-format-toolbar > button:hover, .handout-knowledge-symbols > button:hover { border-color: #b8cbe4; color: var(--handout-accent); }
.handout-knowledge-format-toolbar > i { width: 1px; height: 20px; background: #dfe5ee; margin: 0 3px; }
.handout-knowledge-symbols { position: relative; }
.handout-knowledge-symbols > div { position: absolute; z-index: 4; top: calc(100% + 5px); left: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 5px; min-width: 200px; padding: 8px; border: 1px solid #dfe7f1; border-radius: 10px; background: #fff; box-shadow: 0 10px 28px rgba(32,49,72,.14); }
.handout-knowledge-symbols > div[hidden] { display: none; }
.handout-knowledge-symbols > div button { padding: 6px; border: 1px solid #e4eaf2; border-radius: 6px; background: #fbfcff; color: #40516b; cursor: pointer; }
.handout-knowledge-content-label { display: grid; gap: 6px; color: #63738d; font-size: 11px; font-weight: 750; }
.handout-knowledge-content-label textarea { min-height: 190px; resize: vertical; padding: 12px; border: 1px solid #dfe7f1; border-radius: 10px; background: #fcfdff; color: #34445e; font: 13px/1.7 sans-serif; }
.handout-knowledge-preview { min-height: 76px; padding: 10px 12px; border: 1px solid #e5ebf3; border-radius: 10px; background: #fbfcff; color: #52647f; font-size: 12px; line-height: 1.65; }
.handout-knowledge-preview > strong { display: block; margin-bottom: 5px; color: #7d8ba0; font-size: 10px; }
.handout-knowledge-editor-form > footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid #edf1f6; }

@media (max-width: 1260px) {
  .handout-layout { grid-template-columns: minmax(220px, .8fr) minmax(270px, 1fr); gap: 16px; }
  .handout-column-resizer { display: none; }
  .handout-preview-panel { position: static; grid-column: 1 / -1; }
  .handout-preview-scroll { height: auto; max-height: 70vh; }
}
@media (max-width: 760px) {
  .handout-toolbar { align-items: center; flex-direction: row; padding: 10px; }
  .handout-toolbar-actions { width: auto; }
  .handout-layout { grid-template-columns: minmax(0, 1fr); }
  .handout-preview-panel { grid-column: auto; }
  .handout-paper { min-height: 550px; padding: 24px 18px; }
  .handout-preview-scroll { padding: 8px; }
  .handout-editor-list { max-height: none; }
  .handout-content-meta-fields { grid-template-columns: 1fr; gap: 0; }
  .handout-import-modal { padding: 8px; }
  .handout-import-dialog { max-height: 94vh; border-radius: 14px; }
  .handout-library-modal { padding: 8px; }
  .handout-library-dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); max-height: 96vh; border-radius: 14px; }
  .handout-knowledge-dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); max-height: 96vh; }
  .handout-import-filters { grid-template-columns: 1fr; }
  .handout-import-dialog > footer { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 13px; }
  .handout-import-footer-actions { width: auto; flex-wrap: wrap; justify-content: flex-start; }
  .handout-knowledge-filters { grid-template-columns: 1fr 1fr; }
  .handout-knowledge-editor-fields { grid-template-columns: 1fr 1fr; }
  .handout-knowledge-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
  .handout-knowledge-row.importable { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .handout-knowledge-row > button { padding: 5px 7px; }
  .handout-knowledge-footer { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .handout-import-dialog > footer { grid-template-columns: minmax(0, 1fr); }
  .handout-import-answer-toggle, .handout-import-footer-actions, .handout-import-confirm { grid-column: 1; }
  .handout-import-answer-toggle { grid-row: 1; }
  .handout-import-footer-actions { grid-row: 2; }
  .handout-import-confirm { grid-row: 3; width: 100%; }
  .handout-knowledge-editor-fields { grid-template-columns: 1fr; }
  .handout-knowledge-footer > span { flex-basis: 100%; }
  .handout-knowledge-footer > button { flex: 1; }
  .handout-preview-edit-fields, .handout-preview-edit-answer-fields { grid-template-columns: 1fr; }
  .handout-heading-edit-dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); max-height: 96vh; }
  .handout-heading-edit-dialog form[data-heading-form="true"] { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; gap: 12px; padding: 12px; }
  .handout-heading-editor-preview-column { grid-column: 1; grid-row: 1; }
  .handout-heading-editor-preview { min-height: 90px; }
  .handout-heading-editor-controls { grid-column: 1; grid-row: 2; }
  .handout-heading-edit-dialog form[data-heading-form="true"] > footer { grid-column: 1; grid-row: 3; }
  .handout-component-edit-dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); max-height: 96vh; }
  .handout-component-edit-dialog form { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; gap: 12px; padding: 12px; }
  .handout-component-preview-column { grid-column: 1; grid-row: 1; }
  .handout-component-preview { min-height: 90px; }
  .handout-component-editor-controls { grid-column: 1; grid-row: 2; }
  .handout-component-edit-dialog form > footer { grid-column: 1; grid-row: 3; }
}
@media print {
  .handout-preview-pages { display: block !important; }
  .handout-preview-page-slot { width: auto !important; height: auto !important; margin: 0 !important; break-after: page; page-break-after: always; }
  .handout-preview-pages > .handout-preview-page-slot:last-child { break-after: auto !important; page-break-after: auto !important; }
  .handout-paper[data-preview-page] { box-sizing: border-box !important; width: var(--handout-page-width, 210mm) !important; height: auto !important; min-height: 0 !important; margin: 0 !important; overflow: visible !important; transform: none !important; box-shadow: none !important; }
  .handout-preview-page-slot > .handout-paper[data-preview-page] { height: var(--handout-page-height, 297mm) !important; }
  .handout-preview-page-slot > .handout-paper[data-page-header="true"] > .handout-page-header { display: flex !important; }
  .handout-preview-page-slot > .handout-paper[data-page-footer="true"] > .handout-page-footer { position: absolute; z-index: 10; right: 15mm; bottom: 10mm; left: 15mm; box-sizing: border-box; display: flex; min-height: 10mm; align-items: center; margin: 0; padding: 2mm 0 0; overflow: hidden; border-top: 1px solid #e7ebf1; background: #fff; }
  .handout-paper[data-page-footer="true"] > .handout-page-footer .handout-page-footer-right[data-mode="custom"] { margin-left: auto; }
  .handout-preview-edit, .handout-preview-actions { display: none !important; }
  .handout-paper-meta-target.is-empty::before { content: none !important; }
  body:has(#page-handout.active) * { visibility: hidden !important; }
  body:has(#page-handout.active) #page-handout.active,
  body:has(#page-handout.active) #page-handout.active * { visibility: visible !important; }
  body:has(#page-handout.active) .shell { display: block !important; max-width: none !important; margin: 0 !important; }
  body:has(#page-handout.active) .side-nav,
  body:has(#page-handout.active) .nav-resizer,
  body:has(#page-handout.active) .app > :not(#page-handout) { display: none !important; }
  body:has(#page-handout.active) .app { min-height: 0 !important; height: auto !important; padding: 0 !important; }
  #page-handout.active { position: static !important; inset: auto !important; display: block !important; width: auto !important; height: auto !important; min-height: 0 !important; overflow: visible !important; padding: 0 !important; background: white !important; }
  #page-handout.active .handout-workspace { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  #page-handout.active .handout-toolbar, #page-handout.active .handout-sidebar, #page-handout.active .handout-editor-panel, #page-handout.active .handout-preview-heading { display: none !important; }
  #page-handout.active .handout-layout { display: block !important; }
  #page-handout.active .handout-preview-panel { position: static !important; display: block !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
  #page-handout.active .handout-preview-scroll { height: auto !important; max-height: none !important; overflow: visible !important; padding: 0 !important; background: white !important; }
  #page-handout.active .handout-preview-pages { display: block !important; }
  #page-handout.active .handout-paper { width: var(--handout-page-width, 210mm) !important; height: var(--handout-page-height, 297mm) !important; min-height: 0 !important; overflow: hidden !important; box-shadow: none !important; }
}

.handout-preview-overlay { position: fixed; z-index: 10050; inset: 0; display: grid; place-items: center; padding: 16px; }
.handout-preview-overlay[hidden] { display: none; }
.handout-preview-overlay-backdrop { position: absolute; inset: 0; background: rgba(20, 32, 48, .55); backdrop-filter: blur(3px); }
.handout-preview-overlay-dialog { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(1240px, calc(100vw - 32px)); height: calc(100dvh - 32px); overflow: hidden; border: 1px solid #dfe7f1; border-radius: 18px; background: #eef2f7; box-shadow: 0 30px 90px rgba(15, 27, 45, .38); }
.handout-preview-overlay-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid #e3e9f2; background: #fff; }
.handout-preview-overlay-title { display: flex; align-items: baseline; gap: 10px; color: #2b3b55; }
.handout-preview-overlay-title strong { font-size: 15px; }
.handout-preview-overlay-title span { color: #8794a8; font-size: 12px; }
.handout-preview-overlay-zoom { display: flex; align-items: center; gap: 4px; margin-left: auto; padding: 3px; border: 1px solid #e0e7f1; border-radius: 10px; background: #f7f9fd; }
.handout-preview-overlay-zoom button { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #5b6b85; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.handout-preview-overlay-zoom button:hover { background: #eef3fb; color: #315fd3; }
.handout-preview-overlay-zoom button[aria-pressed="true"] { background: #fff; color: #315fd3; box-shadow: 0 1px 4px rgba(49, 95, 211, .18); }
.handout-preview-overlay-close { width: 34px; height: 34px; border: 1px solid #e0e7f0; border-radius: 50%; background: #f8faff; color: #64748a; font-size: 22px; line-height: 1; cursor: pointer; }
.handout-preview-overlay-close:hover { background: #eef3fb; color: #315fd3; }
.handout-preview-overlay-scroll { overflow: auto; padding: 24px; }
.handout-preview-overlay-scroll .handout-preview-pages { width: max-content; margin: 0 auto; }
@media (max-width: 760px) {
  .handout-preview-overlay { padding: 0; }
  .handout-preview-overlay-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .handout-preview-overlay-head { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
  .handout-preview-overlay-title { flex: 1; }
  .handout-preview-overlay-zoom { order: 3; width: 100%; margin-left: 0; justify-content: center; }
  .handout-preview-overlay-zoom button { padding: 0 8px; }
}
@media print {
  .handout-preview-overlay { display: none !important; }
}
