/* public/assets/css/tools/image/image-hdr-editor.css */
.hdr-wrap {
    width: 100%; display: flex; flex-direction: column;
}

.hdr-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 0 20px 0; margin-bottom: 20px; border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap; gap: 16px;
}
.hdr-header-text h1 { font-size: 1.5rem; margin: 0; color: var(--text-main); font-weight: 700; display: flex; align-items: center; gap: 8px;}
.hdr-file-name { font-size: 0.9rem; color: var(--text-muted); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; flex: 1; margin: 0 20px;}
.hdr-live-badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; background: rgba(255,169,77,.15); color: #ffa94d; font-weight: 600; border: 1px solid rgba(255,169,77,.3);}
.hdr-top-actions { display: flex; gap: 10px; }

.hdr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); padding: 8px 16px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: 0.2s; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.05);}
.hdr-btn:hover:not(:disabled) { background: var(--bg-body); border-color: var(--primary-color); color: var(--primary-color);}
.hdr-btn:active:not(:disabled) { transform: scale(.98); }
.hdr-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hdr-btn.hdr-primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); border: none; color: #fff; box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);}
.hdr-btn.hdr-primary:hover:not(:disabled) { filter: brightness(1.1); color: #fff; border-color: transparent;}
.hdr-btn.hdr-ghost { background: var(--bg-surface); }
.hdr-btn svg { width: 16px; height: 16px; }

.hdr-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 340px; gap: 24px; align-items: start; }

.hdr-panel { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); overflow: hidden; display: flex; flex-direction: column;}
.hdr-sidebar-left { max-height: 75vh; }
.hdr-sidebar-header { padding: 16px 20px; font-size: 0.85rem; font-weight: 700; color: var(--text-main); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color);}
.hdr-sidebar-header span { font-weight: 500; color: var(--text-muted);}
.hdr-photo-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hdr-photo-list::-webkit-scrollbar { width: 6px; }
.hdr-photo-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.hdr-photo-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--bg-body); border: 2px solid transparent; cursor: pointer; transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.05);}
.hdr-photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hdr-photo-item:hover { border-color: var(--border-color); }
.hdr-photo-item.active { border-color: var(--primary-color); box-shadow: 0 4px 12px rgba(var(--primary-rgb),0.3); }
.hdr-photo-item .hdr-remove { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 0.75rem; cursor: pointer; display: none; align-items: center; justify-content: center; }
.hdr-photo-item:hover .hdr-remove { display: flex; }
.hdr-photo-item .hdr-remove:hover { background: var(--danger); }
.hdr-photo-item .hdr-live-tag { position: absolute; bottom: 6px; left: 6px; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; background: rgba(255,169,77,.9); color: #fff; font-weight: 600; cursor: pointer; user-select: none; transition: 0.2s; }
.hdr-photo-item .hdr-live-tag:hover { background: #ffa94d; }
.hdr-photo-item .hdr-live-tag.off { background: var(--border-color); color: var(--text-muted); }
.hdr-photo-item .hdr-live-tag.off:hover { background: rgba(0,0,0,.6); color: #fff; }

.hdr-add-photo { margin: 0 16px 16px; padding: 12px; border: 2px dashed var(--border-color); border-radius: 10px; background: transparent; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hdr-add-photo:hover { border-color: var(--primary-color); color: var(--primary-color); background: rgba(var(--primary-rgb), 0.05); }

.hdr-workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; overflow: hidden; background: var(--bg-body); border-radius: 16px; border: 1px solid var(--border-color); box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);}
.hdr-canvas-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 400px; position: relative; }
#hdrPreviewCanvas { max-width: 100%; max-height: 100%; display: block; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.hdr-canvas-toolbar { flex: none; padding: 12px 24px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg-surface); border-top: 1px solid var(--border-color);}
.hdr-hold-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 20px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-main); font-size: 0.9rem; font-weight: 500; cursor: pointer; user-select: none; transition: 0.2s; }
.hdr-hold-btn:hover:not(:disabled) { background: var(--border-color); }
.hdr-hold-btn:active, .hdr-hold-btn.holding { background: var(--primary-color); border-color: var(--primary-color); color: #fff;}
.hdr-hold-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hdr-empty-state { display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--text-muted); text-align: center; }
.hdr-empty-state svg { width: 56px; height: 56px; opacity: 0.5; color: var(--primary-color);}
.hdr-empty-state p { font-size: 1rem; line-height: 1.7; font-weight: 500;}
.hdr-empty-state span { font-size: 0.85rem; font-weight: 400;}

