/* ===== Side Nav & Layout ===== */
.home-layout {
    display: flex;
    max-width: var(--max-width);
    margin: 0 auto;
}

.side-nav {
    display: none;
    flex-direction: column;
    width: 140px;
    flex-shrink: 0;
    padding: 12px 0;
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    border-right: 1px solid var(--border-color);
    background: var(--card-bg);
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.side-nav-item:hover {
    background: #f9f9f9;
    color: var(--primary);
}

.side-nav-item.active {
    color: var(--primary);
    background: rgba(248, 65, 66, 0.06);
    border-left-color: var(--primary);
    font-weight: 600;
}

.side-nav-footer {
    margin-top: auto;
    padding: 12px 16px;
    font-size: 0.7rem;
}

.side-nav-footer a {
    color: #999;
    text-decoration: none;
    word-break: break-all;
}

.side-nav-footer a:hover {
    color: #666;
}

.home-main {
    flex: 1;
    min-width: 0;
}

@media (min-width: 1025px) {
    .home-layout {
        padding: 0 20px;
    }
    .side-nav {
        display: flex;
        flex-direction: column;
    }
}

/* ===== Category Bar ===== */
.category-bar {
    position: sticky;
    top: var(--navbar-height);
    background: white;
    display: flex;
    align-items: center;
    height: 44px;
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
    box-sizing: border-box;
    width: 100%;
    padding: 0 12px;
}

.category-scroll {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    cursor: grab;
}
.category-scroll:active {
    cursor: grabbing;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: inline-block;
    padding: 8px 14px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.category-tab.active {
    color: var(--primary-dark);
    font-weight: 600;
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-dark);
    border-radius: 2px;
}

.category-manage-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #f84142;
    flex-shrink: 0;
}

/* ===== News List ===== */
.news-list {
    padding-top: 8px;
    padding-bottom: 60px;
}

/* 公共卡片样式 */
.news-card {
    background: white;
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}
.news-card:active {
    background: #fafafa;
}
.news-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-abstract {
    font-size: 0.8rem;
    color: #999;
    line-height: 1.5;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.7rem;
    color: #999;
}
.news-card-author {
    color: #f84142;
}

/* style-0: 无图纯文字 */
.news-card.style-0 .news-card-title {
    font-size: 1rem;
}

/* style-1: 左图右文 */
.news-card.style-1 {
    display: flex;
    gap: 10px;
}
.news-card.style-1 .news-card-img-large {
    width: 50%;
    height: 120px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    background: #f5f5f5;
}
.news-card.style-1 .news-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* style-2: 左文右双图（头条经典样式） */
.news-card.style-2 {
    display: flex;
    gap: 10px;
}
.news-card.style-2 .news-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}
.news-card.style-2 .news-card-imgs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    align-self: center;
}
.news-card.style-2 .news-card-imgs img {
    width: 116px;
    height: 60px;
    object-fit: cover;
    border-radius: 2px;
    background: #f5f5f5;
}

/* style-3: 三图横排 */
.news-card.style-3 .news-card-images {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}
.news-card.style-3 .news-card-images img {
    flex: 1;
    height: 80px;
    object-fit: cover;
    border-radius: 2px;
    background: #f5f5f5;
}

@media (min-width: 769px) {
    .news-list {
        padding-bottom: 20px;
    }
    .news-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .news-card.style-1 .news-card-img-large {
        height: 140px;
    }
    .news-card.style-2 .news-card-imgs img {
        width: 140px;
        height: 72px;
    }
    .news-card.style-3 .news-card-images img {
        height: 100px;
    }
}
