/**
 * 爱减肥 - 减肥手册专用样式
 * 左侧导航 + 右侧内容布局
 */

/* ==================== 手册布局 ==================== */
.handbook-layout {
    display: flex;
    min-height: calc(100vh - 70px);
    margin-top: 70px;
}

/* ==================== 左侧导航栏 ==================== */
.handbook-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #eee;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 100;
}

.sidebar-header {
    padding: 15px 20px 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.sidebar-header h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header p {
    font-size: 13px;
    color: #888;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: #f8f9fa;
    color: #ff6b6b;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, #fff5f5, #fff);
    color: #ff6b6b;
    border-left-color: #ff6b6b;
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-nav a.active .nav-icon {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
}

.sidebar-nav .nav-text {
    flex: 1;
    line-height: 1.4;
}

/* 子导航 */
.sub-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fafafa;
    display: none;
}

.sub-nav.show {
    display: block;
}

.sub-nav a {
    padding: 10px 20px 10px 58px;
    font-size: 13px;
    color: #666;
}

.sub-nav a:hover,
.sub-nav a.active {
    color: #ff6b6b;
    background: #fff5f5;
}

/* ==================== 右侧内容区 ==================== */
.handbook-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px 40px;
    background: linear-gradient(135deg, #fff5f5 0%, #f0f9ff 50%, #f0fff4 100%);
    min-height: calc(100vh - 70px);
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #888;
    margin-bottom: 25px;
}

.breadcrumb a {
    color: #888;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #ff6b6b;
}

.breadcrumb span {
    color: #555;
}

/* 章节标题 */
.chapter-header {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.chapter-number {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.chapter-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.chapter-desc {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* 内容样式 */
.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6b6b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-section h3 {
    font-size: 18px;
    color: #ff6b6b;
    margin: 25px 0 15px;
}

.content-section h4 {
    font-size: 16px;
    color: #333;
    margin: 20px 0 12px;
    font-weight: 600;
}

.content-section p {
    color: #555;
    line-height: 1.9;
    margin-bottom: 15px;
    text-align: justify;
}

.content-section ul,
.content-section ol {
    padding-left: 0;
    margin-bottom: 20px;
    list-style: none;
}

.content-section li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.content-section ul li::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 10px;
    width: 6px;
    height: 6px;
    background: #ff6b6b;
    border-radius: 50%;
}

.content-section ol {
    counter-reset: item;
}

.content-section ol li::before {
    content: counter(item) ".";
    counter-increment: item;
    position: absolute;
    left: 0;
    color: #ff6b6b;
    font-weight: 600;
}

.content-section strong {
    color: #333;
}

/* 重点提示框 */
.highlight-box {
    background: linear-gradient(135deg, #fff5f5, #fff);
    border-left: 4px solid #ff6b6b;
    padding: 20px 25px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
}

.highlight-box.info {
    background: linear-gradient(135deg, #e3f2fd, #fff);
    border-left-color: #2196f3;
}

.highlight-box.success {
    background: linear-gradient(135deg, #e8f5e9, #fff);
    border-left-color: #4caf50;
}

.highlight-box.warning {
    background: linear-gradient(135deg, #fff3e0, #fff);
    border-left-color: #ff9800;
}

.highlight-box p {
    margin: 0;
    color: #555;
}

.highlight-box strong {
    color: #333;
}

/* 数据卡片 */
.data-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
}

.data-card h4 {
    margin-top: 0;
    color: #333;
    font-size: 15px;
}

.data-card p {
    margin-bottom: 10px;
    font-size: 14px;
}

/* 表格样式 */
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.content-table th,
.content-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.content-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.content-table tr:hover {
    background: #fafafa;
}

/* 公式样式 */
.formula {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    color: #333;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #eee;
}

/* 章节导航 */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.chapter-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s ease;
    max-width: 45%;
}

.chapter-nav a:hover {
    background: #ff6b6b;
    color: white;
}

.chapter-nav .prev-chapter {
    flex-direction: row;
}

.chapter-nav .next-chapter {
    flex-direction: row-reverse;
    text-align: right;
    margin-left: auto;
}

.chapter-nav .nav-label {
    font-size: 12px;
    color: #888;
}

.chapter-nav a:hover .nav-label {
    color: rgba(255,255,255,0.8);
}

.chapter-nav .nav-title {
    font-size: 14px;
    font-weight: 500;
}

/* ==================== 移动端响应式 ==================== */
@media (max-width: 1024px) {
    .handbook-sidebar {
        width: 240px;
    }
    
    .handbook-content {
        margin-left: 240px;
        padding: 25px 30px;
    }
    
    .content-container {
        padding: 30px 35px;
    }
}

@media (max-width: 768px) {
    .handbook-layout {
        flex-direction: column;
        margin-top: 60px;
    }
    
    .handbook-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 15px 0;
        max-height: none;
        overflow: visible;
    }
    
    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        margin-bottom: 0;
        border-bottom: none;
    }
    
    .sidebar-nav {
        display: none;
        padding: 10px 0;
        border-top: 1px solid #eee;
    }
    
    .sidebar-nav.show {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: block;
        background: #ff6b6b;
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 20px;
        font-size: 14px;
        cursor: pointer;
    }
    
    .handbook-content {
        margin-left: 0;
        padding: 20px 15px;
        min-height: auto;
    }
    
    .content-container {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .chapter-title {
        font-size: 22px;
    }
    
    .content-section h2 {
        font-size: 18px;
    }
    
    .content-section h3 {
        font-size: 16px;
    }
    
    .chapter-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .chapter-nav a {
        max-width: 100%;
    }
    
    .chapter-nav .next-chapter {
        margin-left: 0;
    }
}

/* 移动端菜单按钮（默认隐藏） */
.mobile-menu-toggle {
    display: none;
}
