/* ===== CMS 页面基础样式 ===== */
.cms-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 60px;
}

/* ===== 面包屑 ===== */
.cms-breadcrumb {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 24px;
    line-height: 1.8;
}

.cms-breadcrumb a {
    color: #3B82F6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cms-breadcrumb a:hover {
    color: #1E3A8A;
    text-decoration: underline;
}

/* ===== 分类区域 ===== */
.cms-category h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 16px;
    line-height: 1.3;
}

.cms-category-cover {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.cms-category-desc {
    font-size: 15px;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 36px;
    padding: 16px 20px;
    background: #F8FAFC;
    border-radius: 8px;
    border-left: 3px solid #3B82F6;
}

/* ===== 子分类 ===== */
.cms-subcategories {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.cms-subcategories li {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 18px 20px;
    transition: all 0.25s ease;
}

.cms-subcategories li:hover {
    border-color: #3B82F6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}

.cms-subcategories a {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
}

.cms-subcategories li:hover a {
    color: #3B82F6;
}

.cms-subcategories p {
    font-size: 13px;
    color: #64748B;
    line-height: 1.6;
    margin: 0;
}

/* ===== 文章卡片网格（核心：一行3个） ===== */
.cms-article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

/* ===== 文章卡片 ===== */
.cms-article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #E2E8F0;
}

.cms-article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(30, 58, 138, 0.12);
    border-color: #3B82F6;
}

/* ===== 16:9 缩略图区域 ===== */
.cms-card-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 = 9/16 = 0.5625 */
    overflow: hidden;
    background: #F1F5F9;
}

.cms-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cms-article-card:hover .cms-card-thumb img {
    transform: scale(1.06);
}

.cms-card-thumb-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 48px;
}

/* ===== 卡片内容区 ===== */
.cms-card-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.cms-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #1E293B;
    line-height: 1.5;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.cms-article-card:hover .cms-card-title {
    color: #3B82F6;
}

.cms-card-desc {
    font-size: 14px;
    color: #64748B;
    line-height: 1.7;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.cms-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #94A3B8;
    padding-top: 14px;
    border-top: 1px solid #F1F5F9;
    margin-top: auto;
}

.cms-card-meta i {
    font-size: 12px;
}

/* ===== 空状态 ===== */
.cms-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed #CBD5E1;
    margin-bottom: 40px;
}

.cms-empty-state i {
    font-size: 56px;
    color: #CBD5E1;
    margin-bottom: 20px;
    display: block;
}

.cms-empty-state p {
    font-size: 15px;
    color: #94A3B8;
    margin: 0;
}

/* ===== 分页 ===== */
.cms-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cms-pagination a {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #E2E8F0;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cms-pagination a:hover {
    border-color: #3B82F6;
    color: #3B82F6;
}

.cms-pagination a.is-current {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* ===== 文章详情页 ===== */
.cms-article {
    background: #fff;
    border-radius: 12px;
    padding: 40px 56px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #E2E8F0;
}

.cms-article h1 {
    font-size: 30px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 16px;
    line-height: 1.35;
}

.cms-article .cms-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #94A3B8;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F1F5F9;
}

.cms-article .cms-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cms-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 28px;
}

.cms-geo-summary {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-left: 4px solid #3B82F6;
    padding: 18px 22px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.8;
    color: #1E40AF;
}

.cms-geo-summary strong {
    color: #1E3A8A;
    margin-right: 6px;
}

/* ===== 目录 ===== */
.cms-toc {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}

.cms-toc strong {
    display: block;
    font-size: 15px;
    color: #1E293B;
    margin-bottom: 12px;
}

.cms-toc ol {
    margin: 0;
    padding-left: 20px;
}

.cms-toc li {
    margin: 6px 0;
}

.cms-toc a {
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
    transition: color 0.2s ease;
}

.cms-toc a:hover {
    color: #3B82F6;
}

.toc-level-3 {
    padding-left: 16px;
    font-size: 13px;
}

/* ===== 正文内容 ===== */
.cms-content {
    font-size: 16px;
    line-height: 1.9;
    color: #334155;
}

.cms-content p {
    margin-bottom: 18px;
}

.cms-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1E293B;
    margin: 36px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E2E8F0;
}

.cms-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1E293B;
    margin: 28px 0 12px;
}

.cms-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin: 20px 0 10px;
}

.cms-content ul,
.cms-content ol {
    margin-bottom: 18px;
    padding-left: 26px;
}

.cms-content li {
    margin: 6px 0;
    line-height: 1.8;
}

.cms-content a {
    color: #3B82F6;
    text-decoration: none;
    border-bottom: 1px solid #BFDBFE;
    transition: all 0.2s ease;
}

