/* 新闻页面样式 */

.page-hero {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.page-hero-small {
    height: 200px;
}

.page-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.page-hero-content {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-hero p {
    font-size: 16px;
    opacity: 0.9;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb span {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.5);
}

/* 新闻列表页面 */
.news-section {
    padding: 40px 0;
}

.news-section .container {
    display: flex;
    gap: 30px;
}

.news-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.news-categories h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.news-categories ul {
    list-style: none;
    padding: 0;
}

.news-categories li {
    margin-bottom: 10px;
}

.news-categories a {
    display: block;
    padding: 10px 15px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.news-categories a:hover,
.news-categories a.active {
    background: #34377e;
    color: white;
}

.news-content {
    flex: 1;
}

.news-search {
    margin-bottom: 20px;
}

.news-search form {
    display: flex;
    gap: 10px;
}

.news-search input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.news-search button {
    padding: 10px 20px;
    background: #34377e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.news-search button:hover {
    background: #3498db;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.news-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.news-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #ecf0f1;
}

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

.news-item:hover .news-image img {
    transform: scale(1.1);
}

.news-content-inner {
    padding: 20px;
}

.news-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #ecf0f1;
    color: #FF4500;
    font-size: 12px;
    border-radius: 20px;
}

.news-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}

.news-content-inner h3 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: justify;
  	overflow-wrap: break-word;
}

.news-content-inner h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.news-content-inner h3 a:hover {
    color: #3498db;
}

.news-content-inner p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: justify;
  	overflow-wrap: break-word;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #95a5a6;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    padding: 5px 11px;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    background: #eff6ff;
    transition: all .22s ease;
    margin-left: auto;
}
.news-read-more svg {
    width: 12px;
    height: 12px;
    transition: transform .22s ease;
}
.news-read-more:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 5px 12px rgba(37,99,235,.3);
    transform: translateY(-1px);
}
.news-read-more:hover svg { transform: translateX(3px); }

.no-news {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #95a5a6;
}

/* 新闻详情页面 */
.news-detail-section {
    padding: 40px 0;
}

.news-detail-wrapper {
    display: flex;
    gap: 30px;
}

.news-detail-main {
    flex: 1;
    min-width: 0;        /* 关键：允许 flex 子项收缩，否则富文本里的宽图/宽表会把整页撑出屏幕 */
    max-width: 100%;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.news-detail-header {
    margin-bottom: 30px;
}

.news-detail-meta {
    margin-bottom: 20px;
}

.news-detail-meta .news-category {
    margin-right: 10px;
}

.news-category.category-enterprise {
    background: #3498db;
    color: white;
}

.news-category.category-industry {
    background: #9b59b6;
    color: white;
}

.news-category.category-technology {
    background: #1abc9c;
    color: white;
}

.news-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    margin-right: 8px;
}

.news-badge.badge-top {
    background: #e74c3c;
    color: white;
}

.news-badge.badge-hot {
    background: #f39c12;
    color: white;
}

.news-detail-title {
    font-size: 24px;
    margin-bottom: 20px;
    line-height: 1.4;
    color: #2c3e50;
    text-align: justify;
  	overflow-wrap: break-word;
}

.news-detail-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-item svg {
    width: 18px;
    height: 18px;
}

.news-detail-featured-image {
    margin-bottom: 30px;
}

.news-detail-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.news-detail-content {
    line-height: 1.8;
    font-size: 15px;
    color: #34495e;
    margin-bottom: 30px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;   /* 长单词/长链接/长英文串自动换行，不撑破容器 */
    word-wrap: break-word;
    word-break: break-word;
    text-align: justify;
  	overflow-wrap: break-word;
}

.news-detail-content p {
    margin-bottom: 1.5em;
}

.news-detail-content h2 {
    font-size: 22px;
    margin: 25px 0 15px;
    color: #2c3e50;
}

