/**
 * AR实景导航 - 现代化UI样式表
 * 科技感设计 | 流畅动画 | 移动端优化
 * Version: 2.0
 */

/* ===== CSS变量定义 ===== */
:root {
    /* 主题色 */
    --primary-color: #00d4ff;
    --primary-gradient: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    --secondary-color: #5856D6;
    --accent-color: #4CD964;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;

    /* 背景色 */
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --bg-panel: rgba(15, 15, 25, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-gradient-dark: linear-gradient(135deg, rgba(10, 10, 20, 0.95) 0%, rgba(20, 20, 35, 0.95) 100%);

    /* 毛玻璃效果 */
    --blur-light: blur(10px);
    --blur-medium: blur(15px);
    --blur-heavy: blur(20px);

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.4);

    /* 边框 */
    --border-light: 1px solid rgba(255, 255, 255, 0.1);
    --border-glow: 1px solid rgba(0, 212, 255, 0.3);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* 动画时长 */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a14 0%, #141423 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #ffffff;
}

/* ===== A-Frame场景容器 ===== */
a-scene {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
}

/* ===== 顶部状态栏 ===== */
#status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 20px);
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 10%);


    z-index: 1000;
    pointer-events: none;
}

/* ===== 坐标信息面板 ===== */
#coords-panel {
    position: fixed;
    top: max(env(safe-area-inset-top, 16px), 16px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 400px;
    background: var(--bg-gradient-dark);
    color: #fff;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    z-index: 1001;
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border: var(--border-glow);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: panelSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* 面板发光边框动画 */
#coords-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: #141423;
    border-radius: var(--radius-lg);
    opacity: 0.3;
    z-index: -1;
    animation: borderRotate 6s linear infinite;
    background-size: 400% 400%;
}

@keyframes borderRotate {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes panelSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#coords-panel .coords-title {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

#coords-panel .coords-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 12px var(--accent-color);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 12px var(--accent-color);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.85);
        box-shadow: 0 0 20px var(--accent-color);
    }
}

#coords-panel .coords-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#coords-panel .coord-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-glass);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-fast);
}

#coords-panel .coord-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

#coords-panel .coord-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

#coords-panel .coord-value {
    font-size: 15px;
    font-weight: 700;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    letter-spacing: -0.5px;
}

#coords-panel .accuracy-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

/* ===== 转向指引面板 ===== */
#direction-panel {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.25), rgba(88, 86, 214, 0.25));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
    pointer-events: none;
}

#direction-panel.visible {
    opacity: 1;
    max-height: 48px;
    transform: translateY(0);
}

#direction-panel .direction-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.6) 0%, rgba(0, 122, 255, 0.15) 70%);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 122, 255, 0.6);
    animation: arrowPulse 1.8s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

#direction-panel .arrow-icon {
    font-size: 18px;
    color: #e8f6ff;
    text-shadow: 0 0 8px rgba(0, 122, 255, 0.8);
}

#direction-panel .arrow-icon.left {
    transform: rotate(-90deg);
}

#direction-panel .arrow-icon.right {
    transform: rotate(90deg);
}

#direction-panel .arrow-icon.straight {
    transform: rotate(0deg);
}

#direction-panel .direction-text {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;
}


/* ===== 导航信息面板 ===== */
#nav-info-wrapper {
    position: fixed;
    bottom: max(env(safe-area-inset-bottom, 12px), 12px);
    left: 12px;
    right: 12px;
    z-index: 1001;
}

#nav-info-toggle {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 22px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#nav-info-toggle:active {
    background: rgba(0, 122, 255, 0.3);
}

#nav-info-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

#nav-info-wrapper.collapsed #nav-info-toggle .toggle-icon {
    transform: rotate(180deg);
}

#nav-info {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 30, 0.85) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 12px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    max-height: 180px;
}

#nav-info-wrapper.collapsed #nav-info {
    max-height: 0;
    opacity: 0;
    border: none;
}

#nav-info .nav-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(90deg, rgba(0, 122, 255, 0.12) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#nav-info .nav-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 16px;
}

#nav-info .nav-main {
    flex: 1;
}

#nav-info .nav-distance {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

#nav-info .nav-target {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1px;
}

/* dat.GUI 调试面板样式覆盖，固定在右侧 */
.dg {
    position: fixed !important;
    right: 10px !important;
    top: 80px !important;
    z-index: 99999 !important;
}

#nav-info .nav-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 6px 8px;
    gap: 4px;
}

#nav-info .nav-detail-item {
    text-align: center;
    padding: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

