/* ==========================================================================
   移动端底部固定操作栏
   仅在移动端显示（max-width: 768px）
   ========================================================================== */

/* 底部操作栏容器 */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 9990;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 操作栏内部布局 */
.mobile-bottom-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 10px;
}

/* 操作按钮 */
.mobile-bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: #666;
    font-size: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    background: none;
    border: none;
    padding: 0;
}

.mobile-bottom-bar-item:active {
    transform: scale(0.95);
}

.mobile-bottom-bar-item.active {
    color: #0ABAB5;
}

/* 图标 */
.mobile-bottom-bar-item i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-bottom-bar-item:active i {
    transform: scale(1.1);
    color: #0ABAB5;
}

/* 文字标签 */
.mobile-bottom-bar-item span {
    font-weight: 500;
    white-space: nowrap;
}

/* 拨号按钮特殊样式 - 主色调突出 */
.mobile-bottom-bar-item.phone-btn {
    color: #0ABAB5;
}

.mobile-bottom-bar-item.phone-btn i {
    font-size: 22px;
    color: #0ABAB5;
}

/* 微信按钮 */
.mobile-bottom-bar-item.wechat-btn {
    color: #07C160;
}

.mobile-bottom-bar-item.wechat-btn i {
    color: #07C160;
}

/* 回到顶部按钮 */
.mobile-bottom-bar-item.top-btn {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-bottom-bar-item.top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

/* 微信二维码弹窗 */
.wechat-qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wechat-qr-modal.show {
    display: flex;
    opacity: 1;
}

.wechat-qr-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wechat-qr-modal.show .wechat-qr-content {
    transform: scale(1);
}

.wechat-qr-content h3 {
    margin: 0 0 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.wechat-qr-content img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #eee;
}

.wechat-qr-content p {
    margin: 16px 0 0;
    color: #666;
    font-size: 13px;
}

.wechat-qr-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wechat-qr-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 移动端显示 */
@media (max-width: 768px) {
    .mobile-bottom-bar {
        display: block;
    }
    
    /* 给页面底部留出空间，避免内容被遮挡 */
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
    
    /* 页脚也要留出空间 */
    footer,
    .footer,
    .site-footer {
        margin-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* 平板以上隐藏 */
@media (min-width: 769px) {
    .mobile-bottom-bar {
        display: none !important;
    }
    
    .wechat-qr-modal {
        display: none !important;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-bottom-bar {
        height: 50px;
    }
    
    .mobile-bottom-bar-inner {
        height: 50px;
    }
    
    .mobile-bottom-bar-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .mobile-bottom-bar-item span {
        font-size: 9px;
    }
}

/* 打印时隐藏 */
@media print {
    .mobile-bottom-bar,
    .wechat-qr-modal {
        display: none !important;
    }
}
