/* Article Detail Page Styles - Tailwind CSS Compatible */

/* 文章头部区域 */
.article-header {
    padding: 2rem 0 1rem;
    margin-bottom: 0;
}

/* 文章标题 */
.article-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* 文章分割线 */
.article-divider {
    height: 3px;
    background: linear-gradient(90deg, #1565c0 0%, #0d47a1 100%);
    border: none;
    margin: 1rem 0;
}

/* 文章元信息 */
.article-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* 文章操作按钮 */
.article-actions {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.article-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    margin-right: 0.5rem;
}

/* 面包屑导航 - 使用 Tailwind 后主要通过 HTML 类控制 */
.breadcrumb {
    font-size: 0.8rem;
    background: transparent;
    padding: 0;
    margin: 0.5rem 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #6c757d;
}

/* 文章内容样式 */
.article-content {
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.article-content blockquote {
    border-left: 4px solid #1565c0;
    padding-left: 1rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.article-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
}

.article-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

/* 侧边栏样式 - 与 Tailwind 配合使用 */
.sidebar {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.sidebar-title {
    color: #1565c0;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1565c0;
}

.sidebar-item {
    display: block;
    color: #333;
    text-decoration: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    transition: color 0.3s ease;
}

.sidebar-item:hover {
    color: #1565c0;
    text-decoration: none;
}

.sidebar-item:last-child {
    border-bottom: none;
}

/* ============================================
   Enhanced Swiper Gallery Styles
   ============================================ */

/* Gallery Container */
.article-gallery {
    position: relative;
}

/* Main Swiper Container */
.article-gallery-main {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Ensure swiper wrapper allows proper touch handling */
.article-gallery-main .swiper-wrapper {
    touch-action: pan-y;
}

/* Swiper Slides */
.article-gallery-main .swiper-slide {
    position: relative;
    overflow: hidden;
}

.article-gallery-main .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.3s ease;
}

/* Slide overlay effect on hover */
.article-gallery-main .swiper-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.1) 0%, transparent 30%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-gallery-main:hover .swiper-slide::after {
    opacity: 1;
}

/* Pagination Bullets */
.article-gallery-main .swiper-pagination {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-gallery-main .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-gallery-main .swiper-pagination-bullet:hover {
    background: white;
    transform: scale(1.2);
}

.article-gallery-main .swiper-pagination-bullet-active {
    width: 24px;
    border-radius: 4px;
    background: #1565c0;
    opacity: 1;
}

/* Navigation Arrows */
.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    touch-action: manipulation;
}

.article-gallery:hover .gallery-prev,
.article-gallery:hover .gallery-next {
    opacity: 1;
    visibility: visible;
}

.gallery-prev {
    left: 16px;
}

.gallery-next {
    right: 16px;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.gallery-prev:active,
.gallery-next:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-prev i,
.gallery-next i {
    color: #334155;
    transition: transform 0.3s ease;
}

.gallery-prev:hover i {
    transform: translateX(-2px);
}

.gallery-next:hover i {
    transform: translateX(2px);
}

/* Single Image Style */
.single-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* 错误信息样式 */
.error-message {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

/* ============================================
   Enhanced Article Content Styles
   ============================================ */

/* Prose content enhancements */
.prose {
    color: #374151;
    line-height: 1.875;
}

.prose > p {
    margin-bottom: 1.5rem;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.prose a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

.prose ul,
.prose ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.prose th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}

.prose tr:nth-child(even) {
    background: #f8fafc;
}

/* ============================================
   Share Buttons Enhancement
   ============================================ */

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* ============================================
   Image Modal Styles
   ============================================ */

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #1565c0, #42a5f5);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .article-content img {
        border-radius: 0.5rem;
    }

    .article-content blockquote {
        border-left-width: 3px;
        padding-left: 0.75rem;
        font-size: 0.95rem;
    }

    .article-gallery-main {
        border-radius: 0.75rem;
    }

    .gallery-prev,
    .gallery-next {
        width: 40px;
        height: 40px;
    }

    .gallery-prev {
        left: 8px;
    }

    .gallery-next {
        right: 8px;
    }

    .single-image {
        height: 300px;
        border-radius: 0.75rem;
    }

    .article-gallery-main .swiper-pagination {
        bottom: 12px;
        gap: 6px;
    }

    .article-gallery-main .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
    }

    .article-gallery-main .swiper-pagination-bullet-active {
        width: 20px;
    }
}

@media (max-width: 480px) {
    .article-gallery-main .swiper-slide img {
        height: 300px;
    }

    .single-image {
        height: 250px;
    }

    .gallery-prev,
    .gallery-next {
        width: 36px;
        height: 36px;
    }

    .gallery-prev i,
    .gallery-next i {
        width: 20px;
        height: 20px;
    }
}
