/* 金蝶新闻页面样式 - 基于现代企业设计 */

/* 全局样式重置和基础设置 */
.news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面头部样式 */
.news-page-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.news-page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.news-page-header .subtitle {
    font-size: 1.1rem;
    margin-top: 10px;
    opacity: 0.9;
}

/* 新闻列表容器 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* 新闻卡片样式 */
.news-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.news-card-image {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 25px;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.news-card-date {
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.news-card-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    text-decoration: none;
}

.news-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 15px;
    color: #333;
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-card-title a:hover {
    color: #1976d2;
}

.news-card-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.read-more-btn {
    background: #1976d2;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: #1565c0;
    transform: translateX(3px);
}

/* 分页样式 */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
}

.news-pagination a,
.news-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.news-pagination a {
    background: white;
    color: #666;
    border: 1px solid #e0e0e0;
}

.news-pagination a:hover {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.news-pagination .current {
    background: #1976d2;
    color: white;
    border: 1px solid #1976d2;
}

/* 单篇文章页面样式 */
.single-news-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.single-news-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.single-news-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
    margin-bottom: 20px;
}

.single-news-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.95rem;
}

.single-news-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.single-news-featured-image {
    margin-bottom: 40px;
    text-align: center;
}

.single-news-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.single-news-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.single-news-content h2,
.single-news-content h3,
.single-news-content h4 {
    color: #333;
    margin-top: 30px;
    margin-bottom: 15px;
}

.single-news-content h2 {
    font-size: 1.6rem;
    border-left: 4px solid #1976d2;
    padding-left: 15px;
}

.single-news-content h3 {
    font-size: 1.4rem;
}

.single-news-content p {
    margin-bottom: 20px;
}

.single-news-content blockquote {
    background: #f8f9fa;
    border-left: 4px solid #1976d2;
    padding: 20px;
    margin: 30px 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.single-news-tags {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.single-news-tags .tag-links a {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 6px 15px;
    border-radius: 20px;
    text-decoration: none;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.single-news-tags .tag-links a:hover {
    background: #1976d2;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-page-header {
        padding: 40px 0;
    }
    
    .news-page-header h1 {
        font-size: 2rem;
    }
    
    .news-card-content {
        padding: 20px;
    }
    
    .single-news-title {
        font-size: 1.8rem;
    }
    
    .single-news-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .news-container,
    .single-news-container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .news-page-header h1 {
        font-size: 1.6rem;
    }
    
    .single-news-title {
        font-size: 1.5rem;
    }
    
    .news-card-image {
        height: 180px;
    }
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.6s ease-out;
}

.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.2s; }
.news-card:nth-child(4) { animation-delay: 0.3s; }
.news-card:nth-child(5) { animation-delay: 0.4s; }
.news-card:nth-child(6) { animation-delay: 0.5s; }

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #1565c0;
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(25, 118, 210, 0.4);
}

/* 打印按钮 */
.print-article {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.print-article:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

/* 社交分享 */
.social-share {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-share span {
    font-weight: 600;
    color: #666;
}

.social-share a {
    display: inline-flex;
    align-items: center;
    padding: 6px 15px;
    background: white;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-share a:hover {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

/* 文章目录 */
.article-toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.article-toc h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
}

.article-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-toc li {
    margin-bottom: 8px;
}

.article-toc a {
    color: #666;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.article-toc a:hover {
    color: #1976d2;
    border-bottom-color: #1976d2;
    padding-left: 10px;
}

/* 外部链接标识 */
.external-link::after {
    content: "↗";
    font-size: 0.8em;
    margin-left: 3px;
    opacity: 0.7;
}

/* 加载状态 */
.news-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.news-grid.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 搜索框增强 */
.search-form.focused {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.2);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .social-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .social-share a {
        margin-bottom: 5px;
    }
    
    .print-article {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* 打印样式 */
@media print {
    .back-to-top,
    .social-share,
    .print-article,
    .news-pagination,
    .news-page-header {
        display: none !important;
    }
    
    .single-news-container {
        max-width: none;
        padding: 0;
    }
    
    .single-news-content {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .dark-mode-preferred .news-card {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #404040;
    }
    
    .dark-mode-preferred .news-page-header {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .dark-mode-preferred .single-news-content {
        color: #e0e0e0;
    }
}

/* 无障碍访问增强 */
.news-card:focus-within {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

.read-more-btn:focus,
.back-to-top:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .news-card {
        border: 2px solid #000;
    }
    
    .read-more-btn {
        border: 2px solid #1976d2;
    }
}