/* =========================================================
   國文書院主題：注釋四選一、國字四選一、句子重組、文意選擇共用
   各 engine 會在 <head> 注入自己的藍紫色樣式，本檔放在 <body> 最後載入，
   以「書院」配色（木紋、宣紙、朱印紅、墨色）覆蓋；答對綠、答錯紅維持原樣。
   ========================================================= */
:root:root {
    --ink: #2b211b;
    --primary: #a51f1f;
    --primary-dark: #6e1212;
    --soft: #f3e7c2;
    --surface: #fffaf0;
    --line: #d9c38a;
    --shadow: rgba(59, 36, 24, 0.18);

    --brand-primary: #a51f1f;
    --brand-secondary: #c0392b;
    --brand-soft: #f6eedb;
    --brand-surface: #f6eedb;
    --brand-line: #d9c38a;
    --brand-shadow: rgba(59, 36, 24, 0.2);
    --brand-accent: #c9a24a;
}

/* 底：宣紙＋木框 */
html body {
    background:
        repeating-linear-gradient(90deg, rgba(120, 80, 40, 0.035) 0 1px, transparent 1px 9px),
        radial-gradient(ellipse at 50% 0%, #fffaf0, #f1e4c4 80%) fixed;
    color: #2b211b;
}

/* 頂列：深木色匾額 */
html body #top-nav {
    background: linear-gradient(180deg, #5a3a27 0%, #3b2418 100%);
    border-bottom: 3px solid #c9a24a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
html body .nav-title,
html body .nav-inner { color: #f6eedb; font-family: 'Noto Serif TC', 'Noto Sans TC', serif; }
html body .nav-sub { color: #e4cfa6; }
html body .back-btn,
html body .settings-btn,
html body .nav-badge {
    background: rgba(246, 238, 219, 0.1);
    border: 1px solid rgba(243, 213, 139, 0.55);
    color: #f6eedb;
}
html body .back-btn:hover,
html body .settings-btn:hover { background: rgba(246, 238, 219, 0.22); }
html body #timer-box { color: #f3d58b; }
html body #score-box,
html body .nav-score { color: #f6eedb; }

/* 卡片：宣紙卷 */
html body .preview-card,
html body .quiz-card,
html body .intro,
html body .result-card,
html body .exercise-card,
html body .modal-box,
html body .settings-dialog {
    background: linear-gradient(180deg, #fffaf0, #fbf3df);
    border: 2px solid #d9c38a;
    box-shadow: 0 4px 0 #c9b07a, 0 12px 28px rgba(59, 36, 24, 0.16);
}

/* 標題與題目：墨色書法感 */
html body .q-text,
html body .question-text,
html body .intro h1,
html body .result-card h1,
html body .preview-card h1,
html body .preview-card h2 {
    color: #2b211b;
    font-family: 'Noto Serif TC', 'DFKai-SB', 'BiauKai', '標楷體', serif;
    text-shadow: none;
}
html body .word-term { color: #a51f1f; font-family: 'Noto Serif TC', serif; }
html body .word-def,
html body .intro p,
html body .result-card p,
html body #progress-text { color: #6b5a4c; }

/* 選項／詞卡：竹簡 */
html body .option-btn,
html body .word-item,
html body .sentence-preview,
html body .word-chip {
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.03) 0 1px, transparent 1px 7px),
        linear-gradient(180deg, #fbf3dc, #efe0b6);
    border-color: #c9b07a;
    color: #2b211b;
    box-shadow: 0 3px 0 #c9b07a;
}
html body .option-btn:hover:not(:disabled),
html body .word-item:hover,
html body .sentence-preview:hover,
html body .word-chip:hover {
    background: linear-gradient(180deg, #fffaf0, #f3e7c2);
    border-color: #a51f1f;
}
html body .option-btn.selected { background: #f3e7c2; border-color: #a51f1f; }
html body .option-mark { color: #a51f1f; }
html body .drop-zone { background: rgba(243, 231, 194, 0.45); border-color: #c9b07a; }

/* 主要按鈕：朱印紅 */
html body .action-btn.primary,
html body .level-btn,
html body .next-btn {
    background: linear-gradient(180deg, #b52a2a, #8f1a1a);
    color: #fff7e6;
    box-shadow: 0 3px 0 #5e1010, 0 6px 14px rgba(110, 18, 18, 0.25);
}
html body .action-btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #c0392b, #a51f1f); }
html body .action-btn.primary:disabled { background: #b8a98c; box-shadow: none; }
html body .level-btn span { color: #f3d58b; }
html body .action-btn.secondary { background: #fffaf0; border-color: #c9b07a; color: #6b5a4c; }

/* 小圓鈕：朗讀、上一題／下一題、題號點 */
html body .speaker-btn,
html body .tap-read,
html body .read-btn,
html body .side-nav-btn,
html body .q-dot {
    background: #fffaf0;
    border-color: #c9b07a;
    color: #a51f1f;
}
html body .speaker-btn:hover { background: #f3e7c2; }
html body .q-dot.current { background: #a51f1f; border-color: #6e1212; color: #fff7e6; }

/* 進度條 */
html body .progress-track { background: #eadcb6; }
html body .progress-bar,
html body #progress-bar { background: linear-gradient(90deg, #c0392b, #8f1a1a); }
html body .progress-text { color: #a51f1f; }

/* 解析框、成績圈、下拉選單 */
html body .feedback { background: #fbf3df; color: #2b211b; }
html body .result-score { background: #fbf3df; border-color: #d9c38a; color: #6e1212; }
html body .result-score span { color: #a51f1f; }
html body .voice-panel { color: #6e1212; }
html body .voice-panel select,
html body .settings-field select { background: #fffaf0; border-color: #d9c38a; color: #2b211b; }
html body .settings-head h2 { color: #6e1212; }
