/* ==========================================================================
   新闻/案例页样式 —— 与站点主色调 #167cba 保持一致
   newslist.html / news.html / caselist.html 共用
   ========================================================================== */

/* ---------- 页头横幅 ---------- */
.page-banner {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, #167cba 0%, #0d5a8a 100%);
    overflow: hidden;
}

.page-banner::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.page-banner .container {
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.page-banner-title {
    font-size: 42px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 2px;
}

.page-banner-sub {
    margin-top: 12px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 1px;
}

/* ---------- 面包屑 ---------- */
.position-bar {
    padding: 20px 0;
    font-size: 14px;
    color: #999;
    border-bottom: 1px solid #eee;
}

.position-bar a {
    color: #666;
    text-decoration: none;
    transition: color .3s;
}

.position-bar a:hover {
    color: #167cba;
}

/* ---------- 栏目切换 ---------- */
.sort-switch {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 35px 0 10px;
}

.sort-switch-item {
    display: inline-block;
    padding: 10px 32px;
    font-size: 16px;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 24px;
    text-decoration: none;
    transition: all .3s;
}

.sort-switch-item:hover,
.sort-switch-item-current {
    color: #fff;
    background: #167cba;
    border-color: #167cba;
}

/* ---------- 新闻列表 ---------- */
.news-list-wrap {
    padding: 20px 0 10px;
}

.news-list-item {
    display: flex;
    padding: 22px;
    margin-bottom: 18px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all .3s;
}

.news-list-item:hover {
    box-shadow: 0 8px 24px rgba(22, 124, 186, 0.14);
    transform: translateY(-3px);
}

.news-list-thumb {
    flex: 0 0 240px;
    width: 240px;
    height: 150px;
    margin-right: 24px;
    border-radius: 6px;
    overflow: hidden;
}

.news-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.news-list-item:hover .news-list-thumb img {
    transform: scale(1.08);
}

.news-list-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.news-list-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.news-list-title a {
    color: #222;
    text-decoration: none;
    transition: color .3s;
}

.news-list-title a:hover {
    color: #167cba;
}

.news-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 12px;
    font-style: normal;
    font-weight: normal;
    border-radius: 3px;
    vertical-align: middle;
}

.news-tag-top {
    color: #fff;
    background: #d9534f;
}

.news-tag-rec {
    color: #fff;
    background: #f0ad4e;
}

.news-list-desc {
    flex: 1;
    font-size: 15px;
    color: #777;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 14px;
    font-size: 14px;
    color: #999;
}

.news-meta-date .layui-icon,
.news-more .layui-icon {
    font-size: 13px;
    margin-right: 3px;
}

.news-meta-sort {
    padding: 2px 10px;
    color: #167cba;
    background: #eef6fc;
    border-radius: 3px;
}

.news-more {
    margin-left: auto;
    color: #167cba;
    text-decoration: none;
    transition: all .3s;
}

.news-more:hover {
    letter-spacing: 1px;
}

/* ---------- 空状态 ---------- */
.news-empty {
    padding: 90px 0;
    text-align: center;
    color: #bbb;
}

.news-empty .layui-icon {
    font-size: 58px;
}

.news-empty p {
    margin-top: 16px;
    font-size: 16px;
}

/* ---------- 分页 ---------- */
.page-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 40px 0 50px;
    font-size: 15px;
}

.page-btn {
    display: inline-block;
    padding: 8px 18px;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all .3s;
}

.page-btn:hover {
    color: #fff;
    background: #167cba;
    border-color: #167cba;
}

.page-num a,
.page-num span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all .3s;
}

.page-num a:hover,
.page-num .current,
.page-num span.current {
    color: #fff;
    background: #167cba;
    border-color: #167cba;
}

.page-info {
    color: #999;
    font-size: 14px;
    margin-left: 12px;
}

/* ==========================================================================
   新闻详情页
   ========================================================================== */
.news-detail-layout {
    display: flex;
    gap: 30px;
    padding: 30px 0 50px;
    align-items: flex-start;
}

.news-detail-main {
    flex: 1;
    min-width: 0;
}

.news-detail-head {
    padding-bottom: 22px;
    border-bottom: 1px solid #eee;
}

.news-detail-title {
    font-size: 30px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

.news-detail-subtitle {
    margin-top: 12px;
    font-size: 16px;
    color: #888;
}

.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 18px;
    font-size: 14px;
    color: #999;
}

.news-detail-meta .layui-icon {
    font-size: 13px;
    margin-right: 3px;
}

.news-detail-content {
    padding: 30px 0;
    font-size: 16px;
    line-height: 1.9;
    color: #444;
    text-align: justify;
    word-break: break-word;
}

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

