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

:root {
    --primary-color: #AB0022;
    --secondary-color: #595757;
    --background-color: #f0f4f8;
    --text-color: #333;
    --card-bg-color: #ffffff;
    --code-bg-color: #eef1f5;
    --border-radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: var(--text-color);
    overflow: hidden;
}

.slideshow-container {
    position: relative;
    max-width: 1000px;
    width: 95%;
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.progress-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: #e0e0e0;
    z-index: 20;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #FFFFFF);
    width: 0%;
    transition: width 0.1s linear;
}

.slide {
    display: none;
    padding: 50px 60px;
    min-height: 550px;
    box-sizing: border-box;
    animation: fadeIn 0.8s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.responsive-grid-2-col,
.responsive-grid-3-col {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.responsive-grid-2-col {
    grid-template-columns: repeat(2, 1fr);
}

.responsive-grid-3-col {
    grid-template-columns: repeat(3, 1fr);
}

.slide-footer {
    text-align: right;
    font-size: 14px;
    color: #888;
    padding-top: 30px;
    margin-top: auto;
}
.slide h1 {
    font-size: 2.8rem; 
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.slide h2 {
    font-size: 2.0rem; 
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 2rem;
    text-align: center;
}


p,
li {
    font-size: 1.1rem;
    line-height: 1.8;
}

ul {
    list-style: none;
    padding-left: 0;
}

li {
    padding-left: 1.5em;
    position: relative;
    margin-bottom: 0.5em;
}

li::before {
    content: "✓";
    color: var(--secondary-color);
    font-weight: bold;
    display: inline-block;
    position: absolute;
    left: 0;
}

code {
    background-color: var(--code-bg-color);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.95em;
    color: #d63384;
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.prev,
.next {
    z-index: 15;
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -30px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s ease;
    border-radius: 0 5px 5px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.next {
    right: 0;
    border-radius: 5px 0 0 5px;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.6);
}

.pause-resume-btn {
    cursor: pointer;
    background: var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    box-shadow: 0 4px 15px rgba(171, 0, 34, 0.4);
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.pause-resume-btn:hover {
    background-color: #c40028;
    transform: translateY(-2px);
}
.pause-resume-btn svg {
    fill: white;
    width: 22px;
    height: 22px;
}
#play-icon {
    display: none;
}

.dots-container {
    text-align: center;
    padding: 20px 0;
    background-color: #fff;
}

.dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 5px;
    background-color: #ddd;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--primary-color);
}

.bottom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px; 
    padding: 15px 0;
    background-color: #fff;
    border-top: 1px solid #f0f0f0;
}

.seek-btn {
    background: #f0f4f8;
    border: none;
    border-radius: 50px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    transition: background-color 0.2s, color 0.2s;
}

.seek-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.seek-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.seek-btn.backward-btn svg {
    transform: rotate(-90deg);
}
.seek-btn.forward-btn svg {
     transform: rotate(90deg);
}

.speed-selector {
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    background-color: white;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.speed-selector:focus {
    outline: none;
    border-color: var(--primary-color);
}

.outline-btn {
    position: absolute;
    top: 15px;
    left: 15px; 
    transform: none;
    z-index: 15;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    color: white;
    transition: background-color 0.3s ease;
}

.outline-btn:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.outline-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
    margin-right: 8px;
}

.outline-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 25;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.outline-panel.visible {
    opacity: 1;
    visibility: visible;
}

.outline-content {
    background: white;
    padding: 20px 30px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 80%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.outline-panel.visible .outline-content {
    transform: scale(1);
}

.outline-content h3 {
    text-align: center;
    color: var(--primary-color);
    margin-top: 0;
}

.outline-list {
    list-style: none;
    padding: 0;
}

.outline-list li {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}
.outline-list li::before {
    content: none;
}

.outline-list li:hover {
    background-color: #f0f4f8;
}

.outline-list li.active {
    color: var(--primary-color);
    font-weight: bold;
}

#loadingIndicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    font-size: 1.2em;
    display: none;
}

@media (max-width: 768px) {
    body {
        overflow: auto;
        align-items: flex-start;
    }

    .slideshow-container {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        padding-bottom: 90px;
    }

    .slide {
        padding: 60px 25px 40px 25px;
        min-height: 450px;
    }

    .slide h1 { font-size: 2.2rem; }
    .slide h2 { font-size: 1.6rem; }
    p, li { font-size: 1rem; line-height: 1.7; }

    .prev, .next, .outline-btn {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .slideshow-container.controls-visible .prev,
    .slideshow-container.controls-visible .next,
    .slideshow-container.controls-visible .outline-btn {
        opacity: 1;
        visibility: visible;
    }

    .prev, .next {
        top: 50%;
        transform: translateY(-50%);
        padding: 12px;
        background-color: rgba(0, 0, 0, 0.4);
    }
    .prev { left: 10px; }
    .next { right: 10px; }

    .bottom-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        padding: 12px 15px;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        gap: 15px;
    }
    
    .dots-container { display: none; } 
    .outline-content { width: 90%; max-height: 75vh; }
    
    .outline-btn {
        top: 15px;
        left: 15px;
    }

    .responsive-grid-2-col,
    .responsive-grid-3-col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .responsive-grid-3-col div {
        text-align: center;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .slide {
        padding-top: 25px;
        padding-bottom: 25px;
        display: block;
        overflow-y: auto;
    }
    .slide-content { justify-content: flex-start; min-height: auto; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; margin-bottom: 10px; }
    p, li { font-size: 0.9rem; line-height: 1.6; }
    .prev, .next { top: 50%; bottom: auto; transform: translateY(-50%); margin-top: 0; }
    .bottom-controls { padding: 8px 10px; }
    .seek-btn, .speed-selector { padding: 6px 10px; font-size: 12px; }
    .seek-btn svg { width: 14px; height: 14px; }
    .pause-resume-btn { width: 40px; height: 40px; }
    .pause-resume-btn svg { width: 18px; height: 18px; }
    .slide-footer { padding-top: 15px; margin-top: 15px; }
}

/* Specific styles from vercel version for the new content */
.info-card {
    background: #fafafa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #eee;
    text-align: center;
}
.info-card h3 {
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 1.1rem;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}
.no-transition {
    transition: none !important;
}


.no-bullet {
    list-style-type: none; 
}
.no-bullet li::before {
    content: none;
}
.no-bullet li::after {
    content: none;
}

/* --- 引导系统样式 --- */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    pointer-events: none; /* 允许点击穿透遮罩层本身 */
}

.guide-highlight {
    position: fixed;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    pointer-events: none; /* 高亮框不响应点击 */
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.guide-tooltip {
    position: fixed;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    visibility: hidden;
}
.guide-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.guide-tooltip p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.guide-tooltip-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.guide-tooltip-nav button {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
}
.guide-tooltip-nav button:hover {
    background-color: #f0f0f0;
}
.guide-tooltip-nav button.skip-btn {
    background: transparent;
    color: white;
}
.guide-tooltip-nav button.skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.guide-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}
.guide-tooltip.arrow-top .guide-tooltip-arrow {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-color: var(--primary-color) transparent transparent transparent;
}
.guide-tooltip.arrow-bottom .guide-tooltip-arrow {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent var(--primary-color) transparent;
}
.guide-tooltip.arrow-left .guide-tooltip-arrow {
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--primary-color);
}
.guide-tooltip.arrow-right .guide-tooltip-arrow {
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--primary-color) transparent transparent;
}


