/* ════════════════════════════════════════════
   图文制作 — Create Page Styles
   ════════════════════════════════════════════ */

.main-layout {
  display: flex;
  max-width: 1400px; margin: 0 auto;
  padding: 24px 28px; gap: 24px;
  height: calc(100vh - 84px); /* 固定高度：导航栏约56px + footer约28px */
  min-height: 600px;
  overflow: hidden;
}
.left-panel {
  width: 400px; flex-shrink: 0;
  display: flex; flex-direction: column;
  height: 100%;
}
.left-panel-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
  padding-right: 4px;
  /* 隐藏滚动条但保持可滚动 */
  scrollbar-width: thin;
}
.left-panel-scroll::-webkit-scrollbar { width: 4px; }
.left-panel-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.left-panel-bottom {
  flex-shrink: 0;
  padding-top: 12px;
}
.right-panel {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  height: 100%;
}
.right-panel-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
  padding-right: 4px;
  scrollbar-width: thin;
}
.right-panel-scroll::-webkit-scrollbar { width: 4px; }
.right-panel-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.right-panel-bottom {
  flex-shrink: 0;
  padding-top: 12px;
  text-align: center;
}

/* ── Mode Cards ── */
.mode-group { display: flex; gap: 8px; margin-bottom: 16px; }
.mode-card {
  flex: 1; padding: 14px; border-radius: 10px;
  border: 1.5px solid #e0e0e0; background: #fff;
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.mode-card:hover { border-color: #bbb; }
.mode-card.active { border-color: #1a1a1a; background: #fafafa; }
.mode-icon { font-size: 22px; display: block; margin-bottom: 6px; }
.mode-label { font-size: 13px; font-weight: 600; color: #1a1a1a; display: block; }
.mode-desc { font-size: 11px; color: #888; margin-top: 3px; display: block; }

/* ── Scene Tags ── */
.scene-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.scene-tag {
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid #e0e0e0; background: #fff;
  font-size: 12px; color: #666; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.scene-tag:hover { border-color: #999; color: #333; }
.scene-tag.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* ── Topic / Slider ── */
.topic-row { display: flex; gap: 8px; margin-bottom: 12px; }
.topic-row .input-field { flex: 1; }
.slider-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: #f9fafb; border-radius: 8px;
  border: 1px solid #eef0f2; margin-bottom: 16px;
}
.slider-row label { font-size: 12px; font-weight: 600; color: #555; white-space: nowrap; }
.slider-row input[type="range"] { flex: 1; accent-color: #1a1a1a; height: 4px; }
.slider-val { font-size: 14px; font-weight: 700; color: #1a1a1a; min-width: 24px; text-align: center; }
.slider-hint { font-size: 11px; color: #aaa; }

/* ── Fashion Type Selector ── */
.fashion-type-group { display: flex; gap: 8px; margin-top: 6px; }
.fashion-type-btn {
  flex: 1; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid #e0e0e0; background: #fff;
  cursor: pointer; text-align: center; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.fashion-type-btn:hover { border-color: #bbb; }
.fashion-type-btn.active { border-color: #1a1a1a; background: #fafafa; }
.fashion-type-btn input[type="radio"] { display: none; }
.fashion-type-btn { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.fashion-type-btn small { font-size: 11px; color: #888; font-weight: 400; }

/* ── Single Upload Slot (compact, same visual size as piece items) ── */
.mat-upload-single {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  min-height: 96px;
  max-height: 100px;
}

/* ── Material Upload ── */
.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px; margin-top: 4px;
}
.mat-upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 3/4;
  border: 1.5px dashed #d0d0d0; border-radius: 8px;
  background: #fafbfc; cursor: pointer; transition: all 0.2s;
  position: relative; overflow: hidden;
}
.mat-upload:hover { border-color: #1a1a1a; background: #f0f1f3; }
.mat-upload.filled { border-style: solid; border-color: #1a1a1a; background-size: cover; background-position: center; }
.mat-upload.filled span, .mat-upload.filled small { opacity: 0; }
.mat-upload span { font-size: 22px; color: #999; }
.mat-upload small { font-size: 10px; color: #aaa; margin-top: 2px; }

/* ── Character Selector ── */
.char-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.char-select-item {
  background: #fff; border: 2px solid #e8e9eb; border-radius: 10px;
  padding: 6px; cursor: pointer; text-align: center;
  transition: all 0.15s; position: relative;
}
.char-select-item:hover { border-color: #bbb; }
.char-select-item.selected { border-color: #1a1a1a; background: #f9fafb; }
.char-select-item img {
  width: 100%; aspect-ratio: 3/4; object-fit: contain; border-radius: 6px; display: block; background: #f0f1f2;
}
.char-select-name {
  font-size: 11px; font-weight: 500; color: #333; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.char-check-mark {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #1a1a1a; color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.char-select-item.selected .char-check-mark { display: flex; }

/* ── Outline Pages ── */
.page-list { display: flex; flex-direction: column; gap: 12px; }
.page-item {
  background: #fafbfc; border: 1px solid #eef0f2; border-radius: 10px;
  padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start;
}
.page-num-badge {
  width: 30px; height: 30px; border-radius: 8px;
  background: #1a1a1a; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.page-detail { flex: 1; min-width: 0; }
.page-type-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; background: #eef0f2; color: #666;
  margin-bottom: 6px;
}
.page-overlay {
  font-size: 12px; color: #555; margin-bottom: 6px;
  background: #f0f1f2; padding: 4px 8px; border-radius: 4px;
  border-left: 2.5px solid #1a1a1a;
}
.page-prompt-preview {
  font-size: 12px; color: #777; background: #f5f6f7;
  padding: 8px 10px; border-radius: 6px; word-break: break-all;
  max-height: 72px; overflow-y: auto;
  font-family: "SF Mono", SFMono-Regular, Consolas, monospace;
}
.page-btns { display: flex; gap: 6px; margin-top: 8px; }
.page-edit-inp {
  width: 100%; padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 6px;
  background: #fff; font-size: 12px; outline: none; font-family: inherit;
}
.page-edit-inp:focus { border-color: #1a1a1a; }
.tags-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
  padding: 4px 12px; border-radius: 999px;
  background: #f0f1f2; color: #555;
  font-size: 12px; font-weight: 500;
}

/* ── Post Info ── */
.post-title-row, .post-body-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid #f0f1f2;
}
.post-label {
  font-size: 11px; font-weight: 700; color: #888; white-space: nowrap;
  padding-top: 1px; min-width: 32px;
}
.post-value { font-size: 13px; color: #333; line-height: 1.6; }
.post-title-val { font-weight: 700; font-size: 15px; color: #1a1a1a; }
.post-body-val { color: #555; }
/* 复制按钮 */
.copy-btn {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 4px;
  color: #999; transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.copy-btn:hover { color: #222; background: #f0f1f2; }

/* ── Image Results ── */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.img-result {
  background: #fff; border: 1px solid #e8e9eb; border-radius: 10px;
  overflow: hidden; transition: box-shadow 0.2s;
}
.img-result:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.img-result img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #f5f6f7; }
.img-result-bar {
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: center;
}
.img-result-label { font-size: 12px; color: #666; font-weight: 500; }
.img-dl-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid #e0e0e0;
  background: #fff; font-size: 11px; color: #666;
  transition: all 0.15s;
}
.img-dl-btn:hover { border-color: #1a1a1a; color: #1a1a1a; }

@media (max-width: 900px) {
  .main-layout { flex-direction: column; padding: 16px; height: auto; overflow: visible; }
  .left-panel { width: 100%; height: auto; }
  .left-panel-scroll { overflow: visible; max-height: none; }
  .right-panel { height: auto; }
  .right-panel-scroll { overflow: visible; max-height: none; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .topic-row { flex-direction: column; }
}