.news-detail-content p {
    padding: 8px 0;
}

.news-detail-content h1,
.news-detail-content h2,
.news-detail-content h3 {
    font-weight: 600;
    padding: 16px 0 10px;
    color: #222;
}

.news-detail-content a {
    color: #167cba;
}

.news-detail-content table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
}

.news-detail-content td,
.news-detail-content th {
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
}

.news-detail-content th {
    background: #f7f9fb;
    font-weight: 600;
}

/* 上一篇 / 下一篇 */
.news-detail-nav {
    position: relative;
    padding: 24px 0;
    border-top: 1px dashed #e5e5e5;
    font-size: 15px;
}

.news-nav-item {
    display: flex;
    padding: 6px 0;
    color: #666;
}

.news-nav-label {
    flex: 0 0 70px;
    color: #999;
}

.news-nav-link {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-nav-link a {
    color: #555;
    text-decoration: none;
    transition: color .3s;
}

.news-nav-link a:hover {
    color: #167cba;
}

.news-back-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 28px;
    color: #fff;
    background: #167cba;
    border-radius: 24px;
    text-decoration: none;
    font-size: 15px;
    transition: all .3s;
}

.news-back-btn:hover {
    background: #0d5a8a;
    box-shadow: 0 6px 16px rgba(22, 124, 186, 0.32);
}

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

.side-box {
    padding: 22px;
    margin-bottom: 24px;
    background: #f8fafc;
    border-radius: 8px;
}

.side-box-title {
    position: relative;
    font-size: 19px;
    font-weight: 600;
    color: #222;
    padding-bottom: 14px;
}

.side-box-title .item-title-line {
    width: 46px;
    height: 3px;
    margin: 12px 0 0;
    background: #167cba;
}

.side-news-list {
    margin-top: 16px;
}

.side-news-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px dashed #e6e9ed;
    font-size: 15px;
}

.side-news-list li:last-child {
    border-bottom: none;
}

.side-news-list a {
    display: flex;
    align-items: center;
    min-width: 0;
    color: #555;
    text-decoration: none;
    transition: color .3s;
}

.side-news-list a:hover {
    color: #167cba;
}

.side-news-dot {
    flex: 0 0 5px;
    width: 5px;
    height: 5px;
    margin-right: 9px;
    border-radius: 50%;
    background: #167cba;
    opacity: .5;
}

.side-news-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-news-date {
    flex: 0 0 auto;
    font-size: 13px;
    color: #aaa;
}

.side-contact p {
    padding: 9px 0;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    word-break: break-all;
}

.side-contact .layui-icon {
    color: #167cba;
    margin-right: 8px;
}

.side-contact-btn {
    display: block;
    margin-top: 16px;
    padding: 11px 0;
    text-align: center;
    color: #fff;
    background: #167cba;
    border-radius: 6px;
    text-decoration: none;
    transition: background .3s;
}

.side-contact-btn:hover {
    background: #0d5a8a;
}

/* ==========================================================================
   案例列表
   ========================================================================== */
.case-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    padding: 30px 0 10px;
}

.case-grid-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all .35s;
}

.case-grid-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(22, 124, 186, 0.18);
}

.case-grid-thumb {
    position: relative;
    display: block;
    height: 210px;
    overflow: hidden;
    background: #f4f6f8;
}

.case-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.case-grid-item:hover .case-grid-thumb img {
    transform: scale(1.09);
}

.case-grid-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 124, 186, 0.72);
    opacity: 0;
    transition: opacity .35s;
}

.case-grid-item:hover .case-grid-mask {
    opacity: 1;
}

.case-grid-mask .layui-icon {
    font-size: 42px;
    color: #fff;
}

.case-grid-info {
    padding: 18px 20px 20px;
}

.case-grid-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-grid-title a {
    color: inherit;
    text-decoration: none;
    transition: color .3s;
}

.case-grid-title a:hover {
    color: #167cba;
}

.case-grid-desc {
    margin-top: 10px;
    font-size: 14px;
    color: #888;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
}

.case-grid-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
}

.case-grid-sort {
    padding: 2px 10px;
    color: #167cba;
    background: #eef6fc;
    border-radius: 3px;
}

.case-grid-more {
    color: #167cba;
    text-decoration: none;
    transition: letter-spacing .3s;
}

