/**
 * 新闻中心样式 - 匹配网站风格优化版
 * 基于 page-news.php 风格，添加搜索、排序、视图切换功能
 */

/* ========== 页面标题区域（Hero Section） ========== */
.news-page-hero {
    position: relative;
    padding: 56px 0 64px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #1d4ed8 100%);
    color: #ffffff;
    overflow: hidden;
}

.news-page-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(circle at 20% 80%, rgba(37,99,235,0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245,158,11,0.12) 0%, transparent 50%);
    opacity: 1;
    z-index: 0;
}

.news-page-hero .container {
    position: relative;
    z-index: 1;
}

.news-page-hero-title {
    color: #ffffff;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.news-page-hero-desc {
    color: rgba(255,255,255,0.75);
    font-size: 1.0625rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========== 页面主体布局 ========== */
.news-page-section {
    padding: 40px 0 80px;
    background: #f8fafc;
    min-height: calc(100vh - 300px);
}

.news-page-section .container {
    max-width: var(--container, 1488px);
    margin: 0 auto;
    padding: 0 24px;
}

.news-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.news-main {
    flex: 1;
    min-width: 0;
}

.news-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ========== 分类筛选标签 ========== */
.news-filter-section {
    margin-bottom: 24px;
}

.news-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: #f8fafc;
    color: #374151;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.filter-chip:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #2563eb;
}

.filter-chip.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* ========== 工具栏（搜索、排序、视图切换） ========== */
.news-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.news-toolbar-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.news-search-box {
    flex: 1;
    min-width: 0;
    position: relative;
}

.news-search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.news-search-box input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.news-search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.news-search-box button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.news-search-box button:hover {
    background: #1e40af;
}

