:root {
    /* 颜色变量 */
    --gold: #FFD700;
    --gold-light: #FFED4E;
    --gold-dark: #FFC107;
    --glass: rgba(15, 15, 15, 0.92);
    --glass-light: rgba(30, 30, 40, 0.85);
    --glass-dark: rgba(10, 10, 20, 0.95);
    --border: rgba(255, 215, 0, 0.35);
    --border-light: rgba(255, 215, 0, 0.5);
    --border-dark: rgba(255, 215, 0, 0.2);

    /* 功能色 */
    --success: #00ff00;
    --error: #ff4444;
    --warning: #ff9800;
    --info: #2196F3;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.4);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* AR.js加载器 */
.arjs-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold);
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.arjs-loader div {
    text-align: center;
    padding: var(--space-xl);
    background: var(--glass-dark);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gold);
    box-shadow: var(--shadow-lg);
}

/* 启动页 */
#start-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-xl);
}

#start-screen h1 {
    color: var(--gold);
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    letter-spacing: 2px;
    text-shadow: var(--shadow-gold);
}

#start-screen h1 i {
    margin-right: var(--space-sm);
    animation: spin 4s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading-msg {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: var(--space-xl);
    min-height: 24px;
}

#main-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-xl);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-gold);
    display: none;
}

#main-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

#main-btn i {
    margin-right: var(--space-sm);
}

/* 视频元素 - 隐藏避免冲突 */
#camera-video {
    display: none;
}

/* 模式选择器 */
#mode-selector {
    position: fixed;
    top: env(safe-area-inset-top, 25px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 4px;
    z-index: 1000;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.mode-btn {
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    border: none;
    background: transparent;
    color: #888;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
}

.mode-btn.active {
    background: var(--gold);
    color: #000;
    box-shadow: var(--shadow-sm);
}

.mode-btn i {
    font-size: 16px;
}

/* 命卦选择弹窗 */
#minggua-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
}

.modal-content {
    background: var(--glass-dark);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

.modal-content h3 {
    color: var(--gold);
    margin-bottom: var(--space-lg);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.modal-explain {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
}

.modal-explain p {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.modal-explain i {
    color: var(--gold);
    margin-top: 2px;
}

.button-group {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.minggua-btn {
    flex: 1;
    max-width: 200px;
    padding: var(--space-md);
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.minggua-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

#confirm-minggua {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    border: none;
    padding: 12px 40px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

#confirm-minggua:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* 扫描容器 - 调整位置避免遮住AR内容 */
#scanner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 60vh;
    z-index: 10;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.indoor-scan-line {
    position: absolute;
    width: 90vw;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    box-shadow: var(--shadow-gold);
    display: none;
    animation: scanMove 3s infinite ease-in-out;
}

.outdoor-wave {
    position: absolute;
    width: 10vw;
    height: 10vw;
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: none;
    animation: waveRipple 3s infinite ease-out;
}

.scene-focus-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vw;
    max-width: 250px;
    max-height: 250px;
    border: 2px solid var(--gold);
    display: none;
    animation: focusPulse 2.5s infinite ease-in-out;
}

@keyframes scanMove {

    0%,
    100% {
        top: 20%;
        opacity: 0;
    }

    50% {
        opacity: 1;
        top: 60%;
    }
}

@keyframes waveRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 120vw;
        height: 120vw;
        opacity: 0;
    }
}

@keyframes focusPulse {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1.2);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(0.6);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(0.3);
        opacity: 0;
    }
}

#object-text {
    position: absolute;
    top: 40%;
    width: 100%;
    text-align: center;
    color: var(--gold);
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 0 10px var(--gold);
    animation: textShine 1.5s infinite alternate ease-in-out;
    z-index: 11;
    padding: 0 var(--space-md);
}

@keyframes textShine {
    from {
        opacity: 0.6;
        transform: scale(0.95);
        text-shadow: 0 0 5px var(--gold);
    }

    to {
        opacity: 1;
        transform: scale(1.05);
        text-shadow: 0 0 25px var(--gold), 0 0 40px #fff;
    }
}

/* 控制面板 - 调整位置避免遮住AR内容 */
#control-panel {
    position: fixed;
    top: 100px;
    right: 15px;
    z-index: 1000;
    pointer-events: auto;
}

#ornament-controls {
    display: none;
    margin-bottom: var(--space-md);
}

