:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-border: #e5e7eb;
  --rail-bg: #ffffff;
  --rail-active: #8b3dff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #8b3dff;
  --canvas-bg: #eef0f4;
  --topbar-bg: #ffffff;
  --topbar-border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }

.editor-app { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }

.editor-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: var(--topbar-bg); color: var(--text);
  border-bottom: 1px solid var(--topbar-border); box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-center { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; flex: 1; }
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-divider { width: 1px; height: 22px; background: #e5e7eb; flex-shrink: 0; }
.design-name-field { display: flex; align-items: center; max-width: min(280px, 32vw); }
.design-name-input {
  width: 100%; min-width: 140px; max-width: 280px;
  border: 1px solid #d1d5db; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  font-family: inherit; color: #374151; background: #f9fafb;
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.design-name-input::placeholder { color: #9ca3af; font-weight: 500; }
.design-name-input:hover { border-color: #c4b5fd; background: #fff; }
.design-name-input:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 61, 255, .12);
}
.save-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent;
  transition: opacity .3s;
}
.save-badge.pending { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.save-badge.saving { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.save-badge.saved { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.save-badge.error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; cursor: pointer; }
.save-badge.fade { opacity: .55; }

.page-tab {
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.page-tab.active { border-color: var(--accent); color: var(--accent); background: rgba(139,61,255,.08); }
.page-tab.saved::after { content: " ✓"; color: #059669; }

.btn {
  border: none; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-ghost { background: transparent; color: #374151; text-decoration: none; display: inline-flex; align-items: center; border: 1px solid transparent; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; line-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:disabled { opacity: .4; }
.btn:hover { opacity: .92; }

/* Canva 式文字工具栏 */
.text-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--topbar-border);
  min-height: 48px;
}
.text-toolbar[hidden] { display: none; }
.tb-group { display: flex; align-items: center; gap: 4px; }
.tb-divider { width: 1px; height: 24px; background: #e5e7eb; margin: 0 4px; }
.tb-select, .tb-size-input {
  border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 8px; font-size: 13px; background: #fff;
}
.tb-font { min-width: 120px; }
.tb-size-input { width: 52px; text-align: center; }
.tb-icon {
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  width: 32px; height: 32px; cursor: pointer; font-size: 14px; color: #374151;
}
.tb-icon:hover { background: #f3f4f6; }
.tb-icon.active { background: rgba(139,61,255,.12); color: var(--accent); border-color: rgba(139,61,255,.25); }
.tb-color-wrap { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.tb-color-a { font-weight: 700; font-size: 16px; padding: 4px 8px; }
.tb-color-wrap input[type="color"] { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.editor-main { flex: 1; display: flex; min-height: 0; }

.editor-rail {
  width: 72px; background: var(--rail-bg); display: flex; flex-direction: column;
  align-items: center; padding: 12px 0; gap: 4px; flex-shrink: 0;
  border-right: 1px solid var(--panel-border);
}
.rail-btn {
  width: 56px; border: none; background: transparent; color: #6b7280;
  border-radius: 10px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.rail-btn:hover { background: #f3f4f6; color: #111; }
.rail-btn.active { background: rgba(139,61,255,.1); color: var(--accent); }
.rail-icon { font-size: 18px; line-height: 1; }
.rail-label { font-size: 10px; }

.editor-panel {
  width: 280px; background: var(--panel); border-right: 1px solid var(--panel-border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.panel-search { padding: 12px; border-bottom: 1px solid var(--panel-border); background: #fafafa; }
.panel-search input {
  width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; background: #fff;
}
.panel-body { flex: 1; overflow-y: auto; padding: 12px; }

.editor-canvas-area {
  flex: 1; display: flex; flex-direction: column; align-items: stretch;
  background: var(--canvas-bg); min-width: 0; padding: 16px 20px;
}
.canvas-toolbar { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-align: center; flex-shrink: 0; }

.pages-scroller {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: center;
  gap: 0; padding-bottom: 24px; min-height: 0;
}

.page-block {
  width: min(100%, calc(var(--canvas-w, 540px) + 48px));
  margin-bottom: 8px;
}
.page-block.active .page-canvas-mount { display: block; }
.page-block:not(.active) .page-canvas-mount { display: none; }

.page-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 4px; margin-bottom: 6px;
}
.page-bar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.page-num { font-size: 13px; font-weight: 600; color: #374151; white-space: nowrap; }
.page-bar-sep { color: #9ca3af; }
.page-title-input {
  flex: 1; min-width: 0; border: none; background: transparent;
  font-size: 13px; color: #6b7280; outline: none; padding: 4px 0;
}
.page-title-input:focus { color: #111; border-bottom: 1px solid var(--accent); }
.page-bar-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.page-act {
  border: none; background: transparent; color: #6b7280;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.page-act:hover:not(:disabled) { background: #e5e7eb; color: #111; }
.page-act:disabled { opacity: .35; cursor: default; }
.page-act.active { background: rgba(139,61,255,.12); color: var(--accent); }
.page-act-icon { width: 18px; height: 18px; display: block; }
.page-bar-divider { width: 1px; height: 20px; background: #d1d5db; margin: 0 4px; }
.page-lock-badge {
  font-size: 11px; color: #92400e; background: #fef3c7;
  border: 1px solid #fcd34d; border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.page-block.page-locked .page-canvas-mount { outline: 2px dashed #fcd34d; outline-offset: 2px; border-radius: 2px; }

.page-canvas-mount {
  display: flex; justify-content: center;
  width: var(--canvas-w, 540px); margin: 0 auto;
}

.page-thumb-btn {
  display: block; width: var(--canvas-w, 540px); margin: 0 auto;
  border: 2px solid transparent; border-radius: 4px; padding: 0;
  background: #fff; cursor: pointer; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.page-thumb-btn:hover { border-color: var(--accent); }
.page-thumb-btn img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.page-thumb-empty {
  width: 100%; aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #9ca3af; font-size: 14px; background: #fff; padding: 16px; text-align: center;
}
.page-thumb-empty strong { color: #6b7280; font-size: 15px; }
.page-thumb-empty span { font-size: 13px; line-height: 1.4; }
.page-thumb-btn.drop-target,
.page-block.tpl-drop-target .page-thumb-btn,
.page-block.tpl-drop-target .page-canvas-mount {
  outline: 3px dashed var(--accent);
  outline-offset: 2px;
}

.page-add-wrap {
  width: min(100%, calc(var(--canvas-w, 540px) + 48px));
  margin-top: 4px;
}
.page-add-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  padding: 14px 16px; border: 1px dashed #cbd5e1; border-radius: 10px;
  background: rgba(255,255,255,.7); color: #64748b; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s;
}
.page-add-btn:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.page-add-label { font-weight: 500; }

.canvas-wrap {
  --canvas-w: 540px; --canvas-h: 720px;
  position: relative;
  width: var(--canvas-w); height: var(--canvas-h);
  box-shadow: 0 4px 24px rgba(0,0,0,.08); border-radius: 2px; overflow: hidden;
  background: #fff;
}
.canvas-wrap[hidden] { display: none !important; }
.canvas-wrap > div { width: 100% !important; height: 100% !important; }
.konva-text-editor {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.konva-text-editor.editing-table-cell {
  outline: none !important;
  box-shadow: inset 0 0 0 2px #8b3dff;
}

.muted { color: var(--muted); font-size: 13px; }

.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl-card {
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; cursor: grab; background: #fff;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.tpl-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(139,61,255,.12); }
.tpl-card:active { cursor: grabbing; }
.tpl-card.dragging { opacity: 0.55; border-color: var(--accent); }
.tpl-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #f3f4f6; }

.tpl-apply-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
}
.tpl-apply-modal {
  position: relative; width: min(420px, calc(100vw - 32px));
  background: #fff; border-radius: 16px; padding: 28px 28px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
}
.tpl-apply-close {
  position: absolute; top: 12px; right: 14px;
  border: none; background: transparent; font-size: 22px; line-height: 1;
  color: #9ca3af; cursor: pointer; padding: 4px 8px;
}
.tpl-apply-close:hover { color: #374151; }
.tpl-apply-title {
  margin: 0 0 20px; font-size: 18px; font-weight: 700; color: #111827; text-align: center;
}
.tpl-apply-skip {
  display: flex; align-items: center; gap: 8px; margin-bottom: 24px;
  font-size: 14px; color: #4b5563; cursor: pointer; user-select: none;
}
.tpl-apply-skip input { width: 16px; height: 16px; accent-color: var(--accent); }
.tpl-apply-actions { display: flex; gap: 12px; }
.tpl-apply-actions .btn { flex: 1; justify-content: center; padding: 10px 16px; }

.mat-group { margin-bottom: 16px; }
.mat-group-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: #374151; }
.mat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mat-item {
  border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; cursor: grab; background: #fff;
}
.mat-item:hover { border-color: var(--accent); }
.mat-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.mat-item span { display: block; font-size: 10px; padding: 4px; text-align: center; color: #666; }

.font-catalog-title { font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.tb-font-group { position: relative; min-width: 140px; }

.font-picker-wrap { position: relative; }
.font-picker-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; min-width: 132px;
  border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 10px; background: #fff;
  cursor: pointer; font-size: 13px; text-align: left;
}
.font-picker-btn:hover { border-color: var(--accent); }
.font-picker-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-picker-caret { color: var(--muted); font-size: 10px; }
.font-picker-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1000;
  width: 280px; max-height: 360px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.12);
  display: flex; flex-direction: column; overflow: hidden;
}
.font-picker-pop[hidden] { display: none !important; }
.font-picker-search {
  border: none; border-bottom: 1px solid #e5e7eb; padding: 10px 12px; font-size: 13px; outline: none;
}
.font-picker-list { overflow-y: auto; flex: 1; padding: 6px 0; }
.font-picker-cat {
  padding: 8px 12px 4px; font-size: 11px; font-weight: 700; color: var(--muted);
}
.font-picker-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; border: none; background: transparent; padding: 8px 12px; cursor: pointer; text-align: left;
}
.font-picker-row:hover, .font-picker-row.active { background: rgba(139,61,255,.08); }
.font-picker-row-name { font-size: 15px; color: #111; line-height: 1.2; }
.font-picker-row-sample { font-size: 12px; color: var(--muted); }
.font-picker-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

.font-panel-wrap { margin-top: 8px; }
.font-panel-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px;
}
.font-panel-tabs button {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 999px;
  padding: 4px 10px; font-size: 11px; cursor: pointer;
}
.font-panel-tabs button.active { border-color: var(--accent); color: var(--accent); background: rgba(139,61,255,.08); }
.font-panel-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.font-panel-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 1px solid transparent; border-radius: 8px; padding: 10px 12px;
  background: #fff; cursor: pointer; text-align: left; width: 100%;
}
.font-panel-row:hover { border-color: #e5e7eb; background: #fafafa; }
.font-panel-name { font-size: 16px; color: #111; }
.font-panel-sample { font-size: 12px; color: var(--muted); }

.font-catalog { display: flex; flex-direction: column; gap: 2px; }

.text-presets { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn-add-textbox {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s, transform .1s;
}
.btn-add-textbox:hover { opacity: .92; }
.btn-add-textbox:active { transform: scale(.98); }
.btn-add-textbox-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255,255,255,.2);
  font-weight: 700;
  font-size: 13px;
}
.text-preset-btn {
  text-align: left; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; cursor: pointer; font-family: inherit;
}
.text-preset-btn:hover { border-color: var(--accent); }
.text-preset-btn .preset-title { font-weight: 900; font-size: 22px; color: #1a1a1a; }
.text-preset-btn .preset-sub { font-size: 14px; color: #666; margin-top: 4px; }
.text-preset-btn .preset-body { font-size: 13px; color: #333; margin-top: 4px; }

.panel-empty { text-align: center; padding: 24px 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.panel-hint { margin: 0 0 12px; font-size: 12px; }

.layer-list { display: flex; flex-direction: column; gap: 6px; }
.layer-row {
  display: flex; align-items: center; gap: 6px; padding: 8px;
  border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; cursor: pointer;
}
.layer-row.active { border-color: var(--accent); background: rgba(139,61,255,.06); }
.layer-icon { flex-shrink: 0; font-size: 14px; }
.layer-name { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-actions { display: flex; gap: 2px; flex-shrink: 0; }
.layer-actions button {
  border: 1px solid #d1d5db; background: #fff; border-radius: 4px; width: 22px; height: 22px;
  font-size: 11px; cursor: pointer; padding: 0;
}
.layer-actions button:hover { border-color: var(--accent); }
.layer-toolbar { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--panel-border); }
.layer-template-note {
  margin-top: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.5;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
}

.canvas-wrap.drop-active {
  outline: 3px dashed var(--accent);
  outline-offset: 4px;
}
.mat-item.dragging { opacity: 0.55; border-color: var(--accent); }
.mat-item:active { cursor: grabbing; }

#btnUndo:disabled, #btnRedo:disabled { opacity: 0.35; cursor: not-allowed; }

.muted-link { color: var(--muted) !important; font-size: 12px; margin-left: 4px; }
.mat-upload-bar { margin-bottom: 12px; }
.mat-upload-btn { display: inline-flex; align-items: center; cursor: pointer; width: 100%; justify-content: center; }

.table-panel { display: flex; flex-direction: column; gap: 10px; }
.panel-subsection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.table-op-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.table-op-grid button {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  cursor: pointer;
}
.table-op-grid button:hover { border-color: var(--accent); }
.table-op-grid button:disabled { opacity: .45; cursor: not-allowed; }

/* 右键上下文菜单 */
.ctx-menu {
  position: fixed;
  z-index: 10000;
  min-width: 220px;
  max-width: 280px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
}
.ctx-submenu { z-index: 10001; }
.ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 13px;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  gap: 12px;
}
.ctx-item:hover:not(:disabled) { background: #f3f4f6; }
.ctx-item:disabled { opacity: 0.4; cursor: not-allowed; }
.ctx-item.ctx-danger span:first-child { color: #dc2626; }
.ctx-item kbd {
  font-size: 11px;
  color: #9ca3af;
  font-family: inherit;
  font-weight: 400;
}
.ctx-sep { height: 1px; background: #e5e7eb; margin: 4px 0; }
.ctx-has-sub .ctx-arrow { color: #9ca3af; font-size: 14px; }

.editor-body-row { display: flex; flex: 1; min-height: 0; }
.studio-panel {
  width: var(--studio-width, 320px);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width .2s;
}
.studio-panel.resizing { transition: none; }
.studio-panel.collapsed { width: 0; overflow: hidden; border: none; }
.studio-panel.collapsed .studio-resize-handle { display: none; }
.studio-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 20;
  touch-action: none;
}
.studio-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 48px;
  border-radius: 2px;
  background: transparent;
  transition: background .15s;
}
.studio-resize-handle:hover::after,
.studio-panel.resizing .studio-resize-handle::after {
  background: var(--accent);
}
.studio-panel-body { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; min-height: 0; }
.studio-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-shrink: 0; }
.studio-tab {
  flex: 1; border: 1px solid #e5e7eb; background: #f9fafb; border-radius: 6px;
  padding: 6px 4px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.studio-tab.active { border-color: var(--accent); color: var(--accent); background: rgba(139,61,255,.08); }
.studio-tab-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.studio-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.studio-msgs { flex: 1; overflow-y: auto; min-height: 120px; margin-bottom: 8px; }
.studio-msg { font-size: 12px; padding: 6px 8px; margin-bottom: 6px; border-radius: 8px; white-space: pre-wrap; }
.studio-msg-user { background: #ede9fe; }
.studio-msg-assistant { background: #f3f4f6; }
.studio-input-row { display: flex; flex-direction: column; gap: 6px; }
.studio-input { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px; font-family: inherit; font-size: 12px; resize: vertical; }
.studio-copy-body { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px; font-size: 12px; font-family: inherit; }
.studio-btn-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.studio-status { font-size: 11px; margin-bottom: 6px; }
.studio-coach {
  position: fixed; bottom: 24px; left: calc(var(--studio-width, 320px) + 20px); z-index: 9999;
  background: #fff; border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 16px; max-width: 280px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  font-size: 13px;
}
.studio-coach ol { margin: 8px 0; padding-left: 18px; }
.materials-highlight { animation: matPulse 1s ease 2; }
@keyframes matPulse { 0%,100% { box-shadow: none; } 50% { box-shadow: inset 0 0 0 2px var(--accent); } }

/* 我的项目 */
.projects-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.projects-panel-title { font-size: 14px; font-weight: 700; }
.projects-panel-meta { font-size: 11px; }
.projects-create-btn { flex-shrink: 0; }
.projects-grid {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
.project-card {
  border: 1px solid var(--panel-border); border-radius: 10px; background: #fff;
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.project-card:hover { border-color: #c4b5fd; box-shadow: 0 4px 12px rgba(139,61,255,.08); }
.project-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(139,61,255,.25); }
.project-thumb {
  display: block; width: 100%; aspect-ratio: 3 / 4; border: none; padding: 0;
  background: #f3f4f6; cursor: pointer; overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-thumb-placeholder {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-size: 11px; color: var(--muted);
}
.project-card-body { padding: 8px 10px 4px; }
.project-card-title {
  font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-card-meta { font-size: 11px; margin-top: 2px; }
.project-card-actions {
  display: flex; gap: 4px; padding: 4px 8px 8px; justify-content: flex-end;
}
.project-delete-btn { color: #b91c1c !important; }
.project-delete-btn:hover { background: #fef2f2 !important; }
