/* 美团式栏目页样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-dark: #2c3e50;
    --text-light: #999;
    --border-color: #e5e5e5;
    --bg-light: #f8f9fa;
    --sidebar-width: 100px;
    --header-height: 56px;
    --bottom-nav-height: 56px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: #fff;
    overflow-x: hidden;
    max-width: 100vw;
}

/* 顶部导航栏 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-content {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.back-btn,
.search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:active,
.search-btn:active {
    background: var(--bg-light);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

/* 搜索面板 */
.search-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.search-panel.show {
    max-height: 60px;
}

.search-box {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 10px;
}

.search-box i {
    color: var(--text-light);
    font-size: 16px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-dark);
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    padding: 5px;
}

/* 主容器 */
.main-container {
    display: flex;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
}

/* 左侧菜单栏 */
.sidebar-menu {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: var(--bottom-nav-height);
    width: var(--sidebar-width);
    background: var(--bg-light);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 100;
}

.menu-list {
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.menu-item:active {
    background: rgba(102, 126, 234, 0.05);
}

.menu-item.active {
    background: white;
    border-left-color: var(--primary-color);
}

.menu-item.active .menu-icon {
    color: var(--primary-color);
}

.menu-item.active .menu-text {
    color: var(--primary-color);
    font-weight: 600;
}

.menu-icon {
    font-size: 24px;
    margin-bottom: 5px;
    color: #666;
    transition: all 0.3s ease;
}

.menu-text {
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
    color: #666;
    transition: all 0.3s ease;
}

.menu-count {
    display: none;
}

/* 菜单分区标题 */
.menu-section {
    padding: 15px 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.menu-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 10px;
}

.menu-section-title i {
    color: #ff6b6b;
}

/* 热门文章列表 */
.hot-articles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hot-article-item {
    padding: 8px;
    border-radius: 6px;
    background: white;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hot-article-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.hot-article-title {
    font-size: 11px;
    line-height: 1.3;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.hot-article-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 10px;
    color: var(--text-light);
}

.hot-article-views {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 右侧文章列表容器 */
.article-list-container {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: white;
}

/* 分类标题 */
.category-header {
    position: sticky;
    top: var(--header-height);
    background: white;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.category-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.sort-options {
    display: flex;
    gap: 10px;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.sort-btn:active {
    transform: scale(0.95);
}

.sort-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 文章列表 */
.article-list {
    padding: 0;
}

.article-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 12px;
}

.article-item:active {
    background: var(--bg-light);
}

.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.article-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.article-summary {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: var(--text-light);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-meta i {
    font-size: 11px;
}

.article-thumbnail {
    width: 100px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 无缩略图时的文章 */
.article-item.no-thumbnail {
    flex-direction: column;
}

/* 加载更多 */
.load-more {
    padding: 20px;
    text-align: center;
}

.load-more-btn {
    padding: 10px 30px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.load-more-btn:active {
    transform: scale(0.95);
}

.load-more-btn i {
    animation: none;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* 固定联系栏 */
.fixed-contact-bar {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 10px 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 99;
}

.fixed-contact-bar.show {
    transform: translateY(0);
}

.contact-actions {
    display: flex;
    gap: 10px;
}

.contact-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.contact-btn:active {
    transform: scale(0.95);
}

.contact-btn i {
    font-size: 18px;
}

.contact-btn.wechat {
    background: linear-gradient(135deg, #38ef7d, #11998e);
}

.contact-btn.consult {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 1000;
}

.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #999;
    text-decoration: none;
    font-size: 11px;
    transition: all 0.3s ease;
}

.bottom-nav .nav-item:active {
    background: var(--bg-light);
}

.bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.bottom-nav .nav-item i {
    font-size: 20px;
}

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-light);
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
}

/* 响应式优化 */
@media (min-width: 768px) {
    :root {
        --sidebar-width: 150px;
    }
    
    .menu-icon {
        font-size: 28px;
    }
    
    .menu-text {
        font-size: 14px;
    }
}

/* 滚动条样式 */
.sidebar-menu::-webkit-scrollbar {
    width: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}
