/* public/assets/css/image/demoire.css */
.demoire-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #3b82f6; --p-primary-hover: #2563eb; --p-success: #10b981; --p-text: #0f172a; --p-text-muted: #64748b; width: 100%; max-width: 1200px; margin: 0 auto; background: var(--p-bg); border-radius: 20px; padding: 24px; border: 1px solid var(--p-border); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); box-sizing: border-box; }
.demoire-wrapper *, .demoire-wrapper *::before, .demoire-wrapper *::after { box-sizing: border-box; }

.demoire-header { text-align: center; margin-bottom: 24px; border-bottom: 1px solid var(--p-border); padding-bottom: 24px; }
.demoire-title { font-size: 1.6rem; font-weight: 800; color: var(--p-text); margin: 0 0 10px 0; }
.demoire-subtitle { font-size: 0.95rem; color: var(--p-text-muted); max-width: 800px; margin: 0 auto; line-height: 1.6; }

/* 上传区 */
.demoire-upload-area { border: 2px dashed #cbd5e1; border-radius: 16px; padding: 60px 20px; text-align: center; background: #f8fafc; cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.demoire-upload-area:hover, .demoire-upload-area.dragover { border-color: var(--p-primary); background: #eff6ff; }
.demoire-upload-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.8; }
.demoire-upload-text { font-size: 1.1rem; font-weight: 700; color: var(--p-text); margin-bottom: 8px; }
.demoire-upload-hint { font-size: 0.9rem; color: var(--p-text-muted); }

/* 工作区布局 */
.demoire-layout { display: flex; flex-direction: row; gap: 24px; align-items: stretch; }
@media (max-width: 900px) { .demoire-layout { flex-direction: column; } }

.demoire-preview-panel { flex: 2; display: flex; flex-direction: column; background: #f8fafc; border: 1px solid var(--p-border); border-radius: 16px; overflow: hidden; }
.demoire-controls-panel { flex: 1; display: flex; flex-direction: column; background: #f8fafc; border: 1px solid var(--p-border); border-radius: 16px; overflow: hidden; min-width: 300px; }

.demoire-panel-title { font-size: 1.05rem; font-weight: 700; color: var(--p-text); padding: 16px 20px; background: #ffffff; border-bottom: 1px solid var(--p-border); margin: 0; }
.demoire-controls-body { padding: 20px; display: flex; flex-direction: column; flex: 1; justify-content: space-between; }

/* 对比容器组件 */
.demoire-compare-container { position: relative; width: 100%; aspect-ratio: 4/3; background: #cbd5e1; overflow: hidden; user-select: none; }
.demoire-img-after, .demoire-img-before { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: #0f172a; pointer-events: none; }
.demoire-img-before-wrapper { position: absolute; top: 0; left: 0; width: 50%; height: 100%; overflow: hidden; z-index: 2; }
.demoire-img-before { width: 200%; /* 因为 wrapper 是 50%，图片必须放大回 200% 才能与底层重合 */ max-width: none; }

.demoire-slider-handle { position: absolute; top: 0; left: 50%; height: 100%; width: 40px; transform: translateX(-50%); z-index: 3; cursor: ew-resize; display: flex; align-items: center; justify-content: center; }
.demoire-slider-line { position: absolute; top: 0; bottom: 0; width: 4px; background: #ffffff; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.demoire-slider-button { position: relative; width: 36px; height: 36px; background: #ffffff; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #0f172a; box-shadow: 0 2px 10px rgba(0,0,0,0.3); border: 2px solid #e2e8f0; }
.demoire-slider-button svg { width: 14px; height: 14px; }

.demoire-badge { position: absolute; top: 12px; padding: 4px 10px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.8rem; font-weight: 600; border-radius: 4px; z-index: 4; backdrop-filter: blur(4px); }
.badge-before { left: 12px; }
.badge-after { right: 12px; }

/* 表单与按钮 */
.demoire-form-group { display: flex; flex-direction: column; gap: 8px; }
.demoire-label { font-size: 0.95rem; font-weight: 700; color: #334155; display: flex; justify-content: space-between; }
.demoire-val { color: var(--p-primary); }
.demoire-slider { width: 100%; accent-color: var(--p-primary); cursor: pointer; }
.demoire-hint { font-size: 0.8rem; color: #94a3b8; line-height: 1.4; }

.demoire-action-group { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.demoire-btn-primary, .demoire-btn-success, .demoire-btn-outline { width: 100%; padding: 14px; border-radius: 10px; font-weight: 700; font-size: 1.05rem; cursor: pointer; border: none; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.demoire-btn-primary { background: var(--p-primary); color: #ffffff; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.demoire-btn-primary:hover:not(:disabled) { background: var(--p-primary-hover); transform: translateY(-2px); }
.demoire-btn-success { background: var(--p-success); color: #ffffff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.demoire-btn-success:hover:not(:disabled) { background: #059669; transform: translateY(-2px); }
.demoire-btn-outline { background: transparent; color: #64748b; border: 2px solid #cbd5e1; }
.demoire-btn-outline:hover:not(:disabled) { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* 黑夜模式 */
[data-theme="dark"] .demoire-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .demoire-title, [data-theme="dark"] .demoire-panel-title, [data-theme="dark"] .demoire-upload-text, [data-theme="dark"] .demoire-label { color: #f8fafc; }
[data-theme="dark"] .demoire-subtitle, [data-theme="dark"] .demoire-hint, [data-theme="dark"] .demoire-upload-hint { color: #94a3b8; }
[data-theme="dark"] .demoire-upload-area { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .demoire-upload-area:hover { background: #1e293b; border-color: var(--p-primary); }
[data-theme="dark"] .demoire-preview-panel, [data-theme="dark"] .demoire-controls-panel { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .demoire-panel-title { background: #1e293b; border-color: #475569; }
[data-theme="dark"] .demoire-compare-container { background: #020617; }
[data-theme="dark"] .demoire-btn-outline { border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .demoire-btn-outline:hover:not(:disabled) { background: #1e293b; color: #fff; }