/* ===== 弹窗遮罩层 ===== */
#html-container .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

#html-container .modal-overlay.show {
    display: flex;
    align-items: center;
}

/* ===== 弹窗容器 ===== */
#html-container .modal-container {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

/* ===== 顶部标题栏（蓝色渐变） ===== */
#html-container .modal-header {
    background: linear-gradient(135deg, #1E5799 0%, #2989D8 100%);
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

#html-container .modal-header-text {
    color: #fff;
}

#html-container .modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: #fff;
}

#html-container .modal-subtitle {
    font-size: 14px;
    margin: 4px 0 0 0;
    opacity: 0.9;
    font-weight: 400;
}

#html-container .modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    outline: none;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
    flex-shrink: 0;
}

#html-container .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ===== 内容区域 ===== */
#html-container .modal-body {
    padding: 28px 30px;
    max-height: 55vh;
    overflow-y: auto;
}

#html-container .modal-body-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px 0;
    text-align: center;
}

#html-container .modal-divider {
    border: none;
    border-top: 2px dashed #e0e0e0;
    margin: 16px 0 24px 0;
}

/* ===== 配置分类区块 ===== */
#html-container .config-section {
    margin-bottom: 20px;
}

#html-container .config-section:last-child {
    margin-bottom: 0;
}

#html-container .config-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1E5799;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #2989D8;
}

#html-container .config-item {
    display: flex;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

#html-container .config-label {
    color: #666;
    min-width: 160px;
    flex-shrink: 1;
}

#html-container .config-label::after {
    content: '：';
}

#html-container .config-value {
    color: #222;
    font-weight: 500;
    word-break: break-all;
}

/* ===== 底部按钮栏 ===== */
#html-container .modal-footer {
    padding: 18px 30px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

#html-container .btn-copy,
#html-container .btn-export,
#html-container .btn-submit {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

/* 复制清单 - 蓝色边框白底 */
#html-container .btn-copy {
    background: #fff;
    color: #2989D8;
    border-color: #2989D8;
}

#html-container .modal-footer button{
    flex: 0 0 auto;
    min-width: 120px;
    outline: none;
}

#html-container .btn-copy:hover {
    background: #f0f6fb;
}

/* 导出文档 - 蓝色填充 */
#html-container .btn-export {
    background: #2989D8;
    color: #fff;
    border-color: #2989D8;
}

#html-container .btn-export:hover {
    background: #1a5fa8;
}

/* 提交配置清单 - 绿色填充 */
#html-container .btn-submit {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
}

#html-container .btn-submit:hover {
    background: #27ae60;
}

/* ===== 响应式 ===== */

/* 768px ~ 1200px 平板端 */
@media (max-width: 1200px) and (min-width: 769px) {
    #html-container .modal-container {
        max-width: 620px;
    }
    #html-container .modal-header {
        padding: 20px 24px;
    }
    #html-container .modal-body {
        padding: 22px 24px;
    }
    #html-container .modal-footer {
        padding: 16px 24px 20px;
    }
}

/* 410px ~ 768px 移动端 */
@media (max-width: 768px) {
    #html-container .modal-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    #html-container .modal-container {
        max-width: 95%;
        border-radius: 10px;
    }

    #html-container .modal-header {
        padding: 18px 20px;
    }

    #html-container .modal-title {
        font-size: 18px;
    }

    #html-container .modal-subtitle {
        font-size: 12px;
    }

    #html-container .modal-body {
        padding: 18px 20px;
        max-height: 50vh;
    }

    #html-container .modal-body-title {
        font-size: 16px;
    }

    #html-container .config-section-title {
        font-size: 14px;
    }

    #html-container .config-item {
        font-size: 13px;
        flex-wrap: wrap;
    }

    #html-container .config-section:nth-child(1) .config-item {
        flex-wrap: wrap;
        flex-direction: column;
    }

    #html-container .config-label {
        min-width: 120px;
    }

    #html-container .modal-footer {
        padding: 14px 20px 18px;
        gap: 8px;
    }

    #html-container .btn-copy,
    #html-container .btn-export,
    #html-container .btn-submit {
        padding: 10px 18px;
        font-size: 13px;
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
}

/* 410px 小屏 */
@media (max-width: 410px) {
    #html-container .modal-overlay {
        padding: 0;
        padding-top: 10px;
    }

    #html-container .modal-container {
        border-radius: 0;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    #html-container .modal-header {
        padding: 14px 16px;
    }

    #html-container .modal-title {
        font-size: 16px;
    }

    #html-container .modal-body {
        padding: 14px 16px;
        max-height: 45vh;
    }

    #html-container .modal-footer {
        padding: 12px 16px 16px;
        flex-direction: column;
        gap: 8px;
    }

    #html-container .btn-copy,
    #html-container .btn-export,
    #html-container .btn-submit {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}

/* ===== 打印样式（PDF导出用） ===== */
@media print {
    body * {
        visibility: hidden;
    }
    #html-container .modal-container,
    #html-container .modal-container * {
        visibility: visible;
    }
    #html-container .modal-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
    }
    #html-container .modal-header {
        background: #2989D8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #html-container .modal-footer {
        display: none !important;
    }
    #html-container .modal-close-btn {
        display: none !important;
    }
}
