/* ==========================================================================
   内网工具集 · 图片合成类工具样式（Q4 共用）
   ---------------------------------------------------------------------------
   只放「两个以上页面都要用」的部分：左右分栏、棋盘格舞台、滑块行、预设胶囊、
   缩略图列表。每页独有的排版仍写在自己 <style> 里。
   ========================================================================== */

.ifx-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.ifx-2col > * { min-width: 0; }

/* 左栏宽、右栏窄的反向布局：调色板在左、预览在右时用 */
.ifx-2col.rev { grid-template-columns: 320px minmax(0, 1fr); }

.ifx-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--panel-sunken);
  background-image:
    linear-gradient(45deg, rgba(128, 138, 156, .10) 25%, transparent 25%, transparent 75%, rgba(128, 138, 156, .10) 75%),
    linear-gradient(45deg, rgba(128, 138, 156, .10) 25%, transparent 25%, transparent 75%, rgba(128, 138, 156, .10) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  overflow: hidden;
}
.ifx-stage canvas,
.ifx-stage img,
.ifx-stage svg { display: block; max-width: 100%; height: auto; }
.ifx-stage.plain { background-image: none; background-color: var(--panel-sunken); }
.ifx-stage.dark { background-image: none; background-color: #0b1120; }
.ifx-stage.tight { min-height: 0; padding: 0; }

.ifx-ctl { display: grid; gap: 13px; }
.ifx-row { display: grid; gap: 5px; }
.ifx-row > label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.ifx-row .v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ifx-row input[type="range"] { width: 100%; }
.ifx-row input[type="text"],
.ifx-row input[type="number"],
.ifx-row select,
.ifx-row textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ifx-row textarea { resize: vertical; min-height: 68px; line-height: 1.6; }

.ifx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ifx-chip {
  padding: 5px 11px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.ifx-chip:hover { border-color: var(--border-strong); color: var(--text); }
.ifx-chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.ifx-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ifx-note {
  font-size: 12px;
  line-height: 1.85;
  color: var(--text-dim);
}
.ifx-note b { color: var(--text); }
/* 段落之间必须留空。只靠 line-height 会让整块说明挤成一坨，
   读者分不清哪句是新的一段——v3.67.0 才发现这是全局缺失。 */
.ifx-note p { margin: 0 0 9px; }
.ifx-note p:last-child { margin-bottom: 0; }
.ifx-note code {
  font-family: var(--mono); font-size: .94em; padding: 1px 4px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
}

.ifx-out {
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  background: var(--panel-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ifx-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.ifx-thumb {
  position: relative;
  width: 78px;
  height: 78px;
  overflow: hidden;
  background: var(--panel-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ifx-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ifx-thumb .n {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 0 4px;
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border-radius: 4px;
}
.ifx-thumb .x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, .62);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.ifx-thumb .x:hover { background: #b42318; }

.ifx-kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}
.ifx-kv > div {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--panel-sunken);
  border-radius: 8px;
}
.ifx-kv b {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 色块条：配色方案、渐变预览都用 */
.ifx-pal { display: flex; height: 84px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.ifx-pal > button {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  position: relative;
}
.ifx-pal > button span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #fff;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .12s;
}
.ifx-pal > button:hover span { opacity: 1; }

@media (max-width: 900px) {
  .ifx-2col,
  .ifx-2col.rev { grid-template-columns: 1fr; }
  .ifx-stage { min-height: 200px; padding: 10px; }
  .ifx-thumb { width: 64px; height: 64px; }
}
