/* public/assets/css/image/mosaic.css */
.mosaic-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; font-family: system-ui, -apple-system, sans-serif; }
.mosaic-wrapper *, .mosaic-wrapper *::before, .mosaic-wrapper *::after { box-sizing: border-box; }

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

/* 上传区 */
.mosaic-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; }
.mosaic-upload-area:hover, .mosaic-upload-area.dragover { border-color: var(--p-primary); background: #eff6ff; }
.mosaic-upload-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.8; }
.mosaic-upload-text { font-size: 1.1rem; font-weight: 700; color: var(--p-text); margin-bottom: 8px; }
.mosaic-upload-hint { font-size: 0.9rem; color: var(--p-text-muted); }

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

.mosaic-preview-panel { flex: 2; display: flex; flex-direction: column; background: #0f172a; border-radius: 16px; overflow: hidden; border: 1px solid var(--p-border); }
.mosaic-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; }

.mosaic-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; }
.mosaic-preview-panel .mosaic-panel-title { color: #f8fafc; background: #1e293b; border-bottom-color: #334155; }

.mosaic-controls-body { padding: 24px 20px; display: flex; flex-direction: column; flex: 1; justify-content: flex-start; }

/* 核心编辑画板区 */
.mosaic-canvas-container { position: relative; width: 100%; min-height: 400px; height: 60vh; background: #000 url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="10" height="10" fill="%231e293b"/><rect x="10" y="10" width="10" height="10" fill="%231e293b"/><rect x="10" width="10" height="10" fill="%230f172a"/><rect y="10" width="10" height="10" fill="%230f172a"/></svg>'); display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: crosshair; }
.mosaic-canvas { display: block; box-shadow: 0 0 20px rgba(0,0,0,0.5); }

/* 悬浮笔刷提示圈 */
.mosaic-cursor { position: absolute; border: 2px solid #ffffff; background: rgba(255,255,255,0.2); border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); display: none; z-index: 10; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
.mosaic-canvas-container:hover .mosaic-cursor { display: block; }

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

/* 画笔工具切换 */
.mosaic-tool-group { display: flex; gap: 12px; }
.mosaic-tool-btn { flex: 1; padding: 12px; border-radius: 10px; border: 2px solid #cbd5e1; background: #ffffff; font-weight: 700; color: #475569; cursor: pointer; transition: 0.2s; font-size: 0.95rem; display: flex; justify-content: center; align-items: center; gap: 6px; }
.mosaic-tool-btn:hover { border-color: #94a3b8; }
.mosaic-tool-btn.active { border-color: var(--p-primary); background: #eff6ff; color: var(--p-primary); }

.mosaic-action-group { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding-top: 32px; }
.mosaic-btn-success, .mosaic-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; }
.mosaic-btn-success { background: var(--p-success); color: #ffffff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.mosaic-btn-success:hover { background: #059669; transform: translateY(-2px); }
.mosaic-btn-outline { background: #ffffff; color: #475569; border: 1px solid #cbd5e1; }
.mosaic-btn-outline:hover { background: #f1f5f9; color: #0f172a; }
.mosaic-btn-outline.danger { color: #ef4444; border-color: #fecaca; background: #fef2f2; }
.mosaic-btn-outline.danger:hover { background: #fee2e2; border-color: #fca5a5; }

/* 黑夜模式 */
[data-theme="dark"] .mosaic-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .mosaic-title, [data-theme="dark"] .mosaic-panel-title, [data-theme="dark"] .mosaic-upload-text, [data-theme="dark"] .mosaic-label { color: #f8fafc; }
[data-theme="dark"] .mosaic-subtitle, [data-theme="dark"] .mosaic-hint, [data-theme="dark"] .mosaic-upload-hint { color: #94a3b8; }
[data-theme="dark"] .mosaic-upload-area { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .mosaic-upload-area:hover { background: #1e293b; border-color: var(--p-primary); }
[data-theme="dark"] .mosaic-controls-panel { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .mosaic-panel-title { background: #1e293b; border-color: #475569; }
[data-theme="dark"] .mosaic-tool-btn { background: #1e293b; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .mosaic-tool-btn:hover { border-color: #64748b; }
[data-theme="dark"] .mosaic-tool-btn.active { border-color: var(--p-primary); background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
[data-theme="dark"] .mosaic-btn-outline { background: #1e293b; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .mosaic-btn-outline:hover { background: #0f172a; color: #fff; border-color: #64748b; }
[data-theme="dark"] .mosaic-btn-outline.danger { background: rgba(239, 68, 68, 0.1); border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .mosaic-btn-outline.danger:hover { background: rgba(239, 68, 68, 0.2); }