:root {
    --reader-bg: #f5f1e6;
    --reader-color: #111;
    --reader-font: Arial;
    --reader-size: 18px;
    --reader-line: 170%;
}

/* =========================
READING MODE
========================= */
body.reading-page {
    background: var(--reader-bg) !important;
    color: var(--reader-color) !important;
    font-family: var(--reader-font);
    font-size: var(--reader-size);
    line-height: var(--reader-line);
    transition: all 0.2s ease;
}

/* =========================
BUTTON ⚙️
========================= */
.reading-tools {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 9999;
}

#openSettings {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    border: none;

    font-size: 18px;

    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(6px);

    cursor: pointer;

    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

#openSettings:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.2);
}

#openSettings:active {
    transform: scale(0.95);
}

/* =========================
OVERLAY
========================= */
#readingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    z-index: 9998;
}

/* =========================
SIDEBAR
========================= */
.reading-sidebar {
    position: fixed;
    top: 0;
    right: -340px; /* ẩn */
    width: 320px;
    height: 100%;

    background: #fff;

    z-index: 9999;

    padding: 16px;

    box-shadow: -4px 0 20px rgba(0,0,0,0.1);

    transition: right 0.3s ease;
}

.reading-sidebar.active {
    right: 0;
}

/* =========================
HEADER
========================= */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    font-weight: 600;
    font-size: 16px;

    margin-bottom: 16px;
}

#closeSettings {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

/* =========================
GROUP
========================= */
.setting-group {
    margin-bottom: 18px;
}

.setting-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}

/* =========================
COLOR PICKER
========================= */
.color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-list span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}

.color-list span:hover {
    transform: scale(1.1);
}

.color-list span.active {
    border-color: #ff4d4f;
}

/* =========================
INPUT RANGE
========================= */
input[type="range"] {
    width: 100%;
    cursor: pointer;
}

/* =========================
SELECT
========================= */
select {
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* =========================
BUTTONS
========================= */
.setting-actions {
    display: flex;
    gap: 10px;
}

.setting-actions button {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

#saveSettings {
    background: #1890ff;
    color: #fff;
}

#resetSettings {
    background: #f5f5f5;
}




/* =========================
APPLY READING SETTINGS
========================= */

.chapter-content{
    font-size: var(--reader-size) !important;

    line-height: var(--reader-line) !important;

    font-family: var(--reader-font) !important;

    color: var(--reader-color) !important;

    transition:
        font-size .2s ease,
        line-height .2s ease,
        color .2s ease;
}

/* BACKGROUND WRAPPER */
.reader-wrapper{
    background: var(--reader-bg) !important;
    color: var(--reader-color) !important;

    transition:
        background .2s ease,
        color .2s ease;
}