/* 基础样式设置 */
:root {
    --primary-color: #1e88e5;
    --primary-dark: #1565c0;
    --primary-light: #bbdefb;
    --secondary-color: #263238;
    --accent-color: #2962ff;
    --bg-color: #f5f7fa;
    --text-color: #263238;
    --light-gray: #ecf0f1;
    --dark-gray: #607d8b;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(30, 136, 229, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --danger-color: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

body {
    font-family: 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow-x: hidden; /* 防止水平滚动 */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* 头部和导航样式 */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
}

.logo span {
    color: var(--primary-color);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-btn i {
    font-size: 20px;
}

.nav-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* 主内容区域样式 */
.main-content {
    padding: 10px 0;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    flex: 1 0 auto;
}

/* 配置单和价格明细区域 */
.config-section, .price-section {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    height: 100%;
}

.section-title {
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--secondary-color);
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-gray);
}

/* 配置单样式 */
.config-item {
    display: flex;
    align-items: center;
}

.config-item-label {
    width: 80px;
    font-weight: 500;
    flex-shrink: 0;
}

.config-item-label span{
    font-size: 18px;
}

.select-wrapper {
    flex: 1;
    position: relative;
}

.component-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    background-color: var(--white);
    font-size: 15px;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
}

.component-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* 价格明细样式 */
.price-list {
    margin-bottom: 25px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--light-gray);
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.section-header .section-title {
    margin: 0;
}
.price-item:last-child {
    border-bottom: none;
}

.price-item-name {
    font-weight: 500;
}

.price-item-value {
    font-weight: 600;
    color: var(--accent-color);
}

.total-price {
    margin-top: 30px;
    padding: 8px 20px;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 18px;
    font-weight: 500;
}

.total-value {
    font-size: 24px;
    font-weight: 700;
}

.save-config-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.save-config-btn:hover {
    background-color: var(--primary-dark);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--white);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 1200px;
    min-height: 650px; /* 最小高度为500px */
    max-height: 650px; /* 最大高度为500px */
    height: 650px; /* 固定高度为500px */
    overflow-y: auto;
    position: relative;
    transform: translateY(-50px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-gray);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-color);
}

.modal-body {
    padding: 0 25px 20px 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--light-gray);
    text-align: right;
}

/* 联系客服模态框 */
.cs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cs-item {
    text-align: center;
    padding: 20px;
}

.cs-title {
    margin-bottom: 15px;
    font-weight: 600;
}

.cs-qrcode {
    width: 260px;
    height: 370px;
    object-fit: contain;
    margin: 10px auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.cs-qrcode:hover {
    transform: scale(1.05);
}

/* 为微信和抖音的二维码特别设置更大尺寸 */
.cs-item[data-type="微信"] .cs-qrcode,
.cs-item[data-type="抖音"] .cs-qrcode {
    width: 220px;
    height: 220px;
}

/* 已收藏配置模态框 */
.search-bar {
    margin: 10px;
    display: flex;
}

.trigger-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 15px;
}

.search-btn {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: var(--primary-dark);
}

.saved-table {
    width: 100%;
    border-collapse: collapse;
}

.saved-table th, .saved-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.saved-table th {
    background-color: var(--light-gray);
    font-weight: 600;
}

.saved-table tr:hover {
    background-color: rgba(236, 240, 241, 0.5);
}

