/* ============================================================
   mobile-nav.css - 移动端专属底部导航栏
   仅在 max-width:768px 生效，PC端完全不影响
   ============================================================ */

/* 移动端底部导航栏 - 6图标导航 */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: calc(65px + env(safe-area-inset-bottom));
    min-height: 65px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-around;
}

[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(20, 20, 20, 0.98);
    border-top-color: rgba(255, 255, 255, 0.06);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 65px;
    min-width: 44px;
    padding: 4px 0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mobile-nav-item span {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.25s ease;
    margin-bottom: 3px;
}

.mobile-nav-item label {
    font-size: 0.48rem;
    color: rgba(0, 0, 0, 0.55);
    letter-spacing: 0.3px;
    font-family: 'Noto Serif SC', serif;
    white-space: nowrap;
}

[data-theme="dark"] .mobile-nav-item label {
    color: rgba(255, 255, 255, 0.55);
}

.mobile-nav-item.active label {
    color: #C9A96E;
}

.mobile-nav-item.active span {
    transform: scale(1.1);
}

.mobile-nav-item:hover {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

[data-theme="dark"] .mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 移动端侧边抽屉菜单 */
.mobile-drawer-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-drawer-mask.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #FAFAF8;
    z-index: 1001;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .mobile-drawer {
    background: #1A1A1A;
}

.mobile-drawer.active {
    left: 0;
}

.mobile-drawer-header {
    padding: 24px 20px;
    padding-top: calc(24px + env(safe-area-inset-top));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

[data-theme="dark"] .mobile-drawer-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.mobile-drawer-title {
    font-size: 1.25rem;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #1C1C1C;
}

[data-theme="dark"] .mobile-drawer-title {
    color: #F5F5F5;
}

.mobile-drawer-subtitle {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.45);
    letter-spacing: 2px;
    margin-top: 4px;
}

[data-theme="dark"] .mobile-drawer-subtitle {
    color: rgba(255, 255, 255, 0.45);
}

.mobile-drawer-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.mobile-drawer-item {
    display: block;
    padding: 14px 24px;
    color: rgba(0, 0, 0, 0.75);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    font-family: 'Noto Serif SC', serif;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .mobile-drawer-item {
    color: rgba(255, 255, 255, 0.75);
}

.mobile-drawer-item:hover {
    background: rgba(0, 0, 0, 0.03);
    padding-left: 28px;
}

[data-theme="dark"] .mobile-drawer-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.mobile-drawer-item.active {
    color: #C9A96E;
    border-left-color: #C9A96E;
    background: rgba(201, 169, 110, 0.05);
}

[data-theme="dark"] .mobile-drawer-item.active {
    background: rgba(201, 169, 110, 0.1);
}

.mobile-drawer-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.04);
    margin: 8px 0;
}

[data-theme="dark"] .mobile-drawer-divider {
    background: rgba(255, 255, 255, 0.06);
}

.mobile-drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.mobile-drawer-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-drawer-close span {
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .mobile-drawer-close span {
    color: rgba(255, 255, 255, 0.5);
}

/* 移动端二级Tab栏 */
.mobile-tab-bar {
    position: sticky;
    top: calc(60px + env(safe-area-inset-top));
    z-index: 100;
    display: flex;
    background: #FAFAF8;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .mobile-tab-bar {
    background: #1A1A1A;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.mobile-tab-item {
    flex: 1;
    padding: 16px 8px;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: relative;
    font-family: 'Noto Serif SC', serif;
    letter-spacing: 2px;
    transition: color 0.2s ease;
    min-width: 70px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .mobile-tab-item {
    color: rgba(255, 255, 255, 0.5);
}

.mobile-tab-item.active {
    color: #C9A96E;
}

.mobile-tab-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 36px;
    height: 2px;
    background: #C9A96E;
    transform: translateX(-50%);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s ease;
    border-radius: 1px;
}

/* 移动端页面内容底部留白 */
.mobile-page-content {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

/* 响应式媒体查询 */
@media screen and (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .mobile-drawer-mask,
    .mobile-drawer {
        display: none !important;
    }
    
    .mobile-tab-bar {
        display: none !important;
    }
    
    .mobile-page-content {
        padding-bottom: 0;
    }
}

@media screen and (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* 移动端隐藏PC端导航菜单 */
    .nav-menu {
        display: none !important;
    }
    
    /* 移动端显示抽屉菜单按钮 */
    .hamburger {
        display: flex;
    }

    /* 确保页面内容不被底部导航遮挡 */
    body[data-nav-mounted="1"] {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

@media screen and (max-width: 480px) {
    .mobile-nav-item {
        min-width: 60px;
    }
    
    .mobile-nav-item span {
        font-size: 1.15rem;
    }
    
    .mobile-nav-item label {
        font-size: 0.54rem;
        letter-spacing: 0;
    }

    .mobile-tab-item {
        font-size: 0.72rem;
        letter-spacing: 1px;
        padding: 14px 4px;
    }

    .mobile-drawer {
        width: 260px;
        left: -260px;
    }

    .mobile-drawer-item {
        padding: 12px 20px;
        font-size: 0.8rem;
    }
}

/* 移动端二级Tab内容区域 */
.mobile-tab-content {
    display: none;
    min-height: 400px;
}

.mobile-tab-content.active {
    display: block;
}

/* 移动端iframe容器 */
.mobile-iframe-container {
    width: 100%;
    min-height: 400px;
    border: none;
    background: transparent;
}

/* iOS安全区适配 */
@supports (padding-top: env(safe-area-inset-top)) {
    .mobile-drawer-header {
        padding-top: calc(24px + env(safe-area-inset-top));
    }
    
    .mobile-tab-bar {
        top: calc(60px + env(safe-area-inset-top));
    }
}

/* iframe环境下隐藏底部导航和抽屉 */
body.is-in-iframe .mobile-bottom-nav,
body.is-in-iframe .mobile-drawer-mask,
body.is-in-iframe .mobile-drawer {
    display: none !important;
}

body.is-in-iframe {
    padding-bottom: 0 !important;
}