.news-detail-content h3 {
    font-size: 18px;
    margin: 20px 0 12px;
    color: #34495e;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 富文本内容防溢出：图片/视频/表格/代码块一律不超出正文容器宽度 */
.news-detail-content img,
.news-detail-content video,
.news-detail-content iframe,
.news-detail-content embed,
.news-detail-content object {
    max-width: 100%;
}
.news-detail-content img,
.news-detail-content video {
    height: auto;   /* 宽度被压缩时高度等比缩放，避免图片变形 */
}
/* KindEditor 内联 style 里写死的 width/height 也要让位，保证不横向撑破 */
.news-detail-content img[style] {
    max-width: 100% !important;
    height: auto !important;
}
.news-detail-content table {
    max-width: 100%;
    width: 100%;
    border-collapse: collapse;
    display: block;       /* 超宽表格在正文内部横向滚动，而不是把整页撑宽 */
    overflow-x: auto;
}
.news-detail-content td,
.news-detail-content th {
    word-break: break-word;
}
.news-detail-content pre {
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
}

.news-detail-footer {
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-bottom: 30px;
}

.news-tags {
    margin-bottom: 20px;
}

.tag-label {
    color: #7f8c8d;
    font-size: 14px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: #ecf0f1;
    color: #3498db;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    margin-right: 8px;
    transition: all 0.3s;
}

.tag:hover {
    background: #3498db;
    color: white;
}

.news-share {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-label {
    color: #7f8c8d;
    font-size: 14px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ecf0f1;
    color: #7f8c8d;
    text-decoration: none;
    transition: all 0.3s;
}

.share-btn:hover {
    background: #3498db;
    color: white;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.news-navigation {
    display: flex;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.news-navigation .nav-item {
    flex: 1;
    min-width: 0;        /* 允许 flex 子项收缩，长标题不撑破容器 */
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.news-navigation a.nav-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-navigation .nav-item a {
    text-decoration: none;
    color: inherit;
}

.news-navigation .nav-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #95a5a6;
    margin-bottom: 8px;
}

.news-navigation .nav-label svg {
    width: 14px;
    height: 14px;
}

.news-navigation .nav-title {
    font-size: 14px;
    color: #2c3e50;
    display: block;
    line-height: 1.5;
    white-space: normal;          /* 标题长时自动换行，不再单行省略 */
    word-break: break-word;
    overflow-wrap: break-word;
}

.news-navigation .nav-empty {
    flex: 1;
}

/* 侧边栏 */
.news-detail-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.sidebar-widget {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
}

.related-news-list {
    list-style: none;
    padding: 0;
}

.related-news-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s;
}

.related-news-item:last-child {
    border-bottom: none;
}

.related-news-item:hover {
    background: #f8fafc;
}

.related-news-image {
    width: 120px;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    background: #ecf0f1;
}

.related-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-news-content h4 {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-news-date {
    font-size: 12px;
    color: #95a5a6;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #555;
    transition: color 0.3s;
}

.category-link:hover {
    color: #3498db;
}

.category-link.active {
    color: #3498db;
    font-weight: 600;
}

.category-link.active .category-arrow,
.category-link.active .category-name {
    color: #3498db;
}

.category-link:last-child {
    border-bottom: none;
}

.category-arrow {
    color: #ddd;
}

.category-link:hover .category-arrow {
    color: #3498db;
}

/* 响应式 */
@media (max-width: 992px) {
    .news-section .container {
        flex-direction: column;
    }
    
    .news-sidebar {
        width: 100%;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .news-detail-wrapper {
        flex-direction: column;
    }
    
    .news-detail-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-hero h1 {
        font-size: 28px;
    }
    
    .news-detail-title {
        font-size: 24px;
    }
    
    .news-detail-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .news-navigation {
        flex-direction: column;
    }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #eef2f7;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.pagination a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

.pagination span.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    cursor: default;
}

.pagination .prev,
.pagination .next {
    padding: 0 20px;
    gap: 6px;
    font-weight: 500;
}

.pagination .prev::before {
    content: "‹";
    font-size: 18px;
    line-height: 1;
}

.pagination .next::after {
    content: "›";
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 480px) {
    .pagination a,
    .pagination span {
        min-width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .pagination .prev,
    .pagination .next {
        padding: 0 14px;
    }
}