.hdr-sidebar-right { max-height: 75vh; }
.hdr-group { padding: 20px; border-bottom: 1px solid var(--border-color); }
.hdr-group:last-child { border-bottom: 0; }
.hdr-group-title { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.hdr-group-title .hdr-reset { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); background: var(--bg-body); border: 1px solid var(--border-color); cursor: pointer; padding: 4px 10px; border-radius: 6px; transition: 0.2s;}
.hdr-group-title .hdr-reset:hover { background: var(--border-color); color: var(--text-main); }

.hdr-smart-btn { width: 100%; margin-bottom: 16px; padding: 12px; border-radius: 10px; background: linear-gradient(135deg, rgba(var(--primary-rgb),.1), rgba(var(--primary-rgb),.05)); border: 1px solid rgba(var(--primary-rgb),.3); color: var(--text-main); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hdr-smart-btn:hover:not(:disabled) { background: linear-gradient(135deg, rgba(var(--primary-rgb),.15), rgba(var(--primary-rgb),.1)); border-color: var(--primary-color); }
.hdr-smart-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hdr-smart-btn .hdr-hint-txt { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-left: 6px; }

.hdr-smart-info { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; padding: 10px 12px; margin-bottom: 16px; background: rgba(16,185,129,.05); border: 1px solid rgba(16,185,129,.2); border-radius: 8px; display: none; }
.hdr-smart-info.show { display: block; }
.hdr-smart-info b { color: #10b981; font-weight: 600; }

.hdr-preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hdr-preset-btn { padding: 8px 4px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-muted); font-size: 0.85rem; cursor: pointer; transition: 0.2s; text-align: center; font-weight: 500;}
.hdr-preset-btn:hover { border-color: var(--primary-color); color: var(--text-main); }
.hdr-preset-btn.active { border-color: var(--primary-color); background: rgba(var(--primary-rgb), 0.08); color: var(--primary-color); font-weight: 600; box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.1);}
.hdr-preset-btn.smart { background: var(--bg-surface); color: var(--primary-color); }

.hdr-slider-row { margin-bottom: 16px; }
.hdr-slider-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hdr-slider-label span:first-child { font-size: 0.85rem; color: var(--text-main); font-weight: 500;}
.hdr-slider-label span:last-child { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.hdr-slider-row input[type="range"] { width: 100%; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px; background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--fill, 50%), var(--border-color) var(--fill, 50%), var(--border-color) 100%); outline: none; cursor: pointer; }
.hdr-slider-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--primary-color); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3); }

