/* 模态框样式 - 裁剪模态框 */

/* 裁剪模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 30000 !important; /* 高于所有其他元素（画布 20000，把手 20001，SVG 20001+），确保模态框在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.crop-container {
    width: 100%;
    height: 500px;
    margin: 20px 0;
    overflow: hidden;
    border: 1px solid #ddd;
}

#crop-image {
    max-width: 100%;
    height: auto;
}

#crop-btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#crop-btn:hover {
    background-color: #45a049;
}

/* 自定义确认弹窗样式 */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 50000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.confirm-modal.show {
    display: flex;
}

/* 遮罩层 */
.confirm-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease-out;
}

/* 弹窗主体 */
.confirm-dialog {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #fff8fa 100%);
    border-radius: 20px;
    padding: 32px 40px;
    min-width: 380px;
    max-width: 450px;
    box-shadow: 
        0 25px 50px -12px rgba(233, 30, 99, 0.25),
        0 0 0 1px rgba(233, 30, 99, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

/* 图标 */
.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--color-primary, #e91e63);
    animation: pulse 2s ease-in-out infinite;
}

.confirm-icon svg {
    width: 100%;
    height: 100%;
}

/* 标题 */
.confirm-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--color-primary, #e91e63), var(--color-primary-light, #f48fb1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 消息内容 */
.confirm-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 提示文字 */
.confirm-hint {
    font-size: 13px;
    color: #999;
    margin-bottom: 28px;
    line-height: 1.6;
    padding: 12px 16px;
    background: rgba(233, 30, 99, 0.05);
    border-radius: 10px;
    border-left: 3px solid var(--color-primary, #e91e63);
}

/* 按钮容器 */
.confirm-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* 按钮基础样式 */
.confirm-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.confirm-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

/* 只在支持 hover 的设备上应用 hover 效果 */
@media (hover: hover) {
    .confirm-btn:hover::before {
        width: 200px;
        height: 200px;
    }
}

/* 取消按钮 */
.confirm-btn-cancel {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #666;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (hover: hover) {
    .confirm-btn-cancel:hover {
        background: linear-gradient(135deg, #eee 0%, #ddd 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }
}

.confirm-btn-cancel:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #e0e0e0 0%, #d5d5d5 100%);
    opacity: 0.9;
}

/* 确定按钮 */
.confirm-btn-ok {
    background: linear-gradient(135deg, var(--color-primary, #e91e63), var(--color-primary-light, #f48fb1));
    color: white;
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.35);
}

@media (hover: hover) {
    .confirm-btn-ok:hover {
        background: linear-gradient(135deg, #d81b60, #ec407a);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(233, 30, 99, 0.45);
    }
}

.confirm-btn-ok:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, var(--color-primary-dark, #c2185b), var(--color-primary, #e91e63));
    opacity: 0.9;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 确认弹窗打开时禁用其他交互 */
body.confirm-modal-open .canvas-container,
body.confirm-modal-open .sidebar,
body.confirm-modal-open .action-buttons {
    pointer-events: none;
    user-select: none;
}

/* 隐藏所有手柄 */
body.confirm-modal-open .resize-handle {
    opacity: 0 !important;
    pointer-events: none !important;
}