* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f9f9fa; color: #555;
}
body { display: flex; flex-direction: column; }
/* 全屏模式：隐藏顶栏和侧栏，画布填满视口 */
body.fullscreen-mode .topbar,
body.fullscreen-mode .main-menu,
body.fullscreen-mode .toolbar-left,
body.fullscreen-mode .sidebar,
body.fullscreen-mode #rulerX,
body.fullscreen-mode #rulerY,
body.fullscreen-mode #rulerCorner,
body.fullscreen-mode #coordReadout,
body.fullscreen-mode #draftBanner { display: none !important; }
body.fullscreen-mode main { flex: 1 1 100%; max-width: 100%; padding: 0; }
body.fullscreen-mode .stage-wrap { width: 100%; height: 100%; }
.exit-fullscreen {
  position: fixed; top: 12px; right: 12px; z-index: 9999;
  background: rgba(0,0,0,0.65); color: #fff; border: none; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.exit-fullscreen:hover { background: rgba(0,0,0,0.8); }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px; background: #fff;
  border-bottom: 1px solid #c4c4c4; flex: none; height: 44px;
}
.brand { font-weight: 700; font-size: 15px; color: #d9a12b; white-space: nowrap; margin-right: 4px; letter-spacing: .5px; text-shadow: 0 1px 0 rgba(224,169,47,.35); }
.tools { display: flex; gap: 6px; align-items: center; flex: 1; }
.tools .sep { width: 1px; height: 22px; background: #c4c4c4; flex: none; }

/* ---------- 主菜单栏 ---------- */
.main-menu {
  display: flex; align-items: stretch; height: 30px;
  background: #f9f9fa; border-bottom: 1px solid #c4c4c4;
  padding: 0 8px; flex: none; user-select: none;
  gap: 2px;
}
.menu-section { position: relative; }
.menu-trigger {
  padding: 5px 12px; font-size: 12px; color: #555;
  cursor: pointer; border-radius: 4px; white-space: nowrap;
  display: flex; align-items: center; gap: 3px;
}
.menu-trigger:hover { background: #eaeaea; }
.menu-trigger.open { background: #c4c4c4; }
.menu-trigger .arr { font-size: 8px; color: #aaa; }
.menu-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 180px; background: #fff; border: 1px solid #c4c4c4;
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px 0; z-index: 100;
}
.menu-dropdown.open { display: block; }
.menu-item {
  padding: 6px 14px; font-size: 12px; color: #555;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.menu-item:hover { background: #cfe0ff; color: #17357d; }
.menu-sep { height: 1px; background: #c4c4c4; margin: 3px 8px; }

/* 模块导航下拉（宽版分类菜单） */
.menu-dropdown-wide { min-width: 340px; padding: 6px 8px; }
.menu-cat {
  font-size: 10px; font-weight: 700; color: #2f6fed;
  padding: 4px 6px 2px; margin-top: 4px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.menu-cat:first-child { margin-top: 0; }
.menu-grid-row { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 2px; }
.menu-grid-row .menu-item {
  padding: 4px 8px; font-size: 11px; border-radius: 4px;
  color: #555; background: #f4f4f5;
  flex: 0 0 auto;
}
.menu-grid-row .menu-item:hover { background: #cfe0ff; color: #17357d; }

/* 面板闪烁动画（模块菜单跳转时使用） */
.panel.flash { animation: flashMod 1.3s ease-out; border-radius: 8px; }
@keyframes flashMod {
  0%   { box-shadow: 0 0 0 3px #2f6fed, 0 6px 18px rgba(224,169,47,.25); background: #e8f0ff; }
  100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}

/* ---------- 前景/背景色 ---------- */
.fg-bg-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fg-bg-stack { position: relative; width: 48px; height: 48px; flex: none; }
.fg-bg-swatch {
  position: absolute; width: 36px; height: 36px;
  border: 2px solid #fff; border-radius: 4px;
  box-shadow: 0 0 0 1px #bbb; cursor: pointer;
}
.fg-swatch { top: 0; left: 0; z-index: 2; }
.bg-swatch { bottom: 0; right: 0; z-index: 1; }
.fg-swatch:hover, .bg-swatch:hover { box-shadow: 0 0 0 2px #2f6fed, 0 0 0 3px #fff; }
.fg-bg-actions { display: flex; flex-direction: column; gap: 4px; }
.fg-bg-hex { font-size: 12px; color: #5d5d5d; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 66px; }

.btn {
  display: inline-block; padding: 7px 12px; font-size: 13px;
  border: 1px solid #c4c4c4; background: #fff; border-radius: 6px;
  cursor: pointer; user-select: none; color: #555; line-height: 1.2;
}
.btn:hover { background: #f0f0f0; }
.btn.active { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.btn.primary { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 4px 8px; font-size: 12px; border: 1px solid #c4c4c4; background: #fff; border-radius: 5px; cursor: pointer; }
.btn-sm:hover:not(:disabled) { background: #f0f0f0; }
.btn-sm:disabled { opacity: .45; cursor: not-allowed; }

.crop-actions { display: inline-flex; gap: 6px; }

.zoom-group { display: inline-flex; align-items: center; gap: 4px; }
.zoom-label { font-size: 12px; min-width: 42px; text-align: center; color: #5d5d5d; }
.quality-label { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; color: #5d5d5d; }
.quality-label input { width: 90px; }
.hint { font-size: 11px; color: #aaa; margin: 6px 0 0; }
.field { font-size: 12px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.gradient-preview { width: 100%; height: 20px; border-radius: 4px; border: 1px solid #c4c4c4; display: block; }
.field.row-inline { flex-direction: row; align-items: center; gap: 6px; }
.sub {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px; margin: 2px 0 10px; background: #f4f4f5; border-radius: 6px;
  font-size: 11px; color: #5d5d5d;
}
.sub input[type="color"] { width: 34px; height: 24px; padding: 0; border: 1px solid #c4c4c4; border-radius: 4px; }
.sub input[type="number"] { width: 56px; padding: 3px 5px; border: 1px solid #c4c4c4; border-radius: 4px; }
.panel hr { border: none; border-top: 1px dashed #c4c4c4; margin: 10px 0; }

.draft-banner {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: #e8f0ff; color: #17357d; font-size: 13px; border-bottom: 1px solid #c4c4c4;
}

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

/* ---------- 左侧工具条（两列布局） ---------- */
.toolbar-left {
  width: 72px; flex: none;
  background: linear-gradient(180deg, #fbfbfc 0%, #f1f1f3 100%);
  border-right: 1px solid #dcdce0;
  box-shadow: 1px 0 0 #fff inset;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 5px; gap: 2px; overflow-y: auto;
  z-index: 10;
}
.tl-group {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; width: 100%;
}
.tl-sep { width: 42px; height: 1px; background: linear-gradient(90deg, transparent, #d2d2d6, transparent); margin: 5px 0; flex: none; }
.tl-btn {
  width: 100%; height: 34px; padding: 0;
  border: 1px solid transparent; background: transparent;
  border-radius: 8px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: #5b5b62; position: relative;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease, transform .08s ease;
}
/* 图标：统一线性风格，使用 currentColor 跟随主题 */
.tl-btn svg {
  width: 21px; height: 21px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.tl-btn:hover { background: #ffffff; color: #2b2b30; box-shadow: 0 1px 3px rgba(0,0,0,.10); }
.tl-btn:active { transform: translateY(1px); }
.tl-btn.active {
  background: linear-gradient(180deg, #cfe0ff, #aecbff);
  color: #17357d;
  border-color: #7fb0ff;
  box-shadow: 0 1px 2px rgba(47,111,237,.35), inset 0 1px 0 rgba(255,255,255,.6);
}
.tl-btn.active:hover { background: linear-gradient(180deg, #c4d9ff, #a3c4ff); }
/* 激活态右上角小圆点指示 */
.tl-btn.active::after {
  content: ''; position: absolute; right: 4px; top: 4px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #e0a92f; box-shadow: 0 0 0 1.5px #fff;
}
.tl-btn.tl-small { color: #b0b0b6; }
.tl-btn.tl-small:hover { color: #555; background: #fff; }

/* 工具条美化滚动 */
.toolbar-left::-webkit-scrollbar { width: 0; }
.toolbar-left:hover::-webkit-scrollbar { width: 3px; }
.toolbar-left::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 2px; }
/* 网格 / 折叠按钮激活态（与工具激活态统一） */
#gridToggle.active, #tlCollapseBtn.active {
  background: linear-gradient(180deg, #cfe0ff, #aecbff);
  color: #17357d; border-color: #7fb0ff;
  box-shadow: 0 1px 2px rgba(47,111,237,.35), inset 0 1px 0 rgba(255,255,255,.6);
}

.canvas-area {
  flex: 1; overflow: hidden; position: relative; background:
    linear-gradient(45deg, #e8e8e9 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(-45deg, #e8e8e9 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(45deg, transparent 75%, #e8e8e9 75%) -10px 0/20px 20px,
    linear-gradient(-45deg, transparent 75%, #e8e8e9 75%) -10px 0/20px 20px,
    #f9f9fa;
}
.stage-wrap { position: absolute; top: 0; left: 0; box-shadow: 0 4px 18px rgba(0,0,0,0.12); background: #fff; transform-origin: 0 0; }
#stage { display: block; }
.text-editor {
  position: absolute; z-index: 4; display: none; margin: 0; padding: 2px 4px;
  border: 2px dashed #2f6fed; border-radius: 4px; background: rgba(255,255,255,0.82);
  resize: none; overflow: hidden; outline: none; line-height: 1.2;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); transform-origin: 0 0;
}
.empty-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #aaa; font-size: 14px; pointer-events: none; text-align: center; padding: 20px;
}
.ruler { position: absolute; z-index: 5; background: #f0f0f0; box-sizing: border-box; }
.ruler-x { top: 0; left: 20px; right: 0; height: 20px; border-bottom: 1px solid #c4c4c4; cursor: row-resize; }
.ruler-y { top: 20px; left: 0; bottom: 0; width: 20px; border-right: 1px solid #c4c4c4; cursor: col-resize; }
.ruler-corner { position: absolute; top: 0; left: 0; width: 20px; height: 20px; background: #e8e8e9; border-right: 1px solid #c4c4c4; border-bottom: 1px solid #c4c4c4; z-index: 6; }
.ruler canvas { display: block; }
.coord-readout {
  position: absolute; right: 8px; bottom: 8px; z-index: 6; background: rgba(255,255,255,0.88);
  border: 1px solid #c4c4c4; padding: 2px 7px; font-size: 11px; color: #555;
  border-radius: 3px; pointer-events: none; font-variant-numeric: tabular-nums;
}

.sidebar {
  width: 300px; flex: none; background: #fff; border-left: 1px solid #c4c4c4;
  overflow-y: auto; padding: 10px 12px 40px;
  transition: width 0.22s ease, padding 0.22s ease, opacity 0.22s ease;
}
.sidebar.collapsed { width: 0; padding: 10px 0; overflow: hidden; opacity: 0; min-width: 0; }
.panel { margin-bottom: 14px; scroll-margin-top: 140px; }
.panel h3 {
  margin: 0 0 8px; font-size: 13px; color: #555;
  border-left: 3px solid #2f6fed; padding-left: 8px;
  cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.panel h3::after {
  content: '▾'; font-size: 10px; color: #aaa; margin-left: 6px;
  transition: transform 0.2s;
}
.panel h3:hover { color: #2f6fed; }
.panel h3:hover::after { color: #2f6fed; }
.panel.collapsed h3::after { transform: rotate(-90deg); }
.panel.collapsed > *:not(h3) { display: none; }
.panel.collapsed { margin-bottom: 4px; }


/* 自定形状库 */
.shape-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.shape-thumb {
  width: 48px; height: 48px; padding: 2px; border: 1px solid #c4c4c4; background: #fff;
  border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.shape-thumb:hover { border-color: #a9bff0; }
.shape-thumb.active { border-color: #2f6fed; box-shadow: 0 0 0 2px rgba(224,169,47,.25); }
.shape-thumb canvas { width: 44px; height: 44px; display: block; }
.shape-cell { width: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.shape-cell canvas { width: 36px; height: 36px; border: 1px solid #c4c4c4; border-radius: 6px; background: #fff; display: block; }
.shape-cell:hover canvas { border-color: #a9bff0; }
.shape-cell span { font-size: 11px; color: #5d5d5d; }
.dyn-block { margin: 6px 0; border: 1px solid #c4c4c4; border-radius: 6px; padding: 4px 8px; background: #fafafa; }
.dyn-block summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #555; user-select: none; }
.dyn-block .field { margin: 5px 0; }

/* 路径布尔运算 */
.bool-row { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #c4c4c4; }
.bool-row .row { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }

.layer-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.slider-label { font-size: 12px; display: flex; align-items: center; gap: 8px; }
.slider-label input { flex: 1; }

.layer-list { display: flex; flex-direction: column; gap: 6px; }
.layer-filter { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 12px; border: 1px solid #c4c4c4; border-radius: 4px; outline: none; margin-bottom: 6px; }
.layer-filter:focus { border-color: #2f6fed; }

.align-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.align-grid .btn { font-size: 12px; padding: 6px 4px; justify-content: center; }
.layer-item {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border: 1px solid #c4c4c4; border-radius: 6px; cursor: pointer; background: #fcfcfc;
}
.layer-item.active { border-color: #2f6fed; background: #e6efff; }
.layer-item.selected { border-color: #a9bff0; background: #eef3ff; }
.layer-item.selected.active { border-color: #2f6fed; background: #d6e4ff; font-weight: 600; }
.layer-vis { cursor: pointer; font-size: 14px; }
.layer-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-ops { display: flex; gap: 4px; }
.layer-ops button { border: none; background: transparent; cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 4px; }
.layer-ops button:hover { background: #c4c4c4; }

.history-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.history-item {
  padding: 6px 8px; border: 1px solid #c4c4c4; border-radius: 6px; cursor: pointer;
  background: #fcfcfc; font-size: 12px; color: #5d5d5d;
}
.history-item:hover { background: #f0f0f0; }
.history-item.active { border-color: #2f6fed; background: #e6efff; color: #17357d; font-weight: 600; }

/* 度量工具 */
.measure-readout {
  font-size: 12px; color: #ad1457; background: #fde7f3; border: 1px solid #f8bbd0;
  border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; word-break: break-all;
}

/* 历史快照 */
.snap-list { display: flex; flex-direction: column; gap: 6px; }
.snap-item { display: flex; gap: 8px; align-items: center; padding: 6px; border: 1px solid #c4c4c4; border-radius: 6px; background: #fcfcfc; }
.snap-thumb { width: 56px; height: 56px; object-fit: contain; border: 1px solid #c4c4c4; border-radius: 4px; background: #fff; }
.snap-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.snap-name { font-size: 12px; font-weight: 600; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snap-btns { display: flex; gap: 6px; }

/* 动作面板 */
.action-select { margin-top: 6px; }
.action-status { font-size: 11px; color: #5d5d5d; margin-top: 6px; min-height: 14px; word-break: break-all; }
#actionRecBtn.rec { background: #e53935; color: #fff; border-color: #e53935; }

textarea, select, input[type="number"] {
  width: 100%; padding: 6px 8px; border: 1px solid #c4c4c4; border-radius: 6px;
  font-size: 13px; font-family: inherit;
}
.row { display: flex; gap: 8px; margin: 8px 0; }
.row label { flex: 1; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.align-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 8px 0; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.filter-grid .small { font-size: 11px; display: flex; align-items: center; gap: 4px; }
.filter-grid input { width: 56px; }

/* 滤镜列表（分组布局） */
.filter-list { display: flex; flex-direction: column; gap: 4px; }
.filter-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 8px; background: #f4f4f5; border-radius: 5px;
}
.filter-item:hover { background: #e8e8e8; }
.filter-name { font-size: 12px; color: #555; min-width: 64px; font-weight: 500; }
.filter-ops { display: flex; align-items: center; gap: 4px; }
.filter-ops input {
  width: 52px; padding: 3px 5px; border: 1px solid #c4c4c4; border-radius: 4px;
  font-size: 12px; font-family: inherit;
}
.filter-ops .btn { min-width: 30px; text-align: center; padding: 4px 8px; }
.filter-ops .btn[data-dir="-1"] { background: #fff; color: #c62828; border-color: #ef9a9a; }
.filter-ops .btn[data-dir="-1"]:hover { background: #ffebee; }
.filter-ops .btn[data-dir="1"] { background: #fff; color: #17357d; border-color: #a9bff0; }
.filter-ops .btn[data-dir="1"]:hover { background: #e8f0ff; }
.filter-divider { height: 1px; background: #c4c4c4; margin: 2px 0; }
.filter-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 5px 8px; margin-bottom: 6px;
  background: #fff8e1; border: 1px solid #ffd54f; border-radius: 5px;
}
.filter-toolbar.previewing { background: #e3f2fd; border-color: #1565c0; }
.filter-toolbar .row-inline { font-size: 12px; color: #333; cursor: pointer; user-select: none; }
.val { font-size: 12px; color: #555; min-width: 24px; text-align: right; align-self: center; }
#magControls .field input, #wandControls .field input { width: 70px; }
#magControls, #wandControls { flex-wrap: wrap; align-items: flex-end; }

.layer-group { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 4px 0 2px; border: 1px dashed #a9bff0; border-radius: 6px; background: #e8f0ff; font-size: 12px; }
.layer-group.collapsed { background: #eef3ff; }
.group-toggle { cursor: pointer; width: 14px; text-align: center; color: #2f6fed; user-select: none; }
.group-name { flex: 1; font-weight: 600; color: #17357d; user-select: none; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-item.grouped { margin-left: 18px; border-left: 2px solid #a9bff0; }
.layer-item.locked { opacity: .7; }
.layer-thumb { width: 30px; height: 30px; border-radius: 4px; border: 1px solid #c4c4c4; flex: 0 0 auto; background: #fff; }
.layer-item.drag-above { box-shadow: inset 0 2px 0 0 #2f6fed; }
.layer-item.drag-below { box-shadow: inset 0 -2px 0 0 #2f6fed; }
.layer-item.dragging { opacity: .4; }
.layer-group.drag-onto { box-shadow: inset 0 0 0 2px #2f6fed; background: #d6e4ff; }
.layer-group.dragging { opacity: .4; }
.layer-group { cursor: grab; }
.sub-h { margin: 10px 0 6px; font-size: 12px; color: #5d5d5d; font-weight: 600; }
.anchor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 102px; margin: 4px 0 8px; }
.anchor-cell { width: 100%; height: 18px; border: 1px solid #c4c4c4; background: #fff; border-radius: 4px; cursor: pointer; padding: 0; }
.anchor-cell.active { background: #2f6fed; border-color: #2f6fed; }

.hist-canvas { width: 100%; height: 140px; background: #1c1c1c; border-radius: 6px; display: block; margin: 6px 0; }
.hist-channels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.hist-channels .btn { padding: 3px 9px; font-size: 12px; }
.hist-channels .btn.active { background: #2f6fed; color: #fff; border-color: #2f6fed; }

/* 通道面板 */
.channel-list { display: flex; flex-direction: column; gap: 4px; }
.channel-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid transparent; border-radius: 5px; background: #f4f4f5; font-size: 13px; }
.channel-row:hover { background: #e8e8e8; }
.channel-row.active { border-color: #2f6fed; background: #e6efff; }
.channel-row .ch-eye { cursor: pointer; user-select: none; font-size: 14px; line-height: 1; }
.channel-row .ch-name { flex: 1; cursor: pointer; font-weight: 600; }
.channel-row .ch-load { cursor: pointer; user-select: none; font-size: 14px; color: #2f6fed; opacity: 0.8; }
.channel-row .ch-load:hover { opacity: 1; }
.hist-stats { font-size: 12px; color: #5d5d5d; line-height: 1.5; font-variant-numeric: tabular-nums; }

.comp-list { display: flex; flex-direction: column; gap: 6px; }
.comp-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #c4c4c4; border-radius: 6px; background: #fcfcfc; }
.comp-item.active { border-color: #2f6fed; background: #e6efff; }
.comp-name { flex: 1; font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-item.active .comp-name { font-weight: 600; color: #17357d; }
.comp-ops { display: flex; gap: 4px; flex: none; }
.comp-ops .btn { padding: 3px 8px; font-size: 11px; }
.comp-compare { display: flex; align-items: center; gap: 6px; margin: 10px 0 6px; }
.comp-sel { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid #c4c4c4; border-radius: 4px; font-size: 12px; }
.comp-compare .vs { color: #5d5d5d; font-size: 12px; flex: none; }
.tone-sel { width: 100%; padding: 5px 6px; border: 1px solid #c4c4c4; border-radius: 4px; font-size: 12px; margin-bottom: 6px; }

/* 智能对象编辑模态框 */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border-radius: 10px; padding: 20px 22px;
  width: 380px; max-width: 92vw; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.modal-box h3 { margin: 0 0 8px; font-size: 16px; }
.modal-box .row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.smart-preview {
  margin: 10px 0; border: 1px solid #c4c4c4; border-radius: 6px;
  background: #f4f4f5; padding: 8px; text-align: center; max-height: 260px; overflow: auto;
}
.smart-preview img { max-width: 100%; max-height: 240px; display: inline-block; }
#smartInfo { margin: 6px 0 0; }

/* 内容识别缩放模态框 */
.cas-row { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.cas-row label { font-size: 13px; color: #333; display: flex; align-items: center; gap: 6px; }
.cas-input { width: 86px; padding: 5px 7px; border: 1px solid #c4c4c4; border-radius: 5px; font-size: 13px; }
.cas-checks { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: #333; }
.cas-checks label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.cas-progress { margin-top: 14px; }
.cas-bar { height: 8px; background: #e3e3e6; border-radius: 5px; overflow: hidden; }
.cas-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, #4a9cff, #2f6fed); transition: width .12s ease; }
.cas-status { margin-top: 6px; font-size: 12px; color: #666; }
.cas-hint { margin-top: 12px; font-size: 12px; color: #888; line-height: 1.5; }
.ca-modal-box { width: 560px; }
.cas-brush { margin-top: 14px; }
.cas-brush-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; color: #333; }
.cas-brush-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #333; }
.cas-size input[type="range"] { flex: 1; min-width: 90px; }
.cas-size-val { min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.cas-preview-wrap {
  margin-top: 10px; border: 1px solid #c4c4c4; border-radius: 6px;
  background: #f4f4f5; padding: 8px; text-align: center;
}
#caPreview {
  max-width: 100%; max-height: 320px; border-radius: 4px; cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(45deg, #e8e8e9 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(-45deg, #e8e8e9 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(45deg, transparent 75%, #e8e8e9 75%) -10px 0/20px 20px,
    linear-gradient(-45deg, transparent 75%, #e8e8e9 75%) -10px 0/20px 20px,
    #fff;
}
.cas-preview-hint { margin-top: 8px; font-size: 12px; color: #888; text-align: left; line-height: 1.6; }
.cas-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 3px; opacity: .85; }
.cas-dot-protect { background: #ffcd50; box-shadow: 0 0 0 1px #d9a91f; }
.cas-dot-remove { background: #ff5a5a; box-shadow: 0 0 0 1px #d93a3a; }

/* 批处理模态框 */
.batch-modal-box { width: 500px; }
.batch-file-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.batch-count { font-size: 12px; color: #888; }
.batch-opts {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  margin-top: 12px; font-size: 13px; color: #333;
}
.batch-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #333; }
.batch-sub { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #666; cursor: pointer; }
.batch-opt select { width: 120px; }
.batch-str { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #333; }
.batch-str input[type="range"] { width: 90px; }
.batch-str span { min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; }

/* 信息面板 */
.info-box { display: flex; flex-direction: column; gap: 4px; }
.info-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; padding: 4px 8px; background: #f4f4f5; border-radius: 4px;
}
.info-row span { color: #5d5d5d; }
.info-row b { color: #555; font-variant-numeric: tabular-nums; font-weight: 600; }

/* 导航器面板 */
.nav-wrap {
  position: relative; width: 100%; padding-bottom: 72%;
  background:
    linear-gradient(45deg, #e8e8e9 25%, transparent 25%) 0 0/16px 16px,
    linear-gradient(-45deg, #e8e8e9 25%, transparent 25%) 0 0/16px 16px,
    linear-gradient(45deg, transparent 75%, #e8e8e9 75%) 8px 8px/16px 16px,
    linear-gradient(-45deg, transparent 75%, #e8e8e9 75%) 8px 8px/16px 16px,
    #fff;
  border: 1px solid #c4c4c4; border-radius: 6px; overflow: hidden; cursor: crosshair;
}
.nav-canvas, .nav-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: block; image-rendering: pixelated;
}
.nav-overlay { pointer-events: none; }
.nav-zoom-label { display: inline-flex; align-items: center; gap: 4px; flex: 1; }
.nav-zoom-label input { flex: 1; min-width: 60px; }

/* 色板面板 */
.swatches-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.swatches-grid.recent { grid-template-columns: repeat(8, 1fr); margin-top: 4px; min-height: 22px; }
.swatch {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 4px; cursor: pointer;
  border: 1px solid rgba(0,0,0,0.18); position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.swatch.empty { background: #fff; cursor: default; border-style: dashed; box-shadow: none; }
.swatch:hover { transform: scale(1.08); z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.swatch.custom::after {
  content: ''; position: absolute; right: 1px; bottom: 1px; width: 6px; height: 6px;
  background: #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}

/* 站点页脚（语义化 + SEO） */
.site-footer {
  flex: none; background: #f4f4f5; border-top: 1px solid #c4c4c4;
  padding: 14px 18px; color: #5d5d5d; font-size: 12px; line-height: 1.6;
}
.foot-inner { max-width: 980px; margin: 0 auto; text-align: center; }
.foot-brand { font-weight: 700; color: #d9a12b; font-size: 13px; margin-bottom: 4px; }
.foot-desc { margin: 0 auto 6px; max-width: 720px; color: #6a6a6a; }
.foot-copy { margin: 0; color: #9a9a9a; }

/* ---------- 全局自定义滚动条（金蓝主题） ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #eef1f6; border-radius: 8px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7fb0ff, #2f6fed);
  border-radius: 8px; border: 2px solid #eef1f6;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #4a9cff, #17357d); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: #2f6fed #eef1f6; }

/* ---------- 紧凑高密度布局覆盖 ---------- */
.panel { margin-bottom: 10px; }
.panel h3 { margin-bottom: 6px; }
.sidebar { padding: 8px 10px 40px; }
.layer-item { padding: 6px 8px; }
.shape-grid { gap: 5px; }

/* ---------- Glowing 发光效果 ---------- */
.tl-btn.active {
  box-shadow: 0 0 10px rgba(47,111,237,.45), 0 1px 2px rgba(47,111,237,.35), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn.primary:hover, .btn.active:hover, .btn.primary:active, .btn.active:active {
  box-shadow: 0 0 12px rgba(47,111,237,.55);
}
.btn.primary:active, .btn.active:active { transform: translateY(1px); }
#gridToggle.active, #tlCollapseBtn.active {
  box-shadow: 0 0 10px rgba(47,111,237,.45), inset 0 1px 0 rgba(255,255,255,.6);
}
.shape-thumb.active { box-shadow: 0 0 8px rgba(224,169,47,.55); }
.history-item.active, .layer-item.active { box-shadow: 0 0 6px rgba(47,111,237,.28); }
.brand { text-shadow: 0 0 8px rgba(224,169,47,.55), 0 1px 0 rgba(224,169,47,.35); }

/* ---------- 顶栏教程链接（金色强调） ---------- */
a.tutorial-link {
  flex: none; text-decoration: none;
  background: linear-gradient(180deg, #f7d98c, #e0a92f);
  color: #4a3405; border-color: #d9a12b; font-weight: 600;
}
a.tutorial-link:hover {
  background: linear-gradient(180deg, #ffe9b3, #e0a92f);
  box-shadow: 0 0 10px rgba(224,169,47,.55);
}
