614 lines
12 KiB
CSS
614 lines
12 KiB
CSS
/* ============================================
|
||
阅读器样式 - 专用于阅读页面
|
||
============================================ */
|
||
|
||
/* 阅读器容器 */
|
||
.reader-page {
|
||
min-height: 100vh;
|
||
min-height: 100dvh;
|
||
background: var(--reader-bg);
|
||
transition: background var(--transition-normal);
|
||
}
|
||
|
||
/* ========== 滚动模式 ========== */
|
||
.reader-page.scroll-mode .reader-content {
|
||
max-width: 720px;
|
||
margin: 0 auto;
|
||
padding: var(--spacing-lg);
|
||
padding-top: calc(var(--spacing-xl) + var(--safe-area-top));
|
||
padding-bottom: calc(100px + var(--safe-area-bottom));
|
||
}
|
||
|
||
/* ========== 翻页模式 ========== */
|
||
.reader-page.page-mode {
|
||
position: fixed;
|
||
inset: 0;
|
||
overflow: hidden;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.page-container {
|
||
flex: 1;
|
||
overflow: hidden;
|
||
position: relative;
|
||
/* 增加左右内边距,作为页面边距,同时避免文字贴边 */
|
||
padding: 0 20px;
|
||
padding-top: calc(var(--spacing-xl) + var(--safe-area-top));
|
||
padding-bottom: calc(var(--spacing-lg) + var(--safe-area-bottom));
|
||
padding-left: calc(20px + var(--safe-area-left));
|
||
padding-right: calc(20px + var(--safe-area-right));
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.page-content {
|
||
height: 100%;
|
||
margin: 0;
|
||
box-sizing: border-box;
|
||
|
||
/* 多栏布局 - 实现横向分页 */
|
||
column-fill: auto;
|
||
/* gap由js设置为0,这里设个默认值 */
|
||
column-gap: 0;
|
||
|
||
/* 动画 */
|
||
transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
|
||
will-change: transform;
|
||
|
||
/* 确保文本对齐 */
|
||
text-align: justify;
|
||
}
|
||
|
||
.page-content p {
|
||
margin-bottom: 1em;
|
||
/* 防止段落内分页断行太过难看 */
|
||
widows: 2;
|
||
orphans: 2;
|
||
}
|
||
|
||
/* 页码指示器 */
|
||
.page-indicator {
|
||
position: fixed;
|
||
bottom: calc(var(--spacing-md) + var(--safe-area-bottom));
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
font-size: var(--font-size-xs);
|
||
color: var(--text-muted);
|
||
background: rgba(0, 0, 0, 0.5);
|
||
padding: 4px 12px;
|
||
border-radius: var(--radius-full);
|
||
z-index: 50;
|
||
}
|
||
|
||
/* 点击区域 */
|
||
.page-tap-zones {
|
||
position: fixed;
|
||
inset: 0;
|
||
display: flex;
|
||
z-index: 10;
|
||
pointer-events: auto;
|
||
}
|
||
|
||
.tap-zone {
|
||
height: 100%;
|
||
}
|
||
|
||
.tap-prev {
|
||
width: 30%;
|
||
}
|
||
|
||
.tap-center {
|
||
width: 40%;
|
||
}
|
||
|
||
.tap-next {
|
||
width: 30%;
|
||
}
|
||
|
||
/* 兼容旧的reader-content类 */
|
||
.reader-content {
|
||
max-width: 720px;
|
||
margin: 0 auto;
|
||
padding: var(--spacing-lg);
|
||
padding-top: calc(var(--spacing-xl) + var(--safe-area-top));
|
||
padding-bottom: calc(100px + var(--safe-area-bottom));
|
||
}
|
||
|
||
.reader-chapter-title {
|
||
font-size: var(--font-size-xl);
|
||
font-weight: 600;
|
||
color: var(--reader-text);
|
||
text-align: center;
|
||
margin-bottom: var(--spacing-xl);
|
||
padding-bottom: var(--spacing-lg);
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
.reader-text {
|
||
font-size: var(--reader-font-size, 18px);
|
||
line-height: var(--reader-line-height, 1.8);
|
||
color: var(--reader-text);
|
||
text-align: justify;
|
||
word-break: break-word;
|
||
}
|
||
|
||
.reader-text p {
|
||
text-indent: 2em;
|
||
margin-bottom: 1em;
|
||
}
|
||
|
||
/* 章节导航 */
|
||
.reader-nav {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
padding: var(--spacing-lg) 0;
|
||
margin-top: var(--spacing-xl);
|
||
border-top: 1px solid var(--border-color);
|
||
}
|
||
|
||
.reader-nav button {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--spacing-xs);
|
||
padding: var(--spacing-sm) var(--spacing-md);
|
||
background: var(--bg-card);
|
||
border-radius: var(--radius-md);
|
||
color: var(--text-secondary);
|
||
font-size: var(--font-size-sm);
|
||
transition: all var(--transition-fast);
|
||
}
|
||
|
||
.reader-nav button:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
}
|
||
|
||
.reader-nav button:not(:disabled):active {
|
||
background: var(--bg-hover);
|
||
}
|
||
|
||
.reader-nav svg {
|
||
width: 16px;
|
||
height: 16px;
|
||
fill: currentColor;
|
||
}
|
||
|
||
/* 阅读器工具栏 */
|
||
#reader-toolbar {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 150;
|
||
pointer-events: none;
|
||
opacity: 0;
|
||
transition: opacity var(--transition-fast);
|
||
}
|
||
|
||
#reader-toolbar.visible {
|
||
opacity: 1;
|
||
pointer-events: auto;
|
||
}
|
||
|
||
.toolbar-top {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: var(--spacing-md);
|
||
padding-top: calc(var(--spacing-md) + var(--safe-area-top));
|
||
background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
|
||
}
|
||
|
||
.toolbar-top #reader-title {
|
||
flex: 1;
|
||
text-align: center;
|
||
font-size: var(--font-size-md);
|
||
color: white;
|
||
padding: 0 var(--spacing-md);
|
||
}
|
||
|
||
.toolbar-bottom {
|
||
position: fixed;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-around;
|
||
padding: var(--spacing-md);
|
||
padding-bottom: calc(var(--spacing-md) + var(--safe-area-bottom));
|
||
background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, transparent 100%);
|
||
}
|
||
|
||
.toolbar-btn {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: 4px;
|
||
padding: var(--spacing-sm);
|
||
color: white;
|
||
min-width: 60px;
|
||
}
|
||
|
||
.toolbar-btn svg {
|
||
width: 24px;
|
||
height: 24px;
|
||
fill: currentColor;
|
||
}
|
||
|
||
.toolbar-btn span {
|
||
font-size: var(--font-size-xs);
|
||
}
|
||
|
||
#reader-prev,
|
||
#reader-next {
|
||
flex-direction: row;
|
||
gap: var(--spacing-xs);
|
||
}
|
||
|
||
/* 阅读设置面板 */
|
||
#reader-settings-panel {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 200;
|
||
}
|
||
|
||
#reader-settings-panel .settings-overlay {
|
||
position: absolute;
|
||
inset: 0;
|
||
background: rgba(0, 0, 0, 0.5);
|
||
}
|
||
|
||
.settings-content {
|
||
position: absolute;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
background: var(--bg-secondary);
|
||
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
|
||
padding-bottom: var(--safe-area-bottom);
|
||
animation: slideInUp var(--transition-normal) ease;
|
||
}
|
||
|
||
.settings-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: var(--spacing-md) var(--spacing-lg);
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
.settings-header span {
|
||
font-size: var(--font-size-lg);
|
||
font-weight: 600;
|
||
}
|
||
|
||
#close-settings {
|
||
width: 32px;
|
||
height: 32px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
#close-settings svg {
|
||
width: 24px;
|
||
height: 24px;
|
||
fill: var(--text-secondary);
|
||
}
|
||
|
||
.settings-group {
|
||
padding: var(--spacing-md) var(--spacing-lg);
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
.settings-group:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.settings-group label {
|
||
display: block;
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-muted);
|
||
margin-bottom: var(--spacing-sm);
|
||
}
|
||
|
||
/* 字体大小控制 */
|
||
.font-size-control {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: var(--spacing-lg);
|
||
}
|
||
|
||
.font-size-control button {
|
||
width: 44px;
|
||
height: 44px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: var(--bg-card);
|
||
border-radius: var(--radius-md);
|
||
font-size: var(--font-size-md);
|
||
font-weight: 600;
|
||
transition: background var(--transition-fast);
|
||
}
|
||
|
||
.font-size-control button:active {
|
||
background: var(--bg-hover);
|
||
}
|
||
|
||
#font-size-value {
|
||
min-width: 40px;
|
||
text-align: center;
|
||
font-size: var(--font-size-lg);
|
||
}
|
||
|
||
/* 行间距控制 */
|
||
.line-height-control {
|
||
display: flex;
|
||
gap: var(--spacing-sm);
|
||
}
|
||
|
||
.line-height-btn {
|
||
flex: 1;
|
||
padding: var(--spacing-sm) var(--spacing-md);
|
||
background: var(--bg-card);
|
||
border-radius: var(--radius-md);
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-secondary);
|
||
transition: all var(--transition-fast);
|
||
}
|
||
|
||
.line-height-btn.active {
|
||
background: var(--primary);
|
||
color: var(--bg-primary);
|
||
}
|
||
|
||
/* 阅读模式控制 */
|
||
.reading-mode-control {
|
||
display: flex;
|
||
gap: var(--spacing-sm);
|
||
}
|
||
|
||
.reading-mode-btn {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: var(--spacing-xs);
|
||
padding: var(--spacing-md);
|
||
background: var(--bg-card);
|
||
border-radius: var(--radius-md);
|
||
color: var(--text-secondary);
|
||
transition: all var(--transition-fast);
|
||
}
|
||
|
||
.reading-mode-btn svg {
|
||
width: 28px;
|
||
height: 28px;
|
||
fill: currentColor;
|
||
}
|
||
|
||
.reading-mode-btn span {
|
||
font-size: var(--font-size-xs);
|
||
}
|
||
|
||
.reading-mode-btn.active {
|
||
background: var(--primary);
|
||
color: var(--bg-primary);
|
||
}
|
||
|
||
/* 主题选择 */
|
||
.theme-control {
|
||
display: flex;
|
||
gap: var(--spacing-md);
|
||
justify-content: center;
|
||
}
|
||
|
||
.theme-btn {
|
||
width: 48px;
|
||
height: 48px;
|
||
padding: 4px;
|
||
border-radius: var(--radius-md);
|
||
border: 2px solid transparent;
|
||
transition: border-color var(--transition-fast);
|
||
}
|
||
|
||
.theme-btn.active {
|
||
border-color: var(--primary);
|
||
}
|
||
|
||
.theme-preview {
|
||
display: block;
|
||
width: 100%;
|
||
height: 100%;
|
||
border-radius: var(--radius-sm);
|
||
}
|
||
|
||
.theme-preview.light {
|
||
background: #f8f5f0;
|
||
border: 1px solid #d8d4cc;
|
||
}
|
||
|
||
.theme-preview.sepia {
|
||
background: #f4ecd8;
|
||
border: 1px solid #d4c8b0;
|
||
}
|
||
|
||
.theme-preview.dark {
|
||
background: #1a1a2e;
|
||
border: 1px solid #3a3a5a;
|
||
}
|
||
|
||
.theme-preview.amoled {
|
||
background: #000000;
|
||
border: 1px solid #2a2a2a;
|
||
}
|
||
|
||
/* 目录面板 */
|
||
#catalog-panel {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 200;
|
||
}
|
||
|
||
#catalog-panel .catalog-overlay {
|
||
position: absolute;
|
||
inset: 0;
|
||
background: rgba(0, 0, 0, 0.5);
|
||
}
|
||
|
||
.catalog-content {
|
||
position: absolute;
|
||
top: 0;
|
||
bottom: 0;
|
||
right: 0;
|
||
width: 85%;
|
||
max-width: 360px;
|
||
background: var(--bg-secondary);
|
||
display: flex;
|
||
flex-direction: column;
|
||
animation: slideInFromRight var(--transition-normal) ease;
|
||
}
|
||
|
||
@keyframes slideInFromRight {
|
||
from {
|
||
transform: translateX(100%);
|
||
}
|
||
to {
|
||
transform: translateX(0);
|
||
}
|
||
}
|
||
|
||
.catalog-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: var(--spacing-md) var(--spacing-lg);
|
||
padding-top: calc(var(--spacing-md) + var(--safe-area-top));
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
.catalog-header span {
|
||
font-size: var(--font-size-lg);
|
||
font-weight: 600;
|
||
}
|
||
|
||
#close-catalog {
|
||
width: 32px;
|
||
height: 32px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
#close-catalog svg {
|
||
width: 24px;
|
||
height: 24px;
|
||
fill: var(--text-secondary);
|
||
}
|
||
|
||
.catalog-search {
|
||
padding: var(--spacing-sm) var(--spacing-lg);
|
||
border-bottom: 1px solid var(--border-color);
|
||
}
|
||
|
||
.catalog-search input {
|
||
width: 100%;
|
||
padding: var(--spacing-sm) var(--spacing-md);
|
||
background: var(--bg-primary);
|
||
border-radius: var(--radius-md);
|
||
font-size: var(--font-size-sm);
|
||
}
|
||
|
||
.catalog-search input::placeholder {
|
||
color: var(--text-muted);
|
||
}
|
||
|
||
.catalog-list {
|
||
flex: 1;
|
||
overflow-y: auto;
|
||
padding-bottom: var(--safe-area-bottom);
|
||
}
|
||
|
||
.catalog-list .chapter-item {
|
||
padding: var(--spacing-md) var(--spacing-lg);
|
||
}
|
||
|
||
/* 阅读进度指示器 */
|
||
.reading-progress-indicator {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 3px;
|
||
background: var(--bg-hover);
|
||
z-index: 160;
|
||
opacity: 0;
|
||
transition: opacity var(--transition-fast);
|
||
}
|
||
|
||
.reading-progress-indicator.visible {
|
||
opacity: 1;
|
||
}
|
||
|
||
.reading-progress-indicator .progress-bar {
|
||
height: 100%;
|
||
background: var(--primary);
|
||
transition: width 0.1s linear;
|
||
}
|
||
|
||
/* 章节加载状态 */
|
||
.chapter-loading {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-height: 300px;
|
||
gap: var(--spacing-md);
|
||
}
|
||
|
||
.chapter-loading .loading-spinner {
|
||
width: 32px;
|
||
height: 32px;
|
||
}
|
||
|
||
.chapter-loading span {
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-muted);
|
||
}
|
||
|
||
/* 章节错误状态 */
|
||
.chapter-error {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-height: 300px;
|
||
gap: var(--spacing-md);
|
||
text-align: center;
|
||
padding: var(--spacing-lg);
|
||
}
|
||
|
||
.chapter-error svg {
|
||
width: 48px;
|
||
height: 48px;
|
||
fill: var(--text-muted);
|
||
}
|
||
|
||
.chapter-error p {
|
||
color: var(--text-muted);
|
||
}
|
||
|
||
.chapter-error button {
|
||
padding: var(--spacing-sm) var(--spacing-lg);
|
||
background: var(--primary);
|
||
color: var(--bg-primary);
|
||
border-radius: var(--radius-md);
|
||
margin-top: var(--spacing-sm);
|
||
}
|
||
|