/* ===================================
   智饰环球 - AR 演示页面样式
   Global Smart Jewelry - Demo Page Styles
   =================================== */

/* CSS 变量 */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    
    --text-dark: #1a202c;
    --text-gray: #4a5568;
    --text-light: #718096;
    --text-white: #ffffff;
    
    --bg-dark: #0d1117;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    
    --navbar-height: 70px;
}

/* 重置样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links a {
    font-weight: 500;
    color: var(--text-gray);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
}

.nav-links a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ===================================
   AR 演示容器
   =================================== */
.ar-demo-container {
    display: flex;
    gap: 24px;
    padding: calc(var(--navbar-height) + 24px) 24px 24px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - var(--navbar-height));
}

/* AR 视窗包装器 - 包含视频+控件 */
.ar-main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
    overflow: hidden;
}

/* AR 视窗 - 仅视频区域 */
.ar-viewport {
    flex: 1;
    position: relative;
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    aspect-ratio: 3/4;
    max-height: calc(100vh - var(--navbar-height) - 200px);
    min-height: 300px;
}

/* 手腕引导框 - 引导态UI */
.wrist-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 40%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.wrist-guide.active {
    opacity: 1;
}

.wrist-guide .guide-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: rgba(255, 255, 255, 0.8);
    border-style: solid;
    border-width: 0;
}

.wrist-guide .guide-corner.tl {
    top: 0;
    left: 0;
    border-top-width: 3px;
    border-left-width: 3px;
}

.wrist-guide .guide-corner.tr {
    top: 0;
    right: 0;
    border-top-width: 3px;
    border-right-width: 3px;
}

.wrist-guide .guide-corner.bl {
    bottom: 0;
    left: 0;
    border-bottom-width: 3px;
    border-left-width: 3px;
}

.wrist-guide .guide-corner.br {
    bottom: 0;
    right: 0;
    border-bottom-width: 3px;
    border-right-width: 3px;
}

.wrist-guide .guide-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    font-weight: 500;
}

.wrist-guide.warning .guide-corner {
    border-color: #ff5722;
}

.wrist-guide.warning .guide-text {
    background: rgba(255, 87, 34, 0.9);
}

.wrist-guide.success .guide-corner {
    border-color: #4caf50;
}

.wrist-guide.success .guide-text {
    background: rgba(76, 175, 80, 0.9);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .wrist-guide {
        width: 70%;
    }
    
    .wrist-guide .guide-corner {
        width: 20px;
        height: 20px;
    }
    
    .wrist-guide .guide-text {
        font-size: 12px;
        padding: 6px 12px;
        bottom: -35px;
    }
}

@media (max-width: 380px) {
    .wrist-guide {
        width: 80%;
    }
    
    .wrist-guide .guide-corner {
        width: 15px;
        height: 15px;
    }
    
    .wrist-guide .guide-text {
        font-size: 11px;
        padding: 5px 10px;
        bottom: -30px;
    }
}

#cameraVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#arCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 状态提示 */
.ar-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-white);
    border-radius: 30px;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.status-icon {
    font-size: 18px;
}

.status-content.success {
    background: rgba(72, 187, 120, 0.9);
}

.status-content.error {
    background: rgba(245, 101, 101, 0.9);
}

/* 控制按钮区域 - 视频下方 */
.ar-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-lg);
}

/* 模型选择器优化 */
.model-selector {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
}

.model-selector h3 {
    font-size: 14px;
    color: #a0aec0;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 控制按钮 */
.ar-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    min-width: 120px;
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.control-btn.primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* 关闭按钮 - 红色警告样式 */
.control-btn.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.control-btn.danger:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
    transform: translateY(-2px);
}

.control-btn.danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.control-btn .btn-icon {
    font-size: 16px;
}

/* 模型选择器 - 视频下方 */
.model-selector {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-lg);
}

.model-selector h3 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.model-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.model-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: #fff;
    min-width: 75px;
    transition: all var(--transition-base);
}

