<style>
  @font-face {
    font-family: "Iansui";
    font-display: swap;
    src: local("Iansui"), local("芫荽"), local("Iansui Regular"),
         url("https://cdn.jsdelivr.net/gh/ButTaiwan/iansui/fonts/ttf/Iansui-Regular.ttf") format("truetype");
  }
  @font-face {
    font-family: "芫荽";
    font-display: swap;
    src: local("芫荽"), local("Iansui"), local("Iansui Regular"),
         url("https://cdn.jsdelivr.net/gh/ButTaiwan/iansui/fonts/ttf/Iansui-Regular.ttf") format("truetype");
  }
  :root {
    /* 文字與紙面：三階中性色，不再為每一個近似暖白各宣告一次 */
    --ink: #1A2A26;
    --ink-soft: #3F514C;
    --muted: #5C6B66;
    --paper: #FFFDF8;
    --panel: #FFFFFF;
    --canvas: #EAE6DC;
    --sunken: #F4F1E9;
    /* 框線三階：預設細線、次要、強調，只有強調那階是深的 */
    --line: #DBD7CC;
    --line-mid: #B9B4A6;
    --line-strong: #3A4B46;
    /* 唯一主色：松煙墨綠三階 */
    --teal: #214842;
    --teal-dark: #15312C;
    --teal-soft: #E4EDE9;
    /* 唯一強調色：硃砂，只給教師標記與錯誤 */
    --accent: #B82918;
    --accent-soft: #FBF0EE;
    /* 唯一狀態色：公告釘選用的暖金三階 */
    --gold: #7A5B22;
    --gold-soft: #FAF3E2;
    --gold-line: #E2D0A8;
    --radius: 16px;
    /* 字體分層契約：紙面層用芫荽體（對照手寫講義），介面層一律現代黑體 */
    --font-paper: "Iansui", "芫荽", "BiauKai", "DFKai-SB", "Noto Serif TC", serif;
    --font-ui: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
    --shadow: 0 12px 32px rgba(33, 72, 66, 0.08);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: radial-gradient(circle at 10% 0%, rgba(255,255,255,0.7), transparent 36rem), var(--canvas);
    color: var(--ink);
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    line-height: 1.68;
    min-height: 100vh;
  }

  /* ===== 字體分層契約 =====
     紙面層：與手寫講義一比一對照的內容（講義內文、大題橫幅、表格、提問、答案格）
     介面層：導覽、按鈕、徽章、頁碼、設定、統計、公告，一律現代黑體
     紙面層裡的按鈕與頁碼徽章仍屬介面層，由下一段回填 */
  .paper-stage,
  .projection-content,
  .projection-table,
  .handout-lead-text,
  .handout-doc-header,
  .handout-doc-main-title,
  .handout-doc-title-row,
  .handout-doc-student-fields,
  .handout-section-banner,
  .handout-section-heading,
  .handout-unit-heading,
  .handout-combined-heading,
  .handout-qa-item,
  .handout-qa-stem,
  .handout-qa-list,
  .handout-qa-group-boxes,
  .qa-ans,
  .ans-slot,
  .student-card,
  .student-blank-input,
  .student-textarea,
  .mcq-option {
    font-family: var(--font-paper);
    font-variant-numeric: normal;
  }
  /* 積分銀行與後台的資料表不是講義紙面：一律現代字，數字等寬對齊 */
  .announcement-shell .projection-table,
  .announcement-shell .projection-table :is(th, td) {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
  }
  /* 紙面層內的按鈕、下拉、頁碼與得分徽章回填現代字，避免被上一段吃掉 */
  .paper-stage :is(button, select, input, textarea, .pill-btn, .handout-page-badge, .item-score-badge),
  .student-card :is(button:not(.mcq-option), select) {
    font-family: var(--font-ui);
  }
  button, input, textarea, select { font: inherit; }
  button { cursor: pointer; transition: all 0.15s ease; }
  button:disabled { opacity: 0.55; cursor: not-allowed; }

  /* 頂部共用導覽列（針對筆電小螢幕緊湊優化，單行不換行擠壓） */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 56px;
    padding: 8px 20px;
    background: rgba(255, 253, 248, 0.96);
    border-bottom: 2px solid var(--line);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--teal-dark);
    font-size: 19px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
  }
  .brand-seal {
    background: var(--teal);
    color: var(--panel);
    font-size: 13.5px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 6px;
  }
  .brand-sub {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 700;
  }
  .nav-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
  }
  .pill-btn {
    min-height: 33px;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1.5px solid var(--line-mid);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }
  .pill-btn:hover { background: var(--panel); border-color: var(--teal); transform: translateY(-1px); }
  .pill-btn.teal { background: var(--teal); color: var(--panel); border-color: var(--teal); }
  .pill-btn.accent { background: var(--accent); color: var(--panel); border-color: var(--accent); }
  .pill-btn.soft { background: var(--teal-soft); color: var(--teal-dark); border-color: var(--teal); }
  .pill-btn.gold { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }

  /* 試算表／後端入口 SVG 圖示（第十二條契約） */
  .sheet-entry-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--paper);
    color: var(--teal);
    opacity: 0.82;
    text-decoration: none;
  }
  .sheet-entry-link:hover { opacity: 1; background: var(--teal-soft); }

  /* 大廳容器 */
  .container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px 32px 48px;
  }

  /* 參考「墨卷」：多連結、可置頂、左右滑動之公告區 */
  .announcement-surface {
    margin: 0 0 26px;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--paper) 0%, var(--teal-soft) 100%);
    border: 1.5px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .announcement-surface.is-collapsed .announcement-list {
    display: none;
  }
  .announcement-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
  }
  .announcement-surface.is-collapsed .announcement-heading {
    margin-bottom: 0;
  }
  .announcement-eyebrow {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--teal);
    margin-bottom: 2px;
  }
  .announcement-heading h2 {
    font-size: 20px;
    font-weight: 900;
    color: var(--teal-dark);
    margin: 0;
  }
  .announcement-heading-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .announcement-list {
    display: flex;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 10px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-color: #B6C8BF transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .announcement-card {
    position: relative;
    display: flex;
    flex: 0 0 min(340px, calc(100% - 24px));
    width: min(340px, calc(100% - 24px));
    height: 238px;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid var(--line);
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(44, 52, 47, 0.06);
  }
  .announcement-card.is-pinned {
    background: var(--gold-soft);
    border-color: var(--gold-line);
  }
  .announcement-card-top {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .announcement-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    color: var(--teal-dark);
    background: var(--teal-soft);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    flex-shrink: 0;
  }
  .announcement-card.is-pinned .announcement-tag {
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
  }
  .announcement-card-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--teal-dark);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .announcement-time {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .announcement-description {
  .announcement-links {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-color: #B6C8BF transparent;
    scrollbar-width: thin;
  }
    white-space: nowrap;
    margin-top: 4px;
    flex-shrink: 0;
  }
  .announcement-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }
  .announcement-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--teal-dark);
    text-decoration: none;
    transition: all 0.15s;
  }
  .announcement-link:hover { background: var(--panel); border-color: var(--teal); }
  .announcement-link strong {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .announcement-open { flex-shrink: 0; color: var(--accent); font-size: 13px; font-weight: 900; }
  .announcement-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(225, 222, 212, 0.85);
    flex-shrink: 0;
  }
  .ann-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
  }
  .ann-action-btn:hover:not(:disabled) {
    border-color: var(--teal);
    background: var(--teal-soft);
  }
  .ann-action-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
  }
  .ann-action-btn.pinned-active {
    background: var(--gold-line);
    border-color: var(--gold-line);
    color: var(--gold);
  }
  .ann-action-btn.danger:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
  }
  .announcement-lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
  }
  .section-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .roster-textarea {
    width: 100%;
    min-height: 220px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.5px;
    resize: vertical;
  }
  .roster-textarea:focus {
    outline: none;
    border-color: var(--teal);
    background: var(--panel);
  }
  .roster-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    max-height: 190px;
    overflow-y: auto;
  }
  .roster-preview-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 99px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 700;
  }
  .announcement-link-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
  }
  .announcement-link-row-fields {
    display: grid;
    grid-template-columns: minmax(120px, 0.75fr) minmax(200px, 1.25fr);
    flex: 1;
    gap: 8px;
    min-width: 0;
  }
  .announcement-link-row .field {
    margin-bottom: 0;
    min-width: 0;
  }
  .announcement-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    background: var(--gold-soft);
    border: 1.5px solid var(--gold-line);
    border-radius: 11px;
    cursor: pointer;
    margin-top: 10px;
  }
  .announcement-checkbox input {
    width: 18px !important;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
  }
  .section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
  }
  .section-head h2 {
    font-size: 20px;
    font-weight: 900;
    color: var(--teal-dark);
  }
  .pin-badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 99px;
    margin-right: 6px;
  }
  .subitem-toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 800;
    padding: 2px 7px;
    white-space: nowrap;
    border-radius: 999px;
    border: 1.5px solid var(--teal);
    background: var(--teal-soft);
    color: var(--teal-dark);
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.15s;
  }
  .subitem-toggle-chip.closed {
    border-color: var(--line-strong);
    background: var(--sunken);
    color: var(--muted);
  }
  .subitem-toggle-chip:hover {
    transform: translateY(-1px);
  }
  .subitem-closed-badge {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sunken);
    color: var(--muted);
    margin-top: 4px;
  }

  /* 各課教材卡片牆 */
  .boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
  }
  .board-card {
    background: var(--panel);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow);
  }
  .board-card.active-board {
    border: 2px solid var(--teal);
    background: var(--paper);
  }
  .board-card.import-card {
    border: 2px dashed var(--teal);
    background: rgba(228, 237, 233, 0.6);
  }
  .board-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: var(--teal);
    color: var(--panel);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 900;
  }
  .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
  }
  .meta-chip {
    background: var(--sunken);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
  }
  .meta-chip.open { background: var(--teal-soft); color: var(--teal-dark); }
  .card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .board-manage-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px dashed var(--line);
  }
  .board-manage-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
  }
  .board-subtitle {
    font-size: 14.5px;
    color: var(--muted);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 班級選單（切換班級＋名單＋班級管理） */
  .class-menu-wrap {
    position: relative;
    display: inline-flex;
  }
  .class-menu-btn {
    gap: 4px;
    font-weight: 900;
  }
  .class-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 80;
    min-width: 210px;
    padding: 6px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    box-shadow: 0 12px 28px rgba(31, 42, 38, 0.16);
    display: grid;
    gap: 2px;
  }
  .class-menu-item {
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 9px 11px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    display: block;
    width: 100%;
  }
  .class-menu-item:hover {
    background: var(--teal-soft);
  }
  .class-menu-item.active {
    background: var(--teal-soft);
    color: var(--teal-dark);
  }
  .class-menu-sep {
    height: 1px;
    background: var(--line);
    margin: 4px 2px;
  }

  /* 各題填答監控 */
  .monitor-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--teal-dark);
    color: var(--panel);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.3px;
  }
  .answer-summary-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 8px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .answer-sum-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
  }
  .answer-sum-chip.count { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--panel); }
  .answer-sum-chip.done { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--panel); }
  .answer-sum-chip.draft { background: var(--sunken); border: 1.5px dashed var(--line-mid); color: var(--muted); }
  .answer-sum-chip.missing { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .answer-sum-chip.na { background: var(--sunken); color: var(--muted); }
  .answer-monitor-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
  }
  .answer-monitor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 720px;
  }
  .answer-monitor-table th,
  .answer-monitor-table td {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 8px 10px;
    text-align: center;
    white-space: nowrap;
  }
  .answer-monitor-table thead th {
    background: var(--paper);
    color: var(--teal-dark);
    font-weight: 900;
    position: sticky;
    top: 0;
  }
  .answer-monitor-table .mon-step-col {
    text-align: left;
    white-space: normal;
    min-width: 220px;
    max-width: 340px;
    line-height: 1.5;
    cursor: pointer;
    font-weight: 800;
  }
  .answer-monitor-table .mon-step-col:hover { background: var(--teal-soft); }
  .answer-monitor-table .mon-done { background: var(--teal-soft); color: var(--teal-dark); font-weight: 800; }
  .answer-monitor-table .mon-draft { background: var(--sunken); color: var(--muted); font-weight: 800; }
  .answer-monitor-table .mon-none { color: var(--muted); }
  .answer-monitor-table .mon-na { background: var(--sunken); color: var(--muted); }
  .answer-monitor-table .mon-count { font-weight: 900; color: var(--accent); }
  .answer-monitor-table .mon-current th,
  .answer-monitor-table .mon-current td { background: var(--teal-soft); }
  .answer-monitor-table .mon-current .mon-step-col { box-shadow: inset 4px 0 0 var(--teal); }
  .answer-monitor-table .mon-foot-row th,
  .answer-monitor-table .mon-foot-row td {
    background: var(--paper);
    font-weight: 900;
    border-bottom: none;
  }
  .answer-monitor-table .mon-foot { color: var(--teal-dark); }

  /* 教師 100% 滿版大螢幕講台（零側邊欄干擾，字體 22px+；支援隱藏上方工具列讓講義區最大化） */
  .teacher-stage-wrap {
    padding: 16px 24px 96px; /* 底部預留漂浮翻頁列空間 */
    max-width: 1460px;
    margin: 0 auto;
    transition: padding 0.18s ease;
  }
  .teacher-stage-wrap.maximized {
    padding: 6px 10px 92px;
    max-width: 100%;
  }
  .paper-stage {
    background: var(--paper);
    border: 1.5px solid var(--line-mid);
    border-radius: 18px;
    padding: 24px 32px;
    min-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 16px 44px rgba(33, 72, 66, 0.1);
    position: relative;
  }
  .teacher-stage-wrap.maximized .paper-stage {
    min-height: calc(100vh - 18px);
    padding: 18px 26px;
    border-radius: 14px;
  }
  .top-nav-restore-pill {
    position: fixed;
    top: 8px;
    right: 16px;
    z-index: 90;
    min-height: 30px;
    padding: 3px 12px;
    border-radius: 99px;
    border: 1.5px solid var(--teal);
    background: rgba(255, 253, 248, 0.96);
    color: var(--teal-dark);
    font-size: 12.5px;
    font-weight: 900;
    box-shadow: 0 4px 14px rgba(24, 34, 31, 0.15);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .top-nav-restore-pill:hover {
    background: var(--teal);
    color: var(--panel);
  }
  /* 漂浮式講義翻頁列：固定在頁面中下方，只留箭頭與「目前/總頁數」 */
  .floating-page-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 86;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    max-width: calc(100vw - 20px);
    gap: 8px;
    padding: 7px 10px;
    background: rgba(255, 253, 248, 0.97);
    border: 2px solid var(--line-strong);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(24, 34, 31, 0.22);
    backdrop-filter: blur(8px);
  }
  .floating-page-nav .page-arrow {
    min-width: 44px;
    padding: 6px 10px;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
  }
  .floating-page-nav .page-select {
    min-width: 66px;
    padding: 6px 10px;
    text-align: center;
    text-align-last: center;
  }
  /* 上拉式頁面選單：按鈕只顯示 4/8，清單顯示完整頁面標題 */
  .page-picker {
    position: relative;
    display: inline-flex;
  }
  .page-picker-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    min-width: 280px;
    max-width: min(86vw, 520px);
    max-height: 62vh;
    overflow-y: auto;
    background: rgba(255, 253, 248, 0.99);
    border: 2px solid var(--line-strong);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(24, 34, 31, 0.26);
    padding: 6px;
    z-index: 2;
  }
  .page-picker.open .page-picker-menu { display: block; }
  .page-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.55;
    cursor: pointer;
  }
  .page-picker-item:hover { background: var(--teal-soft); }
  .page-picker-item.active { background: var(--teal); color: var(--panel); }
  .page-picker-no {
    flex: 0 0 auto;
    min-width: 1.6em;
    text-align: right;
    font-weight: 900;
    color: var(--teal-dark);
  }
  .page-picker-item.active .page-picker-no { color: var(--panel); }
  .page-picker-title { flex: 1 1 auto; white-space: normal; word-break: break-word; }
  .stage-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--line);
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  .stage-title {
    font-size: 26px;
    font-weight: 900;
    color: var(--teal-dark);
  }
  .projection-content {
    font-size: 22px;
    line-height: 1.75;
    position: relative;
  }
  .projection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 21px;
    margin: 12px 0;
    background: var(--paper);
    border: 2px solid var(--ink);
  }
  .projection-table th, .projection-table td {
    border: 1.5px solid var(--line-strong);
    padding: 13px 18px;
    vertical-align: middle;
    line-height: 1.72;
  }
  .projection-table th {
    background: var(--teal-soft);
    color: var(--teal-dark);
    border-bottom: 2px solid var(--ink);
    font-size: 19px;
    font-weight: 900;
    text-align: left;
  }
  .projection-table td:first-child {
    border-left: 2px solid var(--ink);
    background: rgba(244, 241, 233, 0.55);
  }
  /* 紙本講義填空底線格：未揭曉前維持乾淨紙本實線底線留白（無灰底與問號干擾），點擊即揭曉松煙墨綠正解 */
  .ans-slot {
    display: inline-block;
    min-width: 96px;
    border-bottom: 2px solid var(--ink);
    background: transparent;
    color: var(--teal-dark);
    font-weight: 900;
    font-size: 20px;
    padding: 1px 10px;
    text-align: center;
    border-radius: 3px 3px 0 0;
    margin: 2px 4px;
    cursor: pointer;
    vertical-align: baseline;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .ans-slot.masked {
    background: transparent;
    color: transparent;
    border-bottom: 2px solid var(--ink);
    position: relative;
    user-select: none;
  }
  .ans-slot.masked:hover {
    background: rgba(33, 72, 66, 0.06);
  }
  .ans-slot:not(.masked) {
    background: var(--teal-soft);
    color: var(--teal-dark);
    border-bottom: 2.5px solid var(--teal);
    font-weight: 900;
    font-size: 21px;
  }
  /* 紙本講義大題階層橫幅（壹、暖身題／貳、課文理解／參、統整探究／肆、課後延伸） */
  .handout-section-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--teal);
    color: var(--paper);
    padding: 8px 18px;
    border-radius: 8px;
    border-left: 6px solid var(--teal-dark);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
    box-shadow: 0 3px 10px rgba(33, 72, 66, 0.12);
  }
  .handout-page-badge {
    font-size: 14px;
    font-weight: 800;
    background: rgba(255, 253, 248, 0.18);
    color: var(--paper);
    padding: 2px 10px;
    border-radius: 99px;
    border: 1px solid rgba(255, 253, 248, 0.35);
    white-space: nowrap;
  }
  /* 紙本講義【資料一】／【學習引導】對照參考框（置於簡答題下方、單選評量上方，與 Word 表格框線一致） */
  .handout-ref-box {
    margin: 16px 0;
    border: 2px solid var(--line-strong);
    border-radius: 8px;
    background: var(--paper);
    overflow: hidden;
  }
  .handout-ref-box details.hint {
    margin: 0;
  }
  .handout-ref-box details.hint + details.hint {
    border-top: 1.5px solid var(--line-strong);
  }
  .handout-ref-box summary {
    padding: 10px 16px;
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-weight: 900;
    font-size: 19px;
    cursor: pointer;
    border-bottom: 1px solid var(--line-mid);
    list-style: none;
  }
  .handout-ref-box .hint-body {
    padding: 14px 18px;
    font-size: 19.5px;
    line-height: 1.8;
    color: var(--ink);
    background: var(--paper);
    white-space: pre-line;
  }
  .handout-ref-box .hint-body p + p {
    margin-top: 8px;
  }
  /* 簡答小題上方之紙本內嵌引文框（如課外閱讀第4題前之玉賢段落） */
  .handout-qa-excerpt {
    margin: 14px 0 8px;
    padding: 14px 18px;
    background: var(--sunken);
    border: 1.5px solid var(--line-strong);
    border-left: 5px solid var(--teal);
    border-radius: 8px;
    font-size: 19.5px;
    line-height: 1.8;
    color: var(--ink);
  }
  /* 全卷連貫模式分隔線 */
  .continuous-page-divider {
    margin: 28px 0 22px;
    padding-top: 22px;
    border-top: 3px double var(--line-strong);
  }

  /* 教師手寫畫布層（疊加在講義內容上） */
  .ink-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
  }
  .ink-canvas.drawing {
    pointer-events: auto;
    cursor: crosshair;
    /* 手勢交給 JS 控制：一指（或觸控筆）作畫、兩指上下捲動 */
    touch-action: none;
  }

  /* ===== A2 方章系契約：單字方章（.sk）與印泥點（.sealdot）——全站 icon 一律走這兩個元件 ===== */
  .sk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid currentColor;
    border-radius: 5px;
    font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
    font-style: normal;
    font-weight: 900;
    font-size: 12px;
    line-height: 1;
    color: inherit;
    position: relative;
    vertical-align: -4px;
    flex: 0 0 auto;
  }
  .sk::after {
    content: "";
    position: absolute;
    inset: 2px;
    border: 1px solid currentColor;
    opacity: 0.28;
    border-radius: 3px;
    pointer-events: none;
  }
  .sk.zhu { color: var(--accent); }
  .sk.zhu::after { opacity: 0.28; }
  .sk.sm { width: 16px; height: 16px; font-size: 10px; border-radius: 4px; }
  .pill-btn.teal .sk, .pill-btn.teal .sk::after,
  .ink-tool-btn.active .sk { border-color: rgba(255, 253, 248, 0.92); color: #FFFDF8; }
  .pill-btn.teal .sk::after, .ink-tool-btn.active .sk::after { border-color: rgba(255, 253, 248, 0.35); }
  .sealdot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal);
    flex: 0 0 auto;
  }
  .sealdot.off { background: var(--line-mid); }
  .sealdot.zhu { background: var(--accent); border-radius: 2px; }

  .stage-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding-top: 16px;
    border-top: 1.5px solid var(--line);
    margin-top: 24px;
    flex-wrap: wrap;
    z-index: 15;
    position: relative;
  }
  .color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--panel);
    box-shadow: 0 0 0 1.5px var(--line-strong);
    cursor: pointer;
  }
  .color-dot.active {
    transform: scale(1.18);
    box-shadow: 0 0 0 3px var(--teal);
  }

  /* 學生純淨作答端 */
  .student-wrap {
    max-width: 980px;
    margin: 22px auto 48px;
    /* 底部留白，讓固定的翻頁膠囊不會壓到最後一行內容 */
    padding: 0 20px 82px;
  }
  .sync-banner {
    background: var(--accent);
    color: var(--panel);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 900;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .student-card {
    background: var(--paper);
    border: 1.5px solid var(--line);
    border-radius: 18px;
    padding: 24px 30px;
    box-shadow: var(--shadow);
  }
  .student-blank-input {
    border: none;
    border-bottom: 2px solid var(--ink);
    background: rgba(228, 237, 233, 0.32);
    color: var(--teal-dark);
    font-weight: 900;
    font-size: 18px;
    padding: 3px 10px;
    border-radius: 4px 4px 0 0;
    width: 148px;
    text-align: center;
    margin: 2px 4px;
  }
  .student-textarea {
    width: 100%;
    min-height: 110px;
    border: 1.5px solid var(--line-mid);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 18px;
    background: var(--panel);
    margin-top: 10px;
  }
  .student-blank-input:focus, .student-textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(33, 72, 66, 0.12); }
  .mcq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }
  .mcq-option {
    border: 1.5px solid var(--line);
    background: var(--panel);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    text-align: left;
  }
  .mcq-option.selected {
    border-color: var(--teal);
    background: var(--teal-soft);
    color: var(--teal-dark);
  }

  /* 自訂 Modal（契約第二條：禁 alert/confirm/prompt） */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 28, 0.58);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-backdrop.open { display: flex; }
  .modal-card {
    background: var(--paper);
    border: 1.5px solid var(--line-mid);
    border-radius: 18px;
    max-width: 760px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  }
  .modal-card.wide { max-width: 1020px; }
  .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1.5px solid var(--line);
    margin-bottom: 16px;
  }
  .modal-head h3 { font-size: 22px; font-weight: 900; color: var(--teal-dark); }
  .field { margin-bottom: 14px; }
  .field label { display: block; font-size: 14px; font-weight: 800; margin-bottom: 5px; color: var(--muted); }
  .field input, .field textarea, .field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: 10px;
    background: var(--panel);
    font-size: 16px;
  }

  /* 全班學生名單動態選組網格 */
  .roster-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 8px;
  }
  .roster-pill {
    border: 1.5px solid var(--line-strong);
    background: var(--panel);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    transition: all 0.14s ease;
  }
  .roster-pill:hover {
    border-color: var(--teal);
    background: var(--teal-soft);
  }
  .roster-pill.selected {
    border: 2px solid var(--teal);
    background: var(--teal);
    color: var(--panel);
  }
  .roster-pill.other-group {
    background: var(--sunken);
    color: var(--muted);
    border-style: dashed;
  }

  /* 墨卷風：右下懸浮馬卡龍畫筆（預設收合為單一圓形 Icon，展開為雙欄緊湊面板，小螢幕絕不超出） */
  .floating-ink-dock {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 85;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    /* 容器會被撐成一大塊，透明區域會攔截下方「墨」按鈕的點擊：容器只做排版，點擊交給真正的按鈕 */
    pointer-events: none;
  }
  .floating-ink-dock > * {
    pointer-events: auto;
  }
  .ink-icon-fab {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--teal-dark);
    color: var(--panel);
    border: 2.5px solid var(--panel);
    box-shadow: 0 8px 24px rgba(20, 35, 30, 0.32);
    display: grid;
    place-items: center;
    font-size: 24px; font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
    font-weight: 900;
    position: relative;
    user-select: none;
    transition: transform 0.15s ease, background 0.15s ease;
  }
  .ink-icon-fab:hover {
    transform: scale(1.06);
  }
  .ink-icon-fab.active {
    background: var(--accent);
  }
  .ink-icon-color-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--panel);
  }
  /* 收合時懸浮在右下角 icon 上方的快速切換列（直排，避免橫向擋住講義內容） */
  .ink-quick-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 5px;
    background: rgba(255, 253, 248, 0.98);
    border: 2px solid var(--line-strong);
    border-radius: 13px;
    box-shadow: 0 10px 26px rgba(24, 34, 31, 0.22);
    backdrop-filter: blur(8px);
  }
  .ink-quick-bar.hidden { display: none; }
  .ink-quick-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1.5px solid var(--line-strong);
    background: var(--panel);
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
  }
  .ink-quick-btn:hover { transform: translateY(-1px); }
  .ink-quick-btn.active { background: var(--teal); color: var(--panel); border-color: var(--teal-dark); }
  .ink-quick-btn.ink-quick-color { color: #FFFDF8; border-color: transparent; }
  .ink-quick-btn.ink-quick-color.active { box-shadow: 0 0 0 2.5px var(--panel), 0 0 0 4.5px var(--teal-dark); }
  .ink-dock-panel {
    background: rgba(255, 253, 248, 0.98);
    border: 2px solid var(--line-strong);
    border-radius: 16px;
    padding: 9px;
    box-shadow: 0 14px 36px rgba(24, 34, 31, 0.24);
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 118px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    backdrop-filter: blur(8px);
  }
  .ink-dock-panel.collapsed {
    display: none;
  }
  .ink-panel-top {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
  }
  .ink-power-btn {
    flex: 1;
    height: 28px;
    border-radius: 7px;
    border: 1.5px solid var(--line-strong);
    background: var(--panel);
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 900;
    white-space: nowrap;
    padding: 0 4px;
    cursor: pointer;
  }
  .ink-power-btn.active {
    background: var(--accent);
    color: var(--panel);
    border-color: var(--accent);
  }
  .ink-collapse-btn {
    width: 26px;
    height: 28px;
    border-radius: 7px;
    border: 1.5px solid var(--line-strong);
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
  }
  .ink-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    width: 100%;
  }
  .ink-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    justify-items: center;
  }
  .ink-tool-btn {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--line-strong);
    background: var(--panel);
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
    display: grid;
    place-items: center;
    position: relative;
  }
  .ink-tool-btn::after {
    content: "";
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(58, 75, 70, 0.26);
    border-radius: 5px;
    pointer-events: none;
  }
  .ink-tool-btn:hover { background: var(--sunken); }
  .ink-tool-btn.danger:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
  }
  .ink-tool-btn.danger:hover::after { border-color: rgba(184, 41, 24, 0.26); }
  .ink-tool-btn.active {
    background: var(--teal);
    color: var(--panel);
    border-color: var(--teal-dark);
  }
  .ink-tool-btn.active::after { border-color: rgba(255, 253, 248, 0.35); }
  .ink-tool-btn.active:hover { background: var(--teal); }
  .ink-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--panel);
    box-shadow: 0 0 0 1.5px var(--line-strong);
    cursor: pointer;
    transition: transform 0.14s ease;
  }
  .ink-swatch.active {
    transform: scale(1.18);
    box-shadow: 0 0 0 2.5px var(--teal-dark);
  }
  .ink-width-btn {
    width: 100%;
    height: 26px;
    border-radius: 6px;
    border: 1.5px solid var(--line);
    background: var(--panel);
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }
  .ink-width-btn.active {
    border-color: var(--teal);
    background: var(--teal-soft);
    color: var(--teal-dark);
  }
  .ink-divider {
    width: 100%;
    height: 1px;
    background: var(--line);
    margin: 1px 0;
  }

  /* 各組答案直接重疊對照標籤（Overlay Mode） */
  .overlay-group-stack {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    vertical-align: middle;
    margin: 4px 2px;
  }
  .overlay-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 900;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
  }
  .overlay-group-chip .g-tag {
    font-size: 13px;
    padding: 1px 6px;
    border-radius: 5px;
    color: var(--panel);
    font-weight: 900;
  }
  .overlay-photo-trigger {
    border: 1px solid var(--teal);
    background: var(--teal-soft);
    color: var(--teal-dark);
    border-radius: 4px;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  /* 原始照片檢視器 */
  .photo-viewer-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 18px;
    align-items: start;
  }
  .photo-stage-box {
    background: var(--teal-dark);
    border-radius: 12px;
    padding: 14px;
    overflow: auto;
    max-height: 62vh;
    text-align: center;
    border: 2px solid var(--line-strong);
  }

  /* RWD 雙斷點（契約第十五條：768px 與 480px） */
  @media (max-width: 768px) {
    .topbar { padding: 10px 16px; }
    .container, .teacher-stage-wrap { padding: 16px; }
    .paper-stage { padding: 18px; }
    .projection-table { font-size: 18px; display: block; overflow-x: auto; }
    .boards-grid, .ann-grid { grid-template-columns: 1fr; }
    .roster-grid { grid-template-columns: repeat(3, 1fr); }
    .photo-viewer-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 480px) {
    .brand { font-size: 18px; }
    .pill-btn { min-height: 44px; font-size: 14px; padding: 6px 12px; }
    .stage-title { font-size: 20px; }
    .roster-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* ===== 班級與名單設定頁 ===== */
  .settings-block { display: grid; gap: 10px; }
  .settings-block + .settings-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
  .settings-block-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
  .settings-block-title { font-size: 15px; font-weight: 900; color: var(--teal-dark); letter-spacing: 0.4px; }
  .settings-count { font-size: 12.5px; color: var(--muted); font-weight: 800; }
  .settings-new-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .settings-new-row input[type="text"] { width: 170px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--panel); font-family: inherit; font-size: 14px; font-weight: 700; }
  .settings-copy { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
  .settings-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
  .settings-msg { color: var(--accent); font-weight: 800; font-size: 13px; min-height: 18px; }
  .settings-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-weight: 800; background: var(--paper); border: 1.5px dashed var(--line-strong); border-radius: 14px; }
  .class-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
  .class-card { position: relative; display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 8px 10px 14px; transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease; }
  .class-card:hover { border-color: var(--teal); box-shadow: 0 6px 16px rgba(31, 42, 38, 0.08); transform: translateY(-1px); }
  .class-card.selected { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 8px 20px rgba(31, 42, 38, 0.12); }
  .class-card.selected::after { content: "✓"; position: absolute; top: -9px; right: -7px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: var(--panel); font-size: 13px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(31, 42, 38, 0.25); }
  .class-card-main { flex: 1; min-width: 0; text-align: left; border: none; background: transparent; cursor: pointer; display: grid; gap: 4px; padding: 2px; font-family: inherit; }
  .class-card-name { display: flex; align-items: center; gap: 6px; font-size: 15.5px; font-weight: 900; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .class-card-tag { flex-shrink: 0; font-size: 11px; font-weight: 900; color: var(--teal-dark); background: var(--teal-soft); border-radius: 99px; padding: 1px 7px; }
  .class-card-meta { font-size: 12.5px; color: var(--muted); font-weight: 800; }
  .class-card-tools { display: flex; flex-direction: column; gap: 4px; }
  .settings-block .roster-textarea { min-height: 170px; }

  /* ===== 整體視覺微調 ===== */
  .modal-card { border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 26px 70px rgba(18, 28, 26, 0.32); background: var(--paper); }
  .modal-head { border-bottom: 1px solid var(--line); }
  .modal-head h3 { letter-spacing: 0.3px; }
  .modal-card .projection-table { font-size: 15px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .modal-card .projection-table th,
  .modal-card .projection-table td { border: 1px solid var(--line); padding: 10px 12px; }
  .modal-card .projection-table th { background: var(--sunken); font-size: 14px; }
  .modal-card .projection-table tbody tr:nth-child(even) { background: var(--sunken); }
  .modal-card .projection-table tbody tr:hover { background: var(--teal-soft); }
  .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(58, 75, 70, 0.12); }
  .board-card { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
  .board-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(31, 42, 38, 0.12); border-color: var(--line-strong); }
  .announcement-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
  .announcement-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31, 42, 38, 0.12); }

  /* 逐小題拍照與評分 */
  .item-cam-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .item-cam-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .item-cam-wrap { display: inline-flex; align-items: center; gap: 6px; }
  .item-cam-btn { min-height: 34px; font-size: 13.5px; padding: 4px 12px; }
  .item-score-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--teal-dark); border: 1px solid var(--teal-dark); color: var(--panel); font-size: 12.5px; font-weight: 900; }
  .item-score-badge.empty { background: var(--sunken); border-color: var(--line); color: var(--muted); }
  .item-photo-dot { font-size: 14px; }
  .item-review-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
  .item-review-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .item-review-thumb { max-height: 64px; border-radius: 6px; border: 1px solid var(--line); }
  /* 講台：每小題下方的空白板書區（純空白，不顯示任何文字） */
  .teacher-write-area {
    margin-top: 12px;
    min-height: 170px;
    border: 1px dashed var(--line-mid);
    border-radius: 10px;
    background-color: var(--paper);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 33px, rgba(58, 75, 70, 0.14) 33px, rgba(58, 75, 70, 0.14) 34px);
    background-position: 0 10px;
  }
  /* 講台小題的圖示按鈕（只放 icon，省空間，精緻方章） */
  .qa-icon-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .qa-icon-btn:hover { border-color: var(--teal); background: var(--teal-soft); }
  .qa-icon-btn.off { opacity: 0.5; }
  .qa-icon-btn.active {
    border-color: var(--teal);
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-weight: 900;
    box-shadow: 0 0 0 2px rgba(33, 72, 66, 0.15);
  }
  .qa-ctrl-divider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: var(--line-strong);
    margin: 0 4px;
    vertical-align: middle;
  }
  .handout-qa-ctrl-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 4px 0 8px;
    flex-wrap: wrap;
  }
  .handout-qa-group-boxes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(44, 42, 38, 0.04);
    border-radius: 8px;
  }
  .handout-qa-action-btns {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .handout-qa-stem {
    width: 100%;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.8;
    color: var(--ink);
    margin-bottom: 4px;
  }

.mindmap-container {
  background: #FDFBF7 !important;
  border: 2px solid #D5CCBA !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 20px rgba(33,72,66,0.08) !important;
}
.mindmap-container .mermaid svg text {
  font-family: var(--font-ui) !important;
  font-weight: 800 !important;
  font-size: 14.5px !important;
  letter-spacing: 0.5px !important;
}
.mindmap-container .mermaid svg rect,
.mindmap-container .mermaid svg polygon {
  rx: 8px !important;
  ry: 8px !important;
  stroke-width: 2.2px !important;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12)) !important;
}