.cms-content a:hover {
    color: #1E40AF;
    border-bottom-color: #1E40AF;
}

.cms-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cms-content blockquote {
    background: #F8FAFC;
    border-left: 4px solid #94A3B8;
    padding: 14px 20px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    color: #475569;
    font-style: italic;
}

.cms-content pre {
    background: #1E293B;
    color: #E2E8F0;
    padding: 18px 22px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.7;
    margin: 20px 0;
}

.cms-content code {
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #DB2777;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.cms-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.cms-content hr {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 36px 0;
}

.cms-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.cms-content th,
.cms-content td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #E2E8F0;
}

.cms-content th {
    background: #F8FAFC;
    font-weight: 600;
    color: #1E293B;
}

.cms-content strong {
    color: #1E293B;
    font-weight: 600;
}

/* ===== FAQ ===== */
.cms-faq {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid #F1F5F9;
}

.cms-faq h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 20px;
}

.cms-faq-item {
    background: #F8FAFC;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 14px;
    border: 1px solid #E2E8F0;
    transition: border-color 0.2s ease;
}

.cms-faq-item:hover {
    border-color: #3B82F6;
}

.cms-faq-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cms-faq-item h3::before {
    content: 'Q';
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cms-faq-item p {
    font-size: 15px;
    color: #475569;
    line-height: 1.8;
    margin: 0;
    padding-left: 34px;
}

/* ===== 相关文章 ===== */
.cms-related {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid #F1F5F9;
}

.cms-related h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 20px;
}

.cms-related ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.cms-related li {
    padding: 12px 18px;
    background: #F8FAFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    transition: all 0.2s ease;
}

.cms-related li:hover {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.cms-related a {
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
    display: block;
    transition: color 0.2s ease;
}

.cms-related li:hover a {
    color: #3B82F6;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .cms-article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .cms-article {
        padding: 32px 36px;
    }
}