.btn-load, .btn-delete {
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-load {
    background-color: var(--primary-color);
    color: var(--white);
    margin-right: 5px;
}

.btn-load:hover {
    background-color: var(--primary-dark);
}

.btn-delete {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* 推荐配置模态框 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 10px;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 15px;
}

.recommend-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.recommend-table th, .recommend-table td {
    padding: 6px 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
    max-width: 400px;
}

.recommend-table th {
    background-color: var(--light-gray);
    font-weight: 600;
}

.recommend-table tr:hover {
    background-color: rgba(236, 240, 241, 0.5);
}

.btn-use {
    padding: 8px 12px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-use:hover {
    background-color: var(--primary-dark);
}

/* 保存配置模态框 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 15px;
}

.form-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
}

.form-submit {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.form-submit:hover {
    background-color: var(--primary-dark);
}

/* 响应式样式 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .case-display-section {
        margin-bottom: 20px;
    }
    
    .case-image-container {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        padding: 15px 0;
    }
    
    .cs-container {
        grid-template-columns: 1fr;
    }
    
    /* 调整整体布局 */
    .container {
        padding: 0;
        margin: 0;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* 表格容器适应屏幕宽度 */
    .excel-style-config {
        width: 100%;
        margin: 0;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    /* 修复价格列宽度 */
    .excel-cell:nth-child(4) {
        width: 60px;
        min-width: 60px;
        flex-shrink: 0;
        padding-right: 8px; /* 确保价格不会太靠近边缘 */
    }
    
    /* 确保数量列适当宽度 */
    .excel-cell:nth-child(3) {
        width: 35px;
        min-width: 35px;
        justify-content: center;
        padding: 2px;
    }
    
    /* 减少第一列宽度 */
    .excel-cell:first-child {
        width: 50px;
        min-width: 50px;
        flex-shrink: 0;
    }
    
    /* 统一单元格样式 */
    .excel-cell {
        padding: 4px 2px;
    }
    
    /* 外观展示区域样式修正 */
    .case-display-section {
        width: 100%;
        margin: 0;
    }
    
    /* 调整底部按钮 */
    .action-buttons {
        width: 100%;
        margin: 0;
    }
    
    /* 选择项样式 */
    .select-option {
        padding: 10px;
        font-size: 14px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* 关键类最终修复 */
    html, body, .container, .main-content, .config-section, .case-display-section, 
    .action-buttons {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* 确保总价单元格的样式 */
    .excel-total-row .excel-cell:last-child {
        min-width: 65px !important;
        font-size: 16px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-right: 8px;
    }
    

}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .case-image-container {
        height: 200px;
    }
    
    .excel-cell:first-child {
        width: 45px;
        min-width: 45px;
    }
    
    /* 超小屏幕备注输入框调整 */
    .remark-inputs {
        display: flex !important;
        flex-direction: row !important;
    }
    
    .remark-name-input {
        width: 85% !important;
        font-size: 12px;
        padding: 0 3px;
        margin-right: 3px;
    }
    
    .remark-price-input {
        width: 15% !important;
        font-size: 12px;
        padding: 0 2px;
        height: 28px;
    }
}

/* 过滤器按钮样式 */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.filter-btn {
    background-color: var(--white);
    border: 1px solid var(--light-gray);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* 自定义选择框样式 */
.custom-select {
    position: relative;
    width: 100%;
}

.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 41px; /* 确保最小高度一致 */
    padding: 8px 15px;
    background-color: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.select-trigger:hover {
    border-color: var(--primary-color);
}

.select-text, .trigger-search-input {
    display: block;
    flex: 1;
    height: 24px;
    line-height: 24px;
    font-size: 19px;
    font-family: 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

.trigger-search-input {
    padding: 0;
    width: 100%;
    color: var(--text-color);
    border: none;
    background-color: transparent;
    outline: none;
}

.select-arrow {
    color: var(--dark-gray);
    transition: transform 0.2s ease;
}

.custom-select.open .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 9999; /* 提高层级使其显示在所有内容之上 */
    margin-top: 5px;
    display: none;
    max-height: 275px;
    overflow-y: auto;
}

.custom-select.open .select-dropdown {
    display: block;
}


.search-container {
    padding: 10px;
    border-bottom: 1px solid var(--light-gray);
    position: sticky;
    top: 0;
    background-color: var(--white);
    z-index: 1;
}

.select-option {
    padding: 4px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.select-option:hover {
    background-color: var(--primary-light);
}

.select-option.selected {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* 用于没有选项的情况 */
.no-options {
    padding: 10px 15px;
    color: var(--dark-gray);
    text-align: center;
}

/* 页脚样式 */
.footer {
    background-color: var(--white);
    box-shadow: 0 -2px 6px rgba(30, 136, 229, 0.1);
    padding: 20px 0;
    flex-shrink: 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.copyright {
    color: var(--secondary-color);
    font-size: 14px;
}

.icp-info {
    color: var(--dark-gray);
    font-size: 12px;
}

.icp-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.icp-info a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 响应式样式 - 添加到现有的媒体查询中 */
@media (max-width: 768px) {
    .footer-content {
        padding: 0 15px;
    }
} 

/* 按钮行样式 */
.buttons-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: var(--accent-color);
}

.screenshot-btn {
    background-color: #4caf50;
}

.screenshot-btn:hover {
    background-color: #388e3c;
}

.contact-btn {
    background-color: #2196f3;
}

.contact-btn:hover {
    background-color: #1976d2;
}

/* 提示样式 */
.loading-toast, .success-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.loading-toast {
    background-color: rgba(0, 0, 0, 0.8);
}

.success-toast {
    background-color: rgba(76, 175, 80, 0.9);
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* 截图时的临时样式 */
.price-section.capturing {
    padding: 20px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 8px;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 0;
    margin-top: 0;
    background-color: #333;
}

.action-button {
    flex: 1;
    padding: 15px 0;
    background-color: #333;
    color: #ffcc00;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0;
    text-align: center;
}

.save-config-btn {
    background-color: #333;
    color: #ffcc00;
    border: none;
}

.action-button:hover, .save-config-btn:hover {
    background-color: #555;
}

.excel-row:nth-child(even) {
    background-color: #f2f2f2;
}

/* 自定义配件样式改进 */
.custom-component-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background-color: #f9f9f9;
}

.custom-component-inputs {
    display: flex;
    gap: 10px;
    flex: 1;
}

.custom-component-input {
    padding: 8px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 15px;
}

#customComponentName {
    flex: 3;
    min-width: 200px;
}

#customComponentPrice {
    flex: 1;
    min-width: 80px;
}

.add-custom-btn {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.add-custom-btn:hover {
    background-color: var(--primary-dark);
}

/* 移动端适配改进 */
@media (max-width: 768px) {
    .custom-component-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .custom-component-inputs {
        width: 100%;
        flex-direction: column;
    }
    
    #customComponentName,
    #customComponentPrice {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
    }
    
    .add-custom-btn {
        width: 100%;
        padding: 12px;
        margin-top: 5px;
    }
}

/* 删除自定义配件按钮样式 */
.remove-custom-btn {
    background-color: transparent;
    border: none;
    color: var(--danger-color, #dc3545);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.remove-custom-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #b02a37;
}

.remove-custom-btn i {
    font-size: 18px;
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    
    .config-item-label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    /* 价格列表中的自定义配件显示优化 */
    .price-list-item {
        flex-wrap: wrap;
    }
    
    /* 确保删除按钮有足够大的触摸区域 */
    .remove-custom-btn {
        padding: 10px;
    }
}

/* 配置详情模态框样式 */
.config-detail-header {
    margin-top: 10px;
    padding-bottom: 15px;
}

.config-detail-components h4 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--secondary-color);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th, .detail-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.detail-table th {
    background-color: var(--light-gray);
    font-weight: 600;
}

.btn-view {
    padding: 8px 12px;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-view:hover {
    background-color: var(--accent-color);
}

.config-detail-info-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.config-detail-info-row span {
    flex: 1;
    min-width: 150px;
}

@media (max-width: 768px) {
    .config-detail-info-row {
        flex-direction: column;
        gap: 8px;
    }
}

/* 添加此样式，确保搜索框和文本不会同时显示 */
.custom-select.open .select-text {
    display: none !important;
}

.custom-select.open .trigger-search-input {
    display: block !important;
    width: calc(100% - 24px);
}

/* Excel风格表格样式 - 更新为深色表头风格 */
.excel-style-config {
    border: 1px solid #333;
    border-radius: 4px;
    overflow: visible; /* 允许内容溢出 */
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.excel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    padding: 10px 15px;
    border-bottom: 1px solid #555;
    color: white;
}

.excel-promotion {
    font-weight: bold;
    color: #FFCC00;
    font-size: 20px;
}

.excel-id {
    font-weight: bold;
    color: #fff;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
}

.excel-row {
    display: flex;
    border-bottom: 1px solid #ddd;
    max-height: 36px;
}

.excel-row:last-child {
    border-bottom: none;
}

.excel-header-row {
    background-color: #333;
    color: white;
    font-weight: bold;
}

.excel-cell {
    padding: 8px 10px;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
    min-height: 40px;
    font-size: 19px;
    font-weight: bold;
}

.excel-row:nth-child(even) {
    background-color: #f2f2f2;
}

.excel-cell:first-child {
    width: 100px;
    flex-shrink: 0;
}

.excel-cell:nth-child(2) {
    flex-grow: 1;
}

.excel-cell:nth-child(3) {
    width: 60px;
    justify-content: center;
    flex-shrink: 0;
}

.excel-cell:nth-child(4) {
    width: 120px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.excel-cell:last-child {
    border-right: none;
}

.excel-total-row {
    background-color: #333 !important;
    color: white;
    font-weight: bold;
}

.excel-total-price {
    min-width: 120px !important;
    text-align: right;
    font-weight: bold;
    color: #fff;
    font-size: 18px;
}

.excel-footer {
    background-color: #333;
    color: white;
}

.excel-promotion-footer {
    justify-content: center;
    color: #FFCC00;
    font-style: normal;
}

/* 修改按钮样式与图片相似 */
.action-buttons {
    display: flex;
    gap: 0;
    margin-top: 0;
    background-color: #333;
}

.action-button {
    flex: 1;
    padding: 15px 0;
    background-color: #333;
    color: #ffcc00;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0;
    text-align: center;
}

.save-config-btn {
    background-color: #333;
    color: #ffcc00;
    border: none;
}

.action-button:hover, .save-config-btn:hover {
    background-color: #555;
}

/* 外观展示区域样式修改 */
.case-display-section {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0;
    height: fit-content;
}

.case-display-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 0;
}

.case-display-section .section-title {
    margin: 20px 0;
    padding: 0;
    color: var(--secondary-color);
    border-bottom: none;
}

.case-display-content {
    padding: 0;
    border-top: 1px solid #eee;
}

.case-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    min-height: 280px;
}

.case-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 2;
    position: relative;
}

.case-image.loading {
    opacity: 0;
}

.case-image.loaded {
    opacity: 1;
    animation: fadeInZoom 0.4s ease-out;
}

@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.case-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #f8f9fa;
    border-radius: 8px;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.placeholder-content {
    text-align: center;
    padding: 20px;
    transition: transform 0.3s ease;
}

.placeholder-icon {
    font-size: 56px;
    color: #cccccc;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.placeholder-text {
    font-size: 18px;
    font-weight: 500;
    color: #888;
    margin-bottom: 10px;
}

.placeholder-subtext {
    font-size: 14px;
    color: #aaa;
}

/* 鼠标悬停效果 */
.case-image-container:hover .placeholder-content {
    transform: translateY(-5px);
}

.case-image-container:hover .placeholder-icon {
    color: #aaa;
    transform: scale(1.05);
}

/* 占位符隐藏/显示控制 */
.case-image-placeholder.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 切换图片时的动画效果 */
.case-image.changing {
    opacity: 0;
    transform: scale(0.95);
}

/* 容器内部边距与边框 */
.case-display-content {
    padding: 15px;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 标题与图片容器间距 */
.section-header + .case-display-content {
    margin-top: 15px;
}

/* 自定义配件Excel样式 */
#customComponentsContainer .excel-row {
    background-color: #fff8e1;
}

.custom-component-item .custom-component-inputs {
    display: flex;
    width: 100%;
    align-items: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .case-display-section {
        margin-bottom: 20px;
    }
    
    .case-image-container {
        height: 250px;
    }
}

/* 修改select-wrapper适应Excel样式 */
.excel-row .select-wrapper {
    width: 100%;
    padding: 0;
}

.excel-row .custom-select {
    width: 100%;
}

.excel-row .select-trigger {
    padding: 5px 10px;
    border: none;
    background-color: transparent;
}

.component-price {
    font-weight: bold;
    color: #007bff;
}

/* 数量输入框样式 */
.quantity-input {
    width: 100%;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 5px;
    font-size: 14px;
}

.quantity-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 3px rgba(30, 136, 229, 0.3);
}

/* 备注输入框样式 */
.remark-inputs {
    display: flex;
    width: 100%;
}

.remark-name-input {
    width: 80%;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 14px;
    margin-right: 10px;
}

.remark-price-input {
    width: 20%;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 5px;
    font-size: 14px;
    text-align: right;
}

.remark-name-input:focus, .remark-price-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 3px rgba(30, 136, 229, 0.3);
}

/* 确保总计行不换行 */
.excel-total-row .excel-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 新增响应式布局样式 */
/* 桌面视图主内容区域比例4:2 */
@media (min-width: 1025px) {
    body {
        overflow-x: visible;
    }
    
    .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
        overflow-x: visible;
    }
    
    .main-content {
        display: grid;
        grid-template-columns: 3fr 1fr;
        padding: 10px 0;
        gap: 30px;
    }
    
    .excel-style-config {
        border: 1px solid #333;
        border-radius: 4px;
        margin-bottom: 20px;
        width: 100%;
        
    }
    
    .case-display-section {
        margin: 0;
        width: auto;
    }
    
    /* 恢复表格列宽 */
    .excel-cell:first-child {
        width: 100px;
    }
    
    .excel-cell:nth-child(3) {
        width: 60px;
    }
    
    .excel-cell:nth-child(4) {
        width: 120px;
    }
    
    .excel-cell {
        padding: 8px 10px;
    }
    
    .excel-table {
        height: auto;
    }
}

/* 平板视图 */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .case-display-section {
        margin-top: 20px;
    }
    
    .case-image-container {
        height: 300px;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* 平板视图下改为水平布局 */
    .case-display-content {
        display: flex;
        justify-content: center;
    }
}

/* 移动端优化样式 - 完全重写 */
@media (max-width: 768px) {
    /* 整体容器优化 */
    .container {
        padding: 0 5px;
    }
    
    .main-content {
        gap: 10px;
    }
    
    /* Excel表格布局优化 */
    .excel-style-config {
        margin-bottom: 10px;
        overflow: visible !important; /* 完全允许内容溢出，与PC端保持一致 */
    }
    
    .excel-header {
        padding: 8px 10px;
    }
    
    .excel-promotion {
        font-size: 14px;
    }
    
    .excel-id {
        font-size: 12px;
    }
    
    /* 行高调整 */
    .excel-row {
        min-height: 36px;
        flex-wrap: nowrap; /* 确保不换行 */
    }
    
    /* 调整单元格尺寸和布局 */
    .excel-cell {
        padding: 5px 3px;
        min-height: 36px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 类别列宽度 */
    .excel-cell:first-child {
        width: 55px;
        min-width: 55px;
        flex-shrink: 0;
    }
    
    /* 选择项列 */
    .excel-cell:nth-child(2) {
        flex-grow: 1;
        min-width: 0; /* 允许收缩 */
    }
    
    /* 数量列宽度 */
    .excel-cell:nth-child(3) {
        width: 40px;
        min-width: 40px;
    }
    
    /* 价格列宽度 */
    .excel-cell:nth-child(4) {
        width: 65px;
        min-width: 65px;
    }
    
    /* 数量输入框优化 */
    .quantity-input {
        width: 34px;
        height: 26px;
        padding: 0;
        text-align: center;
        font-size: 13px;
        -webkit-appearance: none;
        -moz-appearance: textfield;
    }
    
    /* 隐藏数量输入框的增减按钮 */
    .quantity-input::-webkit-outer-spin-button,
    .quantity-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    
    /* 备注输入框优化 - 已弃用 */
    
    /* 组件价格显示优化 */
    .component-price {
        font-size: 13px;
        text-align: right;
    }
    
    /* 选择框优化 */
    .select-trigger {
        padding: 4px 6px;
        min-height: 28px;
    }
    
    .select-text {
        font-size: 13px;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 下拉菜单优化 */
    .select-dropdown {
        max-height: 60vh; /* 视口高度的60% */
        max-width: 95vw; /* 宽度95%视口宽度 */
    }
    
    /* 主内容容器优化 */
    .main-content {
        width: 100%;
        max-width: 100%;
        padding: 5px;
    }
    
    /* 配置区域优化 */
    .config-section {
        width: 100%;
        padding: 10px;
    }
    
    /* 组件显示区域优化 */
    .case-display-section {
        width: 100%;
        padding: 10px;
        margin: 10px 0;
    }
    
    /* Excel表格特定修复 */
    .excel-cell {
        word-break: break-word;
        white-space: normal;
    }
    
    /* 改进第二列组件名称显示 */
    .excel-cell:nth-child(2) {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 确保总价显示完整 */
    .excel-total-price {
        padding-right: 5px;
        font-size: 16px !important;
    }
    
    /* 备注输入框移动端优化 */
    .remark-inputs {
        display: flex !important;
        flex-direction: row !important;
    }
    
    .remark-name-input {
        width: 80% !important;
        font-size: 13px;
        padding: 0 5px;
        height: 28px;
        margin-right: 5px;
    }
    
    .remark-price-input {
        width: 20% !important;
        font-size: 13px;
        padding: 0 3px;
        height: 28px;
    }
}

/* 超小屏幕更严格控制 */
@media (max-width: 360px) {
    .excel-cell:first-child {
        width: 40px;
        min-width: 40px;
        font-size: 12px;
    }
    
    .excel-cell:nth-child(3) {
        width: 30px;
        min-width: 30px;
    }
    
    .excel-cell:nth-child(4) {
        width: 55px;
        min-width: 55px;
    }
    
    .quantity-input {
        width: 28px;
        height: 24px;
        font-size: 12px;
    }
    
    .component-price {
        font-size: 12px;
    }
}

/* 修复模态框右侧溢出问题 */
@media (max-width: 768px) {
    /* 模态框样式调整 */
    .modal {
        width: 95%;
        max-width: 100vw;
        margin: 0 auto;
    }
    
    /* 调整推荐配置表格 */
    .recommend-table {
        width: 100%;
        display: block;
    }
    
    .recommend-table th, 
    .recommend-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    /* 调整总价行宽度 */
    .excel-total-price {
        min-width: 60px !important;
        padding-right: 8px;
    }
}

/* 全局修复，确保元素不会溢出 */
* {
    box-sizing: border-box;
    max-width: 100%;
}

/* 移动端优化修复 */
@media (max-width: 768px) {
    /* 修复右侧溢出 */
    body, html {
        width: 100%;
        overflow-x: hidden;
    }
    
    /* 操作按钮优化 */
    .action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1px;
        margin-top: 0;
        background-color: #333;
        width: 100%;
    }
    
    .action-button {
        padding: 14px 0;
        font-size: 14px;
        font-weight: 600;
        border-radius: 0;
    }
    
    /* 让截图按钮占据整行 */
    .action-button:first-child {
        grid-column: 1 / -1;
        border-bottom: 1px solid #444;
    }
    
    /* 按钮点击态 */
    .action-button:active {
        background-color: #444;
    }
}


/* 平板和移动端Excel表格尺寸 */
@media (max-width: 1024px) {
    .excel-style-config {
        width: 100%;
        height: auto;
        overflow-y: auto;
    }
}

/* 移动端下拉菜单修复 - 最终解决方案 */
@media (max-width: 768px) {
    /* 强制修复移动端下拉菜单定位问题 */
    .select-dropdown {
        position: absolute !important;
        top: 100% !important;
        left: -15vw !important;
        right: -10px !important;
        width: calc(100% + 20px) !important;
        min-width: 92vw !important;
        transform: none !important;
        z-index: 9999 !important;
        max-height: 50vh !important;
        margin-top: 2px !important;
        background-color: white !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* 确保父容器允许下拉菜单显示 */
    .excel-cell:nth-child(2) {
        position: relative !important;
    }
    
    .select-wrapper {
        overflow: visible !important;
        position: relative !important;
    }
    
    .custom-select {
        overflow: visible !important;
        position: relative !important;
    }
    
    /* 确保下拉菜单在打开状态下显示 */
    .custom-select.open .select-dropdown {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 选项样式优化 */
    .select-option {
        padding: 8px 12px !important;
        font-size: 14px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        background-color: white !important;
        color: #333 !important;
    }
    
    .select-option:hover {
        background-color: #f5f5f5 !important;
    }
    
    .select-option.selected {
        background-color: #e3f2fd !important;
        color: #1976d2 !important;
    }
    
    .no-options {
        padding: 12px !important;
        text-align: center !important;
        color: #999 !important;
        background-color: white !important;
    }
}