.model-item:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.model-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.model-icon {
    font-size: 24px;
}

.model-name {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* ===================================
   信息面板
   =================================== */
.info-panel {
    width: 380px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    max-height: calc(100vh - var(--navbar-height) - 48px);
}

.panel-section {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.panel-section .subtitle {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 16px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-badge {
    padding: 4px 12px;
    background: var(--bg-light);
    color: var(--text-gray);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.panel-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

/* 功能列表 */
.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-gray);
}

.feature-icon {
    font-size: 18px;
}

/* 性能指标 */
.metrics {
    display: flex;
    gap: 24px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-label {
    font-size: 12px;
    color: var(--text-gray);
}

/* 步骤 */
.steps {
    list-style: decimal;
    padding-left: 20px;
}

.steps li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
}

/* CTA */
.panel-section.cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    text-align: center;
}

.panel-section.cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 16px;
}

.panel-section.cta .btn {
    background: var(--text-white);
    color: var(--primary-color);
}

/* ===================================
   加载遮罩
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-base);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    text-align: center;
    color: var(--text-white);
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader p {
    font-size: 16px;
    margin-bottom: 8px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-light);
}

/* ===================================
   弹窗
   =================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-gray);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 24px;
    text-align: center;
}

.modal-body img {
    max-width: 100%;
    border-radius: var(--border-radius);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    flex: 1;
}

/* ===================================
   响应式设计
   =================================== */
