/**
 * PODesigner 前端设计器弹窗样式
 */

/* 设计器弹窗 */
.podesigner-designer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    flex-direction: column;
}

.podesigner-designer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #1a1a1a;
    color: #fff;
}

.podesigner-designer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.podesigner-designer-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.podesigner-designer-close:hover {
    opacity: 1;
}

.podesigner-designer-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.podesigner-designer-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* 加载状态 */
.podesigner-designer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
}

.podesigner-designer-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: podesigner-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes podesigner-spin {
    to {
        transform: rotate(360deg);
    }
}

.podesigner-designer-loading p {
    margin: 0;
    font-size: 14px;
}

/* 按钮加载状态 */
.baijia-design-now.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.baijia-design-now.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: podesigner-spin 1s linear infinite;
    right: 15px;
    top: 50%;
    margin-top: -8px;
}

/* 错误提示 */
.podesigner-error-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #d63638;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: podesigner-toast-in 0.3s ease;
}

@keyframes podesigner-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 禁用滚动 */
body.podesigner-modal-open {
    overflow: hidden;
}

/* 响应式 */
@media (max-width: 768px) {
    .podesigner-designer-header {
        padding: 8px 15px;
    }
    
    .podesigner-designer-header h3 {
        font-size: 14px;
    }
}

/* 加载中遮罩 */
.podesigner-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podesigner-loading-content {
    text-align: center;
    color: #fff;
}

.podesigner-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: podesigner-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.podesigner-loading-content p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* 设计结果弹窗 */
.podesigner-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.podesigner-result-content {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.podesigner-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #fff;
    color: #333;
}

.podesigner-result-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.podesigner-result-close {
    background: #f5f5f5;
    border: none;
    color: #666;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.podesigner-result-close:hover {
    background: #e5e5e5;
}

.podesigner-result-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.result-section {
    margin-bottom: 24px;
}

.result-section:last-child {
    margin-bottom: 0;
}

.result-section h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-left: 3px solid #333;
    padding-left: 10px;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge.status-3 {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-2 {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-1 {
    background: #cce5ff;
    color: #004085;
}

.task-id {
    font-size: 12px;
    color: #888;
}

.result-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.result-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 3/4;
}

.result-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 8px;
    font-size: 12px;
    text-align: center;
}

.factory-images .result-image-item {
    aspect-ratio: 1;
}

.result-attributes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attr-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.attr-name {
    font-weight: 500;
    color: #555;
}

.attr-value {
    padding: 2px 10px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
}

.result-price {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px;
    background: #fff8e6;
    border-radius: 8px;
    border: 1px solid #ffe58f;
}

.price-label {
    font-size: 14px;
    color: #666;
}

.price-value {
    font-size: 24px;
    font-weight: 700;
    color: #f5222d;
}

.podesigner-result-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    text-align: right;
}

.btn-confirm {
    padding: 10px 32px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-confirm:hover {
    background: #000;
}

@media (max-width: 600px) {
    .podesigner-result-content {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .result-images {
        grid-template-columns: repeat(2, 1fr);
    }
}
