/**
 * Knowledge Article Styles
 * 知识库文章详情页样式
 * 用于所有知识中心文章页面
 */

/* ========================================
   Base Styles
======================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #334155;
    background: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.main {
    margin-top: 72px;
}

/* ========================================
   Article Hero Section
======================================== */
.article-hero {
    background: linear-gradient(135deg, #E8F2F8 0%, #f8fbff 60%, #fff 100%);
    padding: 80px 0 60px;
    color: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.article-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(44, 95, 141, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.article-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(44, 95, 141, 0.12) 20%, rgba(44, 95, 141, 0.12) 80%, transparent);
}

.article-hero .container {
    position: relative;
    z-index: 1;
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: #fff;
    border: 1px solid #2C5F8D;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: #2C5F8D;
    margin-bottom: 20px;
}

.category-badge i {
    font-size: 12px;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #2C5F8D;
}

.breadcrumb span {
    color: #94a3b8;
}

/* Article Title */
.article-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
    color: #1a1a1a;
}

.article-hero .subtitle {
    font-size: 1.15rem;
    color: #4a4a4a;
    margin-bottom: 24px;
    font-weight: 400;
}

/* Article Meta */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 14px;
    color: #64748b;
}

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

.article-meta i {
    font-size: 14px;
    color: #94a3b8;
}

/* ========================================
   Article Layout (Two Column)
======================================== */
.article-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    padding: 60px 0;
    max-width: 1100px;
    margin: 0 auto;
}

/* ========================================
   Article Content
======================================== */
.article-content {
    background: #fff;
    border-radius: 12px;
    padding: 0;
}

/* Headings */
.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.article-content h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin: 32px 0 16px;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
    margin: 24px 0 12px;
}

/* Paragraphs */
.article-content p {
    color: #475569;
    line-height: 1.85;
    margin-bottom: 16px;
}

/* Lists */
.article-content ul,
.article-content ol {
    margin: 16px 0 24px 0;
    padding-left: 0;
    list-style: none;
}

.article-content li {
    color: #475569;
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 28px;
    position: relative;
}

.article-content ul li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 50%;
}

.article-content ol {
    counter-reset: list-counter;
}

.article-content ol li {
    counter-increment: list-counter;
}

.article-content ol li::before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 4px;
    top: 0;
    color: #2563eb;
    font-weight: 600;
    font-size: 0.95em;
}

/* Text Styling */
.article-content strong {
    color: #1e293b;
    font-weight: 600;
}

.article-content em {
    font-style: italic;
    color: #64748b;
}

/* Blockquote */
.article-content blockquote {
    border-left: 4px solid #2563eb;
    background: linear-gradient(90deg, #f0f9ff, #fff);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
    font-style: normal;
}

.article-content blockquote p {
    color: #334155;
    margin: 0;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
.article-content code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", "Monaco", "Menlo", monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
}

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

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95em;
}

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

.article-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

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

/* Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.article-content figure {
    margin: 24px 0;
}

.article-content figcaption {
    text-align: center;
    color: #64748b;
    font-size: 0.9em;
    margin-top: 12px;
}

/* Links */
.article-content a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.article-content a:hover {
    border-bottom-color: #2563eb;
}

/* ========================================
   Article Sidebar
======================================== */
.article-sidebar {
    position: sticky;
    top: 96px;
    height: fit-content;
}

/* Sidebar Card */
.sidebar-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-card li {
    margin-bottom: 12px;
}

.sidebar-card li:last-child {
    margin-bottom: 0;
}

.sidebar-card li a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
    transition: color 0.2s;
}

.sidebar-card li a:hover {
    color: #2563eb;
}

.sidebar-card li a i {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
    flex-shrink: 0;
}

/* CTA Card */
.cta-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: 12px;
    padding: 28px 24px;
    color: #fff;
    text-align: center;
}

.cta-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    border: none;
    padding: 0;
    color: #fff;
}

.cta-card p {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 16px;
    line-height: 1.6;
}

.cta-card .btn {
    display: inline-block;
    background: #fff;
    color: #2563eb;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.cta-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tags Card */
.tags-card .tag {
    display: inline-block;
    background: #fff;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin: 0 6px 8px 0;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.tags-card .tag:hover {
    color: #2563eb;
    border-color: #2563eb;
}

/* ========================================
   Related Articles Section
======================================== */
.related-section {
    background: #f8fafc;
    padding: 80px 0;
}

.related-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 40px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.related-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.related-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.5;
}

.related-card h3 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.related-card h3 a:hover {
    color: #2563eb;
}

.related-card p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card .category-tag {
    display: inline-block;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

/* ========================================
   CTA Section
======================================== */
.cta-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 80px 0;
    text-align: center;
    color: #fff;
}

.cta-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 32px;
}

.cta-section .btn-primary {
    display: inline-block;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    color: #fff;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.cta-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

/* ========================================
   Footer
======================================== */
.footer {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    padding: 60px 0 0;
    color: #94a3b8;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.footer-slogan {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.7;
}

.footer-column-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-link {
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
}

.footer-link:hover {
    color: #fff;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}

.footer-contact-item i {
    color: #4a90c8;
    width: 16px;
}

.footer-bottom {
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.footer-bottom p {
    margin: 0 0 8px;
}

.footer-bottom a {
    color: #64748b;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: #94a3b8;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1024px) {
    .article-wrapper {
        grid-template-columns: 1fr;
        padding: 40px 24px;
    }

    .article-sidebar {
        display: none;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .main {
        margin-top: 60px;
    }

    .article-hero {
        padding: 60px 0 40px;
    }

    .article-hero h1 {
        font-size: 1.75rem;
    }

    .article-hero .subtitle {
        font-size: 1rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 12px;
    }

    .article-wrapper {
        padding: 32px 20px;
    }

    .article-content h2 {
        font-size: 1.35rem;
        margin: 32px 0 16px;
    }

    .article-content h3 {
        font-size: 1.15rem;
        margin: 24px 0 12px;
    }

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

    .related-section {
        padding: 60px 0;
    }

    .related-section h2 {
        font-size: 1.5rem;
        margin-bottom: 32px;
    }

    .cta-section {
        padding: 60px 0;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }

    .cta-section p {
        font-size: 1rem;
    }

    .cta-section .btn-primary {
        padding: 14px 32px;
        font-size: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .footer-contact-item {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .article-hero h1 {
        font-size: 1.5rem;
    }

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

    .related-card {
        padding: 20px;
    }
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .article-hero {
        background: #E8F2F8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .article-sidebar,
    .related-section,
    .cta-section,
    .footer,
    #navbar-container {
        display: none !important;
    }

    .article-wrapper {
        grid-template-columns: 1fr;
        padding: 20px 0;
    }

    .article-content {
        max-width: 100%;
    }

    .article-content a {
        color: #2563eb;
    }

    .article-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #64748b;
    }
}

/* ========================================
   Accessibility
======================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2563eb;
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}
