/* ─── 画风模块样式 ─── */

.style-page {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 二级 Tab */
.sub-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.sub-tab {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  position: relative;
}

.sub-tab:hover { color: var(--text); background: rgba(0,0,0,0.03); }

.sub-tab.active {
  color: #6C5CFF;
  font-weight: 500;
  background: rgba(108,92,255,0.06);
}

.sub-tab.active::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: #6C5CFF;
  border-radius: 1px;
}

/* Tab 内容 */
.tab-content { flex: 1; overflow: hidden; }
.tab-pane { display: none; height: 100%; }
.tab-pane.active { display: block; }

/* 我的画风布局 */
.my-styles-layout {
  display: flex;
  gap: 20px;
  height: 100%;
}

.styles-list-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 14px;
  border: 1px solid #E6E9F2;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}

.filter-chips { display: flex; gap: 4px; }

.filter-chip {
  padding: 6px 14px;
  border: 1px solid #E6E9F2;
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.filter-chip:hover { border-color: #6C5CFF; color: #6C5CFF; }
.filter-chip.active { background: #6C5CFF; color: #fff; border-color: #6C5CFF; }

.filter-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #E6E9F2;
  border-radius: 10px;
  background: #fff;
  margin-left: auto;
}

.search-icon-sm { font-size: 14px; color: var(--text-3); }

.filter-search input {
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 140px;
  font-family: inherit;
}

.filter-search input::placeholder { color: var(--text-3); }

/* 画风卡片网格 */
.styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.style-card {
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(20,30,60,0.04);
  cursor: pointer;
  transition: all 0.2s;
}

.style-card:hover {
  box-shadow: 0 8px 28px rgba(20,30,60,0.08);
  transform: translateY(-2px);
}

.style-card.selected {
  box-shadow: inset 0 0 0 2px #6C5CFF;
}

.style-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  display: block;
}

.style-card-body { padding: 14px 16px 16px; }

.style-card-body h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1F2937;
}

.style-card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tag-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(108,92,255,0.08);
  color: #6C5CFF;
  font-weight: 500;
}

.tag-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.tag-status.approved { background: rgba(41,195,106,0.1); color: #29C36A; }
.tag-status.analyzing { background: rgba(246,162,58,0.1); color: #F6A23A; }
.tag-status.draft { background: rgba(138,145,163,0.1); color: #8A91A3; }

.tag-plaza {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(108,92,255,0.1);
  color: #6C5CFF;
  font-weight: 500;
}

.action-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.detail-btn.favorited {
  background: rgba(255,59,48,0.08) !important;
  color: #FF3B30 !important;
  border-color: rgba(255,59,48,0.2) !important;
}

.style-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #8A91A3;
  margin-bottom: 10px;
}

.style-card-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  padding: 5px 12px;
  border: 1px solid #E6E9F2;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.action-btn:hover { border-color: #6C5CFF; color: #6C5CFF; }

.action-btn.primary-sm {
  background: #6C5CFF;
  color: #fff;
  border-color: #6C5CFF;
}

.action-btn.primary-sm:hover { opacity: 0.85; }

/* 新建画风卡片 */
.new-style-card {
  border: 2px dashed #E6E9F2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.new-style-card:hover { border-color: #6C5CFF; }

.new-style-content {
  text-align: center;
  color: #8A91A3;
}

.new-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
  color: #6C5CFF;
}

.new-style-content p { font-size: 13px; }

/* 右侧详情面板 */
.style-detail-panel {
  width: 340px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.04);
  overflow-y: auto;
  height: fit-content;
  max-height: 100%;
}

.detail-title {
  font-size: 14px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 16px;
}

.detail-preview {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.detail-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-status { margin-bottom: 12px; }

.detail-description {
  font-size: 13px;
  color: #6e6e73;
  line-height: 1.6;
  margin-bottom: 16px;
}

.detail-meta-list { margin-bottom: 16px; }

.detail-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #EEF1F6;
}

.detail-meta-row span:first-child { color: #8A91A3; }
.detail-meta-row span:last-child { color: #1F2937; }

.detail-section { margin-bottom: 16px; }

.detail-section h5 {
  font-size: 12px;
  font-weight: 600;
  color: #8A91A3;
  margin-bottom: 8px;
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.detail-tag {
  padding: 4px 10px;
  border-radius: 6px;
  background: #F7F8FB;
  font-size: 11px;
  color: #6C5CFF;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-item {
  text-align: center;
  padding: 10px 4px;
  background: #F7F8FB;
  border-radius: 10px;
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #6C5CFF;
}

.stat-label {
  font-size: 10px;
  color: #8A91A3;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.detail-btn {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #E6E9F2;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.detail-btn:hover { border-color: #6C5CFF; color: #6C5CFF; }

.detail-btn.primary {
  background: #6C5CFF;
  color: #fff;
  border-color: #6C5CFF;
}

.detail-btn.primary:hover { opacity: 0.85; }

.detail-btn.danger { color: #FF5A5F; border-color: #FF5A5F; }
.detail-btn.danger:hover { background: rgba(255,90,95,0.05); }

/* 占位页面 */
.placeholder-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-3);
  font-size: 14px;
}


/* ─── 分析画风 ─── */
.analyze-layout { display: flex; gap: 20px; height: 100%; }

.ref-images-panel {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.04);
}

.ref-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ref-header h4 { font-size: 14px; font-weight: 600; }

.ref-filter { display: flex; gap: 4px; margin-bottom: 12px; }

.ref-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }

.ref-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s;
}

.ref-thumb:hover { transform: scale(1.05); }

.ref-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  color: #fff;
}