@media (max-width: 1024px) {
    .ar-demo-container {
        flex-direction: column;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .ar-viewport {
        max-height: 50vh;
        width: 100%;
    }
    
    .ar-controls-wrapper {
        width: 100%;
    }
    
    .info-panel {
        width: 100%;
        max-height: none;
    }
}

/* ==========================================
   移动端优化布局 (768px以下)
   ========================================== */
@media (max-width: 768px) {
    /* 整体容器 - 垂直布局 */
    .ar-demo-container {
        flex-direction: column;
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }

    /* 移动端显示悬浮按钮 */
    .quick-tune-btn,
    .info-toggle-btn {
        display: flex !important;
    }

    /* AR 视窗 - 占满上半屏 */
    .ar-main-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    .ar-viewport {
        flex: 1;
        width: 100%;
        max-height: 55vh;
        min-height: 40vh;
        aspect-ratio: auto;
        border-radius: 0;
    }

    /* 控制按钮 - 固定底部导航栏 */
    .ar-controls-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 100;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* 模型选择器 - 横向滚动 */
    .model-selector {
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .model-selector h3 {
        display: none;
    }

    .model-list {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding: 4px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .model-list::-webkit-scrollbar {
        display: none;
    }

    .model-item {
        flex-shrink: 0;
        min-width: 60px;
        padding: 8px 14px;
    }

    .model-name {
        font-size: 11px;
    }

    /* 控制按钮行 */
    .ar-controls {
        display: flex;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .control-btn {
        flex: 1;
        min-width: 70px;
        padding: 12px 10px;
        font-size: 13px;
        border-radius: 12px;
    }

    /* 移动端微调面板弹窗优化 */
    .tuning-panel {
        width: 92%;
        max-width: 380px;
        padding-bottom: 20px;
    }

    .tuning-panel.active {
        display: block;
        animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .control-btn .btn-icon {
        font-size: 16px;
    }

    /* 微调面板内容优化 */
    .tuning-content {
        padding: 16px;
    }

    .tuning-actions {
        position: sticky;
        bottom: 0;
        background: var(--bg-white);
        padding-top: 12px;
        margin-top: 8px;
    }

    /* 状态提示 - 居中顶部 */
    .ar-status {
        top: 10px;
    }

    .status-content {
        padding: 8px 16px;
        font-size: 12px;
    }

    /* 信息面板 - 折叠显示 */
    .info-panel {
        position: fixed;
        top: var(--navbar-height);
        right: 0;
        width: 100%;
        max-height: calc(100vh - var(--navbar-height));
        overflow-y: auto;
        z-index: 90;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        border-radius: 0;
    }

    .info-panel.active {
        transform: translateX(0);
    }

    .info-toggle-btn {
        display: flex;
    }

    /* 信息面板内的内容默认折叠 */
    .info-panel .panel-section {
        border-bottom: 1px solid var(--border-color);
    }

    .info-panel .panel-section h3 {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .info-panel .panel-section h3::after {
        content: '▼';
        font-size: 10px;
        transition: transform 0.3s;
    }

    .info-panel .panel-section.collapsed h3::after {
        transform: rotate(-90deg);
    }

    .info-panel .panel-section .feature-list,
    .info-panel .panel-section .tips-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .info-panel .panel-section:not(.collapsed) .feature-list,
    .info-panel .panel-section:not(.collapsed) .tips-list {
        max-height: 500px;
        padding: 12px 0;
    }

    /* 微调按钮 - 悬浮按钮 */
    .quick-tune-btn {
        position: fixed;
        right: 20px;
        bottom: calc(100px + env(safe-area-inset-bottom));
        width: 52px;
        height: 52px;
        border-radius: 16px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
        z-index: 95;
        display: none;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .quick-tune-btn:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 10px 35px rgba(102, 126, 234, 0.6);
    }

    .quick-tune-btn:active {
        transform: scale(0.95);
    }

    /* 信息按钮 */
    .info-toggle-btn {
        display: none;
        position: fixed;
        right: 20px;
        top: calc(var(--navbar-height) + 15px);
        width: 48px;
        height: 48px;
        border-radius: 14px;
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        color: white;
        border: none;
        box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
        z-index: 95;
        cursor: pointer;
        font-size: 20px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .info-toggle-btn:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 8px 30px rgba(245, 87, 108, 0.5);
    }

    /* 模态遮罩 */
    .tuning-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
        display: none;
    }

    .tuning-overlay.active {
        display: block;
    }

    /* 导航栏 */
    .navbar .container {
        padding: 0 15px;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: var(--shadow-md);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* 500px以下更小屏幕优化 */
    @media (max-width: 500px) {
        .ar-viewport {
            max-height: 50vh;
        }

        .ar-controls {
            flex-wrap: wrap;
        }

        .control-btn {
            min-width: 45%;
            padding: 8px 6px;
            font-size: 11px;
        }

        .model-item {
            min-width: 50px;
            padding: 6px 10px;
        }

        .model-icon {
            font-size: 18px;
        }

        .model-name {
            font-size: 10px;
        }

        .quick-tune-btn {
            width: 44px;
            height: 44px;
            font-size: 18px;
            right: 12px;
            bottom: 70px;
        }
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }
    
    .mobile-menu-btn span {
        width: 100%;
        height: 3px;
        background-color: var(--primary-color);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* 移动端：控件区域优化 */
    .ar-controls-wrapper {
        padding: 16px;
        gap: 12px;
    }
    
    .model-selector {
        padding: 12px;
    }
    
    .model-list {
        gap: 8px;
    }
    
    .model-item {
        min-width: 65px;
        padding: 10px 12px;
    }
    
    .model-icon {
        font-size: 20px;
    }
    
    .model-name {
        font-size: 10px;
    }
    
    .ar-controls {
        gap: 8px;
    }
    
    .control-btn {
        padding: 12px 16px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .control-btn.primary {
        font-size: 14px;
        padding: 14px 20px;
    }
    
    /* 防止溢出 */
    .ar-main-wrapper {
        overflow: hidden;
    }
    
    .model-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .metrics {
        flex-direction: column;
    }
    
    /* 信息面板优化 */
    .info-panel {
        padding-bottom: 20px;
    }
}

/* 超小屏幕适配 (iPhone SE 等) */
@media (max-width: 380px) {
    .ar-controls-wrapper {
        padding: 12px;
        gap: 10px;
    }
    
    .model-selector h3 {
        font-size: 12px;
    }
    
    .model-item {
        min-width: 55px;
        padding: 8px 10px;
    }
    
    .model-icon {
        font-size: 18px;
    }
    
    .model-name {
        font-size: 9px;
    }
    
    .control-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .control-btn .btn-icon {
        font-size: 14px;
    }
}

/* ==========================================
   手动微调面板样式
   ========================================== */
/* 手动微调面板 - 桌面端默认显示 */
.tuning-panel {
    display: block !important;
    visibility: visible !important;
    background: linear-gradient(145deg, #1e2538 0%, #2a3447 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-top: 16px;
    overflow: visible;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.tuning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-white);
}

.tuning-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.tuning-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.tuning-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tuning-toggle.collapsed {
    transform: rotate(-90deg);
}

.tuning-content {
    padding: 20px;
    display: block;
    background: rgba(255, 255, 255, 0.02);
}

.tuning-content.hidden {
    display: none;
}

.tuning-group {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.tuning-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tuning-group:last-child {
    margin-bottom: 0;
}

.tuning-group h4 {
    font-size: 11px;
    color: #718096;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.tuning-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    transition: background 0.3s;
}

.tuning-row:hover {
    background: rgba(0, 0, 0, 0.35);
}

.tuning-row:last-child {
    margin-bottom: 0;
}

.tuning-row label {
    font-size: 13px;
    color: #cbd5e0;
    font-weight: 500;
    min-width: 65px;
}

.tuning-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.tune-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 2px solid #667eea;
    background: linear-gradient(145deg, #2a3447, #1e2538);
    color: #667eea;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.tune-btn:hover {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tune-btn:active {
    transform: scale(0.95) translateY(0);
}

.tune-value {
    min-width: 55px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #667eea;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 10px;
    border-radius: 6px;
}

.tuning-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tuning-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid var(--primary-color);
    background: var(--bg-white);
    color: var(--primary-color);
}

.tuning-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.tuning-btn.primary {
    background: var(--primary-color);
    color: var(--text-white);
}

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

/* Toast 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==========================================
   移动端微调面板适配
   ========================================== */
@media (max-width: 768px) {
    /* 移动端：微调面板变为弹窗 */
    .tuning-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 340px;
        max-height: 85vh;
        overflow-y: auto;
        z-index: 200;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        display: none;
        margin-top: 0;
        border-radius: 12px;
    }

    .tuning-panel.active {
        display: block;
        animation: modalSlideIn 0.3s ease;
    }

    @keyframes modalSlideIn {
        from {
            opacity: 0;
            transform: translate(-50%, -40%) scale(0.9);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }

    @keyframes pulse {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.05);
        }
    }

    .tuning-header {
        padding: 10px 12px;
    }

    .tuning-header h3 {
        font-size: 13px;
    }

    .tuning-content {
        padding: 12px;
    }

    .tuning-group {
        margin-bottom: 12px;
    }

    .tuning-group h4 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .tuning-row {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 10px;
    }

    .tuning-row label {
        font-size: 12px;
        min-width: 50px;
    }

    .tuning-controls {
        gap: 6px;
    }

    .tune-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .tune-value {
        min-width: 45px;
        font-size: 13px;
        padding: 5px 8px;
    }

    .tuning-actions {
        margin-top: 14px;
        padding-top: 14px;
        gap: 10px;
    }

    /* 移动端优化 - 确保悬浮按钮显示正确 */
    .quick-tune-btn,
    .info-toggle-btn {
        display: flex !important;
    }

    /* 移动端悬浮按钮优化 */
    .quick-tune-btn {
        bottom: 120px;
        right: 20px;
        width: 56px;
        height: 56px;
        font-size: 24px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    }

    .info-toggle-btn {
        bottom: 120px;
        left: 20px;
        width: 56px;
        height: 56px;
        font-size: 24px;
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4);
    }

    .tuning-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .tuning-content {
        padding: 10px;
    }

    .tuning-row label {
        font-size: 11px;
        min-width: 45px;
    }

    .tune-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .tune-value {
        min-width: 35px;
        font-size: 11px;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}