.orn-btn {
    width: 44px;
    height: 44px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
}

#report-btn,
#test-trigger-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass);
    border: 1.5px solid var(--gold);
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    margin-bottom: var(--space-sm);
}

#report-btn {
    position: fixed;
    top: 40px;
    left: 15px;
    z-index: 1000;
}

.orn-btn:hover,
#report-btn:hover,
#test-trigger-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* 滑动面板 */
.slide-panel {
    position: fixed;
    background: var(--glass-dark);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 6000;
    display: none;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

@keyframes slideUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.panel-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 215, 0, 0.05);
}

.panel-header h3 {
    color: var(--gold);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    font-weight: bold;
}

.close-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: rotate(90deg);
}

.panel-content {
    padding: var(--space-lg);
    overflow-y: auto;
}

.panel-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    text-align: center;
    background: rgba(255, 215, 0, 0.05);
}

/* 信息面板 */
#info-panel {
    bottom: 115px;
    left: 5%;
    width: 90%;
}

#info-panel section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

#info-panel section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#info-panel h4 {
    color: var(--gold);
    margin-bottom: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#info-panel p {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    margin-left: 28px;
}

/* AI解析弹窗 */
#ai-box {
    bottom: 240px;
    left: 5%;
    width: 90%;
    border-left: 4px solid var(--gold);
}

#ai-content {
    line-height: 1.8;
    color: #fff;
    font-size: 14px;
    white-space: pre-wrap;
}

 #fengshui-report {
    position: fixed;
    top: 17px;
    left: 24px;
    width: 90%;
    height: 73%;
    background: rgba(0, 0, 0, 0.531);
    /* z-index: 1000; */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}


#save-report-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: var(--radius-md);
    color: #222;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#save-report-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

#save-report-btn:active {
    transform: scale(0.98);
}

/* 底部仪表盘 - 调整位置避免遮住AR内容 */
#bottom-dashboard {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#compass-area {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

#compass-plate-2d {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 300px;
    height: 300px;
    background-size: contain;
    background-repeat: no-repeat;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.1s linear;
}

#fixed-needle {
    position: absolute;
    bottom: 220px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 50px solid var(--error);
    z-index: 101;
}

#main-panel {
    background: var(--glass);
    backdrop-filter: blur(25px);
    width: 92%;
    margin-bottom: 8px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
    min-height: 80px;
}

#center-content {
    flex: 1;
    text-align: center;
    padding: 0 12px;
}

#direction {
    color: var(--gold);
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#analysis {
    font-size: 11px;
    color: var(--success);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#bagua-tag {
    font-size: 10px;
    color: var(--gold);
    opacity: 0.8;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

#ask-ai-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

#ask-ai-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.dash-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold);
    font-size: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dash-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

#particle-toggle.active {
    box-shadow: 0 0 20px var(--gold);
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 15px var(--gold);
    }

    to {
        box-shadow: 0 0 25px var(--gold), 0 0 35px var(--gold-light);
    }
}

/* 通知和提示 */
.notification {
    position: fixed;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    background: var(--glass-dark);
    border: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    color: #fff;
    text-align: center;
    z-index: 7000;
    display: none;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    animation: noticePopup 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    max-width: 350px;
    width: 85%;
}

@keyframes noticePopup {
    0% {
        transform: translate(-50%, 50%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, 50%) scale(1);
        opacity: 1;
    }
}

.notification-content {
    font-size: 15px;
    line-height: 1.5;
}

.notification.success::before {
    content: "✓";
    display: block;
    font-size: 40px;
    color: var(--success);
    margin-bottom: 12px;
}

.notification.error::before {
    content: "✕";
    display: block;
    font-size: 40px;
    color: var(--error);
    margin-bottom: 12px;
}

.notification.warning::before {
    content: "⚠";
    display: block;
    font-size: 40px;
    color: var(--warning);
    margin-bottom: 12px;
}

