@layer utilities {
    .content-auto {
        content-visibility: auto;
    }

    .text-shadow {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

.chapter-item {
    transition: all 0.2s ease;
}

.chapter-item:hover {
    transform: translateX(4px);
}

.page-indicator {
    transition: all 0.3s ease;
}

.page-indicator.active {
    background-color: #4F46E5;
    color: white;
}

/* 夜间模式开关样式 */
#night-mode-toggle:checked+.toggle-bg {
    background-color: #4F46E5;
}

#night-mode-toggle:checked+.toggle-bg:after {
    transform: translateX(100%);
}

/* 夜间模式过渡效果 */
body,
.bg-white,
.text-gray-800,
.text-gray-700,
.text-gray-600,
.bg-gray-50,
.border-gray-200 {
    transition: all 0.3s ease;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

html {
    scroll-behavior: smooth;
}

/* 背景图（全局） */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('image/background.png');
    background-size: cover;
    background-position: center;
    opacity: 0.65;
}

.dark-mode .bg-container {
    opacity: 0.15;
}

/* 夜间模式降低背景图透明度 */

/* 字数标签 */
.word-count-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s ease;
}

.word-count-badge:hover {
    transform: scale(1.05);
}

/* 标题区域 */
.title-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}