/* ===== 统一底部导航栏样式 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 20, 34, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    max-width: 480px;
    margin: 0 auto;
    z-index: 100;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bottom-nav::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.05) 0%, transparent 70%);
    opacity: 0.5;
    transition: opacity 0.3s ease;
    pointer-events: none;
    animation: rotate 30s linear infinite;
}

.bottom-nav:hover::before {
    opacity: 1;
    animation: rotate 20s linear infinite;
}

/* ===== 真實模式 - 導航欄 ===== */
.bottom-nav:not(.test-mode) {
    border-top: 2px solid rgba(255, 107, 0, 0.4);
    box-shadow: 0 -5px 25px rgba(255, 107, 0, 0.2);
}

.bottom-nav:not(.test-mode)::before {
    background: radial-gradient(circle, rgba(255, 107, 0, 0.05) 0%, transparent 70%);
}

/* ===== 測試模式 - 導航欄 ===== */
.test-mode .bottom-nav {
    border-top: 2px solid rgba(37, 99, 235, 0.4);
    box-shadow: 0 -5px 25px rgba(37, 99, 235, 0.2);
}

.test-mode .bottom-nav::before {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
}

.nav-item {
    position: relative;
    color: var(--text-tertiary, #94A3B8);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    flex: 1;
    transition: all 0.2s ease;
    padding: 8px 0;
}

.nav-item i {
    font-size: 22px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item i::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.15);
    filter: blur(2px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.nav-item:hover i::after {
    width: 40px;
    height: 40px;
}

/* ===== 真實模式 - 激活狀態 ===== */
.nav-item.active:not(.test-mode) {
    color: #FF6B00;
    transform: translateY(-3px);
}

.nav-item.active:not(.test-mode) i {
    transform: translateY(-3px) scale(1.15);
    text-shadow: 0 0 20px rgba(255, 107, 0, 0.6);
    filter: drop-shadow(0 0 8px #FF6B00) drop-shadow(0 0 15px rgba(255, 107, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

.nav-item.active:not(.test-mode) i::after {
    width: 50px;
    height: 50px;
    background: rgba(255, 107, 0, 0.15);
    animation: pulse-glow 2s infinite;
}

.nav-item.active:not(.test-mode) span {
    text-shadow: 0 0 10px rgba(255, 107, 0, 0.4);
}

.nav-item.active:not(.test-mode)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FF6B00;
    box-shadow: 0 0 20px #FF6B00;
    animation: pulse-dot 2s infinite;
}

/* ===== 測試模式 - 激活狀態 ===== */
.test-mode .nav-item.active {
    color: #2563EB;
    transform: translateY(-3px);
}

.test-mode .nav-item.active i {
    transform: translateY(-3px) scale(1.15);
    text-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    filter: drop-shadow(0 0 8px #2563EB);
    animation: float 3s ease-in-out infinite;
}

.test-mode .nav-item.active i::after {
    width: 50px;
    height: 50px;
    background: rgba(37, 99, 235, 0.15);
    animation: pulse-glow 2s infinite;
}

.test-mode .nav-item.active span {
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.test-mode .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563EB;
    box-shadow: 0 0 20px #2563EB;
    animation: pulse-dot 2s infinite;
}

/* ===== 真實模式 - 懸停效果 ===== */
.nav-item:hover:not(.test-mode) {
    color: #FF8A3C;
}

.nav-item:hover:not(.test-mode) i {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.4));
}

.nav-item:hover:not(.test-mode) i::after {
    width: 45px;
    height: 45px;
    background: rgba(255, 107, 0, 0.1);
}

/* ===== 測試模式 - 懸停效果 ===== */
.test-mode .nav-item:hover {
    color: #3B82F6;
}

.test-mode .nav-item:hover i {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.4));
}

.test-mode .nav-item:hover i::after {
    width: 45px;
    height: 45px;
    background: rgba(37, 99, 235, 0.1);
}

/* ===== 動畫定義 ===== */
@keyframes pulse-dot {
    0%, 100% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1);
        filter: blur(0px);
    }
    50% { 
        opacity: 0.8; 
        transform: translateX(-50%) scale(1.6);
        filter: blur(2px);
    }
}

@keyframes pulse-glow {
    0%, 100% { 
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(-3px) scale(1.15);
        filter: drop-shadow(0 0 8px var(--primary));
    }
    50% { 
        transform: translateY(-7px) scale(1.2);
        filter: drop-shadow(0 0 15px var(--primary));
    }
}

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

/* ===== 真實模式特有動畫 ===== */
.nav-item.active:not(.test-mode) {
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0%, 100% { 
        text-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
    }
    50% { 
        text-shadow: 0 0 20px rgba(255, 107, 0, 0.8);
    }
}

/* ===== 測試模式特有動畫 ===== */
.test-mode .nav-item.active {
    animation: glow-pulse-blue 2s infinite;
}

@keyframes glow-pulse-blue {
    0%, 100% { 
        text-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    }
    50% { 
        text-shadow: 0 0 20px rgba(37, 99, 235, 0.8);
    }
}

/* ===== 響應式調整 ===== */
@media (max-width: 480px) {
    .bottom-nav {
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    }
    
    .nav-item i {
        font-size: 20px;
    }
    
    .nav-item span {
        font-size: 11px;
    }
    
    .nav-item.active i::after {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 360px) {
    .nav-item i {
        font-size: 18px;
    }
    
    .nav-item span {
        font-size: 10px;
    }
}

/* ===== 安全區域適配 ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* ===== 保持原有測試模式樣式向後兼容 ===== */
.test-mode .nav-item.active {
    color: var(--primary);
}

.test-mode .nav-item.active::after {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.test-mode .nav-item.active i {
    text-shadow: 0 0 15px rgba(37, 99, 235, 0.5);
}