body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Disable default scrolling */
    background-color: #f0f0f0;
    position: relative;
    user-select: none;
    /* Prevent text selection */
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight */
}

#stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 90px);
    /* Adjust height to exclude toolbar */
    /* Mask top and bottom 5vh to hide off-screen papers */
    /* clip-path: inset(5vh 0 5vh 0); Removed to allow full view */
    overflow: hidden;
}

#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    /* Will be managed by JS/CSS for sliding */
    padding-top: 0;
    position: absolute;
    /* Allow moving the whole container */
    top: 0;
    left: 0;
    will-change: transform;
    /* Optimize for animation */
    touch-action: none;
    /* Prevent browser handling of gestures */
    pointer-events: auto;
    /* Ensure container captures events */
}

.page-wrapper {
    width: 100%;
    height: auto;
    /* Allow stacking */
    display: flex;
    flex-direction: column;
    /* Column for Date - Paper - Text */
    align-items: center;
    justify-content: center;
    /* Center vertically */
    flex-shrink: 0;
    /* Prevent shrinking in flex container */
    padding: 0;
    margin: 0;
    margin-bottom: 0px;
    /* Seamless means no margin? Or small margin? User said "seamless", so 0 */
}

/* 隐藏连版水平滚动条 */
.page-wrapper::-webkit-scrollbar {
    display: none;
}

.static-overlay {
    position: fixed;
    /* Changed to fixed to be independent of stage */
    left: 50%;
    transform: translateX(-50%);
    display: none; /* 初始完全隐藏 */
    align-items: center;
    justify-content: center;
    z-index: 200;
    pointer-events: none;
    opacity: 0; /* 配合动画效果 */
    transition: opacity 0.2s ease-in;
}

#static-date {
    width: 45%;
    height: 30px;
    background: #D2D2D2;
    border-radius: 16px;
    opacity: 0;
    color: #000;
    font-size: 14px;
    pointer-events: auto;
    /* Enable interaction for date if needed */
}

#static-hint {
    font-size: 14px;
    color: #666;
    text-align: center;
    height: 20px;
    opacity: 0;
}

.paper-box {
    position: relative;
    width: 80%;
    /* Changed from 90% to 80% */
    /* height: auto;  Set by JS based on aspect ratio */
    margin-bottom: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Re-added shadow for card look */
}

/* .paper-box.active { display: block; } Removed */
.paper-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
}

.paper-img-layout,
.paper-img-origin {
    display: none;
    /* Hide original images, we draw on canvas */
}

#toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 22vw;
    height: 100%;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.toolbar-btn img {
    width: 22px;
    height: 22px;
    margin-bottom: 6px;
}

#image-viewer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 90px);
    /* Exclude toolbar */
    display: none;
    z-index: 900;
}

#image-viewer .iv-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Center perfectly */
    width: 80vw;
    background: #000;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    /* Reset top/left from previous logic if any */
}

#image-viewer .iv-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    will-change: transform;
}

#image-viewer .iv-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
}

#edition-selector {
    position: fixed;
    bottom: 105px;
    left: 50%;
    transform: translateX(-50%);
    width: 70vw;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 15px;
    z-index: 1001;
    max-height: 40vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.edition-item {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.edition-item.active {
    background: #007aff;
    color: white;
}

/* 目录 start*/
.list {
    /* display: block; */
    display: none;
    position: fixed;
    width: 100vw;
    height: calc(100vh - 200px);
    background-color: #fff;
    top: 0;
    left: 0;
    overflow-y: scroll;
    z-index: 1500;
}

.list .items .item .h3Class {
    padding: 1em 0 1em 45px;
    background-color: #fff;
    font-size: 15px;
    color: #4B83FF;
    position: relative;
        margin-block-start: 0em;
    margin-block-end: 0em;
}

.list .items .item .h3Class::before {
    content: '';
    width: 3px;
    height: 13px;
    background: #4B83FE;
    border-radius: 2px;
    margin-right: 12px;
    position: absolute;
    left: 30px;
    top: 20px;

}

.list .items .item .ulClass {
    padding: 0 30px;
    background-color: #F4F4F4;
    font-size: 15px;
    color: #000;
    margin-block-start: 0em;
    margin-block-end: 0em;
}

.list .items .item .ulClass li {
    list-style: none;
}

.list .items .item .ulClass li a {
    font-size: 15px;
    color: #000;
    text-decoration: none;
    line-height: 45px;
}