/* 🍌 feature_n2 ——居中超大 prompt 卡片布局 (text2img / edit / fusion) */

/* Hero 居中 */
.n2-hero {
  justify-content: center;
  position: relative;
}

/* 外层：drawer 内全宽 */
.n2-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ========== Prompt 卡片 ========== */
.n2-prompt-card {
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.n2-prompt-card:focus-within {
  border-color: var(--color-accent-blue);
  box-shadow: var(--shadow-focus), var(--shadow-md);
}

/* 大 prompt textarea */
.n2-prompt-area {
  width: 100%;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 110px;
  background: transparent;
  color: var(--color-text);
}
.n2-prompt-area::placeholder { color: var(--color-text-faint); }

/* ========== 卡片底部 footer ========== */
.n2-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--color-border);
}
.n2-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.n2-generate {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
  border-radius: var(--radius-pill);
  width: 100%;
}

.n2-hint {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}
.n2-result {
  min-height: 320px;
}

/* ========== Chip (details/summary + radio 列表) ========== */
.n2-chip-details {
  position: relative;
}
.n2-chip-details[open] .chev { transform: rotate(180deg); }
.n2-chip {
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
  border-radius: 14px;
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  transition: all var(--dur-fast);
  list-style: none;
  max-width: 100%;
  user-select: none;
}
.n2-chip::-webkit-details-marker { display: none; }
.n2-chip:hover {
  border-color: var(--color-accent-blue);
  background: var(--color-accent-blue-soft);
}
.n2-chip .ic { font-size: 14px; flex-shrink: 0; }
.n2-chip .chev {
  color: var(--color-text-muted);
  font-size: 11px;
  transition: transform var(--dur-fast);
  flex-shrink: 0;
}
.n2-chip-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.n2-chip-field {
  font-size: 10.5px;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: .03em;
}
.n2-chip-value {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}
.n2-chip-details[open] .n2-chip {
  border-color: var(--color-accent-blue);
  background: var(--color-accent-blue-soft);
}

/* Chip 下拉菜单 */
.n2-chip-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.n2-chip-menu-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 6px 10px 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.n2-chip-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: background var(--dur-fast);
}
.n2-chip-option:hover { background: var(--color-bg-sunken); }
.n2-chip-option input[type="radio"] {
  margin: 0;
  accent-color: var(--color-accent-blue);
  flex-shrink: 0;
}
.n2-chip-option input[type="radio"]:checked ~ .n2-chip-option-text {
  color: var(--color-accent-blue);
  font-weight: 700;
}
.n2-chip-option-text { flex: 1; }

/* ========== edit: 单图顶部附件 ========== */
.n2-attach {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--color-border);
}
.n2-attach-slot {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #FFE08A 0%, #FF8FA3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
}
.n2-attach-slot .n2-attach-icon {
  pointer-events: none;
}
.n2-attach-slot .field-file-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.n2-attach-slot .field-file-preview:empty { display: none; }
.n2-attach-slot .field-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.n2-attach-slot .field-file-preview:not(:empty) ~ .n2-attach-icon {
  display: none;
}
.n2-attach-slot .field-file-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1F1F1F;
  color: #FFF;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid #FFF;
  padding: 0;
  line-height: 1;
}
.n2-attach-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.n2-attach-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.n2-attach-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.n2-attach-label .req { color: var(--color-primary); }
.n2-attach-filename {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.n2-attach-replace {
  align-self: flex-start;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--color-text);
  margin-top: 2px;
}
.n2-attach-replace:hover {
  border-color: var(--color-accent-blue);
  color: var(--color-accent-blue);
}

/* ========== fusion: 7×2 多图网格 ========== */
.n2-grid-section {
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.n2-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.n2-grid-header .left {
  display: flex;
  gap: 8px;
  align-items: center;
}
.n2-grid-header .count {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-sunken);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}
.n2-grid-header .count b { color: var(--color-primary); }
.n2-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.n2-slot {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--dur-fast);
  background: var(--color-bg-sunken);
  border: 1.5px dashed var(--color-border);
  color: var(--color-text-faint);
}
.n2-slot:hover {
  border-color: var(--color-accent-blue);
  color: var(--color-accent-blue);
  background: var(--color-accent-blue-soft);
}
.n2-slot.filled {
  background: linear-gradient(135deg, #FFE08A 0%, #FF8FA3 100%);
  border-style: solid;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
  color: #FFF;
}
.n2-slot.filled .n2-slot-plus { display: none; }
.n2-slot-plus { font-size: 24px; font-weight: 600; line-height: 1; }
.n2-slot-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.n2-slot .field-file-preview {
  position: absolute;
  inset: 0;
}
.n2-slot .field-file-preview:empty { display: none; }
.n2-slot .field-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.n2-slot .field-file-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(31, 31, 31, 0.85);
  color: #FFF;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  border: none;
  z-index: 2;
}
.n2-slot .badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  color: #FFF;
  z-index: 1;
}
.n2-slot .badge.req { background: var(--color-primary); }
.n2-slot .badge.opt { background: rgba(31, 31, 31, 0.6); }
.n2-slot-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(31, 31, 31, 0.75);
  color: #FFF;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  border: none;
  z-index: 3;
}
.n2-slot-remove:hover { background: #DC2626; }
.n2-slot[hidden] { display: none; }

/* fusion: 「+ 添加图片」按钮作为 grid 内虚拟 slot */
.n2-slot-add {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0;
  font-family: inherit;
}
.n2-slot-add[hidden] { display: none; }

/* 小屏：chip 菜单右对齐防溢出（可选） */
@media (max-width: 640px) {
  .n2-grid { grid-template-columns: repeat(5, 1fr); }
  .n2-chip-menu { left: auto; right: 0; }
}

/* ========== Slider chip popout ========== */
.n2-chip-menu-slider {
  min-width: 240px;
  padding: 10px 12px;
  gap: 6px;
}
.n2-chip-slider-input {
  width: 100%;
  accent-color: var(--color-accent-blue);
  margin: 4px 0;
}
.n2-chip-slider-output {
  text-align: center;
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--color-accent-blue);
  padding: 2px 0;
}
.n2-chip-menu-help {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}
