* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.6;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background-color: #444;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.sidebar h2 {
    padding: 0 20px 15px;
    border-bottom: 1px solid #555;
    margin-bottom: 15px;
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 0;
    border-bottom: 1px solid #555;
}

.category-header {
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.category-header:hover {
    background-color: #555;
}

.category-title {
    font-weight: bold;
    word-wrap: break-word;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.category-item.expanded .toggle-icon {
    transform: rotate(90deg);
}

.content-list {
    list-style: none;
    padding: 0;
    display: none;
    overflow: visible;
}

.category-item.expanded .content-list {
    display: block;
}

.content-item {
    padding: 5px 0 5px 30px;
}

.content-item a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
    word-break: break-all;
    display: block;
    padding: 3px 0;
}

.content-item a:hover {
    color: white;
    text-decoration: underline;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 40px;
    background-color: #e0e0e0;
    min-height: 100vh;
}

.welcome-message {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 50px auto;
    text-align: center;
}

.welcome-message h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.welcome-message p {
    color: #7f8c8d;
    margin-bottom: 30px;
    word-wrap: break-word;
}

.content-detail {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.content-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
    position: relative;
    padding-right: 100px; /* 为置顶标志留出空间 */
}

.content-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.content-meta {
    color: #7f8c8d;
    font-size: 14px;
    word-wrap: break-word;
}

.content-body {
    line-height: 1.8;
    /* 关键修复样式 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.content-body img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    display: block;
}

.content-body video {
    max-width: 100%;
    margin: 15px 0;
    display: block;
}

/* DPlayer播放器样式 */
.content-body .dplayer {
    max-width: 100%;
    margin: 15px 0;
    display: block;
}

.content-body table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 15px 0;
}

.content-body th, .content-body td {
    border: 1px solid #ddd;
    padding: 8px;
    word-wrap: break-word;
}

.content-body pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.content-body code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
}

.content-body a {
    color: #3498db;
    word-break: break-all;
}

.copyright {
    text-align: center;
    padding: 20px;
    background-color: #444;
    color: white;
    margin-top: 30px;
    border-radius: 4px;
    word-wrap: break-word;
}

.admin-entry {
    margin-top: 15px;
}

.admin-entry a {
    color: #fff;
    text-decoration: none;
    background-color: #3498db;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
}

.admin-entry a:hover {
    background-color: #2980b9;
}

.top-flag {
    color: red;
    font-size: 12px;
    margin-left: 5px;
    vertical-align: super;
}

/* 导航按钮样式 */
.content-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.nav-btn {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

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

.nav-btn.disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* 底部导航按钮 */
.bottom-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

/* 滚动按钮 */
.scroll-buttons {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

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

.scroll-btn.top {
    margin-bottom: 5px;
}

/* 悬浮翻页按钮 */
.floating-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.floating-nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.8);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

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

.floating-nav-btn.disabled {
    background-color: rgba(149, 165, 166, 0.5);
    cursor: not-allowed;
    transform: none;
}

.floating-nav-btn.disabled:hover {
    background-color: rgba(149, 165, 166, 0.5);
    transform: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .content-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        text-align: center;
    }
    
    .scroll-buttons {
        right: 15px;
        bottom: 15px;
    }
    
    .scroll-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .floating-nav {
        right: 15px;
    }
    
    .floating-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}