/* 案例详情页 - 现代化响应式布局 */
/* 此文件从article-detail.css复制，修改为案例专用，避免与智库共用 */

/* 页面主体 */
.case-page {
    background: #f8f9fa;
    min-height: 100vh;
    padding-top: 20px;
    width: 100%;
    overflow-x: hidden;
}

/* 文章容器 - 自适应宽度 */
.case-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 面包屑导航 */
.case-breadcrumb {
    padding: 16px 0;
    margin-bottom: 24px;
    font-size: 14px;
    color: #6c757d;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb-item {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #dee2e6;
}

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

/* 文章布局 - CSS Grid */
.case-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

/* 文章主体 */
.case-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-width: 0;
}

/* 文章内容包装器 */
.case-content-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

/* 文章头部 */
.case-header {
    padding: 48px 64px 32px;
    border-bottom: 1px solid #e9ecef;
    min-width: 0;
    overflow: hidden;
}

.case-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    line-height: 1.4;
    margin-bottom: 20px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 14px;
    color: #6c757d;
    min-width: 0;
}

.case-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.case-meta-item i {
    color: #adb5bd;
}

/* 文章分类标签 */
.case-category {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* 文章内容 */
.case-content {
    padding: 48px 64px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 40px;
    box-sizing: border-box;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 案例内容区域底部空隙 */
.case-body {
    padding-bottom: 40px;
}

/* 主内容区与页脚之间的空隙 */
.case-page {
    padding-bottom: 20px;
}

/* 强制覆盖所有子元素的宽度限制 */
.case-content *,
.case-content > *,
.case-content > * > * {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* 确保图片和媒体元素正确显示 */
.case-content img,
.case-content video,
.case-content iframe {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* 表格处理 */
.case-content table {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    overflow-x: auto;
}

.case-content pre {
    max-width: 100% !important;
    overflow-x: auto;
}

.case-content h2 {
    font-size: 26px;
    font-weight: 600;
    color: #212529;
    margin-top: 48px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.case-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: #212529;
    margin-top: 36px;
    margin-bottom: 18px;
}

.case-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-top: 28px;
    margin-bottom: 14px;
}

.case-content p {
    margin-bottom: 20px;
    line-height: 1.9;
}

.case-content ul,
.case-content ol {
    margin-bottom: 20px;
    padding-left: 32px;
}

.case-content li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.case-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.case-content blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    font-style: italic;
    color: #495057;
}

.case-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    color: #d63384;
}

.case-content pre {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
}

.case-content pre code {
    background: none;
    padding: 0;
}

/* 文章标签 */
.case-tags {
    padding: 24px 64px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.tags-label {
    font-size: 14px;
    color: #6c757d;
    margin-right: 8px;
}

.case-tag {
    display: inline-block;
    padding: 6px 16px;
    background: #e9ecef;
    color: #495057;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-tag:hover {
    background: #007bff;
    color: white;
}

/* 侧边栏 */
.case-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 100px;
    min-width: 0;
    overflow: hidden;
}

.sidebar-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-width: 0;
}

.widget-title {
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
}

.widget-content {
    padding: 16px;
    min-width: 0;
    overflow: hidden;
}

/* 热门文章列表 */
.popular-article-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
    min-width: 0;
    overflow: hidden;
}

.popular-article-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.popular-article-item:last-child {
    margin-bottom: 0;
}

.popular-article-title {
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.popular-article-views {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 分类列表 */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    margin-bottom: 8px;
    min-width: 0;
    overflow: hidden;
}

.category-item:hover {
    background: #f8f9fa;
}

.category-item:last-child {
    margin-bottom: 0;
}

.category-name {
    font-size: 14px;
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.category-count {
    font-size: 12px;
    color: #adb5bd;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 加载动画 */
.loading-container {
    padding: 80px 64px;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-container p {
    color: #6c757d;
    font-size: 15px;
}

/* 错误消息 */
.error-container {
    padding: 80px 64px;
    text-align: center;
}

.error-container i {
    font-size: 64px;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-container p {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 24px;
}

/* 响应式布局 */
@media (max-width: 1024px) {
    .case-layout {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .case-sidebar {
        position: static;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .case-container {
        padding: 0 16px;
    }
    
    .case-header {
        padding: 24px 16px 20px;
    }

    .case-title {
        font-size: 20px;
        line-height: 1.4;
        word-break: break-word;
    }

    .case-content {
        padding: 24px 16px;
        font-size: 15px;
    }
    
    .case-content h2 {
        font-size: 20px;
        margin-top: 32px;
        margin-bottom: 16px;
    }
    
    .case-content h3 {
        font-size: 18px;
        margin-top: 24px;
        margin-bottom: 12px;
    }
    
    .case-content h4 {
        font-size: 16px;
    }
    
    .case-content p {
        margin-bottom: 16px;
    }
    
    .case-content ul,
    .case-content ol {
        padding-left: 20px;
    }
    
    .case-content img {
        margin: 16px 0;
    }
    
    .case-content blockquote {
        padding: 16px;
        margin: 16px 0;
    }

    .case-tags {
        padding: 16px;
    }
    
    .case-tag {
        padding: 4px 12px;
        font-size: 12px;
    }

    .case-meta {
        flex-direction: column;
        gap: 8px;
        font-size: 13px;
    }
    
    .case-breadcrumb {
        font-size: 13px;
        padding: 12px 0;
        margin-bottom: 16px;
    }
    
    .sidebar-widget {
        width: 100%;
        box-sizing: border-box;
    }
    
    .widget-title {
        padding: 16px;
        font-size: 15px;
    }
    
    .widget-content {
        padding: 12px;
    }
    
    .popular-article-item {
        padding: 10px;
    }
    
    .popular-article-title {
        font-size: 13px;
    }
    
    .category-item {
        padding: 10px;
    }
    
    .category-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .case-container {
        padding: 0 12px;
    }
    
    .case-header {
        padding: 20px 12px 16px;
    }

    .case-title {
        font-size: 18px;
    }

    .case-content {
        padding: 20px 12px;
        font-size: 14px;
    }
    
    .case-content h2 {
        font-size: 18px;
    }
    
    .case-content h3 {
        font-size: 16px;
    }
    
    .case-tags {
        padding: 12px;
    }
}
