/* export-modal.css - 导出弹窗样式 V1.0
 * 支持PC端和手机端响应式设计
 */

/* ========== 弹窗遮罩层 ========== */
.export-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== 弹窗主体 ========== */
.export-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(238, 187, 85, 0.2);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 大弹窗（用于打印预览） */
.export-modal.large {
    max-width: 800px;
    max-height: 90vh;
}

/* ========== 弹窗头部 ========== */
.export-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(238, 187, 85, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(238, 187, 85, 0.05);
}

.export-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #eebb55;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-modal-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.export-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ========== 弹窗主体内容 ========== */
.export-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* 导出选项 */
.export-option {
    margin-bottom: 20px;
}

.export-option:last-child {
    margin-bottom: 0;
}

.export-option label {
    display: block;
    color: #ddd;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.export-option label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.export-option select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(238, 187, 85, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-option select:hover {
    border-color: rgba(238, 187, 85, 0.4);
    background: rgba(0, 0, 0, 0.4);
}

.export-option select:focus {
    outline: none;
    border-color: #eebb55;
    box-shadow: 0 0 0 3px rgba(238, 187, 85, 0.1);
}

/* ========== 打印预览区域 ========== */
.print-preview-area {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    min-height: 400px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: 500px;
}

/* ========== 弹窗底部 ========== */
.export-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(238, 187, 85, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.2);
}

.export-modal-footer button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.btn-primary {
    background: linear-gradient(135deg, #eebb55 0%, #d4a445 100%);
    color: #1a1a2e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 187, 85, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ========== 手机端适配 ========== */
.export-modal.mobile {
    width: 95%;
    max-width: none;
    margin: 10px;
}

.export-modal.mobile .export-modal-header {
    padding: 16px 20px;
}

.export-modal.mobile .export-modal-header h3 {
    font-size: 16px;
}

.export-modal.mobile .export-modal-body {
    padding: 20px;
}

.export-modal.mobile .export-modal-footer {
    padding: 12px 20px;
    flex-direction: column-reverse;
}

.export-modal.mobile .export-modal-footer button {
    width: 100%;
    min-width: auto;
}

.export-modal.mobile .print-preview-area {
    min-height: 300px;
    max-height: 400px;
}

/* ========== 质量指示器 ========== */
.quality-indicator {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(238, 187, 85, 0.2);
    border-radius: 4px;
    font-size: 11px;
    color: #eebb55;
}

/* ========== 提示信息 ========== */
.export-tip {
    padding: 12px;
    background: rgba(238, 187, 85, 0.1);
    border-left: 3px solid #eebb55;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 13px;
    color: #ddd;
    line-height: 1.6;
}

.export-tip strong {
    color: #eebb55;
}

/* ========== 加载动画 ========== */
.export-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #aaa;
}

.export-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(238, 187, 85, 0.2);
    border-top-color: #eebb55;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.export-loading-text {
    font-size: 14px;
    color: #ddd;
}

/* ========== 移动端优化 ========== */
@media (max-width: 768px) {
    .export-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .export-modal {
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        width: 100%;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .export-option select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    /* 增加触摸区域 */
    .export-modal-close {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}

/* ========== 深色模式优化 ========== */
@media (prefers-color-scheme: dark) {
    .print-preview-area {
        background: #f5f5f5;
        color: #333;
    }
}

/* ========== 打印时隐藏 ========== */
@media print {
    .export-modal-overlay,
    .export-modal {
        display: none !important;
    }
}
