/* ================= 基础重置与全局自适应 ================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.manual {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 24px;
    margin-top: -30px;
    transition: padding 0.3s ease;
    position: relative; /* 用于 loading 遮罩定位 */
}

    /* --- 第一行：分类选项区 --- */
    .manual .row-selectors {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
        padding-bottom: 25px;
        border-bottom: 1px solid #ebeef5;
    }

    .manual .form-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

        .manual .form-group label {
            font-size: 14px;
            color: #606266;
            margin-bottom: 8px;
            font-weight: 600;
        }

    /* CSS 控制子分类隐藏开关 */
    .manual.hide-subcategory .subcategory-wrapper {
        display: none !important;
    }

    /* --- 自定义 DIV Select 核心样式 --- */
    .manual .custom-select {
        position: relative;
        width: 100%;
        user-select: none;
    }

    .manual .select-trigger {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 44px;
        padding: 0 14px;
        background-color: #fff;
        border: 1px solid #dcdfe6;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

        .manual .select-trigger:hover {
            border-color: #d80b2a;
        }

    .manual .custom-select.active .select-trigger {
        border-color: #d80b2a;
        box-shadow: 0 0 0 2px rgba(216, 11, 42, 0.15);
    }

    .manual .select-text {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 15px;
        line-height: 1.5;
        color: #333;
        padding-right: 10px;
    }

    .manual .select-input {
        flex: 1;
        border: none;
        outline: none;
        font-size: 15px;
        color: #333;
        background: transparent;
        height: 100%;
        padding-right: 10px;
    }

        .manual .select-input::placeholder {
            color: #c0c4cc;
        }

    .manual .placeholder {
        color: #c0c4cc !important;
    }

    .manual .select-arrow {
        font-size: 12px;
        color: #909399;
        transition: transform 0.3s;
        flex-shrink: 0;
    }

    .manual .custom-select.active .select-arrow {
        transform: rotate(180deg);
    }

    .manual .select-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        border: 1px solid #dcdfe6;
        border-radius: 6px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .manual .custom-select.active .select-dropdown {
        max-height: 300px;
        opacity: 1;
        visibility: visible;
    }

    .manual .select-options {
        max-height: 220px;
        overflow-y: auto;
        padding: 6px 0;
    }

        .manual .select-options::-webkit-scrollbar {
            width: 6px;
        }

        .manual .select-options::-webkit-scrollbar-track {
            background: transparent;
        }

        .manual .select-options::-webkit-scrollbar-thumb {
            background: #d80b2a;
            border-radius: 3px;
        }

    .manual .select-item {
        padding: 0 14px;
        min-height: 40px;
        line-height: 40px;
        font-size: 14px;
        color: #606266;
        cursor: pointer;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        transition: background-color 0.2s;
    }

        .manual .select-item:hover {
            background-color: #fef0f0;
            color: #d80b2a;
        }

        .manual .select-item.selected {
            color: #d80b2a;
            font-weight: bold;
            background-color: #fef0f0;
        }

        .manual .select-item.hidden {
            display: none;
        }

    .manual .no-data {
        padding: 15px;
        text-align: center;
        color: #909399;
        font-size: 13px;
        display: none;
    }

    /* 禁用状态 (纯JS控制) */
    .manual .custom-select.is-disabled .select-trigger {
        background-color: #f5f7fa;
        cursor: not-allowed;
        border-color: #e4e7ed;
    }

        .manual .custom-select.is-disabled .select-trigger:hover {
            border-color: #e4e7ed;
        }

    .manual .custom-select.is-disabled .select-text,
    .manual .custom-select.is-disabled .select-input {
        color: #c0c4cc;
        cursor: not-allowed;
    }

    .manual .custom-select.is-disabled .select-arrow {
        display: none;
    }

    /* --- 第二行：产品信息展示区 --- */
    .manual .row-product {
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
        min-height: 200px;
    }

    .manual .product-image {
        width: 300px;
        min-width: 300px;
        height: 300px;
        background-color: #f8f9fa;
        border: 1px solid #ebeef5;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

        .manual .product-image img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

    .manual .img-placeholder {
        color: #c0c4cc;
        font-size: 14px;
        text-align: center;
        padding: 20px;
    }

    .manual .product-info {
        flex: 1;
        min-width: 280px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .manual .product-name {
        font-size: 22px;
        font-weight: bold;
        color: #303133;
        margin: 0 0 15px 0;
        word-break: break-all;
    }

    .manual .product-desc {
        font-size: 14px;
        color: #606266;
        line-height: 1.8;
        margin: 0;
        min-height: 80px;
    }

    .manual .info-bottom {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        padding-top: 25px;
        margin-top: 25px;
        border-top: 1px dashed #ebeef5;
    }

    .manual .btn {
        padding: 12px 24px;
        font-size: 15px;
        color: #ffffff;
        background-color: #d80b2a;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: opacity 0.3s, transform 0.1s;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        white-space: nowrap;
    }

        .manual .btn:hover {
            opacity: 0.9;
        }

        .manual .btn:active {
            transform: scale(0.97);
        }

        .manual .btn.btn-outline {
            background-color: #fff;
            color: #d80b2a;
            border: 1px solid #d80b2a;
        }

            .manual .btn.btn-outline:hover {
                background-color: #fef0f0;
                opacity: 1;
            }

/* ================= 【新增】全局 Loading 遮罩层样式 ================= */
.global-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .global-loading-overlay.show {
        opacity: 1;
        visibility: visible;
    }

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d80b2a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 12px;
    color: #606266;
    font-size: 14px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ================= 响应式媒体查询 ================= */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .manual {
        padding: 16px;
        border-radius: 8px;
    }

        .manual .row-selectors {
            gap: 15px;
            margin-bottom: 20px;
            padding-bottom: 20px;
        }

        .manual .row-product {
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .manual .product-image {
            width: 100%;
            max-width: 400px;
            min-width: unset;
            height: 250px;
        }

        .manual .product-info {
            width: 100%;
            min-width: unset;
        }

        .manual .product-name {
            font-size: 20px;
            text-align: center;
        }

        .manual .product-desc {
            font-size: 13px;
            text-align: justify;
        }

        .manual .info-bottom {
            flex-direction: column;
            width: 100%;
        }

        .manual .btn {
            width: 100%;
            justify-content: center;
        }
}

@media screen and (max-width: 480px) {
    .manual .product-image {
        height: 200px;
    }

    .manual .select-text, .manual .select-input {
        font-size: 14px;
    }

    .manual .form-group label {
        font-size: 13px;
    }
}
