/* AI 抠图：三栏布局与预览棋盘格。颜色与表单控件沿用 site.css 的全局变量。
   前缀统一用 cu-，避免与 chart.css 的 .ct-* 冲突。 */
.cu-page { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px 22px; }
.cu-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; }
.cu-head h1 { margin: 0; font-size: 26px; }
.cu-head p { margin: 0; color: var(--text-dim); font-size: 13px; }
.cu-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cu-actions .spacer { flex: 1 1 auto; }
.cu-hint { font-size: 12px; color: var(--text-dim); }

.cu-shell {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 300px;
    gap: 12px;
    align-items: start;
}
.cu-col {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 10px;
    min-width: 0;
    overflow: hidden;
}
.cu-col-title {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
}
.cu-src { padding: 10px; }
.cu-src-box {
    width: 100%;
    aspect-ratio: 1;
    border: 1px dashed var(--field-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    background: var(--bg-elev);
}
.cu-src-box:hover { border-color: var(--accent); }
.cu-src-box img { width: 100%; height: 100%; object-fit: contain; }
.cu-src-meta { margin-top: 8px; font-size: 12px; color: var(--text-dim); line-height: 1.7; word-break: break-all; }
.cu-empty-add { margin-top: 8px; width: 100%; white-space: nowrap; }

.cu-stage {
    position: relative;
    min-height: 620px;
    height: 620px;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 18px;
    background: var(--bg-elev);
    scrollbar-gutter: stable;
}
.cu-canvas-wrap {
    margin: auto;
    position: relative;
    line-height: 0;
    box-shadow: 0 2px 16px rgba(0,0,0,.12);
}
.cu-checker {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e4e4e4 25%, transparent 25%),
        linear-gradient(-45deg, #e4e4e4 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e4e4e4 75%),
        linear-gradient(-45deg, transparent 75%, #e4e4e4 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
#cuCanvas { display: block; max-width: none; touch-action: none; }
#cuCanvas.cu-brush { cursor: crosshair; }
.cu-stage-empty {
    margin: auto;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 2;
}
.cu-stage-empty b { display: block; font-size: 18px; color: var(--text); }

.cu-panel { padding: 4px 12px 14px; max-height: 620px; overflow-y: auto; scrollbar-gutter: stable; }
.cu-field { margin-bottom: 12px; }
.cu-field > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.cu-field .cu-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.cu-field input[type="range"] { width: 100%; }
.cu-field input[type="color"] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--field-border); border-radius: 6px; vertical-align: middle; }
.cu-field input[type="text"], .cu-field input[type="number"] { width: 100%; }
.cu-row { display: flex; align-items: center; gap: 8px; }
.cu-row .cu-val { margin-left: auto; font-size: 12px; color: var(--text-dim); min-width: 46px; text-align: right; }
.cu-seg { display: flex; border: 1px solid var(--field-border); border-radius: 8px; overflow: hidden; }
.cu-seg button { flex: 1; border: 0; background: var(--bg-card); padding: 7px 4px; font-size: 12px; cursor: pointer; }
.cu-seg button + button { border-left: 1px solid var(--field-border); }
.cu-seg button.active { background: var(--accent); color: #fff; }
.cu-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cu-chip { border: 1px solid var(--field-border); background: var(--bg-card); border-radius: 999px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.cu-chip:hover { border-color: var(--accent); }
.cu-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.cu-swatch.active { border-color: var(--accent); }
.cu-progress { height: 6px; border-radius: 99px; background: var(--field-muted-bg); overflow: hidden; margin-top: 8px; }
.cu-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.cu-status { font-size: 12px; color: var(--text-dim); min-height: 18px; margin-top: 6px; }
.cu-divider { height: 1px; background: var(--border); margin: 14px 0; }

@media (max-width: 1100px) {
    .cu-shell { grid-template-columns: 160px minmax(0, 1fr); }
    .cu-panel { grid-column: 1 / -1; max-height: none; }
}
@media (max-width: 760px) {
    .cu-shell { grid-template-columns: minmax(0, 1fr); }
    .cu-src { display: flex; gap: 10px; align-items: flex-start; }
    .cu-src-box { width: 120px; flex: none; }
    .cu-src-meta { margin-top: 0; }
    .cu-empty-add { width: auto; margin-top: 0; }
    .cu-stage { height: 460px; min-height: 460px; padding: 10px; }
}
