.container-fluid {
    padding: 0;
}

.main-wrapper {
    display: grid;
    grid-template-columns: repeat(48, 1fr);
    min-height: auto;
    padding-top: calc(var(--x) * 4);
    padding-bottom: calc(var(--x) * 5);
}

/* 左侧3D预览区 */
.canvas-section {
    grid-column: 6 / span 17;
    /* 从第5列开始，占17列 (4x左边距 + 17x预览区) */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: theme('colors.white');
    padding: 0;
    height: calc(var(--x) * 15);
    align-items: center;
}

/* 3D展示区 */
#canvas-box {
    width: 100%;
    height: 480px;
    border-radius: 0;
    overflow: hidden;
}

/* 右侧配置面板 */
.config-section {
    grid-column: 26 / -6;
    /* 从第25列开始到第47列，占22列 (3x间隔后) */
    background: theme('colors.white');
    padding: 0;
    border-left: none;
    overflow-y: auto;
}

.config-title {
    font-size: 20px;
    font-weight: 600;
    height: calc(var(--x) * 2);
    text-align: left;
}

.config-section h2 {
    margin: 0 !important;
}

.config-group {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    /* 配置面板内部18列子网格 */
    min-height: calc(var(--x) * 3);
    /* 使用固定高度 */
    margin-bottom: 0;
    padding: 0;
    align-items: center;
    /* 垂直居中 */
    row-gap: 0;
}

.config-group:last-of-type {
    border-bottom: none;
}

.config-label {
    grid-column: 1 / 5;
    /* 标签占4列 */
    font-size: 13px;
    font-weight: 600;
    /* 不需要padding-top，grid会自动垂直居中 */
}

/* 木材种类选择 */
.wood-options {
    grid-column: 5 / 18;
    /* 从第5列到第18列 */
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5个选项均分 */
    gap: calc(var(--x) * 2);
    justify-items: center;
}

.wood-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-width: 3px;
    border-style: solid;
    border-color: transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.wood-option:hover {
    transform: scale(1.1);
}

.wood-option.active {
    box-shadow: 0 0 0 2px rgba(136, 71, 34, 0.2);
}

.wood-option-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: theme('colors.text-muted');
    white-space: nowrap;
}

/* 形状选择 */
.shape-options {
    grid-column: 5 / 18;
    /* 从第5列到第18列 */
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 预留6个位置 */
    gap: calc(var(--x) * 2);
    justify-items: center;
}

.shape-option {
    width: calc(var(--x) * 1);
    height: calc(var(--x) * 1);
    border: 2px solid theme('colors.border-base');
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: theme('colors.white');
}

.shape-option:hover {
    border-color: theme('colors.text-main');
}

/* 桌面形状选中状态：实心 */
.shape-option.active svg {
    fill: theme('colors.text-main');
    stroke: theme('colors.text-main');
}

/* 桌面形状选项默认状态：空心 */
.shape-option svg {
    fill: none;
    stroke: theme('colors.text-muted');
    stroke-width: 2;
    transition: .25s;
}

/* 桌腿选择 */
.leg-options {
    grid-column: 5 / 18;
    /* 从第5列到第23列 */
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 预留6个位置 */
    gap: calc(var(--x) * 2);
    justify-items: center;
}

.leg-option {
    width: calc(var(--x) * 1);
    height: calc(var(--x) * 1);
    border: 2px solid theme('colors.border-base');
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: theme('colors.white');
    padding: 5px;
}

.leg-option:hover {
    border-color: theme('colors.text-main');
}

.leg-option.active {
    border-color: theme('colors.text-main');
    background: theme('colors.bg-base');
}

.leg-option svg {
    width: 100%;
    height: 100%;
}

.slider-section {
    min-height: calc(var(--x) * 6);
}

