/* 案例详情页面样式 */

/* 案例详情区域 */
.case-detail-section {
    padding: 4rem 0;
    background-color: var(--bg-color);
}

/* 案例文章容器 */
.case-detail-article {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.case-detail-article:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* 案例标题 */
.case-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--accent-color);
}

@media (max-width: 767.98px) {
    .case-detail-title {
        font-size: 1.5rem;
    }
}

/* 案例元信息标签 */
.case-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--medium-gray);
}

.case-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.case-meta-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.case-meta-item i {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.case-meta-item span {
    font-weight: 500;
}

/* 案例主图 */
.case-detail-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.case-detail-image:hover {
    transform: scale(1.02);
}

.case-detail-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.case-detail-image:hover img {
    transform: scale(1.05);
}

/* 案例正文内容 */
.case-detail-content {
    margin-top: 2rem;
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1.05rem;
}

.case-detail-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.case-detail-content h2,
.case-detail-content h3,
.case-detail-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.case-detail-content h2 {
    font-size: 1.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.case-detail-content h3 {
    font-size: 1.5rem;
}

.case-detail-content h4 {
    font-size: 1.3rem;
}

.case-detail-content ul,
.case-detail-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.case-detail-content li {
    margin-bottom: 0.8rem;
    line-height: 1.8;
}

.case-detail-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.case-detail-content a:hover {
    color: #0040cc;
    border-bottom-color: #0040cc;
}

.case-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.case-detail-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--secondary-color);
    background: var(--light-gray);
    padding: 1rem 1.5rem;
    border-radius: 4px;
}

.case-detail-content code {
    background: var(--light-gray);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

.case-detail-content pre {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.case-detail-content pre code {
    background: none;
    padding: 0;
    color: var(--text-color);
}

/* 侧边栏样式 */
.case-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.sidebar-widget .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-widget .btn-outline-primary {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.sidebar-widget .btn-outline-primary:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.3);
}

/* 小工具标题 */
.widget-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-color);
}

.widget-title i {
    color: var(--accent-color);
}

/* 相关案例列表 */
.related-cases-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-case-item {
    transition: transform 0.3s ease;
}

.related-case-item:hover {
    transform: translateX(5px);
}

.related-case-item a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.related-case-item:hover a {
    background: var(--light-gray);
}

.related-case-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.related-case-item:hover .related-case-image {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.related-case-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.related-case-item:hover .related-case-info h4 {
    color: var(--accent-color);
}

.related-case-info .text-muted {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .case-sidebar {
        position: static;
        margin-top: 3rem;
    }
    
    .case-detail-article {
        padding: 1.5rem;
    }
    
    .case-detail-section {
        padding: 2rem 0;
    }
    
    .case-detail-meta {
        gap: 0.75rem;
    }
    
    .case-meta-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 767.98px) {
    .case-detail-article {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .case-detail-content {
        font-size: 1rem;
    }
    
    .case-detail-content h2 {
        font-size: 1.5rem;
    }
    
    .case-detail-content h3 {
        font-size: 1.3rem;
    }
    
    .case-detail-content h4 {
        font-size: 1.1rem;
    }
    
    .case-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .case-meta-item {
        width: 100%;
        justify-content: flex-start;
    }
    
    .related-case-item a {
        flex-direction: column;
        text-align: center;
    }
    
    .related-case-image {
        width: 100% !important;
        height: 200px !important;
        margin-bottom: 0.5rem;
    }
    
    .related-case-info {
        margin-left: 0 !important;
        text-align: center;
    }
}

/* 上一篇/下一篇导航 */
.case-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--medium-gray);
}

.case-nav-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 80px;
}

.case-nav-link:hover {
    background: #fff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.15);
    color: var(--accent-color);
}

.case-nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--light-gray);
}

.case-nav-link.disabled:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
    color: var(--text-color);
}

.case-nav-prev {
    justify-content: flex-start;
}

.case-nav-next {
    justify-content: flex-end;
}

.case-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 87, 255, 0.1);
    border-radius: 50%;
    color: var(--accent-color);
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.case-nav-link:hover .case-nav-icon {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.1);
}

.case-nav-link.disabled .case-nav-icon {
    background: rgba(0, 0, 0, 0.05);
    color: var(--secondary-color);
}

.case-nav-content {
    flex: 1;
    margin: 0 1rem;
}

.case-nav-label {
    display: block;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.case-nav-title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.case-nav-link:hover .case-nav-title {
    color: var(--accent-color);
}

.case-nav-link.disabled .case-nav-title {
    color: var(--secondary-color);
}

@media (max-width: 767.98px) {
    .case-navigation {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .case-nav-link {
        min-height: 70px;
        padding: 0.75rem;
    }
    
    .case-nav-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .case-nav-content {
        margin: 0 0.75rem;
    }
    
    .case-nav-title {
        font-size: 0.9rem;
    }
    
    .case-nav-label {
        font-size: 0.8rem;
    }
}

/* 打印样式 */
@media print {
    .case-sidebar {
        display: none;
    }
    
    .case-detail-article {
        box-shadow: none;
        padding: 0;
    }
    
    .case-detail-image {
        box-shadow: none;
    }
    
    .case-navigation {
        display: none;
    }
}
