/* ============================================================
   COSMO 新闻资讯与知识库视觉规范样式表 (knowledge.css)
   适用于：新闻列表/详情 (news-*.php) 与 知识库列表/详情 (knowledge-*.php)
   与全站（首页、产品中心、服务支持）保持统一的视觉系统与科技质感
   ============================================================ */

/* ------------------------------------------------------------
   0. 统一内页横幅 (Inner Page Hero)
   ------------------------------------------------------------ */
.inner-page-hero {
    height: 40vh !important;
    min-height: 270px !important;
    max-height: 380px !important;
    position: relative !important;
}

.inner-page-hero .overlay-color {
    background: linear-gradient(135deg, rgba(8, 24, 46, 0.86) 0%, rgba(9, 44, 82, 0.75) 100%) !important;
    opacity: 1 !important;
}

.inner-page-hero .hero-text-area .hero-title {
    font-size: clamp(2rem, 3.8vw, 3rem) !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    letter-spacing: 0.02em !important;
    line-height: 1.25 !important;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    margin-bottom: 12px !important;
}

.inner-page-hero .hero-text-area .breadcrumb {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.inner-page-hero .hero-text-area .breadcrumb-item {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font-weight: 500 !important;
}

.inner-page-hero .hero-text-area .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.45) !important;
    padding-right: 6px !important;
}

