/**
 * 详情页共享样式
 * 用于统一文章详情页和问答详情页的视觉风格
 */

/* ==================== 面包屑导航统一样式 ==================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumb a:hover {
    color: #1a3b5d;
}

.breadcrumb .separator {
    color: #adb5bd;
    user-select: none;
}

.breadcrumb .current-category,
.breadcrumb .current {
    color: #495057;
}

.breadcrumb .current {
    font-weight: 500;
    color: #1a3b5d;
}

/* ==================== 详情页容器统一样式 ==================== */

.article-detail,
.qa-detail {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 400px);
}

.detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 头部区域统一样式 ==================== */

.article-header,
.qa-detail-header {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    margin-bottom: 2rem;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    text-align: center;
}

.article-header:hover,
.qa-detail-header:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 顶部装饰条动画 */
.article-header::before,
.qa-detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #1a3b5d 0%, #c9a961 50%, #1a3b5d 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 标题统一样式 */
.article-title,
.qa-detail-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: #1a3b5d;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
    letter-spacing: -0.02em;
    text-align: center;
}

/* 信息栏统一样式 */
.article-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    margin-top: 0;
    border-top: 2px solid #f0f0f0;
}

.article-info span {
    color: #6c757d;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.article-info span:hover {
    color: #1a3b5d;
}

.article-info i {
    color: #c9a961;
    font-size: 1rem;
}

.article-info .separator-dot {
    color: #dee2e6;
    font-size: 0.5rem;
}

/* ==================== 内容区域统一样式 ==================== */

.article-content,
.qa-detail-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 3rem;
    border: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
}

.article-content::before,
.qa-detail-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* 内容区域文本统一样式 */
.article-body,
.article-content-text,
.qa-detail-answer-content {
    color: #2c3e50;
    font-size: 17px;
    line-height: 1.8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Source Han Sans CN", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
    letter-spacing: 0.3px;
    max-width: 800px;
    margin: 0 auto;
}

/* 段落统一样式 - 使用更具体的选择器代替!important */
.article-detail .article-body p,
.article-detail .article-content-text p,
.qa-detail .qa-detail-answer-content p {
    margin: 1.5rem 0;
    color: #2c3e50;
    text-align: justify;
    line-height: 1.8;
    font-size: 17px;
    letter-spacing: 0.3px;
}

/* 所有段落统一缩进 */
.article-detail .article-body > p:first-of-type,
.article-detail .article-content-text > p:first-of-type,
.qa-detail .qa-detail-answer-content > p:first-of-type {
    text-indent: 2em;
    font-weight: 500;
    color: #1a3b5d;
}

.article-detail .article-body p:not(:first-of-type),
.article-detail .article-content-text p:not(:first-of-type),
.qa-detail .qa-detail-answer-content p:not(:first-of-type) {
    text-indent: 2em;
}

/* ==================== 返回按钮统一样式 ==================== */

.detail-actions {
    margin-top: 2rem;
    margin-bottom: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: #ffffff;
    color: #1a3b5d;
    border: 2px solid #1a3b5d;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.back-link:hover {
    background: #1a3b5d;
    color: #ffffff;
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(26, 59, 93, 0.3);
}

.back-link i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.back-link:hover i {
    transform: translateX(-4px);
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .detail-container {
        padding: 0 15px;
    }

    .article-header,
    .qa-detail-header {
        padding: 1.5rem;
        border-radius: 12px;
    }

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

    .article-content,
    .qa-detail-content {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .article-body,
    .article-content-text,
    .qa-detail-answer-content {
        font-size: 16px;
    }

    .article-detail .article-body p,
    .article-detail .article-content-text p,
    .qa-detail .qa-detail-answer-content p {
        font-size: 16px;
    }

    .back-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .article-header,
    .qa-detail-header {
        padding: 1.25rem;
    }

    .article-content,
    .qa-detail-content {
        padding: 1.25rem;
    }

    .article-info {
        gap: 1rem;
    }

    .article-body,
    .article-content-text,
    .qa-detail-answer-content {
        font-size: 15px;
    }

    .article-detail .article-body p,
    .article-detail .article-content-text p,
    .qa-detail .qa-detail-answer-content p {
        font-size: 15px;
        text-indent: 1.5em;
    }
}
