/* 基础样式 - 与首页保持一致 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body { 
    background-color: #f5f5f5; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* 页眉样式 - 与首页保持一致 */
header {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
    color: #3498db;
}

/* 主容器 - 与首页保持一致 */
.front-container { 
    display: flex; 
    width: 100%;
    max-width: 1400px;
    margin: 20px auto 0;
    padding: 0 15px;
    flex: 1;
}

/* 左侧导航栏 - 与首页保持一致 */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    border-radius: 8px;
    margin-right: 20px;
    height: fit-content;
}

.sidebar-title {
    padding: 0 20px 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 15px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 10px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 25px;
}

.sidebar-menu a.active {
    background: #3498db;
    border-left: 4px solid #fff;
}

/* 右侧内容区 */
.content-area {
    flex: 1;
    min-width: 0;
    padding: 20px 0;
}

/* 页脚样式 - 与首页保持一致 */
footer {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    padding: 25px;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

.footer-links a {
    color: #3498db;
    text-decoration: none;
    transition: all 0.2s;
}

.footer-links a:hover {
    color: #1abc9c;
    text-decoration: underline;
}

.copyright {
    margin-top: 15px;
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* 内容头部样式 */
.content-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.content-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.media-stats {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.content-meta {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-top: 8px;
}

/* 内容主体样式 */
.content-body {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    position: relative;
}

/* 图片幻灯片展示区域 */
.slideshow-container {
    margin: 20px auto;
    max-width: 900px;
    width: 100%;
    text-align: center;
    position: relative;
}

/* 16:9 宽高比容器 */
.aspect-ratio-16-9 {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.slides {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* 保持比例，完整显示 */
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer; /* 添加指针光标 */
}

/* 视频容器 */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video {
    width: 100%;
    display: block;
}

/* 幻灯片控制按钮 - 移到下方 */
.slide-text-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px; /* 增加上边距，避免被指示器遮挡 */
    margin-bottom: 40px; /* 增加下边距 */
}

.slide-text-btn {
    padding: 8px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.3s;
}

.slide-text-btn:hover {
    background: #2980b9;
}

.slide-text-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* 幻灯片指示器 */
.slide-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #bdc3c7;
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background: #3498db;
    transform: scale(1.2);
}

/* 文本内容区域 - 修复代码显示问题 */
.content-text {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    line-height: 1.8;
    /* 增强换行能力 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.content-text p {
    margin-bottom: 15px;
    /* 确保所有段落都能正确换行 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

/* 代码块样式 - 新增复制按钮和折叠功能 */
.code-container {
    position: relative;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    color: #ccc;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-bottom: 1px solid #444;
}

.code-buttons {
    display: flex;
    gap: 10px;
}

.code-btn {
    background: #3a3a3a;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.code-btn:hover {
    background: #4a4a4a;
}

.code-btn.copy-btn {
    background: #3498db;
}

.code-btn.copy-btn:hover {
    background: #2980b9;
}

.code-btn.toggle-btn {
    background: #2ecc71;
}

.code-btn.toggle-btn:hover {
    background: #27ae60;
}

.content-text pre {
    margin: 0;
    border-radius: 0 0 8px 8px;
}

.content-text pre code {
    border-radius: 0 0 8px 8px;
}

/* 折叠状态下的样式 */
.code-container.collapsed pre {
    max-height: 7.5em; /* 5行高度 (1.5em/行) */
    overflow: hidden;
    position: relative;
}

.code-container.collapsed pre::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(to bottom, rgba(45,45,45,0), rgba(45,45,45,0.8));
    pointer-events: none;
}

/* 代码块样式 */
.content-text pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 0; /* 改为0，因为容器有圆角 */
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    line-height: 1.5;
    margin: 0; /* 改为0，因为容器有外边距 */
    tab-size: 4;
}

.content-text code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    color: #d63384;
    /* 确保代码也能正确换行 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.content-text pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* 导航按钮 */
.content-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 25px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 1rem;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #2980b9;
}

.nav-btn i {
    margin: 0 8px;
}

.nav-btn.back {
    background: #2c3e50;
}

.nav-btn.back:hover {
    background: #1a252f;
}

.nav-btn.disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    pointer-events: none;
}

/* 彻底隐藏所有可能的箭头图标 */
.nav-btn.prev:before,
.nav-btn.prev:after,
.nav-btn.next:before,
.nav-btn.next:after,
.nav-btn.back:before,
.nav-btn.back:after {
    display: none !important;
    content: none !important;
}

/* 反顶反底按钮 */
.scroll-buttons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.scroll-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.85);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-size: 20px;
    border: 2px solid white;
}

.scroll-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.scroll-btn:active {
    transform: scale(0.95);
}

.scroll-btn.top {
    background: rgba(46, 204, 113, 0.85);
}

.scroll-btn.top:hover {
    background: #27ae60;
}

.scroll-btn.bottom {
    background: rgba(231, 76, 60, 0.85);
}

.scroll-btn.bottom:hover {
    background: #c0392b;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .scroll-buttons {
        right: 10px;
    }
    
    .scroll-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .front-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .scroll-buttons {
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .content-title {
        font-size: 1.5rem;
    }
    
    .content-body {
        padding: 20px;
    }
    
    .slide-text-controls {
        margin-top: 25px;
    }
    
    .content-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .scroll-buttons {
        bottom: 70px;
        right: 10px;
    }
    
    .scroll-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .content-body {
        padding: 15px;
    }
    
    .slide-text-controls {
        margin-top: 20px;
    }
    
    .scroll-buttons {
        bottom: 60px;
        right: 5px;
    }
}