/**
 * Model Player 页面专用样式
 * 包含3D场景容器、导航栏、模型信息展示等样式
 */

/* ========== 基础样式 ========== */

body {
    margin: 0;
    overflow: hidden;
    background-color: #000000; /* 与全站活动页面统一的纯黑背景 */
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

/* 防止 has-topbar 类影响布局 */
body.has-topbar {
    padding-top: 0 !important;
}

.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#filamentCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.navbar {
    position: relative;
    z-index: 10;
    background: transparent;
    backdrop-filter: blur(10px);
}

/* ========== Canvas overlay styles ========== */

.output_canvas {
    z-index: 20;
    width: 640px;
    height: 480px;
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    pointer-events: none;
}

#webcamButton {
    position: relative;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 21;
    margin-bottom: 1em;
}

video {
    width: 640px;
    height: 480px;
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* ========== Model Player 页面导航栏 ========== */

/* 导航栏容器 */
.model-player-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 10000;
    box-sizing: border-box;
    pointer-events: none;
    transition: transform 0.3s ease;
}

/* 恢复交互元素的可点击性 */
.model-player-navbar > * {
    pointer-events: auto;
}

/* Logo 区域 */
.model-player-navbar__logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.model-player-navbar__logo img {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1) opacity(0.45);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.model-player-navbar__logo img:hover {
    filter: brightness(0) invert(1) opacity(0.85);
}

/* 导航栏容器 */
.model-player-navbar__nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* 导航链接 */
.model-player-navbar__nav-link {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: color 0.3s ease, opacity 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.model-player-navbar__nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    transition: width 0.3s ease;
}

.model-player-navbar__nav-link:hover {
    color: rgba(255, 255, 255, 0.85);
}

.model-player-navbar__nav-link:hover::after {
    width: 100%;
}

/* 汉堡菜单按钮（移动端） */
.model-player-navbar__menu-button {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}

.model-player-navbar__menu-button span {
    display: block;
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.65);
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.model-player-navbar__menu-button.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.model-player-navbar__menu-button.active span:nth-child(2) {
    opacity: 0;
}

.model-player-navbar__menu-button.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========== 响应式设计 - 平板和移动端 ========== */

@media (max-width: 768px) {
    .model-player-navbar {
        padding: 0 20px;
        height: 50px;
    }

    .model-player-navbar__logo img {
        height: 40px;
    }

    /* 显示汉堡菜单按钮 */
    .model-player-navbar__menu-button {
        display: flex;
    }

    /* 导航栏折叠样式 */
    .model-player-navbar__nav {
        position: fixed;
        top: 50px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 50px);
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 20px 0;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.45);
    }

    .model-player-navbar__nav.open {
        right: 0;
    }

    .model-player-navbar__nav-link {
        width: 100%;
        padding: 15px 30px;
        font-size: 18px;
        border-left: 3px solid transparent;
    }

    .model-player-navbar__nav-link::after {
        display: none;
    }

    .model-player-navbar__nav-link:hover {
        background: rgba(255, 255, 255, 0.08);
        border-left-color: rgba(255, 255, 255, 0.85);
    }
}

/* ========== 响应式设计 - 小屏幕手机 ========== */

@media (max-width: 480px) {
    .model-player-navbar {
        padding: 0 15px;
    }

    .model-player-navbar__logo img {
        height: 36px;
    }

    .model-player-navbar__nav {
        width: 100%;
        right: -100%;
    }

    .model-player-navbar__nav-link {
        font-size: 16px;
        padding: 12px 20px;
    }
}

/* ========== 模型信息显示区域 ========== */

/* 模型信息容器 */
.model-info-container {
    position: absolute;
    left: 20px;
    bottom: 40px;
    width: calc(100% - 40px);
    max-width: 768px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0;
}

.model-info-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.model-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-info-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.model-info-item .info-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 500;
}

.model-info-item .info-value {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
}

/* 返回按钮 */
.model-back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.model-back-button:hover {
    opacity: 1;
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
}

.model-back-button img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.model-back-button span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ========== 模型信息显示区域响应式设计 ========== */

@media (max-width: 768px) {
    .model-info-container {
        left: 16px;
        bottom: 40px;
        width: calc(100% - 32px);
        gap: 12px;
    }

    .model-info-text {
        font-size: 12px;
    }

    .model-back-button {
        height: 40px;
        padding: 0 16px;
        border-radius: 5px;
    }

    .model-back-button img {
        width: 16px;
        height: 16px;
    }

    .model-back-button span {
        font-size: 13px;
    }
}
