* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
height: 100%;
background: var(--clr-bg);
color: var(--clr-text);
font-family: var(--font-body);
-webkit-font-smoothing: antialiased;
overscroll-behavior: none;
}
button {
font: inherit;
color: inherit;
background: none;
border: none;
cursor: pointer;
}
.viewer {
position: relative;
height: 100dvh;
display: flex;
flex-direction: column;
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 0 16px;
height: 56px;
flex: none;
border-bottom: 1px solid var(--clr-border);
background: color-mix(in srgb, var(--clr-surface) 88%, transparent);
backdrop-filter: saturate(180%) blur(14px);
-webkit-backdrop-filter: saturate(180%) blur(14px);
z-index: 30;
}
.title {
font-family: var(--font-heading);
font-weight: 600;
font-size: 15px;
letter-spacing: -0.01em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--clr-text);
}
.topbar-actions {
display: flex;
align-items: center;
gap: 4px;
}
.icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 38px;
height: 38px;
border-radius: 999px;
color: var(--clr-text);
text-decoration: none;
transition: background-color 0.15s ease;
}
.icon-btn:hover {
background: var(--clr-border);
}
.sidebar {
position: fixed;
top: 56px;
left: 0;
bottom: 0;
width: 200px;
background: var(--clr-surface);
border-right: 1px solid var(--clr-border);
transform: translateX(-100%);
transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 40;
overflow: hidden;
}
.sidebar.open {
transform: translateX(0);
}
.sidebar-inner {
height: 100%;
overflow-y: auto;
padding: 12px;
display: grid;
gap: 10px;
}
.thumb-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
padding: 6px;
border-radius: 10px;
border: 1px solid transparent;
}
.thumb-item img {
width: 100%;
border-radius: 6px;
border: 1px solid var(--clr-border);
display: block;
}
.thumb-item span {
font-size: 11px;
color: var(--clr-muted);
}
.thumb-item.active {
border-color: var(--clr-accent);
}
.thumb-item.active img {
border-color: var(--clr-accent);
}
.sidebar-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.4);
opacity: 0;
pointer-events: none;
transition: opacity 0.25s ease;
z-index: 35;
}
.sidebar-overlay.open {
opacity: 1;
pointer-events: auto;
}
.search-panel {
position: fixed;
z-index: 41;
top: 64px;
right: 16px;
left: 16px;
width: auto;
max-width: 380px;
margin-left: auto;
max-height: min(70vh, 560px);
background: var(--clr-surface);
border: 1px solid var(--clr-border);
border-radius: var(--radius);
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
display: flex;
flex-direction: column;
opacity: 0;
visibility: hidden;
transform: translateY(-8px);
transition: opacity 0.2s ease, transform 0.2s ease;
}
.search-panel.open {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.search-input-row {
flex: none;
display: flex;
align-items: center;
gap: 10px;
padding: 12px 12px 12px 16px;
border-bottom: 1px solid var(--clr-border);
color: var(--clr-muted);
}
.search-input-row #searchInput {
flex: 1;
min-width: 0;
font: inherit;
font-size: 14px;
color: var(--clr-text);
background: none;
border: none;
outline: none;
}
.search-input-row #searchInput::placeholder {
color: var(--clr-muted);
}
.search-input-row .icon-btn {
width: 30px;
height: 30px;
}
.search-results {
overflow-y: auto;
padding: 8px;
display: grid;
gap: 6px;
}
.search-message {
margin: 0;
padding: 14px 10px;
font-size: 13px;
color: var(--clr-muted);
text-align: center;
}
.search-result-item {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
padding: 8px;
border-radius: 10px;
text-align: left;
transition: background-color 0.15s ease;
}
.search-result-item:hover {
background: var(--clr-border);
}
.search-result-item img {
flex: none;
width: 42px;
border-radius: 4px;
border: 1px solid var(--clr-border);
display: block;
}
.search-result-body {
min-width: 0;
display: flex;
flex-direction: column;
gap: 3px;
}
.search-result-page {
font-size: 11px;
font-weight: 600;
color: var(--clr-accent);
}
.search-result-snippet {
margin: 0;
font-size: 12.5px;
line-height: 1.5;
color: var(--clr-muted);
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.search-result-snippet mark {
background: color-mix(in srgb, var(--clr-accent) 30%, transparent);
color: var(--clr-text);
border-radius: 2px;
}
@media (max-width: 768px) {
.search-panel {
top: 56px;
right: 8px;
left: 8px;
max-width: none;
}
}
.stage {
position: relative;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
padding: 24px;
}
.pages {
position: relative;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
perspective: 2200px;
}
.page-turn-layer {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
.spread {
display: flex;
gap: 0;
height: 100%;
align-items: center;
justify-content: center;
transition: transform 0.25s ease;
}
.page-image {
max-width: 100%;
max-height: 100%;
object-fit: contain;
border-radius: 4px;
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
background: var(--clr-surface);
cursor: zoom-in;
transition: transform 0.25s ease;
touch-action: pan-y;
}
.page-image.zoomed {
cursor: zoom-out;
touch-action: none;
}
.spread .page-image {
max-width: 50%;
border-radius: 0;
box-shadow: none;
background: none;
}
.spread .page-image.spread-full {
max-width: 100%;
}
.spread.zoomed .page-image {
cursor: zoom-out;
}
.nav-btn {
position: absolute;
top: 50%;
translate: 0 -50%;
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 999px;
background: color-mix(in srgb, var(--clr-surface) 75%, transparent);
border: 1px solid var(--clr-border);
color: var(--clr-text);
z-index: 20;
transition: opacity 0.15s ease, background-color 0.15s ease;
}
.nav-btn:hover {
background: var(--clr-surface);
}
.nav-prev {
left: 16px;
}
.nav-next {
right: 16px;
}
.nav-btn.is-hidden {
display: none;
}
.footer {
flex: none;
display: flex;
justify-content: center;
padding: 10px 0 14px;
font-size: 12px;
color: var(--clr-muted);
letter-spacing: 0.02em;
}
.pages.view-scroll {
display: block;
overflow-y: auto;
scroll-snap-type: y mandatory;
perspective: none;
}
.scroll-page {
height: 100%;
scroll-snap-align: start;
scroll-snap-stop: always;
display: flex;
align-items: center;
justify-content: center;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideIn {
from { opacity: 0; transform: translateX(24px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes foldAwayLeft {
from { transform: rotateY(0deg); }
to { transform: rotateY(100deg); }
}
@keyframes foldAwayRight {
from { transform: rotateY(0deg); }
to { transform: rotateY(-100deg); }
}
.transition-fade .page-turn-layer {
animation: fadeIn 0.35s ease;
will-change: opacity;
}
.transition-slide .page-turn-layer {
animation: slideIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
will-change: opacity, transform;
}
.fold-half {
z-index: 2;
backface-visibility: hidden;
will-change: transform;
}
.fold-left {
clip-path: inset(0 50% 0 0);
transform-origin: 50% 50%;
}
.fold-right {
clip-path: inset(0 0 0 50%);
transform-origin: 50% 50%;
}
.fold-left.turning {
animation: foldAwayLeft 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.fold-right.turning {
animation: foldAwayRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.icon-btn {
position: relative;
}
.icon-btn::after,
.nav-btn::after {
content: attr(aria-label);
position: absolute;
top: calc(100% + 10px);
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
padding: 5px 10px;
border-radius: 6px;
background: rgba(20, 20, 20, 0.9);
color: #fff;
font-size: 12px;
font-weight: 500;
letter-spacing: 0.01em;
opacity: 0;
pointer-events: none;
transition: opacity 0.15s ease;
z-index: 50;
}
#sidebarToggle::after {
left: 0;
transform: none;
}
#fullscreenToggle::after {
left: auto;
right: 0;
transform: none;
}
.nav-btn::after {
top: auto;
bottom: calc(100% + 10px);
}
.nav-prev::after {
left: 0;
transform: none;
}
.nav-next::after {
left: auto;
right: 0;
transform: none;
}
@media (hover: hover) {
.icon-btn:hover::after,
.nav-btn:hover::after {
opacity: 1;
transition-delay: 0.5s;
}
}
@media (max-width: 768px) {
.sidebar {
width: 78vw;
max-width: 280px;
}
.nav-btn {
display: none;
}
.stage {
padding: 0;
}
.page-image {
border-radius: 0;
}
}
#app:fullscreen {
background: var(--clr-bg);
}
#app:fullscreen .stage {
padding: 40px;
}
.cta-fab {
position: fixed;
right: 20px;
bottom: 24px;
z-index: 25;
display: none;
align-items: center;
padding: 14px 22px;
border-radius: 999px;
background: var(--clr-accent);
color: #fff;
font-family: var(--font-heading);
font-weight: 700;
font-size: 14px;
letter-spacing: 0.01em;
text-decoration: none;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta-fab.visible {
display: inline-flex;
}
.cta-fab:hover {
transform: translateY(-2px);
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}
@media (max-width: 768px) {
.cta-fab {
right: 14px;
bottom: 16px;
padding: 12px 18px;
font-size: 13px;
}
}
#app:fullscreen .cta-fab {
right: 40px;
bottom: 40px;
}
.toc-panel-title {
flex: 1;
font-size: 14px;
font-weight: 700;
color: var(--clr-text);
}
.toc-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
width: 100%;
padding: 10px 12px;
border-radius: 10px;
text-align: left;
font-size: 13px;
color: var(--clr-text);
transition: background-color 0.15s ease;
}
.toc-item:hover {
background: var(--clr-border);
}
.toc-item .toc-item-page {
flex: none;
font-size: 12px;
color: var(--clr-muted);
}