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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #74A5FF, #CEFF7E);
    transition: background 0.5s ease;
    height: 100vh;
    width: 100vw;
}

.presentation-container {
    position: relative; /* 使子元素的绝对定位相对于此容器 */
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.slide {
    width: 90%;
    height: 90%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* 允许垂直滚动 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 和 Edge */
    /* WebKit scrollbar is handled by .slide::-webkit-scrollbar */
    display: none;
    font-size: 24px;
    line-height: 1.6;
}

.slide::-webkit-scrollbar {
    display: none; /* WebKit 浏览器隐藏滚动条 */
}

.slide.active {
    display: block;
}

.slide h1 {
    font-size: 2.5em; /* 60px / 24px */
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

.slide h2 {
    font-size: 1.5em; /* 36px / 24px */
    margin-bottom: 24px;
    color: #444;
}

.slide h3 {
    font-size: 1.25em; /* 30px / 24px */
    margin-bottom: 20px;
}

.slide p {
    margin-bottom: 20px;
}

.slide ul, .slide ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.slide li {
    margin-bottom: 10px;
}

.slide pre {
    background: #f6f8fa;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.83em; /* 20px / 24px */
    white-space: pre-wrap;
}

/* 确保隐藏的代码块容器也不显示背景 */
.slide pre.code-container {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* 只有当代码行可见时才显示背景和样式 */
.slide pre.code-container .visible-segment {
    background: #f6f8fa;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

/* 当代码块中至少有一个可见元素时，恢复代码块容器样式 */
/* 使用JavaScript动态添加类，以确保浏览器兼容性 */
.slide pre.code-container.has-visible-content {
    background: #f6f8fa;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.slide code {
    font-family: 'Courier New', Courier, monospace;
    border-radius: 3px;
    padding: 3px 5px;
    font-size: 0.92em; /* 22px / 24px, relative to slide font-size */
    color: #d63384; /* 使用醒目的颜色 */
    background: rgb(248, 248, 248, 0.2)
}

.slide pre code {
    padding: 0;
    background: transparent;
}

/* 段落显示和隐藏的样式 */
.hidden-segment {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease, height 0.3s ease;
    margin: 0;
    padding: 0;
    background: transparent !important;
    visibility: hidden;
}
.visible-segment {
    opacity: 1;
    height: auto;
    overflow: visible;
    transform: translateY(0) scale(1) rotateX(0);
    filter: blur(0);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.6s ease-out, height 0.3s ease;
    margin-bottom: 20px;
}

/* 代码行样式 */
.code-line {
    white-space: pre;
    font-family: 'Courier New', Courier, monospace;
}

.controls {
    position: fixed;
    bottom: 10px;
    right: 15px;
    display: flex;
    align-items: center;
    z-index: 100;
}

.control-btn {
    background: transparent;
    border: none;
    width: 50px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(0, 0, 0, 0.02);
    margin: 0;
    position: relative;
}

.control-btn:hover {
    background: transparent;
    color: rgba(0, 0, 0, 0.1);
}

.prev-btn {
    padding-right: 0;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 100%;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-btn {
    padding-left: 0;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 100%;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000; /* 确保按钮的z-index高于面板 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0);
}

.settings-btn:hover {
    background: transparent;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.settings-btn i {
    transition: transform 0.3s ease;
    color: rgba(0, 0, 0, 0.1);
}

.settings-btn:hover i {
    transform: rotate(90deg);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1001; /* 提高z-index确保在最上层 */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    display: block; /* 确保面板元素可见 */
}

.settings-panel.active {
    transform: translateX(0) !important;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.theme-option {
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.theme-option:hover {
    transform: scale(1.05);
}

.theme-option.active {
    border: 2px solid #000;
}

.markdown-source {
    margin-top: 20px;
}

.markdown-source h3 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
}

.markdown-source input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.markdown-source button {
    display: inline-block;
    background: #4a89dc;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 1em;
    margin-right: 10px;
}

.markdown-source button:hover {
    background: #3d73b9;
}

.close-settings-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

.close-settings-btn:hover {
    color: #f00;
}

.page-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px 10px;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: right;
    background: transparent;
    width: 100%;
    z-index: 100;
}

/* 添加进度指示器样式 */
.progress-indicator {
    position: absolute; /* 相对于 presentation-container 定位 */
    bottom: 5.7%; /* 位于页码指示器上方 */
    right: 5%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    color: rgba(0, 0, 0, 0.1);
    font-size: 14px;
    z-index: 100; /* 确保它位于其他内容之上 */
}

.progress-bar-container {
    width: 60px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    min-width: 30px;
    text-align: center;
}

/* Add some more styles for better Markdown rendering */
.slide img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 10px 0;
}

.slide blockquote {
    border-left: 4px solid rgb(66, 185, 131);
    padding-left: 15px;
    color: rgb(102, 102, 102);
    margin: 20px 0;
}

.slide table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
}

.slide th, .slide td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.slide th {
    background-color: #f6f8fa;
}

.slide hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* For loading indicator */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 字体大小设置样式 */
.font-size-settings {
    margin-top: 20px;
}

.font-size-settings h3 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
}

.font-size-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.font-size-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-size-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 3px;
}

.font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4a89dc;
    border-radius: 50%;
    cursor: pointer;
}

.font-size-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a89dc;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.font-size-value {
    min-width: 50px;
    text-align: right;
    font-size: 14px;
}

.font-size-presets {
    display: flex;
    gap: 10px;
}

.font-size-preset {
    flex: 1;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.font-size-preset:hover {
    background: #e0e0e0;
}

.font-size-preset.active {
    background: #4a89dc;
    color: white;
    border-color: #4a89dc;
}

/* New styles for article list drawer */
.articles-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0);
}

.articles-btn:hover {
    background: transparent;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.articles-btn i {
    transition: transform 0.3s ease;
    color: rgba(0, 0, 0, 0.1);
}

.articles-btn:hover i {
    transform: rotate(90deg);
}

.articles-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    display: block;
}

.articles-panel.active {
    transform: translateX(0) !important;
}

.articles-panel h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #333;
}

.article-list ul {
    list-style: none;
    padding: 0;
}

.article-list li {
    margin-bottom: 10px;
}

.article-list a {
    display: block;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease, transform 0.2s ease;
}

.article-list a:hover {
    background: #e0e0e0;
    transform: translateX(5px);
}

.close-articles-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

.close-articles-btn:hover {
    color: #f00;
}