.toast {
    position: fixed;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    color: var(--gold);
    font-size: 14px;
    z-index: 6500;
    display: none;
    animation: toastSlide 0.3s ease forwards;
    max-width: 320px;
    width: 80%;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

@keyframes toastSlide {
    0% {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* AR扫描按钮 - 调整位置避免遮住AR内容 */
#ar-scan-btn {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.9);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: bold;
    font-size: 13px;
    z-index: 1000;
    display: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

#ar-scan-btn:hover {
    background: rgba(255, 215, 0, 1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* ============ 关键修复：A-Frame场景层级 ============ */

/* A-Frame场景 - 层级设置 */
#aframe-scene,
#ar-scene-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1 !important;
    /* 最低层级，作为背景 */
    pointer-events: auto !important;
}

/* A-Frame Canvas - 确保摄像头画面在最底层 */
.a-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    transform: scaleX(-1) !important;
    /* 镜像翻转，使后置摄像头显示正常 */
}

/* AR内容容器 - 确保粒子/摆件在摄像头画面上方 */
#manual-particles,
#ornament-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2 !important;
    /* 在摄像头画面上方 */
    pointer-events: none !important;
}

/* 隐藏A-Frame的默认UI */
.a-enter-vr,
.a-orientation-modal {
    display: none !important;
}

/* Three.js容器样式 */
#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    /* 在粒子/摆件上方 */
    display: none;
    pointer-events: none;
}

/* 确保Three.js canvas正确显示 */
#three-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-light);
}

/* 摆件图标样式 */
.orn-icon {
    background: transparent;
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease, filter 0.3s ease;
    object-fit: contain;
}

/* 悬停时的动画效果 */
.orn-btn:hover .orn-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

/* 响应式设计 - 竖屏专用 */
@media (max-width: 768px) and (orientation: portrait) {
    #start-screen h1 {
        font-size: 2rem;
    }

    .mode-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    #compass-plate-2d {
        width: 280px;
        height: 280px;
    }

    #fixed-needle {
        bottom: 200px;
    }

    #main-panel {
        width: 95%;
        padding: 10px;
        min-height: 70px;
    }

    .dash-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    #direction {
        font-size: 15px;
    }

    #analysis {
        font-size: 10px;
    }

    #ask-ai-btn {
        padding: 12px 97px;
        font-size: 10px;
    }
}

@media (max-width: 480px) and (orientation: portrait) {
    #mode-selector {
        top: 15px;
    }

    .modal-content {
        padding: var(--space-lg);
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .minggua-btn {
        width: 100%;
        max-width: none;
    }

    #compass-plate-2d {
        width: 250px;
        height: 250px;
    }

    #fixed-needle {
        bottom: 180px;
        border-bottom: 40px solid var(--error);
    }

    #main-panel {
        padding: 8px;
    }

    #scanner-container {
        height: 55vh;
    }

    #object-text {
        font-size: 16px;
        top: 35%;
    }
}

/* 高度适配 - 竖屏 */
@media (max-height: 700px) and (orientation: portrait) {
    #compass-area {
        height: 180px;
    }

    #compass-plate-2d {
        width: 240px;
        height: 240px;
    }

    #fixed-needle {
        bottom: 160px;
    }

    #bottom-dashboard {
        padding-bottom: 5px;
    }

    #main-panel {
        margin-bottom: 5px;
        padding: 8px;
        min-height: 65px;
    }

    .dash-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    #direction {
        font-size: 14px;
    }

    #scanner-container {
        height: 50vh;
    }
}

/* 强制竖屏警告 */
@media (orientation: landscape) {
    body::before {
        content: "请将设备旋转为竖屏使用";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.95);
        color: var(--gold);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.5rem;
        z-index: 99999;
        text-align: center;
        padding: 20px;
    }

    #start-screen,
    #minggua-modal,
    .slide-panel,
    .notification {
        display: none !important;
    }

    /* 横屏时隐藏所有UI */
    #mode-selector,
    #control-panel,
    #bottom-dashboard,
    #ar-scan-btn {
        display: none !important;
    }
}

/* ============ 摄像头方向修复 ============ */
/* 确保后置摄像头正确显示 */
.a-camera .a-camera-view {
    transform: scaleX(-1) !important;
    /* 镜像翻转，用于后置摄像头 */
}

/* 调试类：显示层级边界 */
.debug-layer {
    border: 2px solid red;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
    display: none;
}

.layer-1 {
    border-color: red;
}

.layer-2 {
    border-color: green;
}

.layer-3 {
    border-color: blue;
}

.layer-10 {
    border-color: yellow;
}

.layer-1000 {
    border-color: purple;
}

.layer-6000 {
    border-color: cyan;
}

/* 摄像头切换提示 */
.camera-hint {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--glass);
    color: var(--gold);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    z-index: 1000;
    display: none;
    border: 1px solid var(--border);
}