/* 公共样式 - 顶部标题栏和底部导航栏 */

/* ========== 顶部标题栏 ========== */
.common-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #000;
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 15px;
    max-width: 500px;
    margin: 0 auto;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.back-btn:hover {
    opacity: 0.8;
}

.back-btn:active {
    opacity: 0.6;
}

.back-btn svg {
    display: block;
}

.header-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-placeholder {
    width: 36px; /* 与返回按钮宽度一致，保持标题居中 */
}

/* ========== 底部导航栏 ========== */
.common-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 64px;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
    -webkit-tap-highlight-color: transparent;
    padding: 4px 0;
}

.nav-item:active {
    background-color: rgba(0,0,0,0.05);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    color: inherit;
}

.nav-icon svg {
    display: block;
    width: 28px;
    height: 28px;
}

.nav-text {
    font-size: 13px;
    color: inherit;
    margin-top: 3px;
    font-weight: 500;
}

.nav-item.active {
    color: #000;
}

.nav-item.active .nav-icon {
    color: #000;
}

/* ========== 页面内容区域需要添加底部和顶部间距 ========== */
body {
    padding-top: 54px !important; /* 顶部标题栏高度 + 额外间距 */
    padding-bottom: 64px !important; /* 底部导航栏高度 */
}

/* 移动端优化 */
@media (max-width: 480px) {
    .header-content {
        height: 44px;
        padding: 0 12px;
    }
    
    .header-title {
        font-size: 15px;
    }
    
    .footer-nav {
        height: 64px;
    }
    
    .nav-text {
        font-size: 12px;
    }
    
    .nav-icon svg {
        width: 28px;
        height: 28px;
    }
}
