/* 官网 News 与 Cases 模块独立样式：列表页（卡片网格 / 通栏横卡）、
   共用详情页（侧栏 + 正文）与首页 News 区块。
   横幅、面包屑、分页、联系卡直接复用产品页既有组件（.pl-banner/.pl-crumbs/
   .pl-pager/.cp-card），此处只放 .nl-*（新闻列表）、.cl-*（案例列表）、
   .ad-*（详情页）与 .public-news（首页模块）前缀的数值。
   方向属性全部使用逻辑属性（margin-inline / padding-inline / inset-inline /
   text-align: end），Arabic RTL 下由 dir="rtl" 自动镜像，无需单独规则。 */

/* ============ 列表页容器（无侧栏，全宽 1366，与产品列表 .pl-main 同值） ============ */
.nl-main {
    max-width: 1366px;
    margin: 0 auto;
    padding: 16px 24px 76px;
}

/* 视口 ≤1280：容器贴合视口。 */
@media screen and (max-width: 1280px) {
    .nl-main { max-width: none; }
}

/* 分类筛选提示：从详情页侧栏进入时显示，可一键清除。 */
.nl-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: #fafafa;
    border-radius: 6px;
    font-size: 14px;
    line-height: 20px;
    color: #646464;
}
.nl-filter__label { font-weight: 700; color: #323232; }
.nl-filter__name { color: var(--site-primary); }
.nl-filter__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #646464;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
}
.nl-filter__clear:hover { background: var(--site-primary); color: #fff; }

/* ============ News 列表：三列卡片网格（12 条/页） ============ */
.nl-grid { display: flex; flex-wrap: wrap; }
.nl-card__item {
    width: calc((100% - 24px) / 3);
    margin-inline-end: 12px;
    margin-block-end: 24px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0, 0, 0, .2);
    padding: 12px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: box-shadow .3s ease;
}
.nl-card__item:nth-child(3n) { margin-inline-end: 0; }
.nl-card__item:hover { box-shadow: 0 0 10px rgba(0, 0, 0, .25); }

/* 封面区 4:3，无图时品牌渐变占位（避免大块灰白空图）。 */
.nl-card__media {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
    border-radius: 4px;
}
/* 无封面占位：深青渐变 + GHT 字样水印，与横幅无图兜底同色系。 */
.nl-card__media.is-empty {
    background: linear-gradient(135deg, var(--site-primary-deep) 0%, var(--site-primary) 62%, var(--site-primary-mid) 100%);
    position: relative;
}
.nl-card__media.is-empty::after {
    content: "GHT";
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, .18);
    user-select: none;
}
.nl-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.nl-card__item:hover .nl-card__media img { transform: scale(1.06); }

/* 标题两行钳制，层级与站内卡片一致。 */
.nl-card__title {
    margin: 14px 0 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
    color: #323232;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 56px;
}
.nl-card__title a { color: inherit; text-decoration: none; }
.nl-card__title a:hover { color: var(--site-primary); }

/* 元信息行：日期 + View More。 */
.nl-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}
.nl-card__date { font-size: 16px; line-height: 24px; color: #646464; }
.nl-card__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    line-height: 24px;
    color: #646464;
    text-decoration: none;
    white-space: nowrap;
}
.nl-card__more:hover { color: var(--site-primary); }
.nl-card__chevron { font-size: 13px; }

