/* ========== css/style.css - 大气极简风格（减少容器嵌套）========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础背景 - 清爽渐变 */
html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(145deg, #eef2f9 0%, #e0e8f0 100%);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* 主容器 - 合并原有的 presentation-container 和 slides-area，更简洁 */
.main-container {
    width: 100%;
    max-width: 1400px;
    height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 幻灯片区域 - 占据剩余所有高度 */
.slides-area {
    flex: 1;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    min-height: 0;  /* flex 限制溢出关键 */
}

.slides-viewport {
    width: 100%;
    height: 100%;
    position: relative;
}

/* slide 卡片样式 - 直接填充，无额外边距 */
.slide {
    display: none;
    padding: 48px 56px;
    animation: fadeSlide 0.3s ease;
    background: #ffffff;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b9d0e0 #f0f4f9;
    position: relative;
    box-sizing: border-box;
}

.slide::-webkit-scrollbar {
    width: 10px;
}

.slide::-webkit-scrollbar-track {
    background: #f0f4f9;
    border-radius: 20px;
    margin: 8px 0;
}

.slide::-webkit-scrollbar-thumb {
    background: #b9d0e0;
    border-radius: 20px;
    border: 2px solid #ffffff;
    transition: 0.2s;
}

.slide::-webkit-scrollbar-thumb:hover {
    background: #7fa1bc;
}

/* 底部渐变提示（滚动时显示） */
.slide::before {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to top, rgba(255,255,255,0.98), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.slide.has-overflow::before {
    opacity: 1;
}

/* 滚动提示浮层 */
.scroll-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 45, 60, 0.85);
    backdrop-filter: blur(12px);
    color: #f0f9ff;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    z-index: 999;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 200, 0.3);
    font-family: monospace;
    opacity: 0;
    visibility: hidden;
}

.scroll-hint.show {
    opacity: 1;
    visibility: visible;
}

.slide.active-slide {
    display: block;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标题样式 */
.slide h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1F5E7A, #2C839C);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 1.2rem;
    border-left: 6px solid #2c9faf;
    padding-left: 24px;
}

.slide h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1e6f5c;
    margin: 1.2rem 0 0.6rem 0;
    border-bottom: 2px solid #cae3e8;
    display: inline-block;
    padding-bottom: 4px;
}

.slide .content {
    font-size: 1.05rem;
    line-height: 1.55;
    color: #2e4a5c;
    margin-top: 20px;
}

.slide .content p {
    margin: 16px 0;
}

.slide .content ul,
.slide .content ol {
    margin: 12px 0 16px 32px;
}

.arch-image {
    text-align: center;
    margin: 20px 0 10px;
}

.arch-image img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #dce9ef;
    background: #fff;
}

/* 代码块 - 修改：删除 pre-wrap 和 word-break，支持水平滚动 */
.code-block {
    background: #f4f9fe;
    color: #1e3b4a;
    padding: 18px 22px;
    border-radius: 24px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 24px 0;
    line-height: 1.45;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02), 0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2edf5;
    /* ✅ 新增：限制高度 + 竖直滚动条 */
    max-height: 500px;       /* 代码块高度调节*/
    overflow-y: auto;        /* 当内容超出 max-height 时出现竖直滚动条 */
}

.code-block {
    width: 90%;          /*代码块宽度调节*/
    margin-left: 10px;   /*代码块左边距调节*/
    margin-right: auto;
}


.code-block .keyword {
    color: #1f8a7a;
    font-weight: 600;
}

.code-block .type {
    color: #be7c4b;
    font-weight: 500;
}

.code-block .string {
    color: #3c8f6e;
}

.code-block .comment {
    color: #8ba0ae;
    font-style: italic;
}

.code-block .function {
    color: #3f7e9c;
    font-weight: 500;
}

.code-block .number {
    color: #d27e4a;
}

.inline-code {
    background: #eef3f7;
    padding: 2px 10px;
    border-radius: 20px;
    font-family: monospace;
    color: #c4543a;
    font-size: 0.9em;
    border: 1px solid #cfdfe8;
}

.highlight {
    background: #f0f9f0;
    border-left: 5px solid #57b5a7;
    padding: 14px 24px;
    border-radius: 24px;
    margin: 24px 0;
    color: #235b4f;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

/* 导航栏 - 固定在底部 */
.nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    flex-wrap: wrap;
    gap: 16px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dots-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.dot {
    min-width: 44px;
    min-height: 12px;
    background: #cbdde6;
    border-radius: 20px;
    cursor: pointer;
    padding: 6px 0;
    transition: 0.2s;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.02);
}

.dot:active {
    transform: scale(0.96);
}

.dot::after {
    content: '';
    display: block;
    width: 100%;
    height: 6px;
    background: inherit;
    border-radius: 12px;
}

.dot.active-dot {
    background: #51b0a7;
    min-width: 56px;
    box-shadow: 0 2px 8px rgba(81, 176, 167, 0.3);
}

.dot:hover {
    background: #8fc1d0;
    transform: scaleY(1.1);
}

.nav-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-btn {
    background: rgba(230, 240, 245, 0.9);
    border: none;
    color: #2c6e7e;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 60px;
    cursor: pointer;
    backdrop-filter: blur(2px);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.nav-btn:active {
    transform: scale(0.94);
    background: #c6dee8;
}

.nav-btn:hover {
    background: #ffffff;
    color: #267c8c;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.page-indicator {
    background: rgba(200, 220, 230, 0.8);
    padding: 6px 18px;
    border-radius: 40px;
    color: #1e5a6b;
    font-weight: 500;
    backdrop-filter: blur(2px);
    font-size: 0.95rem;
}

/* 响应式调整 */
@media (max-width: 750px) {
    body {
        padding: 12px;
    }
    .main-container {
        height: calc(100vh - 24px);
        border-radius: 24px;
    }
    .slide {
        padding: 28px 20px;
    }
    .slide h1 {
        font-size: 2rem;
    }
    .code-block {
        font-size: 0.7rem;
    }
    .dot {
        min-width: 28px;
    }
    .dot.active-dot {
        min-width: 38px;
    }
    .slide::-webkit-scrollbar {
        width: 8px;
    }
    .scroll-hint {
        font-size: 0.7rem;
        padding: 6px 14px;
        bottom: 20px;
    }
    .nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    .nav-controls {
        padding: 12px 20px;
    }
}

/* Mermaid 图表容器样式 */
.mermaid {
    background: #f8fafc;
    padding: 20px;
    border-radius: 24px;
    margin: 24px 0;
    text-align: center;
    overflow-x: auto;
    border: 1px solid #e2edf5;
    font-family: 'Segoe UI', 'Roboto', monospace;
}
.mermaid svg {
    max-width: 100%;
    height: auto;
}