/* ============================================================
   非研科技官网 · 内容页样式  content.css
   覆盖：栏目列表页（新闻 / 技术文章）、文章详情页、分页
   复用站点既有的 CSS 变量，随主题自动适配
   ============================================================ */

/* ------------------------------------------------------------
   1. 栏目页两栏布局
   ------------------------------------------------------------ */

.page-layout {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: var(--container, 1280px);
    margin: 0 auto;
    padding: 40px 30px;
}

/* 站点的 .clear 自带 width:100%，放进 flex 容器会抢占主轴空间，
   这里统一让它退出弹性布局 */
.page-layout .clear,
.zhengwen .clear {
    display: none;
}

.page-layout .subNavBox {
    flex: none;
    width: 260px;
}

.page-layout .cp_content {
    margin-left: 24px;
}

/* ------------------------------------------------------------
   2. 栏目标题下的导语
   ------------------------------------------------------------ */

.article-intro {
    margin: -8px 0 26px;
    padding: 0 !important;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-mute);
}

.empty-tip {
    padding: 60px 0;
    text-align: center;
    color: var(--text-mute);
    font-size: 14px;
}

/* ------------------------------------------------------------
   3. 新闻资讯列表
   ------------------------------------------------------------ */

.news-list {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-list > li {
    display: grid;
    grid-template-columns: 92px 1fr auto;
    align-items: baseline;
    gap: 6px 16px;
    padding: 20px 14px;
    margin: 0;
    border-bottom: 1px dashed var(--border-soft, var(--border));
    border-radius: var(--radius-sm, 6px);
    transition: background-color .3s var(--mz-ease, ease);
}

.news-list > li:hover {
    background: var(--bg-alt, rgba(11, 123, 228, .04));
}

.news-list > li:last-child {
    border-bottom: 0;
}

.news-list .news-date {
    font-family: var(--font-en, inherit);
    font-size: 13px;
    color: var(--text-mute);
    font-variant-numeric: tabular-nums;
    letter-spacing: .3px;
}

.news-list .news-title {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text);
    text-decoration: none;
    transition: color .25s ease;
}

.news-list .news-title:hover {
    color: var(--primary);
}

.news-list .news-cat {
    justify-self: end;
    font-size: 12px;
    line-height: 1;
    padding: 5px 11px;
    border-radius: 20px;
    background: rgba(11, 123, 228, .09);
    color: var(--primary);
    white-space: nowrap;
}

.news-list .news-desc {
    grid-column: 2 / 4;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-soft);
}

/* ------------------------------------------------------------
   4. 技术文章卡片网格
   ------------------------------------------------------------ */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    gap: 22px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

.article-card .card-media {
    aspect-ratio: 16 / 9;
    width: 100%;
    background: linear-gradient(135deg, #0a1a3a 0%, #0b4c9e 60%, #0b7be4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-card .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card .card-media--text span {
    color: rgba(255, 255, 255, .92);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0 18px;
    text-align: center;
}

.article-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 18px 20px 20px;
    flex: 1;
}

.article-card .card-body h3 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.55;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .25s ease;
}

.article-card:hover .card-body h3 {
    color: var(--primary);
}

.article-card .card-body p {
    margin: 0;
    padding: 0 !important;
    font-size: 13.5px;
    line-height: 1.72;
    color: var(--text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    font-size: 12px;
    color: var(--text-mute);
}

.article-card .card-meta .tag {
    padding: 3px 9px;
    border-radius: 4px;
    background: rgba(11, 123, 228, .08);
    color: var(--primary);
}

/* ------------------------------------------------------------
   5. 分页
   ------------------------------------------------------------ */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
}

.pager a,
.pager .current {
    display: inline-block;
    min-width: 38px;
    padding: 8px 13px;
    text-align: center;
    font-size: 13.5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    color: var(--text);
    text-decoration: none;
    transition: all .25s ease;
}

.pager a:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.pager .current {
    background: var(--grad, var(--primary));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

/* ------------------------------------------------------------
   6. 文章详情
   ------------------------------------------------------------ */

.article-page {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    float: none;
    display: block;
}

.article-page .post-meta {
    padding: 0 0 14px !important;
    border-bottom: 1px dashed var(--border);
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--text-mute);
}

.article-page .post-meta a {
    color: var(--primary);
}

.post-cover {
    margin: 24px 0 8px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.post-body {
    font-size: 15px;
    line-height: 1.95;
    color: var(--text-soft);
    word-break: break-word;
}

.post-body > p {
    padding: 0 !important;
    margin: 16px 0 0;
    font-size: 15px !important;
    line-height: 1.95;
    text-indent: 2em;
    color: var(--text-soft);
}

.post-body h3 {
    margin: 30px 0 12px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text);
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

.post-body h4 {
    margin: 22px 0 10px;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text);
}

.post-body ul,
.post-body ol {
    margin: 14px 0 0;
    padding-left: 1.6em;
}

.post-body li {
    margin: 6px 0;
    line-height: 1.9;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm, 8px);
    margin: 16px 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 13.5px;
}

.post-body th,
.post-body td {
    border: 1px solid var(--border);
    padding: 9px 12px;
    text-align: left;
    line-height: 1.7;
}

.post-body th {
    background: var(--bg-alt, #f5f8fc);
    font-weight: 700;
    color: var(--text);
}

.post-body blockquote {
    margin: 18px 0;
    padding: 12px 18px;
    border-left: 4px solid var(--primary);
    background: var(--bg-alt, #f5f8fc);
    color: var(--text-soft);
    border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
}

.post-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.post-tags .tag {
    font-size: 12.5px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(11, 123, 228, .08);
    color: var(--primary);
}

.post-nav {
    margin-top: 22px;
    padding: 16px 18px;
    background: var(--bg-alt, #f5f7f9);
    border-radius: var(--radius-sm, 6px);
    font-size: 13.5px;
    line-height: 2;
}

.post-nav-row {
    display: flex;
    gap: 8px;
}

.post-nav-row strong {
    flex: none;
    color: var(--text);
    font-weight: 600;
}

.post-nav-row a {
    color: var(--primary);
    text-decoration: none;
}

.post-nav-row a:hover {
    text-decoration: underline;
}

.post-cta {
    margin-top: 24px;
    padding: 18px;
    background: #fff8e1;
    border-left: 4px solid #ff9800;
    font-size: 14px;
    line-height: 2;
    border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
}

.post-cta strong {
    color: #b26a00;
}

.post-cta a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.post-back {
    margin-top: 20px;
    font-size: 13.5px;
}

.post-back a {
    color: var(--primary);
    text-decoration: none;
}

/* ------------------------------------------------------------
   7. 移动端
   ------------------------------------------------------------ */

@media (max-width: 900px) {

    .page-layout {
        flex-direction: column;
        padding: 22px 16px;
    }

    .page-layout .subNavBox {
        width: 100%;
        margin-bottom: 18px;
    }

    .page-layout .cp_content {
        margin-left: 0;
        padding: 24px 18px;
    }

    .news-list > li {
        grid-template-columns: 1fr auto;
        gap: 6px 10px;
        padding: 16px 8px;
    }

    .news-list .news-date {
        grid-column: 1 / 3;
    }

    .news-list .news-desc {
        grid-column: 1 / 3;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .article-page {
        padding: 24px 16px;
    }

    .post-nav-row {
        flex-direction: column;
        gap: 0;
    }
}
