/* 自定义样式 */

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 阅读器内容样式 */
.reader-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
}

.reader-text p {
    margin-bottom: 1em;
    text-indent: 2em;
}

.reader-text h1,
.reader-text h2,
.reader-text h3,
.reader-text h4,
.reader-text h5,
.reader-text h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: bold;
    text-indent: 0;
}

/* 图片懒加载占位 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy:not([src]) {
    opacity: 0;
}

img.lazy[src] {
    opacity: 1;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 搜索结果高亮 */
mark {
    background-color: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .reader-text {
        font-size: 16px;
    }
    
    .reader-text p {
        text-indent: 1.5em;
    }
}

/* 打印样式 */
@media print {
    nav,
    footer,
    .sticky,
    button {
        display: none !important;
    }
    
    .reader-text {
        font-size: 12pt;
        line-height: 1.6;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 深色模式下的滚动条 */
.bg-dark ::-webkit-scrollbar-track {
    background: #374151;
}

.bg-dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.bg-dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
