/* ===== 基础变量 ===== */
:root {
    --header-height-mobile: 80px;
    --nav-height-mobile: 60px;
    --primary-color: #0088ff;
    --secondary-color: #00bfff;
    --dark-color: #0a192f;
    --light-color: #f8f9fa;
    --text-color: #4a5568;
    --text-dark: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
}

/* ===== 基础重置 ===== */
.news-page {
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #ffffff;
    padding-top: 0;
}

/* ===== 新闻英雄区域 ===== */
.news-hero {
    background: url('/images/news/bg.jpg') center/cover no-repeat;
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    color: white;
    /* 确保与固定导航栏完美衔接 */
    margin-top: calc(var(--header-height-desktop) + var(--nav-height-desktop));
    margin-bottom: 60px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    will-change: transform, opacity;
}

.hero-subtitle {
    color: black;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    will-change: transform, opacity;
}

.hero-search .input-group {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search .form-control {
    padding: 1rem;
    border: none;
    border-radius: 50px 0 0 50px;
}

.hero-search .btn {
    border-radius: 0 50px 50px 0;
    padding: 0 1.5rem;
}

/* ===== 面包屑导航 ===== */
.news-breadcrumb {
    margin-bottom: 2rem;
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-light);
}

/* ===== 文章列表 ===== */
.news-container {
    padding: 2rem 0;
    position: relative;
}

.article-list {
    display: grid;
    gap: 1.5rem;
}

.article-item {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.article-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(0, 136, 255, 0.1);
}

.tech-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.tech-points.premium {
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: #ffd700;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border-left: 2px solid #ffd700;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.keyword-tag {
    background: #f3f3f3;
    color: #555;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.7rem;
    border: 1px solid #e0e0e0;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.article-author {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #e1f0ff;
    min-height: 64px;
}

.author-avatar {
    width: 42px;
    height: 42px;
    margin-right: 12px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #e1f0ff;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-details {
    flex: 1;
    min-width: 0;
}

.author-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2px;
}

.author-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-position {
    background-color: #ebf5ff;
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.author-bio {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-top: 0.3rem;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.85rem;
}

.article-footer.compact {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 1.25rem 1.25rem;
}

.article-date, .article-views {
    display: flex;
    align-items: center;
    color: var(--text-light);
}

.article-date i, .article-views i {
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.read-more:hover {
    color: var(--secondary-color);
}

.read-more:hover i {
    transform: translateX(3px);
}

/* ===== 侧边栏 ===== */
.news-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.sidebar-widget {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.widget-title i {
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 0.75rem;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.categories-list a:hover {
    color: var(--primary-color);
}

.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-item {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.popular-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-rank {
    flex: 0 0 30px;
    height: 30px;
    background-color: var(--light-color);
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 1rem;
}

.popular-content {
    flex: 1;
}

.popular-title {
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    margin-bottom: 0.25rem;
}

.popular-title:hover {
    color: var(--primary-color);
}

.popular-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.popular-meta i {
    margin-right: 0.25rem;
}

/* ===== 订阅区域 ===== */
.news-subscribe {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 3rem 0;
    color: white;
}

.subscribe-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.subscribe-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.subscribe-text h3 i {
    margin-right: 0.75rem;
}

.subscribe-form {
    flex: 0 0 450px;
    max-width: 100%;
}

.subscribe-form .form-control {
    height: 50px;
    border: none;
    border-radius: 50px 0 0 50px !important;
}

.subscribe-form .btn {
    height: 50px;
    padding: 0 2rem;
    border-radius: 0 50px 50px 0 !important;
    font-weight: 500;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    padding-left: 0;
    list-style: none;
    margin: 20px 0;
}

.pagination li {
    margin: 0 5px;
}

.pagination li a {
    padding: 0.5rem 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.pagination li a:hover {
    color: var(--secondary-color);
    background-color: var(--light-color);
}

.pagination li.active a {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1199.98px) {
    .news-hero {
        height: 350px;
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 991.98px) {
    .news-sidebar {
        top: 100px;
    }
    .news-hero {
        height: 300px;
        margin-bottom: 40px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .subscribe-text {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .news-sidebar {
        position: static;
    }
    .news-hero {
        height: 250px;
        margin-top: 80px;
        padding-top: 20px;
    }
    .hero-title {
        font-size: 1.75rem;
    }
    .news-breadcrumb {
        display: none;
    }
    .article-item {
        padding: 1rem;
    }
    .article-footer.compact {
        position: static;
        padding: 0;
    }
}

@media (max-width: 575.98px) {
    .news-hero {
        height: 200px;
        margin-bottom: 30px;
    }
    .hero-title {
        font-size: 1.5rem;
    }
    .hero-subtitle {
        font-size: 0.75rem;
    }
    .hero-search .form-control {
        padding: 0.75rem 1rem;
    }
    .news-subscribe {
        padding: 2rem 0;
    }
    .subscribe-form .form-control {
        height: 45px;
    }
    .subscribe-form .btn {
        height: 45px;
    }
}