/* Базовые настройки шрифтов */
body {
    font-family: 'Georgia', serif; /* Серифный шрифт для книжного уюта */
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    height: 100vh; 
}

/* --- СВЕТЛАЯ ТЕМА (Теплая) --- */
:root, .light-theme {
    --bg-color: #F9F7F1; /* Цвет старой бумаги */
    --text-color: #4A4036; /* Темный кофейный */
    --input-bg: #FFFFFF; /* Белый лист */
    --input-border: #DBC8B6; /* Бежевая рамка */
    --dropdown-bg: #FFFFFF;
    --dropdown-hover: #F2EFE9;
    --highlight: #D35400; /* Терракотовый */
}

/* --- ТЕМНАЯ ТЕМА (Ночное чтение) --- */
.dark-theme {
    --bg-color: #1F1B18; /* Темный шоколад */
    --text-color: #E0D6CC; /* Светлый песок */
    --input-bg: #2C2622; /* Чуть светлее фона */
    --input-border: #4A4036;
    --dropdown-bg: #2C2622;
    --dropdown-hover: #3E3226;
    --highlight: #E67E22; /* Оранжевый */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}



/* Кнопка темы */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.2s;
}

    .theme-toggle:hover {
        opacity: 1;
    }




/* --- Reader Layout --- */
.reader-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color); /* Берем из глобальных переменных */
    color: var(--text-color);
}

.reader-header {
    padding: 10px 0;
    border-bottom: 1px solid var(--input-border);
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.reader-content {
    flex: 1;
    padding: 2rem 0 4rem 0;
}

.reader-footer {
    padding: 1.5rem 0;
    border-top: 1px solid var(--input-border);
    background-color: var(--bg-color);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

/* --- Typography --- */
.reader-text {
    font-size: 1.25rem;
    line-height: 1.8;
    text-align: justify; 
    text-indent: 3rem;
    position: relative;
}
.variation-badge {
    font-size: 0.7em;
    vertical-align: super;
    color: var(--accent-color);
    cursor: help;
}

.chapter-title {
    font-weight: normal;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 1rem;
    display: inline-block;
}

/* --- Interactions --- */
.paragraph-block:hover .paragraph-actions {
    opacity: 1;
}

.paragraph-actions {
    position: absolute;
    right: -30px;
    top: 0;
    opacity: 0;
    transition: opacity 0.2s;
}


/* Скролл для длинного списка глав в дропдауне */
.scrollable-menu {
    max-height: 60vh;
    overflow-y: auto;
}