.prescription-selector-wrapper {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    clear: both;
    display: block;
    width: 100%;
    box-sizing: border-box;
}


.brand-selector {
    margin-bottom: 15px;
}

.brand-selector label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.lens-brand-select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.prescription-selector {
    margin-bottom: 15px;
}

.prescription-selector label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.prescription-type-select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.prescription-table {
    margin-top: 20px;
}

.prescription-table-header h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: bold;
}

.prescription-table-content {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #ddd;
    font-size: 13px;
}

.prescription-table-content th,
.prescription-table-content td {
    /* padding: 10px; */
    border: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
}

/* 表头背景色 */
.prescription-table-content thead td {
    background: gray;
    font-weight: bold;
    font-size: 12px;
    color: #fff;
}

/* 手机端换行显示 */
@media (max-width: 768px) {
    .prescription-selector-wrapper {
        padding: 20px 0 !important;
    }
    /* 隐藏原文字，只显示伪元素 */
    .prescription-table-content .th-sph,
    .prescription-table-content .th-cyl,
    .prescription-table-content .th-axis,
    .prescription-table-content .td-right,
    .prescription-table-content .td-left {
        color: transparent !important;
        position: relative;
    }
    .prescription-table-content .th-sph::after,
    .prescription-table-content .th-cyl::after,
    .prescription-table-content .th-axis::after {
        content: ""; /* 具体内容见下方 */
        color: #fff;
        white-space: pre-line;
        position: absolute;
        left: 0; right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 100%;
        text-align: center;
        display: block;
        /* 其它样式保持不变 */
    }
    /* 分别设置内容 */
    .prescription-table-content .th-sph::after {
        content: "SPH近视 (-) /\A远视 (+)";
    }
    .prescription-table-content .th-cyl::after {
        content: "CYL POWER\A散光 (-)";
    }
    .prescription-table-content .th-axis::after {
        content: "AXIS 轴线\A(如没散光请选0)";
    }
    .prescription-table-content .td-right::after {
        content: "Right\A右";
        color: #333;
        white-space: pre-line;
        position: absolute;
        left: 0; right: 0; top: 0; bottom: 0;
        width: 100%;
        text-align: center;
        display: block;
        line-height: 1rem;
    }
    .prescription-table-content .td-left::after {
        content: "Left\A左";
        color: #333;
        white-space: pre-line;
        position: absolute;
        left: 0; right: 0; top: 0; bottom: 0;
        width: 100%;
        text-align: center;
        display: block;
        line-height: 1rem;
    }
}

.prescription-table-content tbody td:first-child {
    background: #f9f9f9;
    font-weight: bold;
    text-align: center;
    width: 80px;
}

.prescription-select {
    width: 100%;
    padding: 5px;
    border: 1px solid #a0a0a0 !important;
    border-radius: 3px;
    font-size: 12px;    
    background: white;
    margin: 0 .2rem;
}

.prescription-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

/* 可变产品特殊样式 */
.variations_form .prescription-selector-wrapper {
    margin: 15px 0;
}



/* 确保在可变产品中正确显示 */
.variations_form .prescription-selector-wrapper {
    order: 1;
    flex-basis: 100%;
    width: 100%;
    display: block;
    clear: both;
}

/* 修复可能的布局问题 */
.woocommerce-variation-add-to-cart {
    clear: both;
}

/* 确保度数选择器占一行 */
.prescription-selector-wrapper {
    float: none;
    clear: both;
    width: 100%;
    display: block;
}

/* 在简单产品页面也确保占一行 */
.single-product .prescription-selector-wrapper {
    width: 100%;
    display: block;
    clear: both;
} 

.prescription-selector-wrapper,
.prescription-selector-wrapper * {
    font-family: inherit !important;
} 

.prescription-table-content,
.prescription-table-content th,
.prescription-table-content td {
    border: 1px solid gray !important;
} 

.prescription-selector-wrapper .prescription-step {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.prescription-selector-wrapper .prescription-step label {
    min-width: 150px;   /* 你可以根据实际字数调整宽度 */
    text-align: left;
    margin-right: 10px;
    font-weight: bold;
}

.prescription-selector-wrapper .prescription-type-select {
    flex: 1 1 0;
    min-width: 180px;   /* 下拉框最小宽度，可根据需要调整 */
    max-width: 320px;
} 

/* 响应式设计 */
@media (max-width: 768px) {
    .prescription-table-content {
        font-size: 11px;
    }
    
    .prescription-table-content th,
    .prescription-table-content td {
        padding: 5px;
    }
    
    .prescription-select {
        /* font-size: 10px; */
    }
    
    .prescription-table-content tbody td:first-child {
        width: 60px;
        /* font-size: 10px; */
    }

    .prescription-selector-wrapper {
        padding: 20px 0 !important; /* 手机端padding */
    }
    .prescription-selector-wrapper .prescription-step label {
        min-width: 130px;   /* 你可以根据实际字数调整宽度 */
    }
}