#nav-info .nav-detail-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#nav-info .nav-detail-value {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    color: #4CD964;
}

/* 简化模式的导航信息 */
#nav-info.simple {
    padding: 10px 14px;
    text-align: center;
}

#nav-info.simple .nav-header,
#nav-info.simple .nav-details {
    display: none;
}

#nav-info.simple .nav-message {
    font-size: 13px;
    font-weight: 500;
}

/* ===== 调试信息面板 ===== */
#debug-info {
    position: fixed;
    top: max(env(safe-area-inset-top, 10px), 10px);
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #4CD964;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    z-index: 1000;
    max-width: 180px;
    line-height: 1.6;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(76, 217, 100, 0.2);
    display: none; /* 默认隐藏，可通过设置开启 */
}

#debug-info.visible {
    display: block;
}

/* ===== 加载状态 ===== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

#loading-overlay .loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-overlay .loading-text {
    margin-top: 24px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

#loading-overlay .loading-status {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== 错误提示 ===== */
#error-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 59, 48, 0.95);
    color: #fff;
    padding: 20px 30px;
    border-radius: 16px;
    font-size: 15px;
    text-align: center;
    z-index: 9998;
    max-width: 80%;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(255, 59, 48, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#error-toast.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== GPS信号弱提示 ===== */
#gps-weak-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.95), rgba(255, 120, 0, 0.95));
    border-radius: 16px;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.3);
    z-index: 9999;
    max-width: 85%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#gps-weak-toast.visible {
    opacity: 1;
    visibility: visible;
    animation: gpsWeakPulse 2s infinite;
}

@keyframes gpsWeakPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 32px rgba(255, 149, 0, 0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.02);
        box-shadow: 0 12px 40px rgba(255, 149, 0, 0.5);
    }
}

.gps-weak-icon {
    font-size: 40px;
    animation: iconPulse 1.5s infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.gps-weak-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gps-weak-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.gps-weak-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}



/* ===== 设置按钮和抽屉面板 ===== */
#settings-btn {
    position: fixed;
    right: 16px;
    bottom: max(env(safe-area-inset-bottom, 120px), 120px);
    width: 48px;
    height: 48px;
    background: var(--bg-gradient-dark);
    border: var(--border-glow);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    backdrop-filter: var(--blur-medium);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#settings-btn:active {
    transform: scale(0.9) rotate(45deg);
}

#settings-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--bg-panel);
    backdrop-filter: var(--blur-heavy);
    z-index: 10000;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: var(--border-glow);
}

#settings-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 24px 20px;
    border-bottom: var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.6;
}

.drawer-content {
    padding: 24px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item label {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-item input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color);
}

.setting-item span {
    font-family: monospace;
    font-size: 14px;
    color: var(--primary-color);
    min-width: 36px;
}

 .setting-item input[type="color"] {
    width: 100%;
    height: 40px;
    background: none;
    border: var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.setting-item select {
    width: 100%;
    height: 40px;
    background: var(--bg-glass);
    color: #fff;
    border: var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    outline: none;
}

.setting-item select option {
    background: #111826;
    color: #fff;
}


.save-btn {
    margin-top: auto;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s;
}

.save-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}


/* 小屏手机 (iPhone SE等) */
@media (max-width: 375px) {
    #coords-panel {
        padding: 10px 12px;
        font-size: 12px;
        max-width: 320px;
    }

    #coords-panel .coord-value {
        font-size: 12px;
    }

    #nav-info .nav-distance {
        font-size: 18px;
    }

    #nav-info .nav-details {
        grid-template-columns: repeat(3, 1fr);
    }

    #direction-panel .direction-arrow {
        width: 24px;
        height: 24px;
    }

    #direction-panel .arrow-icon {
        font-size: 16px;
    }

    #direction-panel .direction-text {
        font-size: 11px;
    }

}

/* 中等屏幕 */
@media (min-width: 376px) and (max-width: 428px) {
    #coords-panel {
        padding: 12px 14px;
        max-width: 360px;
    }
}

/* 大屏手机 (iPhone Pro Max等) */
@media (min-width: 429px) and (max-width: 768px) {
    #coords-panel {
        padding: 14px 18px;
        max-width: 400px;
    }

    #nav-info-wrapper {
        left: 16px;
        right: 16px;
    }
}

/* 平板设备 */
@media (min-width: 769px) {
    #coords-panel {
        max-width: 420px;
    }

    #nav-info-wrapper {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 380px;
    }

    #direction-panel .direction-arrow {
        width: 34px;
        height: 34px;
    }

    #direction-panel .arrow-icon {
        font-size: 20px;
    }

}