.news-search-box .search-clear {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    text-decoration: none;
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.news-search-box .search-clear:hover {
    color: #ef4444;
}

.news-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-sort-select {
    padding: 9px 36px 9px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.news-sort-select:focus {
    outline: none;
    border-color: #2563eb;
    background-color: #ffffff;
}

.news-view-toggle {
    display: flex;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.news-view-toggle button {
    padding: 8px 12px;
    border: none;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-view-toggle button {
    padding: 8px 10px;
}

.news-view-toggle button svg {
    display: block;
}

.news-view-toggle button:hover {
    background: #eff6ff;
    color: #2563eb;
}

.news-view-toggle button.active {
    background: #2563eb;
    color: #ffffff;
}

.news-view-toggle button.active svg {
    stroke: #ffffff;
}

/* ========== 新闻网格布局 ========== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.news-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ========== 新闻卡片 ========== */
.news-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.22s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border-color: #bfdbfe;
    transform: translateY(-2px);
}

.news-grid.list-view .news-card {
    flex-direction: row;
}

.news-grid.list-view .news-card-thumb {
    width: 280px;
    min-height: 180px;
    aspect-ratio: auto;
    flex-shrink: 0;
}

.news-card-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #f3f4f6;
}

.news-card-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.news-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-thumb img {
    transform: scale(1.08);
}

.news-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    color: #d1d5db;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.news-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-grid.list-view .news-card-body {
    padding: 20px 24px;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.news-card-category {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.news-card-category:hover {
    background: #2563eb;
    color: #ffffff;
}

.news-card-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: #6b7280;
}

.news-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-grid.list-view .news-card-title {
    -webkit-line-clamp: 1;
}

.news-card-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-card-title a:hover {
    color: #2563eb;
}

.news-card-excerpt {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-grid.list-view .news-card-excerpt {
    -webkit-line-clamp: 2;
    margin-bottom: 12px;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.news-card-date {
    font-size: 0.8125rem;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-card-readmore {
    font-size: 0.875rem;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.news-card-readmore:hover {
    color: #1e40af;
    gap: 10px;
}

/* ========== 分页 ========== */
.news-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.news-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: #4b5563;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.news-pagination .page-numbers:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #2563eb;
}

.news-pagination .page-numbers.current {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.news-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
}

/* ========== 空状态 ========== */
.news-empty {
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.news-empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.news-empty h2 {
    font-size: 1.5rem;
    color: #111827;
    margin: 16px 0 8px;
}

.news-empty p {
    color: #6b7280;
    margin-bottom: 24px;
}

/* ========== 侧边栏 ========== */
.news-sidebar-block {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.news-sidebar-block-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-sidebar-block-title svg {
    color: #2563eb;
}

.news-sidebar-posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-sidebar-post {
    display: flex;
    gap: 12px;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.news-sidebar-post:hover {
    background: #f8fafc;
}

.news-sidebar-post-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.news-sidebar-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-sidebar-post-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.news-sidebar-post-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-sidebar-post:hover .news-sidebar-post-title {
    color: #2563eb;
}

.news-sidebar-post-date {
    font-size: 0.8125rem;
    color: #6b7280;
}

.news-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-category-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.news-category-list li a:hover {
    background: #eff6ff;
    color: #2563eb;
}

.news-category-list .count {
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.news-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-tag {
    display: inline-flex;
    padding: 6px 14px;
    background: #f8fafc;
    color: #374151;
    border-radius: 9999px;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.news-tag:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .news-layout {
        flex-direction: column;
    }
    
    .news-sidebar {
        width: 100%;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .news-grid.list-view .news-card {
        flex-direction: column;
    }
    
    .news-grid.list-view .news-card-thumb {
        width: 100%;
        aspect-ratio: 16 / 10;
    }
}

@media (max-width: 768px) {
    .news-page-hero {
        padding: 40px 0;
    }
    
    .news-page-hero-title {
        font-size: 1.875rem;
    }
    
    .news-page-hero-desc {
        font-size: 1rem;
    }
    
    .news-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .news-search-box {
        min-width: 100%;
    }
    
    .news-toolbar-right {
        justify-content: space-between;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .news-filter-bar {
        padding: 12px 16px;
    }
    
    .filter-chip {
        padding: 6px 14px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .news-page-section {
        padding: 24px 0 60px;
    }
    
    .news-page-section .container {
        padding: 0 16px;
    }
    
    .news-card-body {
        padding: 16px;
    }
    
    .news-pagination {
        flex-wrap: wrap;
    }
    
    .news-sidebar-block {
        padding: 16px;
    }
}

/* ========== 标签页面模块切换 ========== */
.tag-module-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    background: #f1f5f9;
    border-radius: 12px;
    width: fit-content;
}

.module-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.module-tab:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.module-tab.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.module-tab .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
}

.module-tab.active .count {
    background: #2563eb;
    color: #ffffff;
}

/* ========== 产品卡片 ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.product-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.12);
    border-color: #2563eb;
}

.product-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
}

.product-card-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f8fafc;
}

.product-grid.list-view .product-card-thumb {
    width: 280px;
    min-height: 200px;
    flex-shrink: 0;
}

.product-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-thumb img {
    transform: scale(1.05);
}

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.product-card-sku {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.6);
    color: #ffffff;
    font-size: 0.75rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.product-card-body {
    padding: 20px;
}

.product-grid.list-view .product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.4;
}

.product-card-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card-title a:hover {
    color: #2563eb;
}

.product-card-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 8px;
}

.product-card-excerpt {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    justify-content: flex-end;
}

.product-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.product-card-btn:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* ========== 标签信息块 ========== */
.tag-info-block {
    padding: 16px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border-radius: 10px;
    text-align: center;
}

.tag-info-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e40af;
    margin-bottom: 8px;
}

.tag-info-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 8px;
    line-height: 1.6;
}

.tag-info-count {
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* ========== 产品网格响应式 ========== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-grid.list-view .product-card {
        flex-direction: column;
    }

    .product-grid.list-view .product-card-thumb {
        width: 100%;
        aspect-ratio: 4 / 3;
    }

    .tag-module-tabs {
        width: 100%;
    }

    .module-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.875rem;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .news-page-hero,
    .news-toolbar,
    .news-pagination,
    .news-sidebar,
    .news-card-readmore {
        display: none !important;
    }
    
    .news-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .news-page-section {
        padding: 0;
        background: white;
    }
    
    .news-layout {
        display: block;
    }
}
