/* HomeworkOS · Phase 2 编辑器样式 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  background: #171a22;
  color: #e8ecf4;
  display: flex;
  flex-direction: column;
}
.bc-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #e9eef7; }
.bc-link:hover { opacity: 0.85; }
.bc-brand { font-size: 14px; font-weight: 700; color: #e9eef7; }
.bc-version { font-size: 10px; color: #8a97ad; margin-left: 4px; font-weight: 400; }
.bc-sep { color: #5a6478; font-size: 14px; margin: 0 2px; }
.bc-current { font-size: 14px; font-weight: 600; color: #dce4f3; }
.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  background: #1f2430;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* 左上角页面切换下拉 */
.page-switcher { position: relative; margin-right: auto; }
.page-switcher-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-weight: 600;
  color: #e8edf8;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.ps-arrow { font-size: 10px; color: #95a0b5; transition: transform 0.15s; }
.page-switcher.open .ps-arrow { transform: rotate(180deg); }
.page-switcher-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 200px;
  background: #252b38;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 6px;
  z-index: 1000;
}
.page-switcher-menu.hidden { display: none; }
.ps-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  color: #dce4f3;
  text-decoration: none;
  font-size: 13px;
}
.ps-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.ps-item.ps-current { color: var(--accent-2); background: rgba(var(--accent-2-rgb), 0.08); }
.ps-now { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(var(--accent-2-rgb), 0.18); color: var(--accent-2); font-weight: 600; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
}
.brand-title { font-size: 14px; font-weight: 700; }
.brand-sub { font-size: 11px; color: #95a0b5; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sep { width: 1px; height: 20px; background: rgba(255,255,255,0.1); }
.tb-btn, .link-like {
  border: 1px solid rgba(255,255,255,0.12);
  background: #252b38; color: #dce4f3; border-radius: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.tb-btn:hover, .link-like:hover { background: #2b3241; }
.tb-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-btn.primary:hover { background: var(--accent-dark); }
.tb-btn.danger { color: #ffb4b4; }
.tb-btn.active { box-shadow: inset 0 0 0 1px var(--accent-2); }
.tb-btn.icon-btn { padding: 6px 8px; min-width: 32px; }
.tb-btn.icon-btn svg { display: block; }
.tb-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* 顶部跳转相关页面链接组：挤在一起，作为一个整体按钮组 */
.top-link-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  overflow: hidden;
}
.top-link-group .tb-btn.link-like {
  border: none;
  border-radius: 0;
  padding: 7px 10px;
  font-size: 12px;
  background: transparent;
  color: #b8c4d9;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.top-link-group .tb-btn.link-like:last-child {
  border-right: none;
}
.top-link-group .tb-btn.link-like:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.save-badge {
  font-size: 11px; padding: 4px 8px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap; user-select: none;
}
.save-badge[data-state="empty"]   { color: #95a0b5; background: rgba(149,160,181,0.12); border-color: rgba(149,160,181,0.25); }
.save-badge[data-state="dirty"]   { color: #ffb86b; background: rgba(255,184,107,0.12); border-color: rgba(255,184,107,0.35); }
.save-badge[data-state="saving"]  { color: var(--accent-2); background: rgba(var(--accent-2-rgb), 0.12); border-color: rgba(var(--accent-2-rgb), 0.35); }
.save-badge[data-state="saved"]   { color: #5dd39e; background: rgba(93,211,158,0.12); border-color: rgba(93,211,158,0.35); }
.save-badge[data-state="error"]   { color: #ff8a8a; background: rgba(255,138,138,0.12); border-color: rgba(255,138,138,0.35); }
.save-badge[data-state="quota"]   { color: #fbbf24; background: rgba(251,191,36,0.14); border-color: rgba(251,191,36,0.4); }
.save-badge[data-state="conflict"]{ color: #f87171; background: rgba(248,113,113,0.14); border-color: rgba(248,113,113,0.4); }

/* 草稿冲突 / 本地写失败顶栏（叠在画布区域上方，不改变绝对定位布局） */
.draft-alert-bar {
  position: absolute;
  left: 12px; right: 12px; top: 12px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid rgba(251,191,36,0.4);
  background: rgba(26, 22, 12, 0.94);
  color: #fde68a;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  pointer-events: auto;
}
.draft-alert-bar[data-level="error"] {
  border-color: rgba(248,113,113,0.55);
  background: rgba(40, 18, 18, 0.95);
  color: #fecaca;
}
.draft-alert-bar.hidden { display: none !important; }
.draft-alert-text { flex: 1; min-width: 0; line-height: 1.4; }
.draft-alert-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: inherit;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.draft-alert-btn:hover { background: rgba(255,255,255,0.14); }
.draft-alert-btn.secondary {
  border-color: rgba(255,255,255,0.12);
  background: transparent;
  opacity: 0.92;
}
.draft-alert-btn.secondary:hover { background: rgba(255,255,255,0.1); opacity: 1; }
.draft-alert-dismiss {
  flex-shrink: 0;
  border: none; background: transparent;
  color: inherit; opacity: 0.7; cursor: pointer;
  font-size: 14px; padding: 2px 4px;
}
.draft-alert-dismiss:hover { opacity: 1; }
.filename-wrap { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #a9b4c8; }
.filename-wrap input {
  width: 220px; background: #161a22; color: #edf2fb;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px 10px;
}
.filename-wrap.compact input { width: 140px; }
.main { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 260px; background: #1d222d; padding: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.left-sidebar { border-right: 1px solid rgba(255,255,255,0.08); }
/* 右侧属性面板加宽，文字题输入区域更舒展 */
.right-sidebar { border-left: 1px solid rgba(255,255,255,0.08); width: 320px; }
.right-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.right-panel.active {
  display: flex;
}
.props-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.props-panel-header .props-header {
  margin-bottom: 0;
}
#questionsList {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.pagination-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0 0;
  justify-content: center;
  flex-shrink: 0;
}
.right-panel::-webkit-scrollbar,
#questionsList::-webkit-scrollbar {
  width: 6px;
}
.right-panel::-webkit-scrollbar-track,
#questionsList::-webkit-scrollbar-track {
  background: transparent;
}
.right-panel::-webkit-scrollbar-thumb,
#questionsList::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}
.right-panel::-webkit-scrollbar-thumb:hover,
#questionsList::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}
.sidebar-title { font-size: 12px; color: #97a5bc; margin-bottom: 12px; font-weight: 700; letter-spacing: .04em; }
.sidebar-section { margin-top: 18px; }
.comp-item {
  background: #252b38; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; cursor: grab; user-select: none; font-size: 13px; color: #dce4f3;
}
.comp-item:hover { background: #2b3241; border-color: rgba(255,255,255,0.15); }
.comp-item:active { cursor: grabbing; transform: scale(0.97); }
.sidebar-hint, .props-empty, .empty-text { color: #7f8aa0; font-size: 12px; line-height: 1.7; }
.props-header { font-size: 12px; color: #97a5bc; margin-bottom: 12px; font-weight: 700; letter-spacing: .04em; }
.sidebar-scroll { flex: 1; overflow-y: auto; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.sidebar-footer { flex-shrink: 0; border-top: 1px solid rgba(255,255,255,0.06); padding: 8px 0 0; margin-top: 8px; }
.sidebar-footer-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 11px; color: #92a0b7; }
.sidebar-footer-row:last-child { margin-bottom: 0; }
.workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bar-label { font-size: 11px; color: #92a0b7; }
.pagebar {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: #1b2029; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.page-tabs { display: flex; gap: 4px; overflow: auto; align-items: center; }
.page-tab {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1);
  background: #252b38; cursor: pointer; color: #95a0b5; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.page-tab:hover { background: #2b3241; color: #dce4f3; }
.page-tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.page-tab.dragging { opacity: 0.55; }
.page-tab.drag-over { box-shadow: inset 3px 0 0 var(--accent); }
.page-btn {
  border: 1px solid rgba(255,255,255,0.1); background: #252b38; color: #95a0b5;
  border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 11px;
}
.page-btn:hover { background: #2b3241; color: #dce4f3; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.canvas-area {
  flex: 1; overflow: hidden; padding: 0; background: #12151c; position: relative;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}
.canvas-area.pan-ready { cursor: grab; }
.canvas-area.pan-ready:active { cursor: grabbing; }
.canvas-area.panning { cursor: grabbing !important; }
.canvas-area.panning-cursor { cursor: grabbing !important; }
.canvas-area.panning-cursor #annotationSvg { pointer-events: none !important; cursor: none !important; }
.canvas-wrap {
  width: 794px; height: 1123px; position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  background: white;
}
#bgCanvas { display: block; border-radius: 4px; }
.field-node {
  position: absolute; min-width: 40px; min-height: 24px; border-radius: 6px;
  outline: 1.5px solid transparent; cursor: move; user-select: none;
  z-index: 5;
}
/* 组卷：图在字上，点到的就是看见的。导出/布置预览仍先画图再画字（paintOrderNodes）。 */
.field-node.float-image { z-index: 6; }
.field-node.float-image.selected { z-index: 8; }
.field-node:hover { outline-color: rgba(var(--accent-rgb), 0.45); }
.field-node.selected { outline-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }
.field-node.overflow { outline-color: #e53e3e !important; box-shadow: 0 0 0 3px rgba(229,62,62,0.25) !important; }
.field-node.ink-overlap { outline-color: #e53e3e !important; box-shadow: 0 0 0 3px rgba(229,62,62,0.25) !important; }
/* 竖排后整体超出题目区底边（行距撑高后页装不下），与框内文字溢出区分 */
.field-node.page-overflow { outline-color: #f59e0b !important; box-shadow: 0 0 0 3px rgba(245,158,11,0.28) !important; }
.field-node.overflow.page-overflow { outline-color: #e53e3e !important; box-shadow: 0 0 0 3px rgba(229,62,62,0.25) !important; }
.field-node.template-node {
  outline: 2px dashed #3b82f6 !important;
  background: rgba(59, 130, 246, 0.08);
  cursor: default;
}
.field-node.template-node:hover {
  outline-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.field-content { width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.resize-handle { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: se-resize; }
.resize-handle::before, .resize-handle::after { content: ""; position: absolute; background: var(--accent); border-radius: 2px; }
.resize-handle::before { width: 9px; height: 2px; right: 2px; bottom: 2px; }
.resize-handle::after { width: 2px; height: 9px; right: 2px; bottom: 2px; }
.node-delete-btn {
  position: absolute; top: -8px; right: -8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #e53e3e; color: #fff; font-size: 11px;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10; line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.field-node.selected .node-delete-btn { display: flex; }
.node-delete-btn:hover { background: #c53030; }
.props-group { margin-bottom: 14px; }
.props-group label { display: block; font-size: 11px; color: #9aa6bc; margin-bottom: 6px; }
.props-group input, .props-group textarea, .props-group select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
  background: #141922; color: #edf2fb; font-size: 12px;
}
.props-group textarea { min-height: 84px; resize: vertical; }
/* 文字题主输入框：字号、高度、行高加大，缓解长文本输入的拥挤 */
#prop-value {
  font-size: 14px;
  line-height: 1.55;
  min-height: 180px;
  padding: 10px 12px;
}
/* 富文本上下角标小工具栏（右侧属性面板与双击 Modal 共用） */
.rt-toolbar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.rt-toolbar .rt-btn {
  border: 1px solid rgba(255,255,255,0.12); background: #252b38; color: #dce4f3;
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font-size: 13px; line-height: 1.2; font-family: var(--font-ui);
  min-width: 36px;
}
.rt-toolbar .rt-btn:hover { background: #2b3241; }
.rt-toolbar .rt-btn[data-rt-undo] { color: #ffb4b4; }
.rt-toolbar .rt-hint { margin-left: auto; font-size: 11px; color: #7f8aa0; }
.props-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.statusbar {
  min-height: 34px; display: flex; align-items: center; gap: 18px; padding: 0 16px;
  background: #1f2430; border-top: 1px solid rgba(255,255,255,0.08); color: #92a0b7; font-size: 12px; flex-wrap: wrap;
}
/* 后端状态指示灯 */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; background: #95a0b5; vertical-align: middle;
  transition: background 0.2s, box-shadow 0.2s;
}
.status-dot.ok { background: #5dd39e; box-shadow: 0 0 6px rgba(93,211,158,0.5); }
.status-dot.err { background: #ff6b6b; box-shadow: 0 0 6px rgba(255,107,107,0.5); }
.toast-wrap { position: absolute; left: 16px; top: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 999; pointer-events: none; }
.toast {
  border-radius: 10px; padding: 10px 14px; max-width: 360px;
  font-size: 13px; font-weight: 500; pointer-events: auto; animation: toastIn 0.25s ease;
  background: linear-gradient(135deg, #252a20 0%, #1e2218 100%); border: 1px solid rgba(93,211,158,0.35); color: #a8f0c8;
  box-shadow: 0 4px 16px rgba(93,211,158,0.12);
}
.toast.toast-error {
  background: linear-gradient(135deg, #2a2020 0%, #221818 100%); border: 1px solid rgba(255,107,107,0.4); color: #ffb4b4;
  box-shadow: 0 4px 16px rgba(255,107,107,0.12);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
/* .measure-div 已统一迁移到 public/common/fonts.css */
/* 隐藏裸露的图片选择 input：只在双击图片节点时 JS 触发 .click()，平时不该露在页面上 */
#imgPicker { display: none; }
.list-panel {
  border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; background: #181d27; padding: 10px; min-height: 80px;
}
.list-item {
  padding: 10px; border-radius: 8px; background: #222938; border: 1px solid rgba(255,255,255,0.06); margin-bottom: 8px;
}
.list-item:last-child { margin-bottom: 0; }
.list-item-title { font-size: 12px; font-weight: 600; color: #e8edf8; margin-bottom: 4px; }
.list-item-sub { font-size: 11px; color: #8d9ab0; line-height: 1.6; }
.list-item-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.question-thumb { width: 100%; border-radius: 8px; background: white; border: 1px solid #d9e1ef; margin-top: 8px; }
.archived-tag { color: #8a97ad; background: rgba(138,151,173,0.12); padding: 1px 6px; border-radius: 4px; font-size: 10px; }

/* 题卡库：已插入的题卡 */
.list-item.q-used { opacity: 0.5; filter: grayscale(0.3); }
.list-item.q-used .list-item-actions button { cursor: not-allowed; opacity: 0.8; }
.q-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  vertical-align: middle;
}
.q-tag-text { color: #2c8a5e; background: rgba(93,211,158,0.15); }
.q-tag-used { color: #8a97ad; background: rgba(138,151,173,0.15); margin-left: 4px; }
.q-tag-choice { color: #38a169; background: rgba(56,161,105,0.15); margin-left: 4px; }
.q-tag-fillblank { color: #3182ce; background: rgba(49,130,206,0.15); margin-left: 4px; }
.q-tag-essay { color: #8a97ad; background: rgba(138,151,173,0.15); margin-left: 4px; }
.q-text-preview {
  background: #f4f7ff;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 6px;
  padding: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: #3a4a6a;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 选题列表缩略：Markdown 数据表 */
.q-text-preview .q-data-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  font-size: 11px;
  margin: 4px 0;
  table-layout: fixed;
  white-space: normal;
}
.q-text-preview .q-data-table th,
.q-text-preview .q-data-table td {
  border: 1px solid #8a9bb8;
  padding: 2px 4px;
  text-align: center;
  word-break: break-word;
}
.q-text-preview .q-data-table th {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
}
.q-text-preview .q-text-seg {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 2px;
}
.toolbar-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.session-bar {
  font-size: 12px; color: var(--accent-2); background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.25); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px;
}
.hidden { display: none !important; }
/* 紧凑作业行（侧边栏最近已保存） */
.compact-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px;
  font-size: 12px; cursor: pointer;
}
.compact-row:hover { background: #252b38; }
.compact-id { color: var(--accent-2); font-weight: 600; font-family: var(--font-mono); flex-shrink: 0; }
.compact-title { flex: 1; color: #dce4f3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-load-btn {
  flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); background: #252b38; color: var(--accent-2);
  border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 11px;
}
.compact-load-btn:hover { background: #2b3241; }
.compact-footer { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); text-align: center; }
.compact-footer a { color: #95a0b5; font-size: 11px; text-decoration: none; }
.compact-footer a:hover { color: var(--accent-2); }
/* 预览模式：所有节点去掉选中框与手柄，纯打印效果 */
.field-node.preview-mode { outline: none !important; box-shadow: none !important; cursor: default; }
.field-node.preview-mode .resize-handle { display: none; }
.field-node.preview-mode .field-content { pointer-events: none; }

/* 自定义模态弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #1f2430; border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
  padding: 24px; max-width: 440px; width: 90%; box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.modal-title { font-size: 15px; font-weight: 700; color: #e8ecf4; margin-bottom: 16px; }
.modal-body { font-size: 13px; color: #bcc5d6; line-height: 1.7; margin-bottom: 20px; }
.modal-body textarea, .modal-body input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12);
  background: #141922; color: #edf2fb; font-size: 13px; margin-top: 8px; resize: vertical;
}
.modal-body textarea { min-height: 100px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .modal-btn {
  border: 1px solid rgba(255,255,255,0.12); background: #252b38; color: #dce4f3; border-radius: 8px;
  padding: 8px 16px; cursor: pointer; font-size: 12px;
}
.modal-actions .modal-btn:hover { background: #2b3241; }
.modal-actions .modal-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal-actions .modal-btn.primary:hover { background: var(--accent-dark); }
.modal-actions .modal-btn.danger { color: #ffb4b4; border-color: rgba(255,180,180,0.3); }
.modal-actions .modal-btn.danger:hover { background: rgba(255,180,180,0.12); }
/* 文字编辑专用 Modal 变体：更大窗口、更大字号，长题目录入更舒服 */
.modal-box.modal-edit { max-width: 720px; }
.modal-box.modal-edit .modal-body textarea {
  font-size: 15px; min-height: 260px; line-height: 1.6;
}
/* 菁优数据表：列宽/折行跟 canvas cellLines，禁止 CSS 再拆中文 */
.field-content .q-data-table {
  border-collapse: collapse;
  width: auto;
  max-width: none;
  font-size: 0.88em;
  margin: 0;
  table-layout: fixed;
  box-sizing: border-box;
}
.field-content .q-data-table th,
.field-content .q-data-table td {
  border: 1px solid #333;
  padding: 0 6px;
  text-align: center;
  vertical-align: middle;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: nowrap;
  box-sizing: border-box;
}
.field-content .q-data-table th {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
}
.field-content .q-text-seg {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 4px;
}
.field-content .q-mat-two {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.field-content .q-mat-col {
  flex: 1;
  min-width: 0;
}
.field-content .q-mat-line {
  white-space: pre;
  max-width: 100%;
}
.field-content .q-mat-table-band {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  margin: 6px 0;
  flex-wrap: wrap;
}
.field-content .q-mat-col .q-mat-table-band,
.field-content .q-mat-table-band.q-mat-table-band--start {
  justify-content: flex-start;
}
.field-content .q-mat-table-band.q-mat-table-band--center {
  justify-content: center;
}
.field-content .q-mat-table-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.field-content .q-mat-col .q-mat-table-unit,
.field-content .q-mat-table-band--start .q-mat-table-unit {
  align-items: flex-start;
}
.field-content .q-mat-table-band--center .q-mat-table-unit {
  align-items: center;
}
.field-content .q-mat-caption {
  white-space: pre;
  margin-bottom: 2px;
  text-align: center;
}
.field-content .q-mat-col .q-mat-caption,
.field-content .q-mat-table-band--start .q-mat-caption {
  text-align: left;
}
.field-content .q-mat-table-band--center .q-mat-caption {
  text-align: center;
}

/* 答案批注工具栏：手写 / 文字答案 / 操作 三组分区 */
.drawbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 8px 16px;
  background: #1a1f2b; border-bottom: 1px solid rgba(255,180,100,0.2);
}
.drawbar.hidden { display: none; }
.drawbar-group {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.drawbar-group-text {
  padding: 4px 10px;
  background: rgba(229, 62, 62, 0.08);
  border: 1px solid rgba(229, 62, 62, 0.28);
  border-radius: 8px;
}
.drawbar-divider {
  width: 1px; align-self: stretch; min-height: 28px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.drawbar-label {
  font-size: 11px; color: #95a0b5; font-weight: 600;
  letter-spacing: 0.02em; margin-right: 2px; white-space: nowrap;
}
.drawbar-group-text .drawbar-label { color: #fc8181; }
.tb-btn-text-answer {
  border-color: rgba(229, 62, 62, 0.45) !important;
  color: #feb2b2 !important;
  font-weight: 600;
}
.tb-btn-text-answer:hover {
  background: rgba(229, 62, 62, 0.15) !important;
  border-color: #e53e3e !important;
  color: #fff !important;
}
.tb-btn-text-answer.active {
  background: rgba(229, 62, 62, 0.28) !important;
  border-color: #e53e3e !important;
  color: #fff !important;
}
.draw-color-btn {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
}
.draw-color-btn:hover { transform: scale(1.15); }
.draw-color-btn.active { border-color: #fff; box-shadow: 0 0 6px rgba(255,255,255,0.3); }
/* 普通文字选择题：结构由 CanvasCommon.layoutChoiceText 计算；间距由 JS 内联写入（与 canvas 同源）。 */
/* 行用 pre（非 nowrap）：保留连续半角空格，作答括号空位与测量一致 */
.field-content.choice-text-layout { overflow: visible; }
/* 画布文字题：上下角标（含选择题题干/选项） */
.field-content sub,
.field-content sup {
  font-size: 0.75em;
  line-height: 0;
}
.field-content sub { vertical-align: sub; }
.field-content sup { vertical-align: super; }
.field-content .hw-frac-mixed {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  vertical-align: middle;
}
.field-content .hw-frac {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  line-height: 1.05;
  margin: 0 0.06em;
}
.field-content .hw-frac-num,
.field-content .hw-frac-den {
  display: block;
  font-size: 0.78em;
  padding: 0 0.18em;
  white-space: nowrap;
}
.field-content .hw-frac-bar {
  display: block;
  border-top: 1px solid currentColor;
  height: 0;
  line-height: 0;
  margin: 0.02em 0;
}
.field-content .hw-frac-whole { font-size: 1em; }
.choice-stem-line.has-frac,
.choice-option-line.has-frac,
.q-mat-line.has-frac {
  overflow: visible;
}
.choice-stem { white-space: pre; }
.choice-stem-line,
.choice-option-line { white-space: pre; max-width: 100%; overflow: hidden; }
.choice-options { white-space: pre; } /* margin-top / gap 由 renderNodeContent 内联，勿写死 0.4em */
.choice-options--one-row .choice-option { white-space: pre; flex-shrink: 0; min-width: auto; }
.choice-option { min-width: 0; white-space: pre; overflow-wrap: normal; word-break: normal; box-sizing: border-box; }
.choice-option--empty { visibility: hidden; pointer-events: none; }

/* SVG 批注层 */
#annotationSvg {
  position: absolute; top: 0; left: 0; width: 794px; height: 1123px;
  z-index: 10; pointer-events: none;
  overflow: visible;
}
#annotationSvg.tool-pen { pointer-events: auto; cursor: crosshair; }
#annotationSvg.tool-eraser-stroke { pointer-events: auto; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect x='4' y='6' width='16' height='12' rx='2' fill='%23f0f0f0' stroke='%23666' stroke-width='1.5'/%3E%3Crect x='4' y='6' width='16' height='4' rx='2' fill='%23ffb347' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E") 12 12, auto; }
#annotationSvg.tool-eraser-rect { pointer-events: auto; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect x='4' y='4' width='16' height='16' fill='none' stroke='%236c8cff' stroke-width='2' stroke-dasharray='4 2'/%3E%3C/svg%3E") 12 12, crosshair; }
/* 文字标注层 */
#textLabelsLayer {
  position: absolute; top: 0; left: 0; width: 794px; height: 1123px;
  z-index: 12; pointer-events: none;
}
.answer-label {
  position: absolute; pointer-events: auto;
  background: rgba(229, 62, 62, 0.12);
  border: 1px solid rgba(229, 62, 62, 0.35);
  border-radius: 8px; padding: 3px 12px;
  font-size: 18px; font-weight: 700; color: #e53e3e;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.25;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background 0.15s;
  box-sizing: border-box;
  -webkit-text-stroke: 1.5px #fff;
  paint-order: stroke fill;
}
/* 位置和高度由 CanvasCommon.layoutAnswerLabel 统一计算。 */
.answer-label--above-q { margin-top: -2px; }
.answer-label:hover { background: rgba(229, 62, 62, 0.22); }
.answer-label sup {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: super;
}
.answer-label sub {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: sub;
}
/* 浮动输入框 */
#floatingInput {
  position: absolute; z-index: 20;
  background: #1f2430; border: 1px solid rgba(229,62,62,0.35);
  border-radius: 10px; padding: 10px 12px; min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
#floatingInput.hidden { display: none; }
.fi-header { font-size: 13px; color: #fc8181; font-weight: 700; margin-bottom: 8px; }
.fi-abcd { display: flex; gap: 6px; margin-bottom: 8px; }
.abcd-btn {
  flex: 1; height: 40px; border: 2px solid rgba(255,255,255,0.15);
  background: #252b38; color: #dce4f3; border-radius: 8px;
  cursor: pointer; font-size: 18px; font-weight: 800;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.abcd-btn:hover { background: #2b3241; border-color: #e53e3e; transform: scale(1.08); }
.abcd-btn.selected { background: #e53e3e; border-color: #e53e3e; color: #fff; transform: scale(1.08); }
.fi-text-row { display: flex; gap: 6px; }
.fi-text-row input {
  flex: 1; height: 34px; background: #141922; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 0 8px; color: #edf2fb; font-size: 13px; outline: none;
}
.fi-text-row input:focus { border-color: #e53e3e; }
.fi-confirm {
  height: 34px; padding: 0 14px; background: #e53e3e; border: none;
  border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
}
.fi-confirm:hover { background: #c53030; }
.fi-close {
  position: absolute; top: 8px; right: 10px;
  color: #7f8aa0; cursor: pointer; font-size: 14px; line-height: 1;
}
.fi-close:hover { color: #dce4f3; }
/* 动态浮动输入框（多题同时显示 / 单题编辑复用） */
.multi-fi {
  position: absolute; z-index: 20;
  background: #1f2430; border: 1px solid rgba(229,62,62,0.35);
  border-radius: 10px; padding: 8px 10px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0.55;
  transition: opacity 0.2s ease, box-shadow 0.15s ease;
}
.multi-fi:hover,
.multi-fi:focus-within,
.multi-fi.is-active,
.multi-fi.is-dragging {
  opacity: 1;
  z-index: 21;
}
.multi-fi.is-dragging { box-shadow: 0 12px 32px rgba(0,0,0,0.55); }
.multi-fi.is-hiding {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.multi-fi .fi-header {
  font-size: 13px; color: #fc8181; font-weight: 700; margin-bottom: 8px;
  cursor: move; user-select: none; padding-right: 18px;
}
.multi-fi .fi-abcd { display: flex; gap: 6px; margin-bottom: 8px; }
.multi-fi .abcd-btn {
  flex: 1; height: 36px; border: 2px solid rgba(255,255,255,0.15);
  background: #252b38; color: #dce4f3; border-radius: 8px;
  cursor: pointer; font-size: 16px; font-weight: 800;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.multi-fi .abcd-btn:hover { background: #2b3241; border-color: #e53e3e; transform: scale(1.08); }
.multi-fi .abcd-btn.selected { background: #e53e3e; border-color: #e53e3e; color: #fff; transform: scale(1.08); }
.multi-fi .fi-text-row { display: flex; gap: 6px; }
.multi-fi .fi-text-row input {
  flex: 1; height: 32px; background: #141922; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 0 8px; color: #edf2fb; font-size: 13px; outline: none;
}
.multi-fi .fi-text-row input:focus { border-color: #e53e3e; }
.multi-fi .fi-confirm {
  height: 32px; padding: 0 12px; background: #e53e3e; border: none;
  border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
}
.multi-fi .fi-confirm:hover { background: #c53030; }
.multi-fi .fi-close {
  position: absolute; top: 8px; right: 10px;
  color: #7f8aa0; cursor: pointer; font-size: 14px; line-height: 1;
}
.multi-fi .fi-close:hover { color: #dce4f3; }
/* 矩形橡皮擦选框 */
.eraser-selection-rect {
  position: absolute; border: 2px dashed #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  z-index: 11; pointer-events: none;
}
.fi-toggle-text { font-size: 11px; color: #7f8aa0; cursor: pointer; user-select: none; transition: color 0.15s; }
.fi-toggle-text:hover { color: #fc8181; }
/* DPI 选择器 */
.dpi-group { display: inline-flex; gap: 2px; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; overflow: hidden; }
.dpi-btn {
  border: none; background: transparent; color: #95a0b5; cursor: pointer; font-size: 11px;
  padding: 5px 10px; font-family: var(--font-mono);
}
.dpi-btn:hover { background: #252b38; color: #dce4f3; }
.dpi-btn.active { background: var(--accent); color: #fff; }

/* ── Zoom controls ── */
.zoom-controls {
  display: flex; align-items: center; gap: 2px;
  background: #252b38; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 1px; margin-left: 8px;
}
.zoom-btn {
  width: 22px; height: 20px;
  border: none; background: transparent;
  color: #dce4f3; cursor: pointer;
  font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.zoom-btn:hover { background: rgba(255,255,255,0.08); }
.zoom-pct {
  font-size: 11px; color: #b8c4d9;
  min-width: 36px; text-align: center;
  user-select: none; cursor: pointer;
}
.canvas-area.zooming { cursor: grab; }
.canvas-area.zooming:active { cursor: grabbing; }

/* ── 框选选择框 ── */

/* ── Magnetic alignment lines ── */
.align-line {
  position: absolute;
  background: var(--accent);
  z-index: 1000;
  pointer-events: none;
  opacity: 0.8;
}
.align-line.h { height: 1px; width: 100%; }
.align-line.v { width: 1px; height: 100%; }

/* ── Box selection ── */
.selection-rect {
  position: absolute;
  border: 1px dashed var(--accent, #6c8cff);
  background: rgba(var(--accent-rgb, 108, 140, 255), 0.08);
  z-index: 999;
  pointer-events: none;
}

/* ── 多选属性面板 ── */
.props-multi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.props-multi-actions .tb-btn {
  flex: 1 1 auto;
  min-width: 72px;
}
.props-multi-hint {
  font-size: 11px;
  color: #7f8aa0;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Preview mode ── */
.preview-mode .element-box {
  border: none !important;
  box-shadow: none !important;
}
.preview-mode .element-box.selected {
  border: 2px solid var(--accent) !important;
}
.preview-mode .resize-handle {
  display: none !important;
}
.preview-mode .element-box:hover {
  outline: 1px solid rgba(var(--accent-rgb), 0.3);
}

/* ── 高级设置折叠区域 ── */
.props-advanced {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0;
  background: rgba(255,255,255,0.02);
}

.props-advanced summary {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #95a0b5;
  user-select: none;
}

.props-advanced summary:hover {
  color: #dce4f3;
  background: rgba(255,255,255,0.04);
}

.props-advanced-content {
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
/* 导出 loading 遮罩 */
.export-loading-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.3s;
}
.export-loading-overlay.closing { opacity: 0; pointer-events: none; }
.export-loading-box {
  background: #1f2430; border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
  padding: 32px 40px; min-width: 260px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.export-loading-box .spinner {
  width: 36px; height: 36px; border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent); border-radius: 50%;
  animation: export-spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes export-spin { to { transform: rotate(360deg); } }
.export-loading-box .export-loading-text {
  font-size: 14px; color: #e8ecf4; margin-bottom: 12px;
}
.export-loading-box .export-progress-bar {
  height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1); overflow: hidden;
}
.export-loading-box .export-progress-fill {
  height: 100%; border-radius: 2px; background: var(--accent);
  width: 0%; transition: width 0.3s;
}

/* ── 题号角标 ── */
.q-badge {
  position: absolute; pointer-events: none; z-index: 5;
  white-space: nowrap; user-select: none;
}
.q-badge-cn { /* 中文序号 — 矩形外上方，前带彩色竖条 */
  top: -20px; left: 6px;
  font-size: 17px; font-weight: 700; color: #4a5568;
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
/* 几何竖条（不用 ▊ 字符，避免跨字体被横向拉宽；与 canvas drawBadge 一致） */
.q-badge-cn::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 16px;
  background: #B83A2A;
  margin-right: 4px;
  vertical-align: -2px;
  border-radius: 1px;
}
.q-badge-bubble { /* 胶囊气泡 — 与中文序号同字号 */
  top: -20px; left: 6px;
  font-size: 17px; font-weight: 700; color: #4a5568;
  background: #edf2f7; padding: 2px 14px;
  border-radius: 11px;
  font-family: "Microsoft YaHei", sans-serif;
}
.q-badge-watermark { /* 大号衬线水印 — 完全在矩形外 */
  top: -30px; left: 6px;
  font-size: 36px; font-weight: 900; color: rgba(0,0,0,0.15);
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1;
}

/*
 * 画布难度：贴题号右侧（JS 设 left），五星 + 绿/橙/红色相三档
 * t1 = 易/较易(1–2) 绿 · t2 = 中档/较难(3–4) 橙 · t3 = 难(5) 红
 * 仅编辑 DOM；PDF 导出不画此元素
 */
.q-diff-badge {
  position: absolute;
  pointer-events: auto;
  z-index: 6;
  /* 默认靠左；有题号时由 positionDiffBadgeNearNumber 改 left */
  top: -20px;
  left: 6px;
  right: auto;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  /* 默认 = 中档橙 */
  color: #9a6b2f;
  background: rgba(255, 248, 235, 0.96);
  border: 1px solid rgba(190, 150, 100, 0.4);
  border-radius: 8px;
  padding: 2px 7px;
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.5px;
  cursor: default;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
/* t1 偏易：绿 */
.q-diff-badge--t1 {
  color: #2f6b45;
  background: rgba(236, 250, 240, 0.95);
  border-color: rgba(110, 160, 130, 0.45);
  font-weight: 500;
}
/* t2 中等：橙 */
.q-diff-badge--t2 {
  color: #9a6b2f;
  background: rgba(255, 248, 235, 0.96);
  border-color: rgba(190, 150, 100, 0.45);
}


/* t3 难：红 */
.q-diff-badge--t3 {
  color: #9b3a3a;
  background: rgba(255, 240, 240, 0.98);
  border-color: rgba(180, 100, 100, 0.5);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(180, 100, 100, 0.08);
}
.q-diff-badge:hover {
  filter: brightness(0.96);
}

/* 题卡库列表：星+中文，绿/橙/红（深色侧栏略提亮） */
.q-diff-tag {
  font-size: 11px !important;
  letter-spacing: 0.3px;
  background: rgba(190, 150, 100, 0.18) !important;
  color: #e0c9a4 !important;
}
.q-diff-tag--t1 {
  background: rgba(110, 160, 130, 0.16) !important;
  color: #b8dcc4 !important;
  font-weight: 400 !important;
}
.q-diff-tag--t2 {
  background: rgba(190, 150, 100, 0.2) !important;
  color: #e0c9a4 !important;
  font-weight: 500 !important;
}
.q-diff-tag--t3 {
  background: rgba(180, 100, 100, 0.22) !important;
  color: #f0b8b8 !important;
  font-weight: 700 !important;
  border: 1px solid rgba(200, 120, 120, 0.25);
}

.badge-style-bar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.badge-style-bar label { font-size: 11px; color: #95a0b5; white-space: nowrap; }
.badge-style-bar select {
  flex: 1; padding: 5px 6px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #141922; color: #edf2fb; font-size: 12px;
}

/* 侧栏两列紧凑布局 */
.sidebar-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}
.sidebar-field { min-width: 0; }
.sidebar-field .meta-label { margin-top: 0; }

/* 作业分类元数据 */
.meta-form { display: flex; flex-direction: column; gap: 6px; }
.meta-label {
  font-size: 11px; color: #95a0b5; margin-top: 4px;
  display: flex; align-items: baseline; gap: 6px;
}
.meta-hint { font-size: 10px; color: #6b7588; font-weight: 400; }
/* 难度自动归入：一行轻提示，无按钮 */
.paper-diff-hint {
  font-size: 11px;
  color: #8a95a8;
  line-height: 1.35;
  padding: 2px 0 0;
}
.meta-select, .meta-input {
  width: 100%; padding: 6px 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #141922; color: #edf2fb; font-size: 12px;
  box-sizing: border-box;
}

/* 窄屏顶栏轻量防护（与侧栏折叠配合；不改功能） */
@media (max-width: 1180px) {
  .bc-brand, .bc-version, .bc-sep, .bc-current { display: none; }
  .topbar { padding: 6px 10px; gap: 8px; }
  .top-actions { gap: 4px; }
  .tb-btn { padding: 6px 8px; font-size: 11px; }
  .filename-wrap.compact input { width: 100px; }
  #assignmentIdInput { width: 40px !important; }
}
@media (max-width: 900px) {
  .top-actions .sep { display: none; }
  #btnSyncTemplate,
  #btnToggleAnswer { display: none; }
  .dpi-group { display: none; }
}