/* 横屏模式 */
@media (orientation: landscape) and (max-height: 500px) {
    #coords-panel {
        top: 8px;
        padding: 8px 12px;
        max-width: 50%;
    }

    #coords-panel .coords-content {
        grid-template-columns: repeat(4, 1fr);
    }

    #coords-panel .accuracy-info {
        display: none;
    }

    #nav-info-wrapper {
        bottom: 6px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: auto;
        max-width: 55%;
    }

    #nav-info .nav-header {
        padding: 8px 10px;
    }

    #nav-info .nav-details {
        display: none;
    }

    #direction-panel .direction-arrow {
        width: 22px;
        height: 22px;
    }

    #direction-panel .arrow-icon {
        font-size: 14px;
    }

}

/* ===== 暗色模式优化 ===== */
@media (prefers-color-scheme: dark) {
    #coords-panel,
    #nav-info {
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* ===== iOS安全区域适配 ===== */
@supports (padding: max(0px)) {
    #nav-info-wrapper {
        bottom: max(10px, env(safe-area-inset-bottom));
    }
}

/* ===== AR模式指示器 ===== */
#ar-mode-indicator {
    position: fixed;
    top: max(env(safe-area-inset-top, 10px), 10px);
    right: 10px;
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.9), rgba(0, 150, 60, 0.9));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(0, 200, 83, 0.3);
    animation: arIndicatorPulse 2s ease-in-out infinite;
}

#ar-mode-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: arDotBlink 1s ease-in-out infinite;
}

@keyframes arIndicatorPulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(0, 200, 83, 0.3); }
    50% { box-shadow: 0 2px 20px rgba(0, 200, 83, 0.6); }
}

@keyframes arDotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== 距离提示浮层 ===== */
#distance-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -120%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    z-index: 1003;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#distance-overlay.visible {
    opacity: 1;
}

#distance-overlay .distance-value {
    color: #00d4ff;
    font-size: 24px;
    margin-right: 8px;
}

/* ===== 导航完成提示 ===== */
#nav-complete-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.95), rgba(0, 150, 60, 0.95));
    color: white;
    padding: 32px 48px;
    border-radius: 20px;
    text-align: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(0, 200, 83, 0.4);
}

#nav-complete-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

#nav-complete-toast .complete-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

#nav-complete-toast .complete-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

#nav-complete-toast .complete-message {
    font-size: 14px;
    opacity: 0.9;
}

/* ===== 路径可视化增强 ===== */
.path-glow {
    filter: drop-shadow(0 0 10px rgba(0, 153, 255, 0.8));
}

/* ===== 触摸反馈优化 ===== */
.touch-feedback {
    transition: transform 0.1s ease, opacity 0.1s ease;
}

.touch-feedback:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* ===== 方向偏离指示器 ===== */
.orientation-guide {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1005;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.orientation-guide .orientation-arrow-svg {
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
    transition: filter 0.3s ease;
}

/* 正常状态 */
.orientation-guide.normal .orientation-arrow-svg {
    filter: drop-shadow(0 0 15px rgba(76, 217, 100, 0.5));
}

/* 偏离状态 */
.orientation-guide.deviation .orientation-arrow-svg {
    filter: drop-shadow(0 0 20px rgba(255, 149, 0, 0.6));
    animation: deviationPulse 1s ease-in-out infinite;
}

/* 严重偏离状态 */
.orientation-guide.severe .orientation-arrow-svg {
    filter: drop-shadow(0 0 25px rgba(255, 59, 48, 0.7));
    animation: severePulse 0.5s ease-in-out infinite;
}

@keyframes deviationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes severePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.orientation-angle {
    font-size: 24px;
    font-weight: 700;
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease;
}

.orientation-text {
    font-size: 16px;
    font-weight: 600;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease, background 0.3s ease;
}

/* 偏离时文字背景强调 */
.orientation-guide.deviation .orientation-text {
    background: rgba(255, 149, 0, 0.2);
    border-color: rgba(255, 149, 0, 0.3);
}

.orientation-guide.severe .orientation-text {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.3);
}

/* 响应式适配 */
@media (max-width: 375px) {
    .orientation-angle {
        font-size: 20px;
    }
    .orientation-text {
        font-size: 14px;
        padding: 5px 12px;
    }
}

/* 横屏模式 */
@media (orientation: landscape) and (max-height: 500px) {
    .orientation-guide {
        transform: translate(-50%, -50%) scale(0.8);
    }
}

