/**
 * 博客文章详情页样式
 * 包含：文章头部、内容排版、标签、分享、相关文章、CTA等样式
 */

/* 文章页面基础样式 */
.article-page {
    font-family: 'Noto Serif SC', Georgia, serif;
    background: #FAFAFA;
}

/* 文章头部 */
.article-header {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 1.5rem 3rem;
    text-align: center;
}

.article-category {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.article-category:hover {
    opacity: 0.7;
}

.article-category::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

.article-category:hover::after {
    width: 100%;
}

.article-title {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.4;
    color: #0A0A0A;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    color: #6B6B6B;
    font-size: 0.9rem;
}

.article-meta-separator {
    width: 4px;
    height: 4px;
    background: #D1D5DB;
    border-radius: 50%;
}

/* 封面图 */
.article-hero-image {
    max-width: 1000px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

.article-hero-image img {
    width: 100%;
    aspect-ratio: 21/9;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

/* 文章内容区域 */
.article-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem 6rem;
}

/* 编辑风格排版 */
.article-content {
    font-size: 1.15rem;
    line-height: 1.85;
    color: #374151;
}

.article-content > * {
    margin-bottom: 1.75rem;
}

/* 首字下沉效果 */
.article-content > p:first-of-type::first-letter {
    font-family: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
    float: left;
    font-size: 4rem;
    line-height: 0.8;
    padding-right: 0.75rem;
    padding-top: 0.25rem;
    color: #2563EB;
    font-weight: 700;
}

/* 标题样式 */
.article-content h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: #0A0A0A;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.article-content h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #0A0A0A;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.article-content h4 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0A0A0A;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* 段落 */
.article-content p {
    margin-bottom: 1.85rem;
}

.article-content strong {
    color: #0A0A0A;
    font-weight: 600;
}

/* 高亮引用 */
.article-content blockquote {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: #2563EB;
    line-height: 1.65;
    padding: 2rem 2.25rem;
    margin: 3rem 0;
    border-left: 4px solid #2563EB;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
    border-radius: 0 16px 16px 0;
}

/* 列表 */
.article-content ul,
.article-content ol {
    padding-left: 1.75rem;
    margin-bottom: 2rem;
}

.article-content li {
    margin-bottom: 0.85rem;
    position: relative;
    line-height: 1.75;
}

.article-content ul li::marker {
    color: #2563EB;
}

/* 链接 */
.article-content a {
    color: #2563EB;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: #1D4ED8;
}

/* 图片 */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5rem 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.article-content figure {
    margin: 2rem 0;
}

.article-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6B6B6B;
    margin-top: 0.75rem;
}

/* wangEditor 图片对齐样式 */
.article-content img.align-left,
.article-content .w-e-left img {
    float: left;
    margin-right: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.article-content img.align-center,
.article-content .w-e-center img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-content img.align-right,
.article-content .w-e-right img {
    float: right;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* wangEditor figure元素对齐样式 */
.article-content figure[data-align="left"],
.article-content figure.w-e-left {
    text-align: left;
}

.article-content figure[data-align="center"],
.article-content figure.w-e-center {
    text-align: center;
}

.article-content figure[data-align="right"],
.article-content figure.w-e-right {
    text-align: right;
}

.article-content figure[data-align="center"] img,
.article-content figure.w-e-center img {
    display: inline-block;
}

/* wangEditor 文本对齐样式 */
.article-content .w-e-left {
    text-align: left !important;
}

.article-content .w-e-center {
    text-align: center !important;
}

.article-content .w-e-right {
    text-align: right !important;
}

.article-content .w-e-justify {
    text-align: justify !important;
}

/* 通用对齐样式 */
.article-content [style*="text-align: center"] {
    text-align: center !important;
}

.article-content [style*="text-align: left"] {
    text-align: left !important;
}

.article-content [style*="text-align: right"] {
    text-align: right !important;
}

.article-content [style*="text-align: justify"] {
    text-align: justify !important;
}

/* 图片在文本对齐段落中的处理 */
.article-content p[style*="text-align: center"] img {
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

/* 清除浮动 */
.article-content::after {
    content: "";
    display: table;
    clear: both;
}

/* 代码块 */
.article-content pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-content code {
    background: rgba(37, 99, 235, 0.08);
    color: #2563EB;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}

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

/* 表格 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.article-content th,
.article-content td {
    border: 1px solid #E5E7EB;
    padding: 0.75rem 1rem;
    text-align: left;
}

.article-content th {
    background: #F9FAFB;
    font-weight: 600;
    color: #0A0A0A;
}

/* 分割线 */
.article-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
    margin: 3.5rem 0;
}

/* 面包屑导航 */
.article-breadcrumb {
    max-width: 800px;
    margin: 3rem auto 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #9CA3AF;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.breadcrumb-list a {
    color: #6B6B6B;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.breadcrumb-list a:hover {
    color: #2563EB;
}

.breadcrumb-separator {
    color: #D1D5DB;
    font-size: 0.6rem;
}

/* 标签 */
.article-tags {
    margin-top: 3rem;
    padding: 0;
}

.article-tags-label {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-bottom: 0.75rem;
}

.article-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #F3F4F6;
    color: #4B5563;
    font-size: 0.85rem;
    border-radius: 100px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-tag:hover {
    background: #2563EB;
    color: white;
    transform: translateY(-2px);
}

/* 分享按钮 */
.article-share {
    margin-top: 2.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.article-share-label {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-right: 0.5rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F3F4F6;
    color: #6B6B6B;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

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

.share-btn.wechat:hover {
    background: #07C160;
    color: white;
}

.share-btn.weibo:hover {
    background: #E6162D;
    color: white;
}

.share-btn.qq:hover {
    background: #12B7F5;
    color: white;
}

.share-btn.copy:hover {
    background: #2563EB;
    color: white;
}

/* 相关文章 */
.related-articles {
    max-width: 900px;
    margin: 4rem auto 0;
    padding: 0 1.5rem 4rem;
}

.related-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #0A0A0A;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

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

.related-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
}

.related-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(37, 99, 235, 0.15);
}

.related-card:hover::before {
    opacity: 1;
}

.related-card-image {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    position: relative;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-card:hover .related-card-image img {
    transform: scale(1.05);
}

.related-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CBD5E1;
    font-size: 2rem;
}

.related-card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.related-card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: #2563EB;
}

.related-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0A0A0A;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Noto Serif SC', serif;
}

.related-card-date {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: auto;
    letter-spacing: 0.02em;
}

/* CTA Section */
.article-cta-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2563EB 0%, #4F46E5 50%, #7C3AED 100%);
    color: white;
    padding: 6rem 1.5rem;
    margin: 5rem auto 0;
    max-width: 100%;
}

.article-cta-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    opacity: 0.15;
    top: -300px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-20px); }
}

