/* 文章详情页样式 */
:root {
    --primary-color: #4e73df;
    --primary-dark: #375de7;
    --secondary-color: #36b9cc;
    --primary-light: #e8eeff;
    --text-color: #333;
    --secondary-text: #6c757d;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --body-bg: #f8f9fc;
    --body-color: #333;
    --border-radius: 10px;
    --box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

/* 文章头部区域 */
.article-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/index/images/pattern-dots.svg');
    background-size: cover;
    opacity: 0.1;
}

.article-header .badge {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 50px;
    margin-bottom: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.article-meta {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta i {
    margin-right: 6px;
    font-size: 18px;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 0;
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item {
    font-size: 14px;
    font-weight: 500;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
}

.breadcrumb-item i {
    margin-right: 5px;
    font-size: 16px;
}

.breadcrumb-item.active {
    color: var(--secondary-text);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--secondary-text);
    content: "›";
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}

/* 文章内容区域 */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #444;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.article-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 30px 0 20px;
    color: #222;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 25px 0 15px;
    color: #333;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content blockquote {
    background-color: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    font-style: italic;
}

.article-content code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
}

.article-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

/* 文章标签 */
.article-tags {
    margin-top: 20px;
}

.article-tags h6 {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.article-tags .badge {
    padding: 8px 15px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
}

.article-tags .badge:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 文章互动按钮 */
.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 25px 0 10px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid #ddd;
    background: white;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn i {
    margin-right: 6px;
    font-size: 16px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.like-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.like-btn:hover, .like-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.bookmark-btn {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.bookmark-btn:hover, .bookmark-btn.active {
    background-color: var(--secondary-color);
    color: white;
}

/* 文章目录 */
.article-toc {
    max-height: 400px;
    overflow-y: auto;
}

.article-toc::-webkit-scrollbar {
    width: 5px;
}

.article-toc::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.article-toc::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.article-toc::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.article-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc li {
    margin-bottom: 8px;
}

.article-toc a {
    display: block;
    padding: 6px 10px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: var(--transition);
    font-size: 14px;
}

.article-toc a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.article-toc .ms-3 a {
    font-size: 13px;
    color: var(--secondary-text);
}

/* 评论区域 */
.comment-list {
    margin-top: 20px;
}

.comment-item {
    margin-bottom: 20px;
}

.comment-item .rounded-circle {
    object-fit: cover;
}

.comment-item h6 {
    font-weight: 600;
}

.comment-item p {
    margin-bottom: 10px;
    color: var(--text-color);
}

.comment-item .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.replies {
    margin-left: 20px;
}

.reply-item {
    margin-bottom: 10px;
}

/* 相关文章 */
.list-group-item {
    padding: 15px;
    transition: var(--transition);
}

.list-group-item:hover {
    background-color: var(--light-color);
}

.list-group-item a {
    color: var(--text-color);
    text-decoration: none;
}

.list-group-item h6 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    transition: var(--transition);
}

.list-group-item:hover h6 {
    color: var(--primary-color);
}

.list-group-item .small {
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .article-header {
        padding: 3rem 0;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

@media (max-width: 767.98px) {
    .article-header {
        padding: 2rem 0;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-meta {
        gap: 10px;
        font-size: 13px;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.3rem;
    }
    
    .article-actions {
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 100px;
    }
}

/* 阅读进度条动画 */
@keyframes progressAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.reading-progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 200%;
    animation: progressAnimation 2s ease infinite;
}

/* 卡片样式优化 */
.card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.card-header h5 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.card-body {
    padding: 20px;
}

/* 表单元素样式 */
.form-control {
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 8px 20px;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 115, 223, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 115, 223, 0.3);
}

/* 订阅卡片样式 */
.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.bg-primary .card-body {
    position: relative;
    overflow: hidden;
}

.bg-primary .card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/index/images/pattern-dots.svg');
    background-size: cover;
    opacity: 0.1;
    z-index: 0;
}

.bg-primary h5, .bg-primary p {
    position: relative;
    z-index: 1;
}

.bg-primary .input-group {
    position: relative;
    z-index: 1;
}

.bg-primary .input-group .form-control {
    border: none;
}

.bg-primary .input-group .btn {
    border: none;
    padding: 12px 20px;
    font-weight: 500;
}

/* 点赞动画 */
@keyframes likeAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(1);
    }
}

.like-btn.active {
    animation: likeAnimation 0.5s ease;
}