/* 资讯详情页专用样式（依赖 news.css 中的变量与通用组件） */

/* 阅读进度条 */
.nxd-progress {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 900;
    height: 3px;
    width: 0;
    background: var(--gold);
    transition: width 0.1s linear;
}

/* 页头 */
.nxd-hero {
    position: relative;
    padding: clamp(112px, 10vw, 152px) 0 clamp(28px, 3vw, 44px);
    background: linear-gradient(115deg, #0d2c52 0%, var(--main) 60%, #3b82c7 100%);
    overflow: hidden;
}
.nxd-hero-bg {
    position: absolute;
    inset: 0;
    background: url('../images/news.jpg') center / cover no-repeat;
    opacity: 0.2;
}
.nxd-hero-inner {
    position: relative;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.nxd-hero-main {
    max-width: 880px;
}
.nxd-hero-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.nxd-badge {
    padding: 4px 12px;
    border-radius: 4px;
    background: var(--gold);
    color: #16233a;
    font-size: 12px;
}
.nxd-badge-ghost {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
    font-size: 12px;
}
.nxd-title {
    font-size: clamp(24px, 2.9vw, 40px);
    font-weight: 500;
    line-height: 1.35;
    color: #fff;
    letter-spacing: 0.5px;
    font-family: 'SourceHanSansSC Medium', "Microsoft Yahei", sans-serif;
}
.nxd-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(12px, 1.6vw, 26px);
    margin-top: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}
.nxd-meta a {
    color: rgba(255, 255, 255, 0.8);
}
.nxd-meta a:hover {
    color: var(--gold);
}

/* 主体布局 */
.nxd-main {
    background: #f6f7f9;
    padding: clamp(26px, 3.4vw, 44px) 0 clamp(46px, 5vw, 70px);
}
.nxd-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.nxd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(20px, 2.4vw, 32px);
    align-items: start;
}

/* 文章正文 */
.nxd-article {
    background: #fff;
    border: 1px solid var(--nx-line);
    border-radius: 12px;
    padding: clamp(20px, 2.4vw, 40px);
}
.nxd-cover {
    margin: 0 0 clamp(18px, 2vw, 28px);
}
.nxd-cover img {
    width: 100%;
    /* 必须显式写 height:auto：模板里 img 带 width="1200" height="600" 属性，
       该属性会作为表现层提示参与布局（height:600px），两个维度都确定时
       aspect-ratio 会被忽略，图片会被撑成 600px 高，移动端尤其夸张 */
    height: auto;
    aspect-ratio: 16 / 8;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.nxd-cover figcaption {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    text-align: center;
}
.nxd-lead {
    font-size: clamp(15px, 1.15vw, 17px);
    line-height: 1.9;
    color: #3a4a63;
    padding-left: 14px;
    border-left: 3px solid var(--main);
    margin-bottom: clamp(18px, 2vw, 26px);
}
.nxd-tldr {
    background: #f5f9ff;
    border: 1px solid #dbe7f7;
    border-radius: 10px;
    padding: clamp(16px, 1.6vw, 22px);
    margin-bottom: clamp(22px, 2.4vw, 32px);
}
.nxd-tldr-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--main);
    margin-bottom: 10px;
    font-family: 'SourceHanSansSC Medium', "Microsoft Yahei", sans-serif;
}
.nxd-tldr ul li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    line-height: 1.9;
    color: #4a5a72;
}
.nxd-tldr ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}
.nxd-article h2 {
    font-size: clamp(18px, 1.6vw, 24px);
    font-weight: 500;
    color: #16233a;
    line-height: 1.5;
    margin: clamp(28px, 3vw, 40px) 0 14px;
    padding-left: 12px;
    border-left: 4px solid var(--main);
    scroll-margin-top: 20px;
    font-family: 'SourceHanSansSC Medium', "Microsoft Yahei", sans-serif;
}
.nxd-article h3 {
    font-size: clamp(15px, 1.25vw, 18px);
    font-weight: 500;
    color: #22344f;
    margin: 22px 0 10px;
}
.nxd-article p {
    font-size: 15px;
    line-height: 2;
    color: #4a5a72;
}
.nxd-article p + p {
    margin-top: 12px;
}
.nxd-article a.nxd-inline {
    color: var(--main);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.nxd-article a.nxd-inline:hover {
    color: var(--gold);
}
.nxd-article ul,
.nxd-article ol {
    margin-top: 12px;
    padding-left: 4px;
}
.nxd-article ul li,
.nxd-article ol li {
    position: relative;
    font-size: 15px;
    line-height: 2;
    color: #4a5a72;
    padding-left: 18px;
}
.nxd-article ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--main);
}
.nxd-article ol {
    counter-reset: nxdstep;
}
.nxd-article ol li {
    counter-increment: nxdstep;
}
.nxd-article ol li::before {
    content: counter(nxdstep);
    position: absolute;
    left: 0;
    top: 11px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
    color: #fff;
    background: var(--main);
    border-radius: 50%;
}
.nxd-article ol li {
    padding-left: 28px;
}
.nxd-quote {
    margin: clamp(18px, 2vw, 26px) 0;
    padding: clamp(16px, 1.8vw, 24px);
    background: #fafbfd;
    border: 1px dashed var(--nx-line);
    border-radius: 8px;
    font-size: 15px;
    line-height: 2;
    color: #3a4a63;
}
.nxd-quote cite {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-style: normal;
    color: #999;
}
.nxd-figure {
    margin: clamp(18px, 2vw, 26px) 0;
}
.nxd-figure img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.nxd-figure figcaption {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    text-align: center;
}
.nxd-table-wrap {
    margin: clamp(18px, 2vw, 26px) 0;
    overflow-x: auto;
}
.nxd-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 14px;
}
.nxd-table th,
.nxd-table td {
    border: 1px solid var(--nx-line);
    padding: 11px 14px;
    text-align: center;
    color: #4a5a72;
}
.nxd-table thead th {
    background: var(--main);
    color: #fff;
    font-weight: 500;
    border-color: var(--main);
}
.nxd-table tbody tr:nth-child(even) {
    background: #fafcff;
}
.nxd-table caption {
    caption-side: bottom;
    padding-top: 10px;
    font-size: 12px;
    color: #999;
}