.hdr-format-list { display: flex; flex-direction: column; gap: 8px; }
.hdr-format-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-body); cursor: pointer; transition: 0.2s; }
.hdr-format-item:hover { border-color: var(--primary-color); }
.hdr-format-item.active { border-color: var(--primary-color); background: rgba(var(--primary-rgb), 0.05); }
.hdr-format-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-color); flex: none; margin-top: 2px; position: relative; transition: 0.2s; background: var(--bg-surface);}
.hdr-format-item.active .hdr-format-radio { border-color: var(--primary-color); }
.hdr-format-item.active .hdr-format-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary-color); }
.hdr-format-info { flex: 1; min-width: 0; }
.hdr-format-info .hdr-fname { font-size: 0.9rem; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.hdr-format-info .hdr-ftag { font-size: 0.7rem; font-weight: 500; padding: 2px 6px; border-radius: 4px; background: var(--border-color); color: var(--text-muted); }
.hdr-format-item.active .hdr-ftag { background: rgba(var(--primary-rgb),.15); color: var(--primary-color); }
.hdr-format-info .hdr-fdesc { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

.hdr-curve-wrap { margin-top: 16px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px 12px; }
.hdr-curve-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hdr-curve-head span:first-child { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.hdr-curve-head span:last-child { font-size: 0.75rem; color: var(--text-muted); }
.hdr-curve-canvas { display: block; width: 100%; height: 120px; }
.hdr-curve-legend { display: flex; gap: 12px; margin-top: 12px; font-size: 0.75rem; color: var(--text-muted); justify-content: center;}
.hdr-curve-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hdr-curve-legend .hdr-dot { width: 12px; height: 3px; border-radius: 1.5px; display: inline-block; }

.hdr-notice { margin-top: 12px; padding: 12px; background: rgba(var(--primary-rgb),.05); border: 1px solid rgba(var(--primary-rgb),.15); border-radius: 8px; font-size: 0.85rem; color: var(--primary-color); line-height: 1.6; }
.hdr-notice.hdr-live { background: rgba(255,169,77,.08); border-color: rgba(255,169,77,.22); color: #d4a35e; }

.hdr-export-btns { display: flex; gap: 12px; margin-top: 8px; }
.hdr-export-btns .hdr-btn { flex: 1; padding: 12px; font-size: 1rem;}

.hdr-meta-info { padding: 16px 20px; font-size: 0.85rem; color: var(--text-muted); line-height: 1.8; border-top: 1px solid var(--border-color); background: var(--bg-body);}
.hdr-meta-info b { color: var(--text-main); font-weight: 600; }

.hdr-loading-overlay { position: fixed; inset: 0; background: rgba(var(--bg-surface-rgb), 0.75); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.hdr-loading-box { background: var(--bg-surface); padding: 24px 32px; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: 0 10px 40px rgba(0,0,0,.15); display: flex; align-items: center; gap: 16px; font-size: 1rem; color: var(--text-main); font-weight: 600;}
.hdr-spinner { width: 24px; height: 24px; border: 3px solid var(--border-color); border-top-color: var(--primary-color); border-radius: 50%; animation: hdr-spin .7s linear infinite; }
@keyframes hdr-spin { to { transform: rotate(360deg); } }

.hdr-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text-main); color: var(--bg-surface); padding: 12px 24px; border-radius: 12px; font-size: 0.95rem; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: 0.3s; z-index: 1200; }
.hdr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hdr-wrap [hidden], .hdr-loading-overlay[hidden] { display: none !important; }

/* 响应式适配 */
@media (max-width: 1024px) {
    .hdr-layout { grid-template-columns: 1fr; border: none; background: transparent; gap: 20px;}
    .hdr-sidebar-left { width: 100%; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 16px; gap: 12px; border: 1px solid var(--border-color); border-radius: 16px; max-height: unset;}
    .hdr-sidebar-header { display: none; }
    .hdr-photo-list { flex-direction: row; padding: 0; overflow-x: auto; }
    .hdr-photo-item { width: 72px; height: 72px; flex: none; }
    .hdr-add-photo { margin: 0; padding: 12px 20px; flex: none; height: 72px;}
    .hdr-workspace { min-height: 400px; border-radius: 16px;}
    .hdr-sidebar-right { width: 100%; max-height: none; border-left: none; border: 1px solid var(--border-color); border-radius: 16px;}
    .hdr-file-name { display: none; }
    .hdr-top-actions .pc-text { display: none; }
}
@media (max-width: 600px) {
    .hdr-preset-grid { grid-template-columns: repeat(3, 1fr); }
}