.case-grid-more:hover {
    letter-spacing: 1px;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media screen and (max-width: 1240px) {
    .container {
        width: 100%;
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
    }
}

@media screen and (max-width: 992px) {
    .page-banner,
    .page-banner .container {
        height: 170px;
    }

    .page-banner-title {
        font-size: 30px;
    }

    .news-detail-layout {
        flex-direction: column;
        gap: 0;
    }

    /* 纵向排列时必须显式限制宽度，否则 flex 子项会按内容撑开 */
    .news-detail-main,
    .news-detail-side {
        flex: 0 1 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .news-detail-content {
        word-break: break-word;
        overflow-wrap: anywhere;
        overflow-x: hidden;
    }

    .news-detail-content img,
    .news-detail-content table {
        max-width: 100%;
    }

    .news-detail-content table {
        display: block;
        overflow-x: auto;
    }

    .case-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .page-banner,
    .page-banner .container {
        height: 140px;
    }

    .page-banner-title {
        font-size: 24px;
    }

    .page-banner-sub {
        font-size: 14px;
    }

    .sort-switch {
        gap: 10px;
        padding: 22px 0 6px;
    }

    .sort-switch-item {
        padding: 7px 20px;
        font-size: 14px;
    }

    .news-list-item {
        flex-direction: column;
        padding: 14px;
    }

    .news-list-thumb {
        flex: none;
        width: 100%;
        height: 190px;
        margin: 0 0 14px;
    }

    .news-list-title {
        font-size: 17px;
    }

    .news-list-meta {
        flex-wrap: wrap;
        gap: 12px;
    }

    .news-more {
        margin-left: 0;
    }

    .news-detail-title {
        font-size: 22px;
    }

    .news-detail-content {
        font-size: 15px;
    }

    .case-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .case-grid-thumb {
        height: 200px;
    }

    .page-bar {
        padding: 28px 0 36px;
    }
}

/* ==========================================================================
   案例详情页
   ========================================================================== */
.case-detail-layout {
    display: flex;
    gap: 30px;
    padding: 30px 0 50px;
    align-items: flex-start;
}

.case-detail-main {
    flex: 1;
    min-width: 0;
}

.case-detail-head {
    padding-bottom: 22px;
    border-bottom: 1px solid #eee;
}

.case-detail-title {
    font-size: 30px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

.case-detail-subtitle {
    margin-top: 12px;
    font-size: 16px;
    color: #888;
}

.case-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 18px;
    font-size: 14px;
    color: #999;
}

.case-detail-meta .layui-icon {
    font-size: 13px;
    margin-right: 3px;
}

/* 主图 */
.case-detail-cover {
    margin: 26px 0 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f4f6f8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.case-detail-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
}

/* 多图 */
.case-detail-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 20px;
}

.case-detail-gallery:empty {
    display: none;
}

.case-gallery-item {
    display: block;
    height: 140px;
    border-radius: 6px;
    overflow: hidden;
    background: #f4f6f8;
    transition: all .3s;
}

.case-gallery-item:hover {
    box-shadow: 0 6px 18px rgba(22, 124, 186, 0.22);
    transform: translateY(-3px);
}

.case-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s;
}

.case-gallery-item:hover img {
    transform: scale(1.08);
}

/* 正文区块 */
.case-detail-block {
    margin-top: 34px;
}

.case-detail-block-title {
    position: relative;
    font-size: 21px;
    font-weight: 600;
    color: #222;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

.case-detail-block-title .item-title-line {
    width: 46px;
    height: 3px;
    margin: 12px 0 0;
    background: #167cba;
}

.case-detail-content {
    padding: 24px 0 0;
    font-size: 16px;
    line-height: 1.9;
    color: #444;
    text-align: justify;
    word-break: break-word;
}

.case-detail-content img {
    max-width: 100%;
    height: auto;
    margin: 12px auto;
    border-radius: 6px;
}

.case-detail-content p {
    padding: 8px 0;
}

.case-detail-content h1,
.case-detail-content h2,
.case-detail-content h3 {
    font-weight: 600;
    padding: 16px 0 10px;
    color: #222;
}

.case-detail-content a {
    color: #167cba;
}

.case-detail-content table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
}

.case-detail-content td,
.case-detail-content th {
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
}

.case-detail-content th {
    background: #f7f9fb;
    font-weight: 600;
}

/* 上一个 / 下一个 */
.case-detail-nav {
    position: relative;
    padding: 24px 0;
    margin-top: 10px;
    border-top: 1px dashed #e5e5e5;
    font-size: 15px;
}

/* 右侧边栏 */
.case-detail-side {
    flex: 0 0 320px;
    width: 320px;
}

@media screen and (max-width: 992px) {
    .case-detail-layout {
        flex-direction: column;
    }

    .case-detail-side {
        flex: 1 1 auto;
        width: 100%;
    }

    .case-detail-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .case-detail-title {
        font-size: 22px;
    }

    .case-detail-content {
        font-size: 15px;
    }

    .case-detail-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .case-gallery-item {
        height: 110px;
    }
}