.article-cta-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.article-cta-title {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

.article-cta-desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2.5rem;
}

.article-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.1rem 2.5rem;
    background: white;
    color: #2563EB;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.article-cta-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* 响应式样式 */
@media (max-width: 768px) {
    .article-header {
        padding: 7rem 1.5rem 2rem;
    }

    .article-hero-image {
        padding: 0 1.5rem;
    }

    .article-body {
        max-width: 100%;
        padding: 0 1.5rem 4rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-content {
        font-size: 1.05rem;
        line-height: 1.75;
    }

    .article-content h2 {
        font-size: 1.5rem;
        margin-top: 2.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
        margin-top: 2rem;
    }

    .article-content blockquote {
        font-size: 1.15rem;
        padding: 1.5rem 1.25rem;
        margin: 2rem 0;
    }

    .article-breadcrumb {
        margin: 2rem auto 0;
        padding: 0;
    }

    .breadcrumb-list {
        font-size: 0.75rem;
    }

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

    .related-card-image {
        aspect-ratio: 16/9;
    }

    .share-buttons {
        gap: 0.5rem;
    }

    .share-btn {
        width: 36px;
        height: 36px;
    }

    .article-cta-section {
        padding: 4rem 1.5rem;
        margin: 4rem auto 0;
    }

    .article-cta-glow {
        width: 400px;
        height: 400px;
        top: -200px;
    }

    .article-cta-title {
        font-size: 1.5rem;
    }

    .article-cta-desc {
        font-size: 1rem;
    }

    .article-cta-btn {
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .article-header {
        padding: 6.5rem 1.25rem 1.5rem;
    }

    .article-hero-image {
        padding: 0 1.25rem;
    }

    .article-body {
        padding: 0 1.25rem 3rem;
    }

    .article-title {
        font-size: 1.35rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.35rem;
    }

    .article-content h3 {
        font-size: 1.15rem;
    }

    .article-content blockquote {
        font-size: 1.1rem;
        padding: 1.25rem 1rem;
    }

    .article-hero-image img {
        border-radius: 8px;
    }

    .article-content > p:first-of-type::first-letter {
        font-size: 3rem;
    }
}