.inner-page-hero .hero-text-area .breadcrumb-link {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.inner-page-hero .hero-text-area .breadcrumb-link:hover {
    color: #38bdf8 !important;
}

.inner-page-hero .hero-text-area .breadcrumb-item.active {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.kb-page {
    --kb-ink: #0f172a;
    --kb-steel: #64748b;
    --kb-paper: #ffffff;
    --kb-mist: #f8fafc;
    --kb-line: #e2e8f0;
    --kb-accent: #08adef;
    --kb-deep: #0284c7;
    background: #f8fafc !important;
}

.kb-page .kb-layout {
    padding-top: 2.5rem;
    padding-bottom: 4.5rem;
}

/* ------------------------------------------------------------
   1. 搜索框 (Search Bar)
   ------------------------------------------------------------ */
.kb-search {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--kb-paper);
    border: 1px solid var(--kb-line);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
}

.kb-search input {
    flex: 1;
    border: 1px solid var(--kb-line);
    box-shadow: none;
    height: 44px;
    padding: 0 16px;
    font-size: 14.5px;
    color: var(--kb-ink);
    background: #f1f5f9;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.kb-search input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--kb-accent);
    box-shadow: 0 0 0 3px rgba(8, 173, 239, 0.15);
}

.kb-search .btn {
    height: 44px;
    padding: 0 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.kb-search .btn-primary {
    background: linear-gradient(135deg, #08adef 0%, #0284c7 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(8, 173, 239, 0.3);
}

.kb-search .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(8, 173, 239, 0.45);
}

.kb-search .btn-outline-secondary {
    border: 1px solid var(--kb-line);
    color: var(--kb-steel);
    background: #ffffff;
}

.kb-search .btn-outline-secondary:hover {
    background: #f1f5f9;
    color: var(--kb-ink);
}

/* ------------------------------------------------------------
   2. 列表项卡片 (Article List Card)
   ------------------------------------------------------------ */
.kb-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-item {
    display: block;
    background: var(--kb-paper);
    border: 1px solid var(--kb-line);
    border-radius: 16px;
    padding: 24px 26px;
    margin-bottom: 18px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.kb-item:hover {
    border-color: #7dd3fc;
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(8, 173, 239, 0.12);
}

.kb-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.kb-item-title {
    margin: 0;
    font-size: 18.5px;
    line-height: 1.45;
    font-weight: 800;
}

.kb-item-title a {
    color: var(--kb-ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

.kb-item-title a:hover {
    color: var(--kb-accent);
}

.kb-doc-mark {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    border: 1px solid #bae6fd;
}

.kb-item-summary {
    margin: 0 0 14px;
    color: var(--kb-steel);
    font-size: 14px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-item-meta,
.kb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    color: #94a3b8;
    font-size: 13px;
    align-items: center;
}

.kb-item-meta span,
.kb-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kb-item-meta a,
.kb-meta a {
    color: #0369a1;
    background: #e0f2fe;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.kb-item-meta a:hover,
.kb-meta a:hover {
    background: var(--kb-accent);
    color: #ffffff;
}

.kb-empty {
    background: var(--kb-paper);
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 56px 24px;
    text-align: center;
    color: var(--kb-steel);
}

.kb-empty h4 {
    color: var(--kb-ink);
    font-weight: 800;
    margin-bottom: 8px;
}

/* ------------------------------------------------------------
   3. 侧边栏卡片 (Sidebar Cards)
   ------------------------------------------------------------ */
.kb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kb-side-card {
    background: var(--kb-paper);
    border: 1px solid var(--kb-line);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.kb-side-title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    font-size: 16.5px;
    font-weight: 800;
    color: var(--kb-ink);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-side-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--kb-accent);
    border-radius: 2px;
}

.kb-cat-list,
.kb-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.kb-cat-list a em {
    font-style: normal;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.kb-cat-list a:hover,
.kb-cat-list li.is-active a {
    background: #e0f2fe;
    color: #0284c7;
}

.kb-cat-list a:hover em,
.kb-cat-list li.is-active a em {
    background: var(--kb-accent);
    color: #ffffff;
}

.kb-recent-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.kb-recent-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.kb-recent-list a {
    display: block;
    color: var(--kb-ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.kb-recent-list a:hover,
.kb-recent-list a.is-current {
    color: var(--kb-accent);
}

.kb-recent-list time {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

/* ------------------------------------------------------------
   4. 文章详情页 (Article Detail Page)
   ------------------------------------------------------------ */
.kb-article {
    background: var(--kb-paper);
    border: 1px solid var(--kb-line);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    padding: 40px 42px 36px;
    margin-bottom: 28px;
}

.kb-article-title {
    margin: 0 0 18px;
    color: var(--kb-ink);
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.kb-article-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 0 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--kb-line);
    background: transparent;
    flex-wrap: wrap;
}

/* 分享按钮组 */
.kb-share {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-share span {
    font-size: 13.5px;
    color: #64748b;
    font-weight: 600;
}

.kb-share-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 15px;
    transition: all .25s ease;
    border: 1px solid var(--kb-line);
}

.kb-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.kb-share-btn:hover .fa-weixin {
    color: #07c160;
}

.kb-share-btn:hover .fa-weibo {
    color: #e6162d;
}

.kb-share-btn:hover .fa-qq {
    color: #12b7f5;
}

/* 导语摘要区 */
.kb-summary {
    background: #f0f9ff;
    border-left: 4px solid var(--kb-accent);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 28px;
}

.kb-summary p {
    margin: 0;
    color: #334155;
    line-height: 1.8;
    font-size: 14.5px;
}

.kb-featured {
    margin: 0 0 26px;
}

.kb-featured img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

/* 正文排版 */
.kb-content {
    line-height: 1.9;
    font-size: 15.5px;
    color: #334155;
    word-break: break-word;
}

.kb-content h1,
.kb-content h2,
.kb-content h3,
.kb-content h4,
.kb-content h5,
.kb-content h6 {
    font-weight: 800;
    color: var(--kb-ink);
    line-height: 1.4;
}

.kb-content h1 { font-size: 1.75em; margin: 1.6em 0 0.8em; }
.kb-content h2 { 
    font-size: 1.45em; 
    margin: 1.8em 0 0.8em;
    padding-left: 12px;
    border-left: 4px solid var(--kb-accent);
}
.kb-content h3 { font-size: 1.25em; margin: 1.5em 0 0.7em; }

.kb-content p { 
    margin-bottom: 20px; 
}

.kb-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.kb-content ul,
.kb-content ol {
    padding-left: 2em;
    margin-bottom: 20px;
}

.kb-content li { 
    margin-bottom: 8px; 
}

.kb-content blockquote {
    border-left: 4px solid var(--kb-accent);
    padding: 14px 20px;
    margin: 22px 0;
    background: #f0f9ff;
    color: #334155;
    border-radius: 0 10px 10px 0;
}

.kb-content a {
    color: var(--kb-accent);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.kb-content a:hover {
    color: var(--kb-deep);
}

.kb-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--kb-line);
}

.kb-content th,
.kb-content td {
    border: 1px solid var(--kb-line);
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
}

.kb-content th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--kb-ink);
}

.kb-content tr:hover td {
    background: #f8fafc;
}

.kb-content .ql-align-center { text-align: center; }
.kb-content .ql-align-right { text-align: right; }
.kb-content .ql-align-justify { text-align: justify; }
.kb-content .ql-indent-1 { padding-left: 3em; }
.kb-content .ql-indent-2 { padding-left: 6em; }
.kb-content .ql-indent-3 { padding-left: 9em; }

/* 底部标签 */
.kb-tags {
    padding-top: 22px;
    border-top: 1px solid var(--kb-line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.kb-tag {
    display: inline-block;
    padding: 4px 14px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid #bae6fd;
    transition: all 0.2s ease;
}

.kb-tag:hover {
    background: var(--kb-accent);
    color: #ffffff;
    border-color: var(--kb-accent);
}

/* 上下篇翻页 */
.kb-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    margin-top: 16px;
    border-top: 1px solid var(--kb-line);
}

.kb-pager a {
    color: var(--kb-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.kb-pager a:hover {
    color: var(--kb-accent);
}

.kb-back {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--kb-line);
}

/* ------------------------------------------------------------
   5. PDF 嵌入与预览
   ------------------------------------------------------------ */
.ql-pdf-embed,
.ql-pdf-embed__inner,
.ql-pdf-preview {
    width: 100%;
}

.ql-pdf-embed {
    margin: 16px 0 32px;
    user-select: none;
    -webkit-user-select: none;
}

.ql-pdf-preview__status {
    padding: 20px;
    border: 1px dashed var(--kb-line);
    border-radius: 12px;
    background: var(--kb-mist);
    color: var(--kb-steel);
    text-align: center;
}

.ql-pdf-preview__pages {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ql-pdf-preview__page {
    background: #ffffff;
    border: 1px solid var(--kb-line);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    padding: 10px;
}

.ql-pdf-preview__page canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    pointer-events: none;
}

.ql-pdf-embed iframe,
.ql-pdf-embed embed,
.ql-pdf-embed object,
.ql-pdf-embed__actions {
    display: none !important;
}

@media print {
    .ql-pdf-embed,
    .ql-pdf-preview {
        display: none !important;
    }
}

/* ------------------------------------------------------------
   6. 响应式微调
   ------------------------------------------------------------ */
@media (max-width: 991px) {
    .kb-page .kb-sidebar {
        margin-top: 28px;
    }
}

@media (max-width: 768px) {
    .kb-article {
        padding: 24px 20px;
    }

    .kb-article-title {
        font-size: 1.6rem;
    }

    .kb-article-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .kb-search {
        flex-wrap: wrap;
    }

    .kb-search .btn {
        width: 100%;
    }

    .kb-item {
        padding: 20px 18px;
    }

    .kb-item-title {
        font-size: 17px;
    }

    .kb-item-head {
        flex-direction: column;
        gap: 8px;
    }

    .kb-content {
        font-size: 15px;
    }

    .kb-pager {
        flex-direction: column;
        gap: 12px;
    }
}