/* ============ Cases 列表：通栏横卡（10 条/页，图占 42%） ============ */
.cl-list { display: flex; flex-direction: column; }
.cl-item {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0, 0, 0, .2);
    padding: 12px;
    margin-block-end: 24px;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    transition: box-shadow .3s ease;
}
.cl-item:hover { box-shadow: 0 0 10px rgba(0, 0, 0, .25); }
.cl-item__media {
    width: 42%;
    flex-shrink: 0;
    aspect-ratio: 564 / 360;
    overflow: hidden;
    background: #fafafa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 无封面占位：品牌渐变 + GHT 水印，与 News 卡片一致。 */
.cl-item__media.is-empty {
    background: linear-gradient(135deg, var(--site-primary-deep) 0%, var(--site-primary) 62%, var(--site-primary-mid) 100%);
}
.cl-item__media.is-empty::after {
    content: "GHT";
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, .18);
    user-select: none;
}
.cl-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.cl-item:hover .cl-item__media img { transform: scale(1.06); }
.cl-item__info {
    flex: 1;
    min-width: 0;
    padding-inline-start: 36px;
    padding-block: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.cl-item__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 30px;
    color: #323232;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cl-item:hover .cl-item__title { color: var(--site-primary); }
.cl-item__summary {
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 28px;
    color: #969696;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cl-item__date {
    margin-top: auto;
    padding-top: 24px;
    font-size: 14px;
    line-height: 20px;
    color: #969696;
}
/* 摘要与日期之间加分隔感，避免横卡下半部大片空白。 */
.cl-item__summary { margin-block-end: 0; }

/* 空状态：无已发布内容或当前分类下无内容。 */
.nl-empty, .cl-empty {
    margin: 0;
    padding: 64px 24px;
    text-align: center;
    font-size: 16px;
    line-height: 24px;
    color: #969696;
}

/* ============ 详情页：左 268 侧栏 + 右栏正文 ============ */
.ad-main {
    max-width: 1366px;
    margin: 0 auto;
    padding: 16px 24px 76px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.ad-side { width: 268px; flex-shrink: 0; }
.ad-content { flex: 1; min-width: 0; }

/* 类型切换：News / Cases 两项，当前类型主色高亮。 */
.ad-types {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.ad-types__item {
    flex: 1;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    color: #505050;
    text-decoration: none;
    transition: background .3s ease, color .3s ease;
}
.ad-types__item:hover { color: var(--site-primary); }
.ad-types__item.is-current,
.ad-types__item.is-current:hover { background: var(--site-primary); color: #fff; }

/* 侧栏标题条与分类导航：复用产品侧栏标题条数值。 */
.ad-side__title {
    height: 54px;
    line-height: 54px;
    font-size: 20px;
    font-weight: 700;
    background: #eee;
    text-indent: 12px;
    box-shadow: 0 0 4px rgba(0, 0, 0, .25);
    margin-bottom: 8px;
}
.ad-cats { display: flex; flex-direction: column; margin-bottom: 24px; }
.ad-cats__item {
    height: 36px;
    line-height: 36px;
    padding-inline-start: 12px;
    font-size: 14px;
    color: #505050;
    text-decoration: none;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ad-cats__item:hover { color: var(--site-primary); background: #fafafa; }
.ad-cats__item.is-current { color: var(--site-primary); font-weight: 700; background: #fafafa; }

/* 右栏：标题 + 元信息 + 正文 + 上/下一篇。 */
.ad-title {
    margin: 8px 0 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    line-height: 42px;
    color: #323232;
}
.ad-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    font-size: 14px;
    line-height: 20px;
    color: #969696;
}
.ad-meta__category { color: var(--site-primary); text-decoration: none; }
.ad-meta__category:hover { text-decoration: underline; }

/* 正文：服务端已按白名单净化，此处只做排版。 */
.ad-body { font-size: 16px; line-height: 28px; color: #323232; }
.ad-body p { margin: 0 0 20px; }
.ad-body img { max-width: 100%; height: auto; display: block; margin: 24px auto; }
.ad-body ul, .ad-body ol { margin: 0 0 20px; padding-inline-start: 24px; }
.ad-body li { margin-bottom: 8px; }
.ad-body a { color: var(--site-primary); }
.ad-body strong, .ad-body b { font-weight: 700; }

/* 上/下一篇：同类型相邻内容，任一侧缺失时只渲染存在的一侧。 */
.ad-neighbor {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.ad-neighbor__item {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: #323232;
}
.ad-neighbor__item--next { justify-content: flex-end; text-align: end; }
.ad-neighbor__chevron { color: #969696; font-size: 14px; flex-shrink: 0; }
.ad-neighbor__label { font-size: 13px; line-height: 20px; color: #969696; flex-shrink: 0; }
.ad-neighbor__title {
    font-size: 15px;
    line-height: 22px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ad-neighbor__item:hover .ad-neighbor__title { color: var(--site-primary); }

/* ============ 首页 News 区块（与首页其他模块同构） ============ */
.public-news__inner {
    width: min(1270px, calc(100% - 32px));
    margin: 0 auto;
    position: relative;
}
.public-news__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 32px;
}
.public-news__title {
    margin: 6px 0 0;
    font-size: 32px;
    font-weight: 700;
    line-height: 44px;
    color: #323232;
}
.public-news__desc {
    margin: 8px 0 0;
    font-size: 16px;
    line-height: 24px;
    color: #646464;
    max-width: 640px;
}
/* View All 按钮：48 高描边胶囊，hover 填充主色。 */
.public-news__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 28px;
    border: 1px solid var(--site-primary);
    border-radius: 24px;
    color: var(--site-primary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background .3s ease, color .3s ease;
    flex-shrink: 0;
}
.public-news__all:hover { background: var(--site-primary); color: #fff; }
.public-news__chevron { font-size: 13px; }

.public-news__list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}
.public-news__card {
    width: calc((100% - 48px) / 3);
    margin-inline-end: 24px;
    margin-block-end: 24px;
}
.public-news__card:nth-child(3n) { margin-inline-end: 0; }
.public-news__link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    min-height: 120px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0, 0, 0, .2);
    text-decoration: none;
    color: #323232;
    box-sizing: border-box;
    transition: box-shadow .3s ease, transform .3s ease;
}
.public-news__link:hover { box-shadow: 0 0 10px rgba(0, 0, 0, .25); transform: translateY(-2px); }
.public-news__date { font-size: 13px; line-height: 20px; color: #969696; }
.public-news__card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.public-news__link:hover .public-news__card-title { color: var(--site-primary); }
.public-news__more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    line-height: 20px;
    color: var(--site-primary);
}
.public-news__card-chevron { font-size: 12px; }

/* ============ 响应式 ============ */

/* ≤1180：新闻卡片两列。 */
@media screen and (max-width: 1180px) {
    .nl-card__item { width: calc((100% - 12px) / 2); }
    .nl-card__item:nth-child(3n) { margin-inline-end: 12px; }
    .nl-card__item:nth-child(2n) { margin-inline-end: 0; }
    .public-news__card { width: calc((100% - 24px) / 2); }
    .public-news__card:nth-child(3n) { margin-inline-end: 24px; }
    .public-news__card:nth-child(2n) { margin-inline-end: 0; }
}

/* ≤920：详情页侧栏下沉到正文上方（联系卡隐藏，由悬浮联系栏承接），
   案例横卡纵向堆叠（图在上），面包屑字号收缩。 */
@media screen and (max-width: 920px) {
    .ad-main { flex-direction: column; max-width: none; }
    .ad-side { width: 100%; order: -1; }
    /* 移动端不展示侧栏联系卡：悬浮联系栏已提供同等入口。 */
    .ad-side .cp-card { display: none; }
    .pl-crumbs { font-size: 13px; }
    .cl-item { flex-direction: column; }
    .cl-item__media { width: 100%; }
    .cl-item__info { padding-inline-start: 0; padding-block-start: 16px; }
    .public-news__head { flex-direction: column; align-items: flex-start; }
}

/* ≤640：横幅压低、卡片单列通栏、标题缩小（与产品页移动端规格一致）。 */
@media screen and (max-width: 640px) {
    .pl-banner { height: 180px; }
    .pl-banner__title { font-size: 28px; line-height: 38px; }
    .pl-banner__desc { font-size: 14px; line-height: 22px; }
    .nl-card__item {
        width: 100%;
        margin-inline-end: 0;
    }
    .nl-card__item:nth-child(n) { margin-inline-end: 0; }
    .nl-card__title { font-size: 16px; line-height: 24px; min-height: 48px; }
    .public-news__card {
        width: 100%;
        margin-inline-end: 0;
    }
    .public-news__card:nth-child(n) { margin-inline-end: 0; }
    .public-news__title { font-size: 26px; line-height: 36px; }
    .ad-title { font-size: 22px; line-height: 32px; }
    .ad-neighbor { flex-direction: column; gap: 16px; }
    .ad-neighbor__item--next { justify-content: flex-start; text-align: start; }
}