/* ===== 心智圖深色高對比莫蘭迪強烈風格：粗實線、拒絕死白、白板極致好讀 ===== */
.mindmap-container .mermaid svg .edge {
  fill: none !important;
}
.mindmap-container .mermaid svg path[class*="edge-depth"] {
  stroke-width: 3.8px !important;
}
.mindmap-container .mermaid svg .section-edge-0 { stroke: #A06728 !important; stroke-width: 4px !important; }
.mindmap-container .mermaid svg .section-edge-1 { stroke: #2B6B4F !important; stroke-width: 4px !important; }
.mindmap-container .mermaid svg .section-edge-2 { stroke: #295A75 !important; stroke-width: 4px !important; }
.mindmap-container .mermaid svg .section-edge-3 { stroke: #7A364B !important; stroke-width: 4px !important; }
.mindmap-container .mermaid svg .section-edge-4 { stroke: #4B6858 !important; stroke-width: 4px !important; }
.mindmap-container .mermaid svg .section-edge-5 { stroke: #804810 !important; stroke-width: 4px !important; }
.mindmap-container .mermaid svg line[class*="section-edge"] { stroke-width: 4px !important; }

/* 根節點：深墨綠基底與白字 */
.mindmap-container .mermaid svg .section-root path,
.mindmap-container .mermaid svg .section-root rect,
.mindmap-container .mermaid svg .section-root circle {
  fill: #163831 !important;
  stroke: #0E2520 !important;
  stroke-width: 2.5px !important;
}
.mindmap-container .mermaid svg .section-root text {
  fill: #FFFFFF !important;
  font-weight: 900 !important;
  font-size: 16.5px !important;
}

/* 分支 0：深莫蘭迪赭黃 */
.mindmap-container .mermaid svg .section-0 path,
.mindmap-container .mermaid svg .section-0 rect {
  fill: #F5EADB !important;
  stroke: #A06728 !important;
  stroke-width: 2.2px !important;
}
.mindmap-container .mermaid svg .section-0 line {
  stroke: #A06728 !important;
  stroke-width: 3.8px !important;
}
.mindmap-container .mermaid svg .section-0 text {
  fill: #42260B !important;
  font-weight: 900 !important;
}

/* 分支 1：深莫蘭迪松竹綠 */
.mindmap-container .mermaid svg .section-1 path,
.mindmap-container .mermaid svg .section-1 rect {
  fill: #DEEFE5 !important;
  stroke: #2B6B4F !important;
  stroke-width: 2.2px !important;
}
.mindmap-container .mermaid svg .section-1 line {
  stroke: #2B6B4F !important;
  stroke-width: 3.8px !important;
}
.mindmap-container .mermaid svg .section-1 text {
  fill: #0F3524 !important;
  font-weight: 900 !important;
}

/* 分支 2：深莫蘭迪孔雀黛藍 */
.mindmap-container .mermaid svg .section-2 path,
.mindmap-container .mermaid svg .section-2 rect {
  fill: #DBE8F0 !important;
  stroke: #295A75 !important;
  stroke-width: 2.2px !important;
}
.mindmap-container .mermaid svg .section-2 line {
  stroke: #295A75 !important;
  stroke-width: 3.8px !important;
}
.mindmap-container .mermaid svg .section-2 text {
  fill: #0E2A3B !important;
  font-weight: 900 !important;
}

/* 分支 3：深莫蘭迪煙燻絳紫 */
.mindmap-container .mermaid svg .section-3 path,
.mindmap-container .mermaid svg .section-3 rect {
  fill: #EFE0E6 !important;
  stroke: #7A364B !important;
  stroke-width: 2.2px !important;
}
.mindmap-container .mermaid svg .section-3 line {
  stroke: #7A364B !important;
  stroke-width: 3.8px !important;
}
.mindmap-container .mermaid svg .section-3 text {
  fill: #3D1220 !important;
  font-weight: 900 !important;
}

/* 分支 4：深莫蘭迪石青綠 */
.mindmap-container .mermaid svg .section-4 path,
.mindmap-container .mermaid svg .section-4 rect {
  fill: #E0EAE4 !important;
  stroke: #4B6858 !important;
  stroke-width: 2.2px !important;
}
.mindmap-container .mermaid svg .section-4 line {
  stroke: #4B6858 !important;
  stroke-width: 3.8px !important;
}
.mindmap-container .mermaid svg .section-4 text {
  fill: #1E3127 !important;
  font-weight: 900 !important;
}

.mindmap-card {
  margin: 16px 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 16px 18px 18px;
}
.mindmap-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.mindmap-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--teal);
}
.mindmap-badge {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 900;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 2px 10px;
}
.mindmap-root-wrap {
  text-align: center;
  margin-bottom: 16px;
}
.mindmap-root {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--teal);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 900;
}
.mindmap-branches {
  display: grid;
  gap: 12px;
}
.mindmap-branch {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.mindmap-branch-label {
  flex: 0 0 176px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  color: #FFFFFF;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.45;
}
.mm-ord {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
}
.mindmap-leaves {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 10px;
  align-content: start;
}
.mindmap-leaf {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 9px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.mm-leaf-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
}
.mm-chip {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 2px 9px;
}
.mindmap-locked {
  margin: 16px 0;
  border: 1.5px dashed var(--line-mid);
  border-radius: var(--radius);
  background: var(--sunken);
  padding: 24px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}
.mindmap-locked-hint {
  font-size: 13px;
  font-weight: 900;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 2px 10px;
}
/* 投影到電子白板時放大，最後一排看得清楚 */
.projection-content .mindmap-title { font-size: 20px; }
.projection-content .mindmap-root { font-size: 19px; padding: 10px 24px; }
.projection-content .mindmap-branch-label { font-size: 17px; }
.projection-content .mm-leaf-name { font-size: 16.5px; }
.projection-content .mm-chip { font-size: 14.5px; }
.projection-content .mindmap-locked { font-size: 18px; }
@media (max-width: 900px) {
  .mindmap-branch { flex-direction: column; }
  .mindmap-branch-label { flex: 0 0 auto; }
}
/* 教室常見的矮視窗（1280×720／1280×800）把整張圖壓進一屏 */
@media (max-height: 900px) {
  .mindmap-card { padding: 12px 14px 14px; }
  .mindmap-head { padding-bottom: 8px; margin-bottom: 10px; }
  .mindmap-root { padding: 6px 16px; font-size: 15px; }
  .mindmap-root-wrap { margin-bottom: 10px; }
  .mindmap-branches { gap: 8px; }
  .mindmap-branch { gap: 10px; }
  .mindmap-branch-label { padding: 8px 10px; font-size: 13.5px; }
  .mindmap-leaves { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); }
  .mindmap-leaf { padding: 7px 10px; }
  .mm-chip { font-size: 12px; padding: 1px 8px; }
}
</style>


/* ===== 紙本講義 1:1 鏡像排版與本機常駐評語樣式 ===== */
.handout-doc-header {
  border-bottom: 2.5px double var(--ink);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.handout-doc-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}
.handout-doc-main-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.06em;
}
.handout-doc-student-fields {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.03em;
}
.handout-section-heading {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  margin: 6px 0 8px;
  letter-spacing: 0.04em;
}
.handout-unit-heading {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  margin: 4px 0 10px;
  line-height: 1.5;
}
/* 講義原文段落：保留 docx 的手動換行（\n），避免全部擠成一段 */
.handout-lead-text {
  white-space: pre-line;
}
.handout-lead-text p {
  font-size: 18.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0;
  line-height: 1.75;
  white-space: pre-line;
}
.handout-qa-list {
  margin: 16px 0;
}
.handout-qa-item {
  margin: 14px 0 18px;
  padding: 4px 0 10px;
  border-bottom: 1px dashed var(--line-strong);
}
.handout-qa-stem {
  font-size: 19.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.8;
}
.handout-ref-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--ink);
  margin-top: 16px;
  background: #FFFFFF;
}
.handout-ref-table td {
  border: 1.5px solid var(--ink);
  padding: 12px 16px;
  font-size: 17.5px;
  line-height: 1.8;
  color: var(--ink);
  /* 注意：不可在此整格套用 pre-line，否則樣板字串（如單選題）本身的換行也會變成空行。
     只對資料文字用的 .handout-ref-body 保留換行。 */
}
.handout-ref-body {
  white-space: pre-line;
}
.item-feedback-box {
  margin-top: 8px;
  padding: 10px 14px;
  background: #F2F8F5;
  border: 1.5px solid var(--teal);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.65;
}
.item-feedback-box .fb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: var(--teal-dark);
  margin-bottom: 3px;
  font-size: 15px;
}
.item-feedback-box .fb-body {
  font-weight: 700;
  color: var(--ink);
}

