/* --- 1. 核心变量与背景设置 --- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --accent-color: #3b82f6;
    --text-main: #2d3748;
    /* Q弹动画曲线：这是灵魂 */
    --spring-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.bg-novel-gradient {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    font-family: 'Noto Sans SC', sans-serif;
}

/* --- 2. 背景氛围装饰圆 --- */
.glass-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.blob-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blob-float 20s infinite alternate;
}

.blob-blue {
    width: 500px;
    height: 500px;
    background: #60a5fa;
    top: -100px;
    right: -100px;
}

.blob-indigo {
    width: 400px;
    height: 400px;
    background: #818cf8;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

@keyframes blob-float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 50px) scale(1.1); }
}

/* --- 3. 毛玻璃组件基础 --- */
.glass-header, .glass-sidebar, .glass-card, .glass-toc {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* 顶部导航 */
.glass-header {
    border-radius: 20px;
}

/* 侧边栏 */
.glass-sidebar {
    border-radius: 24px;
    height: calc(100vh - 120px);
}

/* 正文卡片 */
.glass-card {
    border-radius: 32px;
    margin-top: 1rem;
}

/* --- 4. 动画效果 --- */
@keyframes popIn {
    0% { transform: scale(0.96) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.animate-pop-in {
    animation: popIn 0.6s var(--spring-easing) forwards;
}

/* --- 5. 小说排版优化 --- */
.prose {
    color: var(--text-main);
    line-height: 2.2;
    font-size: 1.15rem;
}

.prose h1 {
    font-weight: 800;
    font-size: 2.5rem;
    background: linear-gradient(120deg, #1e40af, #4338ca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 3rem !important;
}

.prose p {
    margin-bottom: 2rem;
    text-indent: 2em; /* 自动首行缩进 */
}

/* --- 6. 章节导航按钮 --- */
.nav-footer {
    margin-top: 6rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.publish-date {
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.nav-btn-group {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.nav-btn {
    padding: 0.8rem 1.8rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.4s var(--spring-easing);
    text-decoration: none !important;
}

.nav-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: #fff;
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.15);
    color: var(--accent-color);
}

.end-label {
    color: #cbd5e1;
    font-style: italic;
    font-size: 0.9rem;
}

/* --- 7. 子分类与滚动条 --- */
.sidebar-sub-container {
    margin-left: 1.25rem;
    padding-left: 0.75rem;
    border-left: 1.5px solid rgba(59, 130, 246, 0.2);
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

/* --- 8. 响应式补丁 --- */
@media (max-width: 768px) {
    .glass-header { top: 0; left: 0; right: 0; border-radius: 0; }
    .glass-card { border-radius: 20px; padding: 1.5rem !important; }
    .prose { font-size: 1.1rem; }
}