/* 文内 CTA */
.nxd-inline-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: clamp(22px, 2.4vw, 32px) 0;
    padding: clamp(18px, 1.8vw, 24px);
    border-radius: 10px;
    background: linear-gradient(115deg, #0d2c52 0%, var(--main) 100%);
    color: #fff;
}
.nxd-inline-cta p {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 14px;
    line-height: 1.8;
    margin: 0;
}
.nxd-inline-cta strong {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}
.nxd-inline-cta-btn {
    flex: none;
    font-size: 14px;
    color: var(--main);
    background: var(--gold);
    border-radius: 30px;
    padding: 11px 28px;
    transition: all 0.3s;
}
.nxd-inline-cta-btn:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

/* FAQ */
.nxd-faq-item {
    border-bottom: 1px solid var(--nx-line);
    padding: 14px 0;
}
.nxd-faq-item:last-child {
    border-bottom: 0;
}
.nxd-faq-q {
    font-size: 15px;
    font-weight: 500;
    color: #16233a;
    margin-bottom: 6px;
    position: relative;
    padding-left: 20px;
}
.nxd-faq-q::before {
    content: '问';
    position: absolute;
    left: 0;
    top: 2px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 11px;
    font-weight: 400;
    color: #fff;
    background: var(--main);
    border-radius: 3px;
}
.nxd-faq-a {
    font-size: 14px;
    line-height: 2;
    color: #55647d;
    padding-left: 20px;
}

/* 作者 / 标签 / 上下篇 */
.nxd-author {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: clamp(26px, 3vw, 36px);
    padding: clamp(16px, 1.6vw, 22px);
    background: #fafbfd;
    border: 1px solid var(--nx-line);
    border-radius: 10px;
}
.nxd-author-avatar {
    flex: none;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    background: #eef2f7;
}
.nxd-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nxd-author-info {
    flex: 1;
    min-width: 220px;
}
.nxd-author-name {
    font-size: 15px;
    color: #16233a;
    margin-bottom: 4px;
}
.nxd-author-desc {
    font-size: 13px;
    line-height: 1.8;
    color: #888;
}
.nxd-tags {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--nx-line);
}
.nxd-pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.nxd-pager a {
    display: block;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--nx-line);
    border-radius: 10px;
    transition: all 0.3s;
}
.nxd-pager a:hover {
    border-color: var(--main);
    box-shadow: 0 10px 22px rgba(13, 44, 82, 0.08);
}
.nxd-pager-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}
.nxd-pager-title {
    display: block;
    font-size: 14px;
    color: #16233a;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nxd-pager .is-empty {
    opacity: 0.6;
    pointer-events: none;
}

/* 相关阅读 */
.nxd-related {
    margin-top: clamp(26px, 3vw, 40px);
}
.nxd-related-title {
    font-size: clamp(17px, 1.6vw, 22px);
    font-weight: 500;
    color: #16233a;
    margin-bottom: 16px;
    font-family: 'SourceHanSansSC Medium', "Microsoft Yahei", sans-serif;
}
.nxd-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.nxd-related-card {
    background: #fff;
    border: 1px solid var(--nx-line);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.nxd-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(13, 44, 82, 0.1);
}
.nxd-related-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.nxd-related-body {
    padding: 14px 16px 18px;
}
.nxd-related-date {
    font-size: 12px;
    color: #999;
}
.nxd-related-name {
    font-size: 14px;
    line-height: 1.7;
    color: #16233a;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nxd-related-card:hover .nxd-related-name {
    color: var(--main);
}

/* 侧栏 */
.nxd-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 24px;
}
.nxd-toc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nxd-toc-list a {
    display: block;
    font-size: 13px;
    line-height: 1.7;
    color: #66748c;
    padding: 7px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.3s;
}
.nxd-toc-list a:hover {
    color: var(--main);
}
.nxd-toc-list a.active {
    color: var(--main);
    background: #f2f7ff;
    border-left-color: var(--main);
}
.nxd-utils {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.nxd-util-btn {
    flex: 1;
    font: inherit;
    font-size: 13px;
    color: #66748c;
    background: #f4f6fa;
    border: 0;
    border-radius: 6px;
    padding: 9px 0;
    cursor: pointer;
    transition: all 0.3s;
}
.nxd-util-btn:hover {
    background: var(--main);
    color: #fff;
}
.nxd-copy-tip {
    font-size: 12px;
    color: var(--main);
    margin-top: 8px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .nxd-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .nxd-side {
        position: static;
    }
    .nxd-toc-widget {
        display: none;
    }
}
@media (max-width: 900px) {
    .nxd-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    /* 小屏正文卡片较窄，2:1 的头图仍偏高（375px 屏约 150px，占首屏近 1/4）。
       这里按视口定高并封顶 220px，多余部分由 object-fit:cover 裁掉 */
    .nxd-cover img {
        height: clamp(120px, 33vw, 220px);
    }
}
@media (max-width: 600px) {
    .nxd-related-grid,
    .nxd-pager {
        grid-template-columns: minmax(0, 1fr);
    }
    .nxd-inline-cta {
        flex-direction: column;
        align-items: flex-start;
    }
}
