body.reader-body-page { overflow-x: hidden; background-color: #f1f5f9; }
body.reader-body-page .bg-canvas, body.reader-body-page .bg-blobs-container { display: none !important; }

.reader-overlay { position: fixed; inset: 0; z-index: 90; overflow-y: auto; display: none; flex-direction: column; }
.reader-overlay::before { content: ''; position: fixed; inset: 0; z-index: -2; background-color: #f1f5f9; background-image: radial-gradient(circle at 10% 20%, rgba(186, 230, 253, 0.4) 0%, transparent 50%), radial-gradient(circle at 90% 15%, rgba(254, 243, 199, 0.3) 0%, transparent 50%), radial-gradient(circle at 50% 80%, rgba(224, 231, 255, 0.4) 0%, transparent 50%); }
.reader-overlay::after { content: ''; position: fixed; inset: 0; z-index: -1; backdrop-filter: blur(80px); background: rgba(255, 255, 255, 0.65); }
.reader-overlay.visible { display: flex; }
.reader-page { min-height: 100vh; opacity: 1 !important; }
.reader-page .reader-overlay { position: relative; inset: auto; z-index: 10; display: flex; }

.reader-content { max-width: 1080px; margin: 0 auto; padding: 7.5rem 1.65rem 6.6rem; width: 100%; display: flex; flex-direction: column; }
.reader-title { font-family: var(--font-raleway); font-size: 2.0625rem; font-weight: 300; line-height: 1.25; color: var(--text-heading); text-transform: uppercase; letter-spacing: 0.025em; margin-bottom: 2.75rem; }
.reader-overlay.pinned-reader .reader-title { background: linear-gradient(135deg, #b906d9 0%, #6709b4 50%, #350e92 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 400; text-shadow: 0 0 30px rgba(177,77,252,0.3); }
.reader-overlay.pinned-reader .reader-title::after { content: ''; display: block; height: 2px; max-width: 80%; margin-top: 0.9rem; background: linear-gradient(to right, rgba(185,6,217,0.4), transparent); box-shadow: 0 0 10px rgba(201,77,252,0.19); border-radius: 999px; }

.reader-body { color: var(--text-main); font-weight: 350; font-size: 1.1rem; line-height: 1.9; letter-spacing: 0.025em; }
.reader-body h1, .reader-body h2, .reader-body h3, .reader-body h4, .reader-body h5, .reader-body h6 { font-family: var(--font-raleway); color: var(--text-heading); margin-top: 2.75rem; margin-bottom: 1.375rem; line-height: 1.3; font-weight: 600; }
.reader-body h1:first-child, .reader-body h2:first-child, .reader-body h3:first-child { margin-top: 0; }
.reader-body h1 { font-size: 2.475rem; } .reader-body h2 { font-size: 2.0625rem; } .reader-body h3 { font-size: 1.75rem; }
.reader-body h4 { font-size: 2rem; position: relative; font-weight: 700; }
.reader-body h4::after { content: ''; position: absolute; bottom: -10px; left: 0; height: 2px; width: 100%; background: linear-gradient(to right, rgba(235,37,222,0.37) 0%, rgba(232,219,254,0.67) 50%, transparent 100%); }
.reader-body h5 { font-size: 1.75rem; } .reader-body h6 { font-size: 1.4rem; }
.reader-body p { margin-bottom: 1.65rem; }
.reader-body ul, .reader-body ol { margin-bottom: 1.65rem; padding-left: 1.65rem; }
.reader-body li { margin-bottom: 0.55rem; }
.reader-body blockquote { border-left: 4px solid var(--blue-accent); margin: 2.2rem 0; font-style: italic; color: var(--text-muted); background: var(--blue-light); padding: 1.65rem; border-radius: 0 1.1rem 1.1rem 0; }
.reader-body img, .reader-body iframe, .reader-body video { max-width: 100%; height: auto; border-radius: 1.1rem; margin: 2.2rem auto; display: block; }
.reader-body a { color: var(--blue-accent); }
.reader-body a:hover { text-decoration-color: var(--blue-accent); }
.reader-body hr { border: none; height: 2px; background: linear-gradient(to right, transparent, rgba(133,59,246,0.8), transparent); box-shadow: 0 0 12px rgba(133,59,246,0.5); margin: 3.3rem 0; }
.reader-body table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 2.2rem 0; font-size: 0.95rem; background: rgba(255, 255, 255, 0.45); box-shadow: 0 10px 30px -10px rgba(147, 197, 253, 0.2); }
.reader-body th, .reader-body td { border: 1px solid rgba(0,0,0,0.2) !important; padding: 0.6rem; vertical-align: top; }
.reader-body th { background: linear-gradient(180deg, rgba(239,246,255,0.6), rgba(239,246,255,0.2)); font-family: var(--font-raleway); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; text-align: left; }
.reader-body tr:nth-child(even) { background: rgba(239,246,255,0.2); }

.btn-toc { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.825rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--blue-accent); background: var(--blue-light); border: 1px solid rgba(219,234,254,0.5); cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-toc:hover { background: #dbeafe; box-shadow: 0 2px 8px rgba(37,99,235,0.1); }
.hide-mobile { display: none; }

.doc-outline-sidebar { position: fixed; right: -380px; top: 5rem; height: calc(100vh - 5rem); width: 380px; background: var(--bg-container, rgba(255,255,255,0.85)); backdrop-filter: blur(24px); border-left: 1px solid var(--blue-border, rgba(255,255,255,0.5)); box-shadow: -10px 0 30px rgba(0,0,0,0.05); z-index: 110; transition: right 0.35s ease; display: flex; flex-direction: column; }
.doc-outline-sidebar.open { right: 0; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--blue-border, rgba(0,0,0,0.05)); flex-shrink: 0; }
.sidebar-header h3 { font-family: var(--font-raleway); font-size: 0.95rem; font-weight: 600; margin: 0; }
.sidebar-header .back-link { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; }
.sidebar-header .back-link:hover { color: var(--blue-accent); }
.btn-close-sidebar { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; padding: 4px; border-radius: 6px; }
.btn-close-sidebar:hover { background: var(--blue-light); color: var(--text-main); }
#book-list-container, .book-list-container { flex: 1; overflow-y: auto; padding: 0; }
#book-list-container::-webkit-scrollbar, .book-list-container::-webkit-scrollbar { width: 4px; }
.outline-item { display: block; padding: 0.6rem 0.5rem; font-size: 0.85rem; color: var(--text-muted); text-decoration: none; border-left: 3px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all 0.2s; }
.outline-item:hover { color: var(--blue-accent); background: rgba(37,99,235,0.05); }
.outline-item.active { color: var(--blue-bright); border-left-color: var(--blue-bright); background: rgba(37,99,235,0.08); font-weight: 500; }

.spanFootNote { cursor: pointer; color: var(--blue-bright); font-weight: 600; padding: 0 2px; transition: color 0.2s; }
.spanFootNote:hover { color: var(--blue-accent); }
.spanFootNoteNone { display: none; }
.modal-overlay { position: fixed; inset: 0; top: 5.5rem; background: rgba(15,23,42,0.4); backdrop-filter: blur(12px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-overlay.global-modal { top: 0; z-index: 999999; }
.modal-content { background: rgba(255,255,255,0.95); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,0.5); box-shadow: 0 20px 40px rgba(0,0,0,0.1); border-radius: 1.5rem; width: 800px; max-width: 90%; max-height: 85vh; overflow-y: auto; position: relative; padding: 2.5rem 2rem 2rem; transform: scale(0.95) translateY(10px); transition: all 0.3s ease; }
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.modal-close-btn { position: absolute; top: 1rem; right: 1rem; background: transparent; border: none; color: var(--text-muted); cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.modal-close-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }

p.answer { border-left: 4px solid #a3b8cc; padding: 14px 14px 14px 16px; margin: 24px 0; background-color: #f7f9fb; border-radius: 0 6px 6px 0; color: #3b4249; line-height: 1.6; }
p.answer + p.answer { margin-top: -24px; padding-top: 0; border-top-right-radius: 0; }
p.answer + p { margin-top: 1.5em; }

@media (min-width: 768px) { .reader-content { padding-top: 8.5rem; } .reader-body { font-size: 1rem; } .hide-mobile { display: inline; } }
@media (max-width: 1023px) { .doc-outline-sidebar { width: 100%; right: -100%; } }
@media (max-width: 767px) {
    .reader-content { padding: 5rem 0.6rem 2rem; }
    .reader-title { font-size: 1.4rem; margin-bottom: 1.2rem; }
    .reader-body { font-size: 0.9rem; line-height: 1.6; }
    .reader-body h1 { font-size: 1.4rem; } .reader-body h2 { font-size: 1.3rem; } .reader-body h3 { font-size: 1.18rem; } .reader-body h4 { font-size: 1.05rem; }
    .reader-body blockquote { padding: 0.8rem; margin: 1rem 0; border-radius: 0 0.5rem 0.5rem 0; }
    .reader-body img, .reader-body iframe, .reader-body video { border-radius: 0.5rem; margin: 1rem 0; }
    .reader-body table { margin: 1.5rem -0.8rem; border-radius: 0; font-size: 0.8rem; }
    .reader-body th, .reader-body td { padding: 0.6rem 0.8rem; }
    .btn-toc { padding: 0.35rem 0.6rem; font-size: 0.65rem; }
    .doc-outline-sidebar { top: 3.6rem; height: calc(100vh - 3.6rem); }
    .modal-overlay { top: 3.6rem; height: calc(100vh - 3.6rem); }
    .modal-content { padding: 1rem; }
}