/* ===== 各小題得分右側「硃批（紅色）」常駐評語樣式 ===== */
.zhupi-feedback {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #B82918;
  background: #FDF3F1;
  border: 1.5px solid rgba(184, 41, 24, 0.38);
  border-left: 4px solid #B82918;
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}

/* ===== 心智圖放射狀互動導圖：點節點展開下一層（原生 SVG，不依賴 Mermaid） ===== */
.mm-shell {
  text-align: left;
  padding: 0;
}
.mm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mm-toolbar:empty { display: none; }
.mm-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.mm-head-slot { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.mm-head-slot .mm-actions { margin-left: 0; }
.mm-btn {
  border: 1px solid #CFC7B7;
  background: #FFF;
  color: #214842;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.mm-btn:hover { background: #E2F0EA; border-color: #2B6B4F; }
.mm-canvas { overflow-x: auto; padding: 2px 0 0; }
.mm-svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.mm-svg text { font-family: inherit; letter-spacing: 0.02em; }
.mm-clickable { cursor: pointer; }
.mm-clickable rect { transition: filter 0.15s ease; }
.mm-clickable:hover rect { filter: brightness(1.1); }
.mm-caret { pointer-events: none; }
.projection-content .mm-svg { max-width: none; }
.projection-content .mm-btn { font-size: 14px; }
.mm-btn { white-space: nowrap; }
.mm-toolbar .mm-actions { flex-wrap: wrap; }

/* ===== 修改模式：正解可直接編輯 ===== */
.ans-editable {
  cursor: text;
  outline: 1.5px dashed var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}
.ans-editable:hover { background: var(--teal-soft); }
.ans-editable:focus {
  outline: 2px solid var(--teal);
  background: #FFFDF8;
  color: var(--ink);
}
.qa-ans.ans-editable span { cursor: text; display: inline-block; min-width: 40px; }

/* ===== 古風便條（無動畫）：硃砂印開合、宣紙橫線箋 ===== */
/* 便條圖層壓在彈窗（z-index:100）之下：開排行榜或任何彈窗時，記印章不會浮上來 */
.note-layer { position: absolute; inset: 0; pointer-events: none; z-index: 99; }
.note-layer > * { pointer-events: auto; }

.note-seal {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 6px;
  border: 2px solid #B82918;
  background: #FDF6E9;
  color: #B82918;
  font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  box-shadow: 0 3px 10px rgba(120, 30, 20, 0.18);
  user-select: none;
  touch-action: none;
}
.note-seal:active { cursor: grabbing; }
.note-seal:hover { border-color: #9A2113; color: #9A2113; }

.note-card {
  position: absolute;
  resize: none;
  overflow: hidden;
  width: 300px;
  min-width: 220px;
  min-height: 130px;
  max-width: min(92%, calc(100vw - 32px));
  max-height: min(76%, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  margin-left: 34px;
  margin-top: -18px;
  background: repeating-linear-gradient(#FBF7EC, #FBF7EC 27px, #E7DFCB 28px);
  border: 1.5px solid #C9BFA6;
  border-top: 4px solid #B82918;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(60, 40, 20, 0.18);
  padding: 8px 10px 10px;
  z-index: 640;
}
.note-card.note-flip-x { transform: translateX(-100%); margin-left: -34px; }
.note-card.note-flip-y { transform: translateY(-100%); margin-top: 18px; }
.note-card.note-flip-x.note-flip-y { transform: translate(-100%, -100%); }

.note-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 4px; }
.note-card-title { font-size: 13px; font-weight: 900; color: #8A5A12; letter-spacing: 0.12em; }
.note-card-tools { display: flex; gap: 4px; }
.note-tool {
  border: 1px solid #C9BFA6;
  background: #FFFDF7;
  color: #214842;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  padding: 1px 7px;
  cursor: pointer;
}
.note-tool:hover { background: #F2ECE0; }

.note-text {
  flex: 1 1 auto;
  min-height: 96px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: none;
  background: transparent;
  color: #1F2421;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 28px;
  padding: 0;
  outline: none;
}
.note-link { color: #1A5B8A; text-decoration: underline; word-break: break-all; cursor: pointer; }
.note-text:empty::before { content: "貼上補充資料或網址…"; color: #A99F8C; font-weight: 700; }

/* 便條一律現代黑體：紙面層的芫荽手寫體不得進便條（含印章「記」與便條按鈕） */
.note-card, .note-card * {
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* 印章是 button，會被 .paper-stage :is(button…) 的介面字型蓋掉，這裡提權重蓋回明體（與全站 .sk 方章同字體） */
.note-layer .note-seal, .note-layer .note-seal * {
  font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
}

/* 便條自訂的拖曳大小把手（不用原生 resize：貼在頁面上時角落很難抓，還會被「點外收回」誤關） */
.note-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 0 52%, #B82918 52% 60%, transparent 60% 72%, #B82918 72% 80%, transparent 80%);
  border-bottom-right-radius: 7px;
  opacity: 0.45;
}
.note-resize:hover { opacity: 1; }
.note-card.note-flip-x .note-resize {
  right: auto;
  left: 0;
  cursor: nesw-resize;
  transform: scaleX(-1);
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 7px;
}