/* 滑块控制 */
.slider-control {
    grid-column: 1 / 23;
    /* 跨越整个配置面板宽度 */
    margin-bottom: 12px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.slider-label span {
    font-size: 12px;
}

.slider-value {
    padding: 1px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 12px;
}

input[type="range"] {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: theme('colors.border-base');
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: theme('colors.text-main');
    cursor: pointer;
    border: 2px solid theme('colors.white');
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: theme('colors.text-main');
    cursor: pointer;
    border: 2px solid theme('colors.white');
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 产地 */
.origin-info {
    font-size: 14px;
}

/* 价格信息 */
.price-info {
    grid-column: 5 / 23;
    /* 从第5列开始 */
    font-size: 20px;
    font-weight: 600;
}

/* 配置说明 */
.config-note {
    grid-column: 1 / 23;
    /* 跨越整个宽度 */
    font-size: 11px;
    line-height: 1.5;
    margin: 12px 0;
    padding: 0;
}

/* PDF按钮 - 全宽 */
.btn-pdf-full {
    grid-column: 1 / 23;
    /* 跨越整个配置面板宽度 */
    width: 100%;
    color: white;
    border: none;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 5px;
}

.btn-pdf-full:hover {
    height: calc(var(--x) * 2);
}

/* 下方内容区域 */
.content-sections {
    background: theme('colors.white');
    margin-bottom: calc(var(--x) * 4);
    /* padding: calc(var(--x) * 5) 0; */
}

.content-section {
    display: grid;
    grid-template-columns: repeat(48, 1fr);
    margin-bottom: calc(var(--x) * 2);
    align-items: flex-start;
}

.content-section:last-child {
    margin-bottom: 0;
}

/* 第一个content-section：为什么选择原木桌 */
.content-section:not(.reverse) .content-image {
    grid-column: 7 / span 16;
    /* 从第7列开始，占16列 (6x左边距后) */
}

.content-section:not(.reverse) .content-text {
    grid-column: 26 / span 18;
    /* 从第25列开始，占18列 */
    align-self: center;
}

/* 第二个content-section：我们的原木好在哪（reverse） */
/* reverse样式已通过grid-column和grid-row定义 */

.content-section.reverse .content-text {
    grid-column: 7 / span 15;
    /* 从第9列开始，占15列 */
    grid-row: 1;
    align-self: center;
}

.content-section.reverse .content-image {
    grid-column: 26 / span 18;
    /* 从第29列开始，占18列 */
    grid-row: 1;
}

.content-image {
    width: 100%;
    height: auto;
    display: block;
}

/* content-text 样式通过 h2 和 p 子元素定义 */

.content-text h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: calc(var(--x) * 1);
    text-align: center;
}

.content-text p {
    white-space: pre-line;
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
    margin: 0;
}

/* ========== 响应式 ========== */
/* 平板设备 */
@media (max-width: 992px) {
    .main-wrapper {
        display: flex;
        flex-direction: column;
        padding-top: calc(var(--x) * 2);
    }

    .canvas-section {
        grid-column: auto;
        width: 100%;
        padding: 20px;
        height: auto;
    }

    .config-section {
        grid-column: auto;
        width: 100%;
        border-top: 1px solid theme('colors.border-base');
        padding: 20px;
    }

    /* 配置面板在移动端改为垂直布局 */
    .config-group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
        padding: calc(var(--x) * 3) 0;
        gap: calc(var(--x) * 0.5);
    }

    .config-label {
        margin-bottom: calc(var(--x) * 0.5);
    }

    .wood-options,
    .shape-options,
    .leg-options {
        grid-column: auto;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: calc(var(--x) * 1);
    }

    .slider-section {
        min-height: auto;
    }

    .slider-control {
        grid-column: auto;
        width: 100%;
    }

    .price-info {
        grid-column: auto;
    }

    .config-note {
        grid-column: auto;
    }

    .btn-pdf-full {
        grid-column: auto;
    }

    .content-section {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 0 20px;
    }

    .content-section.reverse {
        flex-direction: column;
    }

    .content-section:not(.reverse) .content-image,
    .content-section:not(.reverse) .content-text,
    .content-section.reverse .content-image,
    .content-section.reverse .content-text {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
    }

    .content-sections {
        margin-top: calc(var(--x) * 3);
        padding: calc(var(--x) * 2) 0;
    }

    .content-text h2,
    .content-text p {
        text-align: center;
    }
}

/* 移动设备 */
@media (max-width: 768px) {
    .canvas-section {
        padding: 15px;
    }

    #canvas-box {
        height: 300px;
    }

    .config-section {
        padding: 20px 15px;
    }

    .config-title {
        font-size: 18px;
    }

    .wood-options {
        gap: calc(var(--x) * 1);
        justify-content: flex-start;
    }

    .wood-option {
        width: 40px;
        height: 40px;
    }

    .shape-options,
    .leg-options {
        justify-content: flex-start;
    }

    .shape-option {
        width: 50px;
        height: 50px;
    }

    .leg-option {
        width: 50px;
        height: 50px;
    }

    .content-sections {
        margin-top: 40px;
        padding: 30px 0;
    }

    .content-section {
        margin-bottom: 60px;
        padding: 0 15px;
        gap: 30px;
    }

    .content-text h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .content-text p {
        font-size: 14px;
        line-height: 1.6;
    }

    .content-image {
        border-radius: 6px;
    }
}

/* 小屏手机 */
@media (max-width: 576px) {
    #canvas-box {
        height: 250px;
    }

    .config-section {
        padding: 15px 10px;
    }

    .wood-option {
        width: 45px;
        height: 45px;
    }

    .shape-option {
        width: 55px;
        height: 55px;
    }

    .leg-option {
        width: 48px;
        height: 60px;
    }

    .content-section {
        padding: 0 10px;
        gap: 25px;
        margin-bottom: 50px;
    }

    .content-text h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .content-text p {
        font-size: 13px;
    }

    .content-image {
        border-radius: 4px;
    }
}