/* 全局卡片式弹窗样式 - 优化版本 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10100;
    opacity: 0;
    /* 性能优化 */
    will-change: opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: opacity 0.25s ease-out;
}

.custom-modal-overlay.show {
    opacity: 1;
}

.custom-modal-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

.custom-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px) scale(0.95) translateZ(0);
    /* 性能优化 */
    will-change: transform, opacity;
    backface-visibility: hidden;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal-overlay.show .custom-modal {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
}

.custom-modal-overlay.hide .custom-modal {
    opacity: 0;
    transform: translateY(30px) scale(0.95) translateZ(0);
}

.custom-modal-large {
    max-width: 600px;
}

.custom-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.custom-modal-info h3 { color: #2563eb; }
.custom-modal-success h3 { color: #16a34a; }
.custom-modal-warning h3 { color: #ea580c; }
.custom-modal-error h3 { color: #dc2626; }

.custom-modal-body {
    padding: 20px 24px;
    color: #475569;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* 重要：允许flex子元素正确滚动 */
}

.custom-modal-body p {
    margin: 0;
}

.custom-modal-content {
    /* 支持HTML内容 */
}

/* 版本日志滚动区域样式 */
.custom-modal-body::-webkit-scrollbar {
    width: 6px;
}

.custom-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.custom-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 版本日志专用样式 */
.version-log-header {
    text-align: center;
    margin-bottom: 20px;
}

.version-log-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.version-log-title {
    color: #1e293b;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.version-log-subtitle {
    color: #94a3b8;
    font-size: 13px;
    margin: 8px 0 0 0;
}

.version-log-container {
    text-align: left;
}

.version-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.version-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.version-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.version-badge {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
}

.version-date {
    color: #94a3b8;
    font-size: 12px;
}

.version-changes {
    margin: 0;
    padding-left: 18px;
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}

.version-changes li {
    margin: 5px 0;
}

.custom-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.custom-btn {
    padding: 10px 20px;
    border: none !important;
    outline: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.custom-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.custom-btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.2);
}

.custom-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.custom-btn-secondary:hover {
    background: #e2e8f0;
}

.custom-btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.custom-input {
    outline: none;
}

.custom-input:focus {
    border-color: #2a5298 !important;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* 加载动画 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #2a5298;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式 */
@media (max-width: 600px) {
    .custom-modal {
        min-width: auto;
        width: 90%;
        margin: 0 20px;
    }
}
