/* Controls Container */
.reader-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Nunito", sans-serif;
    font-weight: 600;
}

/* Reader Content */
#smart-reader {
    font-size: 24px;
    line-height: 2.2;
    max-width: 800px;
    margin: 20px auto;
    font-family: "Noto Serif SC", serif;
}

.paragraph-block {
    margin-bottom: 30px;
}

/* Translation Text */
.translation-text {
    display: none; /* Hidden by default */
    font-family: "Nunito", sans-serif;
    font-size: 16px;
    color: #666;
    margin-top: 8px;
    padding: 10px;
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    line-height: 1.6;
}

/* Character Styling */
.char {
    position: relative;
    cursor: pointer;
    padding: 2px 2px;
    border-radius: 4px;
    display: inline-block;
    transition: background 0.2s;
}
.char:hover { background-color: #f0f0f0; }
.char.active { background-color: #e3f2fd; color: #1565c0; }

/* Insights Section */
.story-insights {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.story-insights h2 { margin-top: 0; color: var(--primary); }
.insight-item { margin-bottom: 15px; }
.insight-title { font-weight: bold; color: #333; }

/* Sticky Definition Box */
#definition-box {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    padding: 20px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    border-top: 1px solid #ddd;
}
#definition-box.visible { transform: translateY(0); }
.def-pinyin { font-size: 1.2em; color: #666; font-family: "Nunito", sans-serif; }
.def-hanzi { font-size: 2.5em; font-weight: bold; margin: 5px 0; font-family: "Noto Serif SC", serif; }
.def-meaning { font-size: 1.1em; color: #333; font-family: "Nunito", sans-serif; }

/* Toggle Switch Styling */
.switch { position: relative; display: inline-block; width: 40px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: "";
    height: 16px; width: 16px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(16px); }