/* public/assets/css/image/snipping-tool.css */

.action-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.action-btn.sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 6px; }
.action-btn:hover:not(:disabled) { background: #e2e8f0; }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.action-btn.primary { background: var(--primary-color); color: #fff; border: none; box-shadow: 0 4px 10px rgba(0,102,204,0.2); }
.action-btn.primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
[data-theme="dark"] .action-btn { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .action-btn:hover:not(:disabled) { background: #334155; }
[data-theme="dark"] .action-btn.primary { color: #fff; background: var(--primary-color); }

.snip-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.snip-main-panel {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.snip-hint {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

.snip-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
}
[data-theme="dark"] .workspace-header { background: #1e293b; }

.canvas-wrapper {
    position: relative;
    flex: 1;
    background: #e2e8f0;
    overflow: auto; /* 允许滚动大图 */
    cursor: crosshair;
}
[data-theme="dark"] .canvas-wrapper { background: #0f172a; }

/* 防止选中图片时的默认拖拽行为 */
#screenCanvas {
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.selection-box {
    position: absolute;
    border: 2px dashed #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    pointer-events: none; /* 让鼠标事件穿透到下层的 Canvas */
    display: none;
    z-index: 10;
}

/* 侧边栏预览 */
.snip-side-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.side-header {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}

.preview-container {
    width: 100%;
    height: 200px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
[data-theme="dark"] .preview-container { background: #0f172a; border-color: #334155; }

.preview-container .empty-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons .action-btn { width: 100%; }

@media (max-width: 850px) {
    .pc-text { display: none !important; }
    .snip-layout { flex-direction: column; }
    .snip-side-panel { width: 100%; }
    .canvas-wrapper { max-height: 50vh; }
}