/* 公用样式 - Header */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #8e8e93;
    --accent-red: #ff3b30;
    --accent-blue: #007aff;
    --accent-yellow: #fbc02d;
    --pc-header-bg: #ffffff;
    --mobile-header-bg: #1a1a1a;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    width: 100%;
}

* {
    box-sizing: border-box;
}

.header { 
    background: #1a1a1a;
    display: flex; 
    flex-direction: column; 
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner { 
    width: 100%; 
    height: 44px; /* 减小高度 */
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 8px; /* 减小内边距 */
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 4px; /* 减小间距 */
    flex: 1;
    min-width: 0; 
    overflow: hidden;
}

/* 返回按钮样式 */
.back-btn {
    color: #fff !important;
    font-size: 1.2rem !important;
    display: flex !important; 
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    flex-shrink: 0 !important;
    height: 32px;
    transition: background 0.2s;
    border-radius: 50%;
    z-index: 10;
}

.back-btn:active {
    background: rgba(255,255,255,0.1);
}

.back-btn i {
    display: inline-block !important;
    line-height: 1 !important;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    gap: 4px; /* 减小间距 */
}

.header-logo { 
    height: 24px; /* 缩小 Logo */
    width: auto; 
    object-fit: contain; 
    border-radius: 4px;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
    color: #fff;
}

.logo-text {
    font-size:  0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-subtext {
    color: #fff!important;
    font-size: 0.6rem;
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 0;
    align-items: center;
    margin-left: 4px;
}

.nav-links a {
    color: #fff; /* 菜单文字改为白色 */
    text-decoration: none;
    font-size: 0.85rem; /* 减小字号 */
    font-weight: 600;
    padding: 2px 6px; /* 进一步压缩上下内边距确保居中 */
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px; /* 减小间距 */
    flex-shrink: 0;
}

.btn-icon {
    background: transparent; /* 移除背景 */
    border: none;
    color: #fff;
    font-size: 1.1rem; /* 稍微恢复一点尺寸 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: rgba(255,255,255,0.8);
}

.btn-bookmark {
    background: var(--accent-yellow);
    color: #000;
    border: none;
    border-radius: 14px;
    padding: 2px 8px; /* 紧凑内边距 */
    font-size: 0.7rem; /* 减小字号 */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-bookmark i {
    font-size: 0.9rem;
}

.btn-bookmark:active { transform: scale(0.95); }
.btn-bookmark:hover { 
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(251, 192, 45, 0.4);
}

/* 搜索栏样式 */
.search-bar-wrapper {
    width: 100%;
    background: #fff;
    padding: 10px 15px;
    display: none; 
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-bar-wrapper.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.search-bar-inner {
    background: #f5f5f7;
    border-radius: 10px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    height: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.search-input-icon {
    color: #999;
    margin-right: 8px;
    font-size: 1rem;
}

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #1d1d1f;
    padding: 0;
}

#clearSearch {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    display: none;
    font-size: 1.1rem;
}

#clearSearch.show { display: block; }

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 1024px) {
    .header { 
        min-height: 56px; 
    }
    .header-inner { 
        height: 56px; 
        max-width: 1200px; 
        margin: 0 auto; 
        padding: 0 20px; 
    }
    
    .header-left { 
        gap: 16px; 
        flex: none;
    }
    
    .header-logo { height: 30px; }
    .logo-text { font-size: 0.8rem; }
    
    .nav-links { gap: 4px; margin-left: 8px; }
    .nav-links a { font-size: 0.95rem; padding: 6px 12px; }
    
    .btn-icon { 
        font-size: 1.1rem;
        width: 32px;
        height: 32px;
    }
    
    .btn-bookmark {
        font-size: 0.8rem;
        padding: 4px 12px;
        border-radius: 18px;
    }
    
    .search-bar-inner {
        height: 44px;
        padding: 0 15px;
    }
}

/* 收藏指引弹窗公共样式 */
.bookmark-instruction {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.bookmark-instruction-content {
    background: #fff;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    color: #333;
}

.bookmark-instruction-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.bookmark-instruction-text {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.bookmark-instruction-close {
    width: 100%;
    padding: 12px;
    background: var(--accent-yellow);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.bookmark-instruction-close:active { opacity: 0.8; }

/* 全局提示消息样式 */
.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10001;
    font-size: 14px;
}

.toast-message.error { background: #f44336; }

@media (max-width: 1023px) {
    .mobile-nav {
        display: flex;
    }
}
