/* ==================== 长图拼接 / 自由拼图 通用样式 ====================
 * 纯色卡片 + 细边框，无渐变、无毛玻璃；三栏：图片列表 / 画布 / 参数。
 * 颜色与表单控件沿用 site.css 的全局变量。
 * ==================================================================== */
.cl-page { display: flex; flex-direction: column; gap: 14px; }
.cl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cl-head h1 { font-size: clamp(1.5rem, 3.2vw, 2rem); font-weight: 800; margin: 0 0 4px; letter-spacing: -.02em; }
.cl-head p { margin: 0; color: var(--text-dim); font-size: .875rem; max-width: 760px; line-height: 1.65; }
.cl-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-actions input[type="file"] { display: none; }

.cl-shell { display: grid; grid-template-columns: 186px minmax(0, 1fr) 292px; gap: 12px; align-items: start; }
.cl-col { border: 1px solid var(--border); background: var(--bg-card); border-radius: 10px; min-width: 0; }
.cl-col-title { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .82rem; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-col-title small { font-weight: 400; color: var(--text-dim); }

/* 图片列表 */
.cl-strip { max-height: 660px; overflow-y: auto; padding: 8px; scrollbar-gutter: stable; }
.cl-thumb { position: relative; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev); padding: 4px; margin-bottom: 8px; cursor: grab; }
.cl-thumb.dragging { opacity: .4; }
.cl-thumb.over { border-color: var(--accent); }
.cl-thumb img { display: block; width: 100%; height: 78px; object-fit: cover; border-radius: 5px; background: #fff; }
.cl-thumb-index { position: absolute; left: 8px; top: 8px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 5px; background: rgba(31,36,48,.78); color: #fff; font-size: 11px; line-height: 19px; text-align: center; }
.cl-thumb-btns { display: flex; gap: 4px; margin-top: 5px; }
.cl-thumb-btns button { flex: 1; height: 25px; border: 1px solid var(--border); background: var(--bg); color: var(--text-dim); border-radius: 5px; font-size: 13px; line-height: 1; cursor: pointer; }
.cl-thumb-btns button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cl-thumb-btns button:disabled { opacity: .35; cursor: default; }
.cl-add { width: 100%; height: 36px; border: 1px dashed var(--border-strong); background: var(--bg); color: var(--text-dim); border-radius: 7px; cursor: pointer; font-size: .82rem; }
.cl-add:hover { border-color: var(--accent); color: var(--accent); }
.cl-drop { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 16px 8px; text-align: center; color: var(--text-dim); font-size: .8rem; line-height: 1.7; cursor: pointer; }
.cl-drop:hover, .cl-drop.hot { border-color: var(--accent); color: var(--accent); background: var(--bg-elev); }
.cl-drop b { display: block; font-size: .84rem; color: var(--text); margin-bottom: 2px; }

/* 画布区 */
.cl-stage { height: 660px; overflow: auto; padding: 18px; display: flex; justify-content: center; align-items: flex-start; scrollbar-gutter: stable; background: var(--bg-elev); }
.cl-stage canvas { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 6px rgba(15,23,42,.12); border: 1px solid var(--border); }
.cl-stage-empty { margin: auto; text-align: center; color: var(--text-dim); font-size: .86rem; line-height: 1.8; }
.cl-stage-empty svg { width: 54px; height: 54px; stroke: var(--border-strong); fill: none; stroke-width: 1.4; display: block; margin: 0 auto 10px; }
.cl-note { padding: 8px 12px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: .78rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* 参数区 */
.cl-panel { max-height: 660px; overflow-y: auto; padding: 4px 12px 12px; scrollbar-gutter: stable; }
.cl-group { padding: 12px 0; border-bottom: 1px solid var(--border); }
.cl-group:last-child { border-bottom: 0; }
.cl-group > h3 { margin: 0 0 10px; font-size: .8rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.cl-group > h3::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--accent); }
.cl-field { margin-bottom: 10px; }
.cl-field:last-child { margin-bottom: 0; }
.cl-field label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--text-dim); margin-bottom: 5px; }
.cl-field label b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-field input[type="range"] { width: 100%; height: 20px; accent-color: var(--accent); cursor: pointer; }
.cl-field input[type="number"], .cl-field input[type="text"] { width: 100%; height: 36px; padding: 0 var(--field-px); border: 1px solid var(--field-border); border-radius: var(--field-radius); background: var(--field-bg); color: var(--field-text); font-size: .85rem; }
.cl-field input[type="number"]:focus, .cl-field input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--field-focus-ring); }
.cl-field input[type="color"] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--field-border); border-radius: 6px; background: var(--field-bg); cursor: pointer; }
.cl-color-row { display: flex; align-items: center; gap: 8px; }
.cl-color-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.cl-swatch { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border-strong); cursor: pointer; }
.cl-swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.cl-seg { display: flex; gap: 4px; background: var(--bg-elev); padding: 3px; border-radius: 8px; }
.cl-seg button { flex: 1; min-width: 0; height: 30px; border: 1px solid transparent; background: transparent; color: var(--text-dim); border-radius: 6px; font-size: .78rem; cursor: pointer; }
.cl-seg button.active { background: var(--bg-card); border-color: var(--border); color: var(--text); font-weight: 700; }
.cl-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cl-chip { border: 1px solid var(--border); background: var(--bg); color: var(--text-dim); border-radius: 6px; padding: 4px 9px; font-size: .76rem; cursor: pointer; }
.cl-chip:hover, .cl-chip.active { border-color: var(--accent); color: var(--accent); }
.cl-hint { margin-top: 6px; color: var(--text-dim); font-size: .74rem; line-height: 1.6; }
.cl-tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cl-tpl { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--border); background: var(--bg); border-radius: 7px; padding: 5px; cursor: pointer; }
.cl-tpl svg { width: 100%; height: 100%; }
.cl-tpl svg rect { fill: var(--border-strong); }
.cl-tpl.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cl-tpl.active svg rect { fill: var(--accent); }
.cl-tpl span { position: absolute; right: 3px; bottom: 2px; font-size: 10px; color: var(--text-dim); font-weight: 700; }

@media (max-width: 1100px) {
    .cl-shell { grid-template-columns: minmax(0, 1fr) 280px; }
    .cl-strip-col { grid-column: 1 / -1; }
    .cl-strip { max-height: none; display: flex; gap: 8px; overflow-x: auto; }
    .cl-thumb { flex: 0 0 128px; margin-bottom: 0; }
    .cl-add { flex: 0 0 96px; height: auto; align-self: stretch; }
}
@media (max-width: 760px) {
    .cl-shell { grid-template-columns: 1fr; }
    .cl-stage, .cl-panel { height: auto; max-height: none; }
    .cl-stage { min-height: 320px; max-height: 560px; }
    .cl-panel { max-height: none; }
    .cl-actions { width: 100%; }
    .cl-actions .btn { flex: 1; }
}