/* 
   ==========================================================================
   核心修复逻辑：当引导激活时，强制所有控件可见并移除过渡动画
   ==========================================================================
*/
body.guide-active .slideshow-container,
body.guide-active .slideshow-container * {
    /* 禁用常规交互，防止在引导时误触 */
    pointer-events: none;
}

body.guide-active .prev,
body.guide-active .next,
body.guide-active .outline-btn {
    /*
     * 关键！无论屏幕尺寸如何，都强制显示这些按钮。
     * 使用 !important 来确保覆盖媒体查询中的 opacity: 0 和 visibility: hidden。
     */
    opacity: 1 !important;
    visibility: visible !important;
    /*
     * 关键！禁用过渡，以便 JavaScript 可以立即获得最终位置。
     * 这避免了所有竞态问题。
     */
    transition: none !important;
}

body.guide-active .guide-tooltip,
body.guide-active .guide-tooltip button {
    /* 重新启用引导提示框及其按钮的交互 */
    pointer-events: auto;
}

/* 让最后一步的高亮元素可交互 */
body.guide-active .guide-highlight.is-interactive {
    cursor: pointer;
    pointer-events: auto; /* 允许点击高亮框本身 */
}

/* 隐藏最后一步的导航按钮 */
.guide-tooltip.is-final .guide-tooltip-nav {
    display: none;
}

.guide-tooltip-nav {
    /* 确保父容器是 flex 布局且垂直居中 */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guide-progress-indicator {
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    /* 防止进度文本影响按钮布局 */
    flex-shrink: 0; 
}

.guide-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    /* 添加过渡效果使箭头移动更平滑 */
    transition: left 0.3s ease, top 0.3s ease;
}
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 在 style.css 文件末尾添加 */

/* 按钮禁用时的基础样式 */
.pause-resume-btn:disabled {
    cursor: not-allowed;
    background-color: #cccccc; /* 用灰色背景表示禁用 */
    box-shadow: none;
    transform: none;
}

/* 按钮禁用时，内部的图标也变灰 */
.pause-resume-btn:disabled svg {
    fill: #888888;
}

/* Tooltip 容器设置 */
.pause-resume-btn[data-tooltip] {
    position: relative;
}

/* Tooltip 样式 */
.pause-resume-btn[data-tooltip]::after {
    content: attr(data-tooltip); /* 读取 data-tooltip 属性的内容 */
    position: absolute;
    bottom: 120%; /* 定位在按钮上方 */
    left: 50%;
    transform: translateX(-50%);
    
    background-color: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap; /* 防止文字换行 */
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 110; /* 确保在最上层 */
}

/* Tooltip 小箭头 */
.pause-resume-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 120%;
    margin-bottom: -10px; /* 定位在 tooltip 下方 */
    left: 50%;
    transform: translateX(-50%);

    border: 5px solid transparent;
    border-top-color: #333;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 110;
}


/* 鼠标悬停在带 tooltip 的按钮上时，显示 tooltip */
.pause-resume-btn[data-tooltip]:hover::after,
.pause-resume-btn[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}