/* 图片拼接/长图生成工具 */
.ist-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.ist-panel { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 20px; }
.ist-section { margin-bottom: 18px; }
.ist-section:last-child { margin-bottom: 0; }
.ist-section h3 { display: flex; align-items: center; gap: 6px; font-size: .95rem; margin: 0 0 12px; }
.ist-section h3 i { color: var(--accent); }

.ist-upload {
  border: 2px dashed var(--rule);
  border-radius: var(--radius-sm);
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  background: var(--bg2);
}
.ist-upload:hover, .ist-upload.dragover { border-color: var(--accent); background: var(--accent-soft); }
.ist-upload i { font-size: 1.8rem; color: var(--accent); margin-bottom: 8px; display: block; }
.ist-upload p { color: var(--ink); font-size: .85rem; margin: 0 0 4px; }
.ist-hint { color: var(--muted); font-size: .75rem; }

.ist-form-row { margin-bottom: 12px; }
.ist-form-row label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.ist-form-row label output { color: var(--accent); font-weight: 600; }
.ist-form-row input[type="range"] { width: 100%; accent-color: var(--accent); }

.ist-mode-tabs { display: flex; gap: 4px; background: var(--bg2); border-radius: var(--radius-sm); padding: 3px; }
.ist-mode-tab {
  flex: 1; padding: 7px 3px; border: none; border-radius: 6px; background: transparent;
  font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.ist-mode-tab:hover { color: var(--ink); }
.ist-mode-tab.active { background: var(--bg); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.ist-color-options { display: flex; gap: 6px; flex-wrap: wrap; }
.ist-color-btn {
  width: 36px; height: 36px; border-radius: 6px; cursor: pointer; font-size: .65rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
  border: 1px solid var(--rule); background: var(--bg); color: var(--muted);
}
.ist-color-btn.active { box-shadow: 0 0 0 2px var(--accent); }

.ist-align-options { display: flex; gap: 6px; }
.ist-align-btn {
  flex: 1; padding: 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg);
  cursor: pointer; font-size: .85rem; color: var(--muted); transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.ist-align-btn:hover { border-color: var(--accent); color: var(--accent); }
.ist-align-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.ist-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ist-actions .btn { flex: 1; min-width: 90px; }

/* 缩略图与排序 */
.ist-thumbs { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; margin-bottom: 16px; justify-content: center; }
.ist-thumb-wrap {
  position: relative; width: 100px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px; background: var(--bg); border-radius: var(--radius-sm); border: 2px solid var(--rule);
  cursor: grab; transition: all .2s; user-select: none;
}
.ist-thumb-wrap:hover { border-color: var(--accent); box-shadow: 0 2px 8px var(--accent-soft); }
.ist-thumb-wrap.dragging { opacity: .5; cursor: grabbing; border-color: var(--accent); box-shadow: 0 4px 12px var(--accent-soft); }
.ist-thumb-wrap.drag-over { border-color: var(--accent); border-style: dashed; }
.ist-thumb-item { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; pointer-events: none; }
.ist-thumb-idx {
  position: absolute; top: 4px; left: 4px; background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 700; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ist-thumb-actions { display: flex; gap: 3px; width: 100%; justify-content: center; }
.ist-thumb-btn {
  width: 24px; height: 24px; border: none; border-radius: 4px; background: var(--bg2); color: var(--muted);
  font-size: .7rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.ist-thumb-btn:hover { background: var(--accent); color: #fff; }
.ist-thumb-btn.delete:hover { background: var(--danger); color: #fff; }
.ist-thumb-btn:disabled { opacity: .3; cursor: not-allowed; }

/* 预览区 */
.ist-preview-area {
  background: var(--bg2); border: 1px dashed var(--rule); border-radius: var(--radius-md);
  min-height: 320px; padding: 16px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; overflow: hidden;
}
.ist-result-wrap { width: 100%; display: flex; justify-content: center; overflow: auto; max-height: 600px; }
.ist-result-wrap canvas { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--rule); }
.ist-placeholder { text-align: center; color: var(--muted); }
.ist-placeholder i { font-size: 3rem; margin-bottom: 12px; color: var(--rule); display: block; }
.ist-placeholder p { margin: 0; font-size: .85rem; }

/* 使用提示 */
.ist-tips { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 16px; }
.ist-tips h4 { display: flex; align-items: center; gap: 6px; font-size: .9rem; margin: 0 0 12px; }
.ist-tips h4 i { color: var(--accent); }
.ist-tip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ist-tip-item { background: var(--bg2); border-radius: var(--radius-sm); padding: 10px 12px; border-left: 3px solid var(--accent); }
.ist-tip-item strong { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink); margin-bottom: 3px; }
.ist-tip-item strong i { color: var(--accent); }
.ist-tip-item p { font-size: .75rem; color: var(--muted); margin: 0; line-height: 1.5; }

@media (max-width: 900px) {
  .ist-grid { grid-template-columns: 1fr; }
  .ist-tip-grid { grid-template-columns: 1fr; }
  .ist-thumb-wrap { width: 85px; }
  .ist-thumb-item { width: 65px; height: 65px; }
}