@media (max-width: 768px) {
    .cms-page {
        padding: 16px 14px 40px;
    }

    .cms-breadcrumb {
        font-size: 13px;
        margin-bottom: 16px;
        line-height: 1.7;
    }

    .cms-category h1 {
        font-size: 22px;
    }

    .cms-category-desc {
        font-size: 14px;
        padding: 14px 16px;
        margin-bottom: 28px;
    }

    .cms-article-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cms-card-body {
        padding: 14px 16px 16px;
    }

    .cms-card-title {
        font-size: 16px;
    }

    .cms-card-desc {
        font-size: 14px;
    }

    /* ===== 文章详情：移动端整体优化 ===== */
    .cms-article {
        padding: 20px 16px 28px;
        border-radius: 12px;
        border-width: 0;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    }

    .cms-article h1 {
        font-size: 22px;
        line-height: 1.45;
        margin-bottom: 14px;
        letter-spacing: 0.01em;
    }

    .cms-article .cms-meta {
        gap: 10px 16px;
        font-size: 12.5px;
        flex-direction: row;
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .cms-cover {
        max-height: 300px;
        border-radius: 8px;
        margin-bottom: 20px;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    }

    .cms-geo-summary {
        padding: 14px 16px;
        font-size: 14.5px;
        line-height: 1.75;
        margin-bottom: 22px;
        border-left-width: 3px;
    }

    /* ===== 正文排版 ===== */
    .cms-content {
        font-size: 15px;
        line-height: 1.75;
        color: #1F2937;
        word-break: break-word;
        -webkit-font-smoothing: antialiased;
    }

    .cms-content p {
        margin-bottom: 14px;
        text-align: justify;
    }

    .cms-content p:empty {
        display: none;
    }

    .cms-content h2 {
        font-size: 18px;
        line-height: 1.45;
        margin: 24px 0 12px;
        padding: 10px 12px;
        border: 0;
        background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 100%);
        border-left: 3px solid #3B82F6;
        border-radius: 6px;
        position: relative;
    }

    .cms-content h3 {
        font-size: 16.5px;
        line-height: 1.5;
        margin: 20px 0 10px;
        color: #0F172A;
        padding-left: 10px;
        border-left: 3px solid #93C5FD;
    }

    .cms-content h4 {
        font-size: 15.5px;
        line-height: 1.55;
        margin: 16px 0 8px;
        color: #1E293B;
    }

    .cms-content ul,
    .cms-content ol {
        margin-bottom: 14px;
        padding-left: 20px;
    }

    .cms-content li {
        margin: 5px 0;
        line-height: 1.75;
        font-size: 15px;
    }

    .cms-content a {
        word-break: break-all;
    }

    .cms-content img {
        border-radius: 8px;
        margin: 16px auto;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10);
        width: 100%;
    }

    .cms-content blockquote {
        padding: 12px 14px;
        margin: 14px 0;
        font-size: 14.5px;
        line-height: 1.75;
    }

    .cms-content pre {
        padding: 12px 14px;
        font-size: 12.5px;
        line-height: 1.6;
        margin: 14px 0;
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .cms-content code {
        font-size: 12.5px;
    }

    .cms-content hr {
        margin: 22px 0;
    }

    .cms-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12.5px;
        margin: 14px 0;
        border-spacing: 0;
        white-space: nowrap;
    }

    .cms-content th,
    .cms-content td {
        padding: 8px 10px;
    }

    .cms-content strong {
        color: #0F172A;
        font-weight: 700;
    }

    .cms-subcategories {
        grid-template-columns: 1fr;
    }

    .cms-toc {
        padding: 12px 14px;
        margin-bottom: 18px;
    }

    .cms-toc strong {
        font-size: 13.5px;
        margin-bottom: 8px;
    }

    .cms-toc ol {
        padding-left: 18px;
    }

    .cms-toc li {
        margin: 4px 0;
    }

    .cms-toc a {
        font-size: 13px;
        line-height: 1.6;
    }

    .toc-level-3 {
        padding-left: 12px;
        font-size: 12px;
    }

    /* ===== FAQ 移动端 ===== */
    .cms-faq {
        margin-top: 28px;
        padding-top: 20px;
    }

    .cms-faq h2 {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .cms-faq-item {
        padding: 12px 12px 12px 10px;
        border-radius: 10px;
    }

    .cms-faq-item h3 {
        font-size: 14.5px;
        line-height: 1.5;
        margin-bottom: 6px;
        gap: 8px;
    }

    .cms-faq-item h3::before {
        width: 22px;
        height: 22px;
        font-size: 11.5px;
        border-radius: 5px;
        margin-top: 2px;
    }

    .cms-faq-item p {
        font-size: 14px;
        line-height: 1.75;
        padding-left: 30px;
    }

    /* ===== 相关文章 移动端 ===== */
    .cms-related {
        margin-top: 28px;
        padding-top: 20px;
    }

    .cms-related h2 {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .cms-related ul {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cms-related li {
        padding: 10px 12px;
    }

    .cms-related a {
        font-size: 13.5px;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .cms-article {
        padding: 14px 12px 20px;
        border-radius: 10px;
    }

    .cms-article h1 {
        font-size: 18px;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    .cms-article .cms-meta {
        gap: 6px 10px;
        font-size: 11.5px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .cms-cover {
        max-height: 240px;
        border-radius: 6px;
        margin-bottom: 16px;
    }

    .cms-geo-summary {
        font-size: 13px;
        line-height: 1.7;
        padding: 12px 14px;
        margin-bottom: 18px;
    }

    .cms-content {
        font-size: 14px;
        line-height: 1.75;
    }

    .cms-content p {
        margin-bottom: 12px;
    }

    .cms-content h2 {
        font-size: 17px;
        margin: 22px 0 10px;
        padding: 9px 11px;
        border-left-width: 3px;
    }

    .cms-content h3 {
        font-size: 16px;
    }

    .cms-content h4 {
        font-size: 15px;
    }

    .cms-content li {
        font-size: 14px;
        line-height: 1.7;
    }

    .cms-content img {
        border-radius: 6px;
        margin: 14px auto;
    }

    .cms-content blockquote {
        font-size: 13.5px;
    }

    .cms-content pre {
        font-size: 12px;
    }

    .cms-content code {
        font-size: 12px;
    }

    .cms-content table {
        font-size: 12px;
    }

    .cms-toc {
        padding: 10px 12px;
    }

    .cms-toc strong {
        font-size: 13px;
    }

    .cms-toc a {
        font-size: 12.5px;
        line-height: 1.55;
    }

    .toc-level-3 {
        font-size: 11.5px;
        padding-left: 10px;
    }

    .cms-faq h2,
    .cms-related h2 {
        font-size: 17px;
    }

    .cms-faq-item {
        padding: 10px 10px 10px 8px;
    }

    .cms-faq-item h3 {
        font-size: 14px;
    }

    .cms-faq-item p {
        font-size: 13.5px;
        line-height: 1.7;
        padding-left: 28px;
    }

    .cms-related a {
        font-size: 13px;
    }

    .cms-pagination a {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 12.5px;
    }
}

/* 防止 iOS 横竖屏切字号突然变大 */
@media screen and (max-width: 768px) {
    .cms-content,
    .cms-article h1,
    .cms-content h2,
    .cms-content h3,
    .cms-content p,
    .cms-content li {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}
