* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background-color: #1a1a1a; font-family: 'Segoe UI', sans-serif; color: white; }

#canvas-container { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; z-index: 1; }
#ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

/* 侧边栏 */
.sidebar {
    position: absolute; top: 20px; left: 20px;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px);
    padding: 20px; border-radius: 12px; pointer-events: auto;
    display: flex; flex-direction: column; gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* 1. 限制侧边栏的最大高度，通常设置为视口高度 */
    max-height: 100vh; 
    
    /* 2. 开启垂直滚动 */
    overflow-y: auto; 
    
    /* 3. 隐藏水平方向的滚动条（防止内容横向溢出） */
    overflow-x: hidden; 
    
    /* 4. 可选：优化滚动条样式（让滚动条看起来更美观） */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent; /* Firefox */
}

/* 针对 Webkit 内核浏览器（Chrome, Edge, Safari）的滚动条美化 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.title { font-size: 18px; margin-bottom: 10px; color: #d4af37; letter-spacing: 1px; }
.menu-btn {
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc; padding: 10px 20px; text-align: left; cursor: pointer;
    transition: all 0.3s; border-radius: 6px; font-size: 14px;
}
.menu-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.menu-btn.active { background: #d4af37; color: #000; border-color: #d4af37; font-weight: bold; }
/* 模式切换分组 */
.mode-group {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sub-title {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.mode-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    padding: 8px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 6px;
    font-size: 13px;
}
.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.mode-btn.active {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border-color: #d4af37;
    font-weight: bold;
}
/* 右上角提示框 */
.help-tip {
    position: absolute; top: 20px; right: 20px;
    background: rgba(30, 30, 30, 0.9); border: 1px solid #d4af37;
    border-radius: 8px; padding: 12px 40px 12px 15px;
    color: #eee; font-size: 14px; line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    max-width: 300px; pointer-events: auto;
}
.close-tip-btn {
    position: absolute; top: 5px; right: 8px;
    background: none; border: none; color: #888;
    font-size: 20px; cursor: pointer; line-height: 1;
}
.close-tip-btn:hover { color: #fff; }

/* 底部控制栏 */
.bottom-bar {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px);
    padding: 10px 20px; border-radius: 30px; display: flex; gap: 15px;
    pointer-events: auto; border: 1px solid rgba(255, 255, 255, 0.1);
     
}
.control-btn {
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.3);
    color: white; padding: 8px 20px; border-radius: 20px; cursor: pointer;
    font-size: 14px; transition: all 0.3s; display: flex; align-items: center; gap: 5px;
}
.control-btn:hover:not(.disabled) { background: rgba(255, 255, 255, 0.1); }
.control-btn.highlight { background: #d4af37; color: black; border-color: #d4af37; font-weight: bold; }
.control-btn.disabled { opacity: 0.5; cursor: not-allowed; border-color: #555; color: #888; }

/* 加载动画（修复：用独立容器避免 transform 冲突） */
/* 加载动画容器：负责居中 */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 100;
}

/* 加载符号：只负责旋转 */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden { display: none !important; }
/* ========== 使用指南弹窗 ========== */
.guide-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.guide-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.guide-panel {
    position: relative;
    width: 560px;
    max-width: 90vw;
    max-height: 85vh;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #d4af37;
    border-radius: 16px;
    padding: 32px;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    color: #eee;
}

.close-guide-btn {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.close-guide-btn:hover { color: #fff; }

.guide-title {
    font-size: 22px;
    color: #d4af37;
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: 1px;
}
.guide-subtitle {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-section {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s;
}
.guide-section:hover {
    background: rgba(255,255,255,0.06);
}
.guide-section.highlight {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.05);
}

.guide-icon {
    font-size: 24px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.guide-text h4 {
    font-size: 15px;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.guide-text p {
    font-size: 13.5px;
    color: #bbb;
    line-height: 1.7;
}

.badge {
    font-size: 11px;
    background: #d4af37;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.key {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    margin-right: 4px;
}

.guide-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.guide-checkbox {
    font-size: 13px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.guide-checkbox input {
    accent-color: #d4af37;
    cursor: pointer;
}

.guide-start-btn {
    background: #d4af37;
    color: #000;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.guide-start-btn:hover {
    background: #e5c158;
    transform: translateY(-1px);
}

/* ========== 右下角帮助按钮 ========== */
.help-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #d4af37;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    pointer-events: auto;
}
.help-fab:hover {
    background: #d4af37;
    color: #000;
    transform: scale(1.1);
}
/* ========== 周边产品展示区 ========== */
.product-group {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.3s;
}
.product-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateX(4px);
}
.product-icon {
    font-size: 20px;
    line-height: 1;
}
.product-name {
    font-size: 13px;
    color: #ccc;
}
.product-item:hover .product-name {
    color: #fff;
}

/* ========== 产品详情面板 ========== */
.product-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 360px;
    max-width: 85vw;
    height: 100vh;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(12px);
    border-left: 1px solid #d4af37;
    padding: 28px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 200;
    overflow-y: auto;
    color: #eee;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.product-panel.active {
    transform: translateX(0);
}
.product-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.product-panel-title {
    font-size: 18px;
    color: #d4af37;
}
.btn-close-product {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}
.btn-close-product:hover {
    color: #fff;
}
.product-img {
    width: 100%;
    height: 220px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
    overflow: hidden;        /* 【新增】防止图片溢出 */
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* 图片填满容器，保持比例裁剪 */
    transition: transform 0.3s;
}
.product-img:hover img {
    transform: scale(1.05);  /* 悬停微放大 */
}
.product-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #bbb;
    margin-bottom: 20px;
}
.product-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.product-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
}
.product-meta-label {
    color: #666;
}
.product-meta-value {
    color: #d4af37;
    font-weight: bold;
}
.product-link {
    display: block;
    width: 100%;
    padding: 12px;
    background: #d4af37;
    color: #000;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
}
.product-link:hover {
    background: #e5c158;
}
.product-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.product-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
/* ========== 图片放大查看层 ========== */
.image-zoom-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.image-zoom-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.image-zoom-overlay img {
    max-width: 85vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform 0.35s ease;
}
.image-zoom-overlay.active img {
    transform: scale(1);
}

.btn-close-zoom {
    position: absolute;
    top: 24px; right: 32px;
    background: none; border: none;
    color: #888;
    font-size: 36px;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 301;
}
.btn-close-zoom:hover {
    color: #fff;
}

.image-zoom-caption {
    margin-top: 20px;
    font-size: 16px;
    color: #d4af37;
    letter-spacing: 1px;
}
/* ========== 移动端适配 ========== */

/* 汉堡菜单按钮（默认隐藏） */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 60;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #d4af37;
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.menu-toggle:hover {
    background: rgba(212, 175, 55, 0.2);
}

/* ========== 移动端侧边栏 ========== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 60;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #d4af37;
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    pointer-events: auto;  /* 【确保有这行】 */
}
.menu-toggle:hover {
    background: rgba(212, 175, 55, 0.2);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
}
.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 80vw;
        transform: translateX(-100%);
        z-index: 55;
        border-radius: 0;
        margin: 0;
        padding-top: 60px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .bottom-bar {
        bottom: 16px;
        padding: 8px 12px;
        gap: 8px;
    }
    .control-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .help-tip {
        top: 60px;
        right: 10px;
        left: 60px;
        max-width: none;
    }

    .help-fab {
        bottom: 80px;
        right: 16px;
    }

    .product-panel {
        width: 100vw;
        max-width: 100vw;
    }
}
/* ========== 产品分类 ========== */
.product-category {
    margin-bottom: 12px;
}
.category-title {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 4px;
    border-left: 2px solid #d4af37;
}
/* 产品类型标签 */
.type-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
    font-weight: bold;
    vertical-align: middle;
}
.type-3d {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.3);
}
.type-flat {
    background: rgba(100, 180, 255, 0.2);
    color: #64b4ff;
    border: 1px solid rgba(100, 180, 255, 0.3);
}