/* 新闻页面样式 - 专业配色方案 */

/* 专业配色方案 */
:root {
    --primary-color: #0A3D62;      /* 主色调：深蓝色 */
    --secondary-color: #3C6382;    /* 次要色：中蓝色 */
    --accent-color: #60A3BC;       /* 强调色：亮蓝色 */
    --background-color: #F5F7FA;   /* 背景色：浅灰色 */
    --text-color: #333333;         /* 文本色：深灰色 */
    --text-secondary: #777777;     /* 辅助文本色：中灰色 */
    --border-color: #E0E0E0;       /* 边框色：浅灰色 */
    --card-bg: #FFFFFF;            /* 卡片背景色：白色 */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    --transition: all 0.3s ease;   /* 过渡效果 */
}

/* 容器样式 */
.news-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 新闻页面头部样式 */
.news-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 80px 0;
    text-align: center;
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.news-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="rgba(255,255,255,0.05)"/><path d="M0 0 L100 100 M100 0 L0 100" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
    opacity: 0.5;
}

.news-header .news-container {
    position: relative;
    z-index: 1;
    padding-top: 50px;
}

.news-header h1 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.news-header p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 新闻搜索样式 */
.news-nav-bar {
    margin-bottom: 30px;
}

.news-search {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.search-input {
    padding: 12px 45px 12px 18px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    width: 280px;
    transition: var(--transition);
    background-color: var(--background-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.1);
    width: 320px;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--primary-color);
    background-color: rgba(10, 61, 98, 0.05);
}

/* 新闻内容样式 */
.news-content {
    padding: 60px 0;
    background-color: var(--background-color);
}

.news-tab {
    display: block;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.news-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.news-card-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card:hover .news-card-img img {
    transform: scale(1.1);
}

.news-card-date {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(10, 61, 98, 0.9);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-card-date i {
    font-size: 12px;
}

.news-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.news-card-tag {
    display: inline-block;
    background-color: rgba(10, 61, 98, 0.1);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    align-self: flex-start;
}

/* 技术文章标签样式 */
.news-card-tag.tech-tag {
    background-color: rgba(96, 163, 188, 0.15);
    color: var(--accent-color);
}

.news-card-views {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.news-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
    flex: 1;
}

.news-card-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.news-card-title a:hover {
    color: var(--primary-color);
}

.news-card-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

.news-card-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-size: 14px;
}

.news-card-link i {
    margin-left: 8px;
    font-size: 12px;
    transition: var(--transition);
}

.news-card-link:hover {
    color: var(--accent-color);
}

.news-card-link:hover i {
    transform: translateX(5px);
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.news-card-share {
    display: flex;
    align-items: center;
}

.share-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.share-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(10, 61, 98, 0.15);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 50px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px;
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(10, 61, 98, 0.15);
}

.page-link.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 12px rgba(10, 61, 98, 0.3);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-link.disabled:hover {
    border-color: var(--border-color);
    color: var(--text-color);
    box-shadow: none;
}

/* 订阅部分样式 */
.news-subscribe {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.news-subscribe::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="rgba(255,255,255,0.05)"/><path d="M0 0 L100 100 M100 0 L0 100" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
    opacity: 0.5;
}

.subscribe-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subscribe-info {
    margin-bottom: 40px;
    text-align: center;
}

.subscribe-info h2 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.subscribe-info p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.subscribe-form {
    display: flex;
    gap: 20px;
    max-width: 700px;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.subscribe-form input {
    flex: 1;
    min-width: 350px;
    padding: 18px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.subscribe-form input::placeholder {
    color: var(--text-secondary);
}

.subscribe-form button {
    padding: 18px 40px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.subscribe-form button:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(96, 163, 188, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .news-header h1 {
        font-size: 36px;
    }
    
    .news-header p {
        font-size: 18px;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 24px;
    }
    
    .subscribe-info h2 {
        font-size: 32px;
    }
}

@media (max-width: 992px) {
    .news-search {
        justify-content: center;
    }
    
    .search-input {
        width: 100%;
        max-width: 400px;
    }
    
    .search-input:focus {
        width: 100%;
        max-width: 450px;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .news-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .subscribe-form {
        flex-direction: column;
        align-items: center;
    }
    
    .subscribe-form input {
        width: 100%;
        min-width: 400px;
    }
    
    .subscribe-form button {
        width: 100%;
        min-width: 400px;
    }
}

@media (max-width: 768px) {
    .news-header {
        padding: 60px 0;
    }
    
    .news-header h1 {
        font-size: 32px;
    }
    
    .news-header p {
        font-size: 16px;
    }
    
    .news-content {
        padding: 40px 0;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-card-img {
        height: 200px;
    }
    
    .news-card-content {
        padding: 24px;
    }
    
    .news-card-title {
        font-size: 18px;
    }
    
    .news-subscribe {
        padding: 80px 0;
    }
    
    .subscribe-info h2 {
        font-size: 28px;
    }
    
    .subscribe-info p {
        font-size: 16px;
    }
    
    .subscribe-form input,
    .subscribe-form button {
        min-width: 300px;
    }
}

@media (max-width: 576px) {
    .news-header {
        padding: 40px 0;
        text-align: left;
    }
    .news-header h1 {
        font-size: 28px;
        text-align: left;
    }
    
    .news-header p {
        text-align: left;
        font-size: 16px;
    }

    .news-content {
        padding: 30px 0;
    }
    
    .news-card-img {
        height: 180px;
    }
    
    .news-card-content {
        padding: 20px;
    }
    
    .news-subscribe {
        padding: 60px 0;
    }
    
    .subscribe-info h2 {
        font-size: 24px;
    }
    
    .subscribe-form input,
    .subscribe-form button {
        min-width: 280px;
    }
    
    .pagination {
        gap: 8px;
    }
    
    .page-link {
        width: 40px;
        height: 40px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.6s ease forwards;
}

.news-card:nth-child(1) {
    animation-delay: 0.1s;
}

.news-card:nth-child(2) {
    animation-delay: 0.2s;
}

.news-card:nth-child(3) {
    animation-delay: 0.3s;
}

.news-card:nth-child(4) {
    animation-delay: 0.4s;
}

.news-card:nth-child(5) {
    animation-delay: 0.5s;
}

.news-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 选择文本样式 */
::selection {
    background-color: var(--accent-color);
    color: #FFFFFF;
}

::-moz-selection {
    background-color: var(--accent-color);
    color: #FFFFFF;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(10, 61, 98, 0.3);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(10, 61, 98, 0.4);
}

.back-to-top i {
    font-size: 20px;
}

/* 加载动画样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}