.add-ref {
  background: #F7F8FB !important;
  border: 2px dashed #E6E9F2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #8A91A3;
}

.ref-footer { font-size: 11px; color: #8A91A3; text-align: center; }

.analyze-center { flex: 1; min-width: 0; overflow-y: auto; }

/* 步骤进度 */
.analyze-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.04);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #8A91A3;
}

.step.done { color: #29C36A; }
.step.active { color: #6C5CFF; }

.step-dot { font-size: 14px; }

.step-line {
  flex: 1;
  height: 2px;
  background: #E6E9F2;
  min-width: 20px;
  margin: 0 4px;
}

.step-line.done { background: #29C36A; }
.step-line.active { background: linear-gradient(90deg, #29C36A, #6C5CFF); }

/* 分析结果卡片 */
.analyze-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.result-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.04);
}

.result-card h5 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }

.color-palette { display: flex; gap: 6px; margin-bottom: 10px; }

.color-dot { width: 24px; height: 24px; border-radius: 50%; }

.result-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: #8A91A3; }

/* 右侧操作面板 */
.analyze-actions-panel {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.04);
  height: fit-content;
}

.analyze-status { text-align: center; margin-bottom: 16px; }

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

.status-badge.analyzing { background: rgba(246,162,58,0.1); color: #F6A23A; }

.confidence { text-align: center; }
.confidence-value { display: block; font-size: 36px; font-weight: 700; color: #6C5CFF; }
.confidence-label { font-size: 11px; color: #8A91A3; }

.analyze-info { margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; color: #8A91A3; border-bottom: 1px solid #EEF1F6; }

.analyze-btns { display: flex; flex-direction: column; gap: 8px; }

/* ─── 画风广场 ─── */
.plaza-layout { display: flex; flex-direction: column; gap: 16px; height: 100%; }

/* 顶部筛选栏：搜索 + 标签 一行 */
.plaza-top-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 16px;
}

.plaza-search-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 20px;
  font-size: 14px;
  color: #8A91A3;
  width: auto;
  flex-shrink: 0;
}
.plaza-search-compact input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #1D1D1F;
  width: 80px;
}
.plaza-search-compact input::placeholder { color: #AEAEB2; }

.plaza-top-filter .plaza-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  flex: 1;
  align-items: center;
}

.plaza-top-filter .filter-select {
  margin-left: auto;
  flex-shrink: 0;
  display: none;
}

/* 下方主区域：网格 + 详情 */
.plaza-main { display: flex; gap: 20px; flex: 1; min-height: 0; overflow: hidden; }

.plaza-filter-panel { display: none; }

.plaza-filter-group { margin-bottom: 20px; }
.plaza-filter-group h5 { font-size: 12px; font-weight: 600; color: #8A91A3; margin-bottom: 8px; }

.plaza-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.plaza-tag {
  padding: 6px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #E0E0E0;
  font-size: 14px;
  color: #6e6e73;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 400;
  white-space: nowrap;
}

.plaza-tag:hover { border-color: #6C5CFF; color: #6C5CFF; }
.plaza-tag.active { background: #6C5CFF; border-color: #6C5CFF; color: #fff; font-weight: 500; }

.plaza-grid-area { flex: 1; min-width: 0; overflow-y: auto; }

.plaza-topbar { display: none; }

.plaza-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #E6E9F2;
  border-radius: 10px;
  flex: 1;
}

.plaza-search input { border: none; outline: none; font-size: 13px; width: 100%; font-family: inherit; color: #1F2937; }
.plaza-search input::placeholder { color: #8A91A3; }

.plaza-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.plaza-card {
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(20,30,60,0.06);
  cursor: pointer;
  transition: all 0.2s;
}

.plaza-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,30,60,0.08); }
.plaza-card.selected { box-shadow: inset 0 0 0 2px #6C5CFF; }

.plaza-card-img { width: 100%; aspect-ratio: 4 / 3; background-size: cover; background-position: center; display: block; }
.plaza-card-body { padding: 12px 14px; }
.plaza-card-body h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }

.plaza-source {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(108,92,255,0.08);
  color: #6C5CFF;
  margin-bottom: 6px;
}

.plaza-card-stats { display: flex; gap: 10px; font-size: 11px; color: #8A91A3; }

.plaza-detail {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.04);
  height: fit-content;
}

.plaza-detail-img { height: 160px; border-radius: 0; margin-bottom: 14px; }
.plaza-detail h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.plaza-detail-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; color: #8A91A3; margin-bottom: 12px; }
.plaza-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.plaza-detail-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }

/* ─── 用画风生成 ─── */
.generate-layout { display: flex; height: 100%; gap: 0; }

.canvas-workspace {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #FAFBFD;
}

.canvas-grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #e0e0e0 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
}

.infinite-canvas { position: relative; width: 100%; height: 100%; }

/* 画布节点 */
.canvas-node {
  position: absolute;
  width: 240px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(20,30,60,0.06);
  padding: 12px;
  cursor: grab;
  transition: box-shadow 0.2s;
}

.canvas-node:hover { box-shadow: 0 8px 28px rgba(20,30,60,0.1); }

.node-header { margin-bottom: 8px; }

.node-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.node-tag.sketch { background: rgba(246,162,58,0.1); color: #F6A23A; }
.node-tag.gen { background: rgba(108,92,255,0.1); color: #6C5CFF; }

.node-thumb { height: 100px; border-radius: 10px; margin-bottom: 8px; }
.node-title { font-size: 12px; font-weight: 500; margin-bottom: 8px; }

.node-actions { display: flex; gap: 6px; }
.node-btn { padding: 5px 12px; border: 1px solid #E6E9F2; border-radius: 8px; background: #fff; font-size: 11px; color: #6e6e73; cursor: pointer; font-family: inherit; }
.node-btn.primary-sm { background: #6C5CFF; color: #fff; border-color: #6C5CFF; }

/* 悬浮工具栏 */
.canvas-toolbar-float {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(20,30,60,0.08);
}

.canvas-tool-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.12s;
}

.canvas-tool-btn:hover { background: #F7F8FB; }

/* 底部画风选择条 */
.canvas-bottom-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

.bottom-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(20,30,60,0.1);
}

.bottom-bar-label { font-size: 12px; color: #8A91A3; }
.bottom-bar-style { font-size: 13px; font-weight: 500; color: #6C5CFF; }

.bottom-bar-btn {
  padding: 6px 14px;
  border: 1px solid #E6E9F2;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: #6e6e73;
  cursor: pointer;
  font-family: inherit;
}

.bottom-bar-search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #F7F8FB;
  border-radius: 8px;
  font-size: 12px;
  color: #8A91A3;
}

.bottom-bar-search input { border: none; outline: none; background: none; font-size: 12px; width: 100px; font-family: inherit; }

/* 缩放控件 */
.canvas-zoom {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.08);
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: #6e6e73;
}

.zoom-btn:hover { background: #F7F8FB; }
.zoom-level { font-size: 11px; color: #8A91A3; padding: 0 4px; }

/* 右侧项目面板 */
.canvas-project-panel {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid rgba(0,0,0,0.05);
  padding: 16px;
  overflow-y: auto;
}

.canvas-project-panel h4 { font-size: 13px; font-weight: 600; margin-bottom: 14px; }

.project-list { display: flex; flex-direction: column; gap: 8px; }

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}

.project-item:hover { background: #F7F8FB; }

.project-thumb { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.project-info { flex: 1; min-width: 0; }
.project-name { display: block; font-size: 12px; font-weight: 500; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.locate-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 14px;
  color: #8A91A3;
  cursor: pointer;
}

.locate-btn:hover { background: #F7F8FB; color: #6C5CFF; }


/* ─── 分析画风（重写） ─── */
.analyze-layout { display: flex; gap: 16px; height: 100%; }

.analyze-left { width: 300px; flex-shrink: 0; overflow-y: auto; }
.analyze-left-card { background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 2px 12px rgba(20,30,60,0.04); }

.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.info-tip { font-size: 12px; color: #8A91A3; cursor: help; }

/* 上传区 */
.upload-drop-zone {
  border: 2px dashed #E5E7EB;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 14px;
}
.upload-drop-zone:hover { border-color: #6D5DF6; background: rgba(109,93,246,0.03); }
.upload-drop-zone.dragover { border-color: #6D5DF6; background: rgba(109,93,246,0.06); }
.upload-drop-icon { font-size: 24px; margin-bottom: 8px; color: #6D5DF6; }
.upload-drop-zone p { font-size: 13px; color: #374151; margin-bottom: 4px; }
.upload-drop-zone span { font-size: 11px; color: #9CA3AF; }

/* 分类筛选 */
.analyze-filter-row { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.analyze-filter {
  padding: 5px 10px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: #6B7280;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.analyze-filter:hover { border-color: #6D5DF6; color: #6D5DF6; }
.analyze-filter.active { background: rgba(109,93,246,0.08); border-color: #6D5DF6; color: #6D5DF6; }
.analyze-filter b { font-weight: 600; margin-left: 2px; }

/* 图片网格 */
.analyze-img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  min-height: 80px;
}
.analyze-empty-hint { grid-column: span 3; text-align: center; padding: 20px; font-size: 12px; color: #9CA3AF; }

.analyze-img-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.12s;
}
.analyze-img-item.selected { border-color: #6D5DF6; }
.analyze-img-item img { width: 100%; height: 100%; object-fit: cover; }
.analyze-img-check { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: #6D5DF6; color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center; }
.analyze-img-item.selected .analyze-img-check { display: flex; }
.analyze-img-cat { position: absolute; bottom: 4px; left: 4px; font-size: 9px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,0.5); color: #fff; }
.analyze-img-remove { position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,0.4); color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center; cursor: pointer; }
.analyze-img-item:hover .analyze-img-remove { display: flex; }

/* 添加更多 */
.add-more-card {
  border: 2px dashed #E5E7EB;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #9CA3AF;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.12s;
}
.add-more-card:hover { border-color: #6D5DF6; color: #6D5DF6; }

/* 底部状态 */
.analyze-bottom-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; color: #6B7280; }
.text-btn-danger { background: none; border: none; font-size: 11px; color: #EF4444; cursor: pointer; font-family: inherit; }
.text-btn-danger:hover { text-decoration: underline; }

/* 开始分析按钮 */
.analyze-start-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6D5DF6, #7C5CFF);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(109,93,246,0.25);
}
.analyze-start-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.analyze-start-btn:hover:not(:disabled) { opacity: 0.9; }

/* 中间分析结果 */
.analyze-center { flex: 1; min-width: 0; overflow-y: auto; }
.analyze-center .card-title { margin-bottom: 16px; }

.analyze-placeholder { text-align: center; padding: 60px 20px; color: #9CA3AF; font-size: 14px; }

/* 进度条 */
.analyze-progress-wrap { margin-bottom: 20px; }
.analyze-steps-bar {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(20,30,60,0.04);
}
.a-step { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: #9CA3AF; white-space: nowrap; }
.a-step.done { color: #16A34A; }
.a-step.active { color: #6D5DF6; }
.a-step-dot { font-size: 14px; }
.a-step-line { flex: 1; height: 2px; background: #E5E7EB; margin: 0 4px; min-width: 12px; }
.a-step-line.done { background: #16A34A; }
.a-step-line.active { background: linear-gradient(90deg, #16A34A, #6D5DF6); }

/* 结果卡片 */
.analyze-result-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.a-result-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(20,30,60,0.04);
  min-height: 120px;
  transition: all 0.3s;
}
.a-result-card.analyzing {
  border: 1px solid rgba(109,93,246,0.2);
  animation: cardPulse 1.5s ease-in-out infinite;
}
@keyframes cardPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(20,30,60,0.04); }
  50% { box-shadow: 0 4px 16px rgba(109,93,246,0.12); }
}
.a-result-card h5 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #1F2937; }
.a-result-desc { font-size: 13px; color: #374151; line-height: 1.7; margin-top: 8px; }
.a-result-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.a-result-tag { padding: 4px 12px; border-radius: 8px; background: rgba(109,93,246,0.08); font-size: 12px; color: #6D5DF6; font-weight: 500; }
.a-color-palette { display: flex; gap: 8px; }
.a-color-swatch { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.a-recommend-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.a-recommend-pill { padding: 7px 16px; border-radius: 20px; background: rgba(109,93,246,0.08); color: #6D5DF6; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.12s; }
.a-recommend-pill:hover { background: rgba(109,93,246,0.15); }

/* 右侧操作面板 */
.analyze-right { width: 260px; flex-shrink: 0; }
.analyze-right-card { background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 2px 12px rgba(20,30,60,0.04); }

.a-status-section { margin-bottom: 16px; text-align: center; }
.a-status-label { font-size: 11px; color: #9CA3AF; display: block; margin-bottom: 6px; }
.a-status-badge { display: inline-block; padding: 4px 14px; border-radius: 8px; font-size: 12px; font-weight: 500; background: #F3F4F6; color: #6B7280; }
.a-status-badge.analyzing { background: rgba(246,162,58,0.1); color: #F6A23A; }
.a-status-badge.completed { background: rgba(22,163,74,0.1); color: #16A34A; }
.a-status-badge.failed { background: rgba(239,68,68,0.1); color: #EF4444; }
.a-status-hint { font-size: 11px; color: #9CA3AF; margin-top: 6px; }

.a-confidence-section { text-align: center; margin-bottom: 16px; padding: 12px; background: #F9FAFB; border-radius: 12px; }
.a-confidence-score { font-size: 36px; font-weight: 700; color: #6D5DF6; }
.a-confidence-bar { height: 4px; background: #E5E7EB; border-radius: 2px; margin: 8px 0; overflow: hidden; }
.a-confidence-fill { height: 100%; background: #6D5DF6; border-radius: 2px; transition: width 0.5s; }
.a-confidence-hint { font-size: 10px; color: #9CA3AF; }

.a-ref-info { margin-bottom: 16px; }
.a-ref-info-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; color: #6B7280; border-bottom: 1px solid #F3F4F6; }

.a-action-buttons { display: flex; flex-direction: column; gap: 8px; }

.a-btn-confirm {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: #16A34A;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(22,163,74,0.2);
}
.a-btn-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
.a-btn-confirm:hover:not(:disabled) { opacity: 0.9; }

.a-btn-secondary {
  width: 100%;
  padding: 10px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.a-btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.a-btn-secondary:hover:not(:disabled) { border-color: #6D5DF6; color: #6D5DF6; }

.a-btn-ghost {
  width: 100%;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: 12px;
  color: #6B7280;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.a-btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.a-btn-ghost:hover:not(:disabled) { background: #F3F4F6; color: #374151; }


/* ─── 用画风生成（重写） ─── */
.generate-layout { display: flex; height: 100%; gap: 0; }

.gen-canvas-wrap { flex: 1; position: relative; overflow: hidden; border-radius: 16px; background: #FAFBFD; }

.gen-canvas { width: 100%; height: 100%; position: relative; overflow: hidden; }
.gen-canvas-grid { position: absolute; inset: 0; background-image: radial-gradient(circle, #d4d4d8 1px, transparent 1px); background-size: 24px 24px; opacity: 0.4; }

.gen-nodes { position: absolute; inset: 0; }

/* 节点通用 */
.gen-node {
  position: absolute;
  width: 280px;
  background: #fff;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(124,92,255,0.12);
  box-shadow: 0 8px 24px rgba(15,23,42,0.05), 0 0 20px rgba(124,92,255,0.08);
  cursor: grab;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.gen-node:hover { box-shadow: 0 12px 32px rgba(15,23,42,0.08), 0 0 28px rgba(124,92,255,0.16); border-color: rgba(124,92,255,0.25); }
.gen-node.selected { border-color: #6D5DF6; box-shadow: 0 12px 32px rgba(15,23,42,0.08), 0 0 32px rgba(124,92,255,0.22); }

.gen-node-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gen-node-icon { font-size: 16px; }
.gen-node-title { font-size: 12px; font-weight: 600; color: #1F2937; flex: 1; margin-left: 8px; }
.gen-node-status { font-size: 10px; padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.gen-node-status.edited { background: rgba(22,163,74,0.1); color: #16A34A; }
.gen-node-status.pending { background: rgba(245,158,11,0.1); color: #F59E0B; }
.gen-node-status.completed { background: rgba(22,163,74,0.1); color: #16A34A; }
.gen-node-status.generating { background: rgba(59,130,246,0.1); color: #3B82F6; }
.gen-node-status.unedited { background: #F3F4F6; color: #9CA3AF; }
.gen-node-status.failed { background: rgba(239,68,68,0.1); color: #EF4444; }

.gen-node-body { height: 100px; border-radius: 12px; background: #F9FAFB; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; overflow: hidden; }
.gen-node-body img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.gen-node-body-text { font-size: 11px; color: #9CA3AF; text-align: center; padding: 8px; }
.gen-node-thumb { width: 100%; height: 100%; border-radius: 12px; background-size: contain; background-position: center; background-repeat: no-repeat; }

/* 图片预览弹窗 */
.img-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}
.img-preview-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  object-fit: contain;
}

.gen-node-more { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 16px; color: #9CA3AF; cursor: pointer; }
.gen-node-more:hover { color: #6D5DF6; }

/* 连接线 SVG */
.gen-connections { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* 左下工具 */
.gen-tools-left { position: absolute; bottom: 16px; left: 16px; z-index: 10; display: flex; flex-direction: column; gap: 2px; background: #fff; border-radius: 10px; padding: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); pointer-events: auto; }
.gen-tool-btn { width: 32px; height: 32px; border: none; border-radius: 8px; background: none; font-size: 14px; cursor: pointer; color: #6B7280; transition: all 0.12s; }
.gen-tool-btn:hover { background: #F3F4F6; }
.gen-tool-btn.active { background: rgba(109,93,246,0.08); color: #6D5DF6; }

/* 右下缩放 */
.gen-zoom-ctrl { position: absolute; bottom: 16px; right: 280px; z-index: 10; display: flex; align-items: center; gap: 2px; background: #fff; border-radius: 10px; padding: 4px 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); pointer-events: auto; }
.gen-zoom-btn { width: 28px; height: 28px; border: none; border-radius: 6px; background: none; font-size: 14px; cursor: pointer; color: #6B7280; }
.gen-zoom-btn:hover { background: #F3F4F6; }
.gen-zoom-reset { width: auto; padding: 2px 6px; font-size: 11px; color: #374151; font-weight: 500; border: 1px solid #E5E7EB; margin-left: 6px; border-radius: 4px; background: #F9FAFB; line-height: 1.1; }
.gen-zoom-reset:hover { color: #6D5DF6; border-color: #6D5DF6; background: rgba(109,93,246,0.04); }
.gen-zoom-level { font-size: 11px; color: #9CA3AF; padding: 0 6px; min-width: 40px; text-align: center; }

/* 底部画风栏 */
.gen-style-bar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 10; pointer-events: auto; }
.gen-style-bar-inner { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #fff; border-radius: 50px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.gen-style-thumb { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg,#667eea,#764ba2); flex-shrink: 0; }
.gen-style-label { font-size: 12px; color: #9CA3AF; }
.gen-style-name { font-size: 13px; font-weight: 500; color: #1F2937; }
.gen-style-tags { display: flex; gap: 4px; }
.gen-style-tag { font-size: 10px; padding: 2px 8px; border-radius: 4px; background: rgba(109,93,246,0.08); color: #6D5DF6; }
.gen-style-change-btn { padding: 5px 12px; border: 1px solid #E5E7EB; border-radius: 8px; background: #fff; font-size: 11px; color: #6B7280; cursor: pointer; font-family: inherit; }
.gen-style-change-btn:hover { border-color: #6D5DF6; color: #6D5DF6; }

/* 右侧面板 */
.gen-right-panel { width: 240px; flex-shrink: 0; background: #fff; border-left: 1px solid rgba(0,0,0,0.05); padding: 14px; display: flex; flex-direction: column; overflow-y: auto; }

.gen-panel-tabs { display: flex; gap: 2px; margin-bottom: 14px; background: #F3F4F6; border-radius: 8px; padding: 3px; }
.gen-panel-tab { flex: 1; padding: 6px 0; border: none; border-radius: 6px; background: none; font-size: 12px; color: #6B7280; cursor: pointer; font-family: inherit; text-align: center; transition: all 0.12s; }
.gen-panel-tab.active { background: #fff; color: #1F2937; font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

.gen-panel-content { display: none; flex: 1; }
.gen-panel-content.active { display: block; }

.gen-add-func-btn { width: 100%; padding: 10px; border: 1px dashed #E5E7EB; border-radius: 10px; background: none; font-size: 12px; color: #6D5DF6; cursor: pointer; font-family: inherit; margin-bottom: 12px; transition: all 0.12s; }
.gen-add-func-btn:hover { border-color: #6D5DF6; background: rgba(109,93,246,0.03); }

.gen-func-list { display: flex; flex-direction: column; gap: 4px; }
.gen-func-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; font-size: 12px; color: #374151; }
.gen-func-item:hover { background: #F9FAFB; }
.gen-func-item.active { background: rgba(109,93,246,0.06); color: #6D5DF6; font-weight: 500; }
.gen-func-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-func-rename-btn { border: none; background: none; cursor: pointer; color: #9CA3AF; padding: 0; margin-left: auto; transition: color 0.15s; flex-shrink: 0; line-height: 1; display: flex; align-items: center; }
.gen-func-rename-btn:hover { color: #6D5DF6; }
.gen-func-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gen-func-dot.green { background: #16A34A; }
.gen-func-dot.orange { background: #F59E0B; }
.gen-func-dot.blue { background: #3B82F6; }
.gen-func-dot.gray { background: #D1D5DB; }

.gen-canvas-list { display: flex; flex-direction: column; gap: 4px; }
.gen-canvas-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; color: #374151; transition: background 0.12s; }
.gen-canvas-item:hover { background: #F9FAFB; }
.gen-canvas-item.active { background: rgba(109,93,246,0.06); color: #6D5DF6; font-weight: 500; }
.gen-canvas-dot { width: 6px; height: 6px; border-radius: 50%; background: #D1D5DB; }
.gen-canvas-item.active .gen-canvas-dot { background: #6D5DF6; }


/* 流式分析等待状态 */
.a-streaming { color: #9CA3AF; font-style: italic; font-size: 13px; }
.a-streaming::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.a-result-card.analyzing .a-streaming { color: #6D5DF6; }
.a-result-card.analyzing .a-streaming::before { background: #6D5DF6; animation: dotBlink 1s infinite; }
@keyframes dotBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }


/* ─── 自定义弹窗（Apple HIG 风格） ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: #ffffff !important;
  border-radius: 14px;
  padding: 28px 24px 20px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2), 0 0 0 0.5px rgba(0,0,0,0.05);
  animation: scaleIn 0.2s cubic-bezier(0.4,0,0.2,1);
  text-align: center;
}
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1D1D1F !important;
  letter-spacing: -0.2px;
}
.modal-desc {
  font-size: 13px;
  color: #86868B !important;
  line-height: 1.5;
  margin-bottom: 20px;
}
.modal-info {
  background: #F5F5F7;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
}
.modal-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}
.modal-info-row span:first-child { color: #86868B; }
.modal-info-row span:last-child { color: #1D1D1F; font-weight: 500; }

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}
.modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  transition: all 0.12s;
  border: none;
  min-width: 80px;
}
.modal-btn.cancel {
  background: #F5F5F7 !important;
  color: #1D1D1F !important;
}
.modal-btn.cancel:hover { background: #E8E8ED !important; }
.modal-btn.confirm {
  background: #007AFF !important;
  color: #fff !important;
  box-shadow: none;
}
.modal-btn.confirm:hover { background: #0066D6 !important; }
.modal-btn.danger {
  background: #FF3B30 !important;
  color: #fff !important;
}
.modal-btn.danger:hover { background: #D63029 !important; }

/* 成功提示 */
.modal-success-icon { font-size: 48px; text-align: center; margin-bottom: 16px; }
.modal-success-title { font-size: 17px; font-weight: 600; text-align: center; color: #34C759 !important; margin-bottom: 8px; }
.modal-success-desc { font-size: 13px; color: #86868B !important; text-align: center; margin-bottom: 20px; }
.modal-success-actions { display: flex; gap: 8px; justify-content: center; }


/* 弹窗输入框（Apple 风格） */
.modal-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #D2D2D7 !important;
  border-radius: 8px;
  font-size: 15px;
  color: #1D1D1F !important;
  background: #FFFFFF !important;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  outline: none;
  margin-bottom: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.modal-input::placeholder { color: #AEAEB2 !important; }
.modal-input:focus {
  border-color: #007AFF !important;
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15) !important;
}


/* 节点操作按钮 */
.gen-node-action-btn {
  display: block;
  width: calc(100% - 8px);
  margin: 4px auto 0;
  padding: 8px 0;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.sketch-edit-btn { background: rgba(59,130,246,0.08); color: #3B82F6; }
.sketch-edit-btn:hover { background: rgba(59,130,246,0.15); }

.gen-ui-btn { background: #16A34A; color: #fff; }
.gen-ui-btn:hover { background: #15803D; }

.slice-btn { background: rgba(22,163,74,0.08); color: #16A34A; }
.slice-btn:hover { background: rgba(22,163,74,0.15); }

/* 切图下载按钮 */
.slice-download-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  color: #16A34A;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.12s;
  z-index: 5;
}
.slice-download-btn::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316A34A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.slice-download-btn:hover { border-color: #16A34A; box-shadow: 0 2px 8px rgba(22,163,74,0.15); }

/* 拆分预览按钮 */
.split-preview-btn {
  display: block;
  width: calc(100% - 8px);
  margin: 0 auto 6px;
  padding: 5px 0;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: #6D5DF6;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.12s;
}
.split-preview-btn:hover { border-color: #6D5DF6; background: rgba(109,93,246,0.04); }

/* 画风选择列表弹窗 */
.style-select-list { max-height: 300px; overflow-y: auto; margin-bottom: 20px; }
.style-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 13px;
  color: #1F2937;
}
.style-select-item:hover { background: rgba(109,93,246,0.06); }
.style-select-thumb { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; }

/* 画布可拖动 */
.gen-canvas-wrap { overflow: auto; cursor: grab; }
.gen-canvas { min-width: 2200px; min-height: 1000px; }

/* 固定工具层 - 不随画布滚动 */
.gen-fixed-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
.gen-fixed-overlay > * { pointer-events: auto; }


/* ─── 切图节点两栏布局 ─── */
.gen-node-slice {
  width: 580px !important;
}

.slice-columns {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
}

.slice-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.slice-col-divider {
  width: 1px;
  background: #E5E7EB;
  margin: 0 10px;
  flex-shrink: 0;
}

.slice-col-title {
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slice-col-body {
  flex: 1;
  min-height: 120px;
  max-height: 200px;
  border-radius: 10px;
  background: #F9FAFB;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
}

.slice-col-body img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.slice-col-body .slice-placeholder {
  font-size: 11px;
  color: #9CA3AF;
  text-align: center;
  padding: 12px;
}

.slice-col-body .slice-error {
  font-size: 11px;
  color: #EF4444;
  text-align: center;
  padding: 12px;
}

.slice-col-body .slice-loading {
  font-size: 11px;
  color: #3B82F6;
  text-align: center;
  padding: 12px;
}

.slice-col-btn {
  display: block;
  width: 100%;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  text-align: center;
}

.split-start-btn {
  background: rgba(109, 93, 246, 0.08);
  color: #6D5DF6;
}
.split-start-btn:hover:not(:disabled) {
  background: rgba(109, 93, 246, 0.15);
}

.crop-start-btn {
  background: rgba(22, 163, 74, 0.08);
  color: #16A34A;
}
.crop-start-btn:hover:not(:disabled) {
  background: rgba(22, 163, 74, 0.15);
}

.slice-col-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 切图栏组件网格 */
.crop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
  width: 100%;
  align-self: flex-start;
}

.crop-item {
  position: relative;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 4px;
  text-align: center;
}

.crop-item img {
  width: 100%;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  cursor: pointer;
}

.crop-item-size {
  font-size: 9px;
  color: #9CA3AF;
  margin-top: 2px;
}

.crop-item-dl {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 4px;
  background: rgba(22, 163, 74, 0.1);
  color: #16A34A;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s;
}

.crop-item:hover .crop-item-dl {
  opacity: 1;
}

.crop-download-all-btn {
  display: block;
  width: 100%;
  padding: 6px 0;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
  color: #16A34A;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  margin-bottom: 6px;
  transition: all 0.12s;
}

.crop-download-all-btn:hover {
  border-color: #16A34A;
  background: rgba(22, 163, 74, 0.04);
}

/* 切图预览缩略图 */
.crop-preview-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.crop-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crop-preview-info {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(22, 163, 74, 0.9);
  color: #fff;
}


/* 画布名称栏（右侧面板顶部） */
.gen-canvas-name-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #F3F4F6;
}
.gen-canvas-name-bar .canvas-name { font-size: 13px; font-weight: 500; color: #1F2937; }
.gen-canvas-name-bar .canvas-rename-btn { border: none; background: none; font-size: 13px; color: #9CA3AF; cursor: pointer; }
.gen-canvas-name-bar .canvas-rename-btn:hover { color: #6D5DF6; }

/* ─── 生成组件节点 ─── */
.gen-node-manifest {
  width: 280px;
}

.manifest-preview-area {
  min-height: 100px;
  border-radius: 12px;
  background: #F9FAFB;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
}

.manifest-preview-area:empty::after {
  content: 'UI 拼装预览';
  font-size: 12px;
  color: #9CA3AF;
}

.manifest-assembly-thumb {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.manifest-assembly-thumb:hover {
  opacity: 0.85;
}

.manifest-btn-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manifest-gen-btn {
  width: 100%;
}

.manifest-download-btn {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.manifest-download-btn:hover {
  border-color: #6D5DF6;
  color: #6D5DF6;
}

/* 全尺寸预览弹窗 */
.manifest-fullsize-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.manifest-fullsize-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* 分辨率输入行 */
.manifest-resolution-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #F9FAFB;
  border-radius: 10px;
}

.manifest-resolution-row label {
  font-size: 11px;
  color: #6B7280;
  white-space: nowrap;
}

.manifest-resolution-row span {
  font-size: 12px;
  color: #9CA3AF;
}

.manifest-res-input {
  width: 68px;
  padding: 5px 8px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  font-family: inherit;
  color: #374151;
  outline: none;
}

.manifest-res-input:focus {
  border-color: #6D5DF6;
}
