.nav-space {
    width: 150px;
    flex-shrink: 0;
}

.text-transition {
    transition-duration: .15s;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
}

.text-duration {
    transition-duration: .3s;
}

p a {
    position: relative;
    z-index: 1;
    background-color: transparent;
    text-decoration: none;
}

p a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0.5em;
    background-color: rgba(219, 110, 167, 0.5);
    z-index: -1;
    transition: height 0.3s cubic-bezier(.4,0,.2,1);
}

p a:hover::before {
    height: 1.2em;
}

/* 未访问的链接 */
p a:link {
    color: #8B0000; 
}

/* 已访问的链接 */
p a:visited {
    color: #8B0000;     
}

p a:active {
    color: #8B0000; 
}




.viewer-container {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 700px;
    width: 100%;
    max-width: 1200px;
}

.caption-panel {
    width: 100px; /* 原来的三分之一 */
    padding: 0;
    background: white;
    color: black;
    display: flex;
    flex-direction: column;
    overflow-y: hidden; /* 改为hidden，因为现在不需要滚动 */
}

.caption-block {
    flex: 1; /* 每个色块均匀分布 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    padding: 10px;
    transition: all 0.3s ease;
}

.caption-block:nth-child(1) {
    background-color: #fadfeb; /* Design - 蓝色 */
}

.caption-block:nth-child(2) {
    background-color: #dfe1f2; /* Build - 绿色 */
}

.caption-block:nth-child(3) {
    background-color: #ecd8e9; /* Test - 橙色 */
}

.caption-block:nth-child(4) {
    background-color: #f9d0ce; /* Learning - 紫色 */
}

.viewer-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.scroll-container {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    position: relative;
    -webkit-overflow-scrolling: touch; /* 移动端流畅滚动 */
}

/* 自定义滚动条样式 */
.scroll-container::-webkit-scrollbar {
    height: 12px;
}

.scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 182, 193, 0.2);
    border-radius: 6px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 182, 193, 0.7);
    border-radius: 6px;
    border: 2px solid rgba(255, 182, 193, 0.2);
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 182, 193, 0.9);
}

.long-image {
    height: 100%;
    min-width: 100%;
    object-fit: cover;
    display: block;
}

.scroll-arrows {
    position: absolute;
    top: 0;
    bottom: 12px; /* 减去滚动条高度 */
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.viewer-panel:hover .scroll-arrows {
    opacity: 0.7;
    pointer-events: auto;
}

.scroll-arrows:hover {
    background: rgba(0, 0, 0, 0.2);
    opacity: 1 !important;
}

.arrow-left {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.arrow-right {
    right: 0;
    border-radius: 8px 0 0 8px;
}

.scroll-indicator {
    position: absolute;
    bottom: 32px; /* 20px + 12px滚动条高度 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-indicator i {
    font-size: 1.2rem;
}

/* 移动端触摸指示器 */
.touch-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.touch-indicator.show {
    display: flex;
    animation: fadeInOut 2s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* 响应式设计 - 平板 */
@media (max-width: 1024px) {
    .viewer-container {
        height: 600px;
    }
    
    .caption-panel {
        width: 83px; /* 保持比例 */
    }
    
    .caption-block {
        font-size: 0.9rem;
    }
}

/* 响应式设计 - 手机（保持横向布局） */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .viewer-container {
        height: 500px;
        flex-direction: row; /* 保持横向布局 */
    }
    
    .caption-panel {
        width: 40px; /* 手机端缩小图注区域宽度 */
    }
    
    .caption-block {
        font-size: 0.7rem;
        writing-mode: vertical-rl; /* 垂直文本 */
        text-orientation: mixed;
        padding: 5px;
    }
    
    .scroll-arrows {
        width: 40px;
        font-size: 1.5rem;
        opacity: 0.7; /* 移动端默认显示箭头 */
        pointer-events: auto;
        bottom: 12px; /* 保持滚动条高度 */
    }
    
    .scroll-indicator {
        bottom: 32px; /* 保持相对位置 */
        font-size: 0.7rem;
        padding: 5px 10px;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 480px) {
    .viewer-container {
        height: 400px;
    }
    
    .caption-panel {
        width: 33px;
    }
    
    .caption-block {
        font-size: 0.6rem;
    }
    
    .scroll-arrows {
        width: 35px;
        font-size: 1.3rem;
        bottom: 12px; /* 保持滚动条高度 */
    }
    
    .scroll-indicator {
        font-size: 0.65rem;
        padding: 4px 8px;
        bottom: 32px; /* 保持相对位置 */
    }
}

/* 响应式设计 - 超小屏手机 */
@media (max-width: 360px) {
    .viewer-container {
        height: 350px;
    }
    
    .caption-panel {
        width: 27px;
    }
    
    .caption-block {
        font-size: 0.5rem;
    }
}