/* ===================================================
   CAP 2026 MASTER STYLES v7.2 — tw-exam.com
   =================================================== */

:root {
    --bg-main: #1a1a2e;
    --bg-side: #16213e;
    --bg-card: #0f3460;
    --accent:  #e94560;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger:  #e74c3c;
    --font-sans: 'Inter', 'Noto Sans TC', sans-serif;
    --border-color: rgba(255,255,255,0.08);
    --nav-active-bg: rgba(233,69,96,0.15);
    --input-bg: rgba(255,255,255,0.06);
    --input-border: rgba(255,255,255,0.12);
    --card-hover-shadow: rgba(233,69,96,0.15);
    --progress-track: rgba(255,255,255,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
    font-family: var(--font-sans);
    background: var(--bg-main);
    color: var(--text-main);
    transition: background 0.4s, color 0.4s;
}

.hidden { display: none !important; }

/* ===== LAYOUT ===== */
.app-container { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
    width: 250px; background: var(--bg-side);
    padding: 28px 20px; display: flex; flex-direction: column;
    flex-shrink: 0; position: sticky; top: 0; height: 100vh;
    border-right: 1px solid var(--border-color); z-index: 100; overflow-y: auto;
    transition: background 0.4s;
}
.main-content {
    flex-grow: 1; padding: 30px 50px;
    background: var(--bg-main); min-width: 0; overflow-y: auto;
    transition: background 0.4s;
}

/* ===== SIDEBAR ===== */
.logo { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 900; }
.logo-emoji { font-size: 2rem; }
.nav-menu { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.nav-btn {
    background: transparent; border: none; color: var(--text-muted);
    padding: 13px 18px; text-align: left; width: 100%; cursor: pointer;
    font-size: 1.05rem; border-radius: 12px; font-weight: 700;
    transition: 0.2s; font-family: inherit;
}
.nav-btn.active, .nav-btn:hover { background: var(--nav-active-bg); color: var(--accent); }
.sidebar-footer { margin-top: auto; padding-top: 20px; }
.sponsor-btn {
    background: #6772e5; color: white; text-decoration: none;
    padding: 15px; border-radius: 12px; text-align: center;
    font-weight: 700; display: block; font-size: 0.9rem; transition: 0.2s;
}
.sponsor-btn:hover { background: #5a63d0; }

/* ===== TOP HEADER ===== */
.top-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 40px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.user-profile { display: flex; align-items: center; gap: 18px; }
.avatar-large { font-size: 3rem; line-height: 1; transition: transform 0.3s; }
.user-info { display: flex; flex-direction: column; }
.user-welcome { font-size: 1.7rem; font-weight: 700; margin-bottom: 4px; }
.user-caption { color: var(--text-muted); font-size: 0.95rem; }

/* Sprint Toast */
.sprint-toast {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(90deg, var(--accent), #f05470);
    color: white; padding: 10px 25px; border-radius: 50px;
    font-weight: 700; z-index: 1000; font-size: 0.95rem;
    box-shadow: 0 10px 25px rgba(233,69,96,0.4);
    animation: slideDownToast 0.6s cubic-bezier(0.34,1.56,0.64,1);
    white-space: nowrap;
}
@keyframes slideDownToast {
    from { transform: translate(-50%, -40px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* ===== HERO CARD ===== */
.hero-usp-card {
    background: linear-gradient(135deg, var(--bg-side) 0%, var(--bg-main) 100%);
    padding: 50px;    border-radius: 28px; margin-bottom: 40px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    position: relative; overflow: hidden;
}

/* Sprint Countdown Styling */
.sprint-countdown {
    background: rgba(233,69,96,0.1);
    border: 1px solid rgba(233,69,96,0.2);
    padding: 20px 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.countdown-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.countdown-timer {
    display: flex;
    gap: 15px;
}
.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.time-block span {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}
.time-block small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 4px;
}
.usp-tag { color: var(--accent); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.responsive-title {
    font-size: 3.2rem;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    line-height: 1.2; margin-bottom: 18px;
}
.usp-description { color: var(--text-muted); font-size: 1.15rem; margin-bottom: 20px; }
.blooms-summary {
    background: rgba(233,69,96,0.08); padding: 14px 18px;
    border-radius: 12px; border-left: 3px solid var(--accent); font-size: 0.95rem;
}

/* ===== ANALYTICS ROW ===== */
.analytics-row { display: flex; gap: 30px; margin-bottom: 50px; flex-wrap: wrap; align-items: stretch; }
.main-analytics { flex: 1 1 480px; background: var(--bg-side); padding: 35px; border-radius: 28px; transition: background 0.4s; }
.radar-box      { flex: 0 0 340px; background: var(--bg-side); padding: 35px; border-radius: 28px; transition: background 0.4s; }
.card-title     { font-size: 1.2rem; font-weight: 700; margin-bottom: 18px; }
.analytics-title{ font-size: 1.1rem; font-weight: 700; margin-bottom: 18px; }
.radar-wrapper  { height: 250px; display: flex; justify-content: center; align-items: center; margin-bottom: 20px; }

.progress-info-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.progress-container{ height: 10px; background: var(--progress-track); border-radius: 5px; overflow: hidden; margin-bottom: 25px; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 5px; transition: width 1s ease; box-shadow: 0 0 12px rgba(233,69,96,0.4); }

.proficiency-list { display: flex; flex-direction: column; gap: 18px; }
.prof-label { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 5px; }
.prof-bar-bg { height: 8px; background: var(--progress-track); border-radius: 4px; overflow: hidden; position: relative; }
.prof-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

.weakness-subject-group {
    background: rgba(255,255,255,0.02);
    padding: 15px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.proficiency-row { margin-bottom: 12px; }
.proficiency-row:last-child { margin-bottom: 0; }

/* ===== MILESTONE GRID ===== */
.quest-grid {
    display: flex !important; flex-direction: row !important;
    flex-wrap: wrap !important; gap: 18px !important; margin-top: 25px !important;
}
.quest-card {
    flex: 1 1 160px !important; min-width: 140px !important;
    background: var(--bg-card) !important; padding: 22px 16px !important;
    border-radius: 16px !important; text-align: center !important;
    border: 1px solid var(--border-color) !important; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.quest-tag    { font-size: 0.78rem; font-weight: 900; opacity: 0.75; display: block; margin-bottom: 8px; }
.quest-status { font-weight: 700; font-size: 1.05rem; }
.quest-done   { border-bottom: 4px solid var(--success) !important; background: rgba(46,204,113,0.07) !important; }
.quest-active { 
    border-color: var(--accent) !important; 
    box-shadow: 0 8px 20px rgba(233,69,96,0.1) !important;
    transform: translateY(0);
}
.quest-active:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(233,69,96,0.25) !important;
    background: rgba(233,69,96,0.08) !important;
}
.quest-locked { opacity: 0.2 !important; filter: grayscale(1) !important; cursor: not-allowed !important; }

/* ===== SUBJECT GRID ===== */
.section-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 18px; }
.subject-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 20px !important; margin-bottom: 50px !important;
}
.subject-btn {
    background: var(--bg-card) !important; padding: 40px 20px 30px !important;
    border-radius: 20px !important; text-align: center !important; cursor: pointer !important;
    border: 1px solid var(--border-color) !important;
    transition: 0.3s cubic-bezier(0.4,0,0.2,1) !important; display: block !important;
}
.subject-btn:hover {
    background: var(--bg-side) !important; border-color: var(--accent) !important;
    transform: translateY(-8px) !important; box-shadow: 0 12px 30px rgba(233,69,96,0.15) !important;
}
.subject-btn .emoji { font-size: 3.2rem; display: block; margin-bottom: 12px; }
.subject-btn .name  { font-weight: 700; font-size: 0.95rem; }

/* ===== EXAM SELECTOR MODAL ===== */
.exam-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 5000;
    display: flex; justify-content: center; align-items: center; padding: 20px;
}
.overlay-content {
    background: var(--bg-main); width: 100%; max-width: 860px; height: 80vh;
    border-radius: 28px; padding: 40px; display: flex; flex-direction: column;
    border: 1px solid var(--border-color); animation: zoomIn 0.25s ease;
}
@keyframes zoomIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.overlay-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.overlay-scroll-body { flex: 1 1 auto; overflow-y: auto; padding-right: 10px; }
.close-btn { background: transparent; border: none; color: var(--text-main); font-size: 2rem; cursor: pointer; }
.item-grid-group { margin-bottom: 28px; }
.item-grid-group h3 {
    color: var(--text-muted); font-size: 0.85rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color); padding-bottom: 8px; margin-bottom: 14px;
}
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.exam-item {
    background: var(--bg-side); padding: 16px 14px; border-radius: 12px; cursor: pointer;
    text-align: center; font-weight: 700; font-size: 0.92rem;
    border: 1px solid transparent; transition: 0.2s; font-family: inherit; color: var(--text-main);
}
.exam-item:hover { border-color: var(--accent); color: var(--accent); background: rgba(233,69,96,0.05); }

/* ===== ABOUT VIEW ===== */
.about-container { max-width: 800px; margin: 0 auto; }
.dev-note { font-size: 1.1rem; color: var(--text-main); line-height: 1.9; }
.dev-note p { margin-bottom: 1.5em; }
.dev-note p:last-child { margin-bottom: 0; }
.view-divider { border: none; border-top: 1px solid var(--border-color); margin: 40px 0; }
#feedback-form textarea {
    width: 100%; padding: 15px; background: var(--bg-side); min-height: 150px;
    border: 1px solid var(--input-border); border-radius: 12px;
    color: var(--text-main); font-family: inherit; font-size: 1rem; resize: vertical; margin-top: 15px;
}
.submit-btn {
    background: var(--accent); color: white; border: none;
    padding: 15px 28px; border-radius: 12px; font-size: 1.05rem; font-weight: 700;
    cursor: pointer; display: block; margin: 25px auto 0;
    max-width: 250px; width: 100%; transition: 0.2s; font-family: inherit;
}
.submit-btn:hover { opacity: 0.88; transform: scale(1.03); }

/* ===== SETTINGS VIEW ===== */
.settings-container { max-width: 720px; margin: 0 auto; }
.settings-card {
    background: var(--bg-side); border-radius: 20px; padding: 30px;
    margin-bottom: 24px; border: 1px solid var(--border-color);
    transition: background 0.4s;
}
.settings-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 22px; color: var(--text-main); }
.settings-row { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.settings-row label { font-size: 0.95rem; color: var(--text-muted); min-width: 80px; }
.settings-input {
    flex: 1; background: var(--input-bg); border: 1px solid var(--input-border);
    border-radius: 10px; padding: 12px 16px; color: var(--text-main);
    font-family: inherit; font-size: 1rem; transition: border 0.2s;
}
.settings-input:focus { outline: none; border-color: var(--accent); }

/* Emoji Picker */
.emoji-settings-row { margin-bottom: 8px !important; }
.emoji-category-label {
    font-size: 0.82rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    margin: 14px 0 8px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}
.emoji-picker {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.emoji-opt {
    font-size: 1.8rem; cursor: pointer; padding: 6px 8px;
    border-radius: 10px; transition: 0.15s; border: 2px solid transparent;
    line-height: 1; user-select: none;
}
.emoji-opt:hover  { background: var(--input-bg); transform: scale(1.15); }
.emoji-opt.active { border-color: var(--accent); background: rgba(233,69,96,0.12); transform: scale(1.15); }

/* Theme Picker */
.theme-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.theme-btn {
    flex: 1 1 160px; background: var(--input-bg); border: 2px solid var(--border-color);
    border-radius: 16px; padding: 16px; cursor: pointer; text-align: center;
    transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.theme-btn:hover { border-color: var(--text-muted); transform: translateY(-3px); }
.theme-btn.active { border-color: var(--accent); box-shadow: 0 0 18px rgba(233,69,96,0.2); }
.theme-preview { width: 100%; height: 50px; border-radius: 10px; }
.theme-btn span { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); }
.settings-saved { color: var(--success); text-align: center; font-weight: 700; font-size: 1rem; margin-top: 12px; }

/* Level Modal */
.level-desc h4 { color: var(--accent); margin-top: 15px; margin-bottom: 5px; font-size: 1.15rem; }
.level-desc p { color: var(--text-muted); line-height: 1.6; margin-bottom: 15px; }

/* ===== FULLSCREEN EXAM HUD ===== */
.fullscreen-view {
    position: fixed; inset: 0; background: var(--bg-main); z-index: 3000;
    display: flex; flex-direction: column; height: 100vh; height: 100dvh;
}
.exam-header {
    flex: 0 0 auto; background: var(--bg-side);
    border-bottom: 2px solid rgba(233,69,96,0.3);
    padding: 16px 35px; display: flex;
    justify-content: space-between; align-items: center; gap: 15px;
}
.exam-body  { flex: 1 1 auto; overflow-y: auto; padding: 40px 20px; -webkit-overflow-scrolling: touch; }
.exam-footer{
    flex: 0 0 auto; background: var(--bg-side);
    border-top: 1px solid var(--border-color);
    padding: 22px 35px; display: flex; justify-content: center; align-items: center; gap: 45px;
}
#exam-stats-center { text-align: center; }
#exam-stats-center h2 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.live-timer { font-size: 1.25rem; font-weight: 900; color: var(--warning); }

/* ===== QUESTION DISPLAY ===== */
#question-container { max-width: 900px; margin: 0 auto; padding: 20px; }

.context-box {
    background: var(--input-bg); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 28px; margin-bottom: 28px;
    font-size: 1.05rem; line-height: 1.8; color: var(--text-main);
}
.question-text { font-size: 1.55rem; font-weight: 700; margin-bottom: 30px; line-height: 1.5; }
.question-text p { margin-bottom: 8px; }

/* Answer Choices */
.option-list { display: flex; flex-direction: column; gap: 14px; }
.option-item {
    background: var(--bg-card); border: 2px solid transparent;
    padding: 20px 28px; border-radius: 14px; font-size: 1.25rem;
    transition: all 0.2s; width: 100%; text-align: left;
    color: var(--text-main); cursor: pointer; font-family: inherit; line-height: 1.5;
}
.option-item:hover:not([disabled]) { background: var(--nav-active-bg); transform: translateX(5px); }
.option-item.selected { border-color: var(--accent); background: rgba(233,69,96,0.08); }
.option-item.correct  { border-color: var(--success); background: rgba(46,204,113,0.1); }
.option-item.wrong    { border-color: var(--danger);  background: rgba(231,76,60,0.1); }
.option-item[disabled]{ cursor: default; }

/* Self-Assessment HUD */
.self-assessment-hud {
    background: rgba(255,255,255,0.05);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-top: 10px;
}
.self-assessment-hud p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}
.btn-reveal {
    background: var(--accent);
    color: white;
    border: none;
    padding: 16px 35px;
    border-radius: 14px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 8px 20px rgba(233,69,96,0.3);
}
.btn-reveal:hover { transform: translateY(-3px); background: #f05470; }
.self-assessment-revealed {
    padding: 15px;
    text-align: center;
    color: var(--success);
    font-weight: 700;
}

/* Explanation */
.explanation {
    background: var(--input-bg); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 28px; margin-top: 28px;
}
.explanation h3 { color: var(--accent); margin-bottom: 10px; font-size: 1.05rem; }

/* Listening HUD */
.listening-hud {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(46,204,113,0.06); border: 2px solid rgba(46,204,113,0.25);
    border-radius: 20px; padding: 45px 30px; margin-bottom: 35px; gap: 18px;
}
.listening-icon { font-size: 4.5rem; line-height: 1; }
.listening-hint { color: var(--text-muted); font-size: 1.1rem; margin: 0; }
.btn-speak {
    background: var(--success); color: white; border: none;
    padding: 18px 50px; border-radius: 14px; font-size: 1.15rem; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: 0.2s;
    box-shadow: 0 6px 20px rgba(46,204,113,0.3);
}
.btn-speak:hover { background: #27ae60; transform: translateY(-3px); }

/* HUD Buttons */
.btn-nav {
    background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); padding: 18px 42px;
    border-radius: 12px; font-size: 1.4rem; font-weight: 900;
    cursor: pointer; transition: 0.2s; min-width: 170px; font-family: inherit;
}
.btn-nav:hover   { background: #3b3e5a; transform: translateY(-3px); }
.btn-nav:active  { transform: scale(0.95); }
#question-nav-info { font-size: 1.5rem; font-weight: 900; color: var(--accent); min-width: 90px; text-align: center; }

.btn-danger {
    background: var(--danger); color: white; border: none;
    padding: 13px 24px; border-radius: 12px; font-weight: 700;
    cursor: pointer; transition: 0.2s; font-size: 0.95rem; font-family: inherit;
}
.btn-danger:hover { background: #c0392b; }
.btn-secondary {
    background: #3b4252; color: white; border: none;
    padding: 13px 24px; border-radius: 12px; font-weight: 700;
    cursor: pointer; transition: 0.2s; font-size: 0.95rem; font-family: inherit;
}
.btn-secondary:hover { background: #4c566a; }

/* ===== MARKDOWN TABLES ===== */
.markdown-body table {
    border-collapse: collapse; width: 100%; margin: 20px 0;
    font-size: 1rem; border-radius: 8px; overflow: hidden;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--border-color); padding: 13px 16px; text-align: left;
}
.markdown-body th { background: rgba(233,69,96,0.15); color: var(--accent); font-weight: 700; }
.markdown-body tr:nth-child(even) td { background: var(--input-bg); }
.markdown-body p { margin-bottom: 8px; line-height: 1.7; }
.markdown-body strong { color: var(--text-main); }
.markdown-body ul, .markdown-body ol { padding-left: 22px; margin-bottom: 8px; }
.markdown-body li { margin-bottom: 4px; line-height: 1.7; }

/* Handle KaTeX overflow on mobile so vertical scroll does not get stuck */
.markdown-body .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

/* ===== SOCIAL SHARE MODAL ===== */
.share-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    padding: 20px; animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.share-card {
    background: linear-gradient(145deg, var(--bg-side), var(--bg-main));
    border: 1px solid var(--border-color);
    border-radius: 28px; padding: 50px 40px;
    max-width: 500px; width: 100%; text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.share-unlock-icon  { font-size: 4rem; margin-bottom: 16px; animation: bounce 1s ease infinite alternate; }
@keyframes bounce   { from { transform: scale(1); } to { transform: scale(1.12); } }
.share-title        { font-size: 1.7rem; font-weight: 900; margin-bottom: 12px; color: var(--text-main); }
.share-desc         { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 30px; line-height: 1.6; }

.share-buttons { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.share-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px 24px; border-radius: 14px; font-size: 1.05rem;
    font-weight: 700; cursor: pointer; border: none;
    text-decoration: none; font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.share-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.share-icon { font-size: 1.3rem; }

.share-fb {
    background: #1877f2; color: #fff;
}
.share-ig {
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: #fff;
}
.share-threads {
    background: var(--bg-side); color: var(--text-main);
    border: 1px solid var(--border-color);
}

.share-dismiss {
    background: transparent; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.95rem; font-family: inherit;
    transition: color 0.2s; padding: 8px 16px; border-radius: 8px;
}
.share-dismiss:hover { color: var(--text-main); background: var(--input-bg); }

/* ===== WRITING PRACTICE VIEW (HIGH-FIDELITY PAPER) ===== */
.writing-container {
    max-width: 900px; margin: 0 auto;
    color: #1a1a2e;
}
.writing-container .section-title { color: var(--text-base); margin-bottom: 20px;}

.writing-select {
    width: 100%;
    max-width: 400px;
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--input-border);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: var(--font-sans);
    margin-bottom: 25px;
    outline: none;
    cursor: pointer;
}
.writing-select:focus { border-color: var(--accent); }
.writing-select optgroup { background: var(--bg-main); color: var(--text-muted); }
.writing-select option { background: var(--bg-card); color: var(--text-main); }

.ai-disclaimer {
    color: var(--warning);
    background: rgba(241, 196, 15, 0.1);
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

/* The Simulated Physical Exam Paper */
.exam-paper {
    background-color: #fcfcfb;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    font-family: 'BiauKai', 'DFKai-SB', serif;
    color: #111;
    line-height: 1.8;
}
.exam-paper-header h1 {
    font-size: 1.8rem;
    text-align: center;
    border-bottom: 2px solid #111;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-weight: 700;
}
.exam-paper-instruction {
    font-size: 1.1rem;
    border: 1px dashed #777;
    padding: 12px 18px;
    margin-bottom: 30px;
    background: #f8f8f8;
}
.exam-paper-question {
    border: 3px double #333;
    padding: 25px;
}
.writing-layout {
    display: flex; gap: 20px; align-items: stretch;
    margin-bottom: 25px; background: white; padding: 15px;
    border: 1px solid #ddd;
}
.writing-diagram-box {
    display: flex; gap: 15px; align-items: center; width: 100%;
}
.diagram-graphic {
    flex: 0 0 auto;
    border-right: 1px dashed #ccc; padding-right: 15px;
}
.diagram-dialogue {
    flex: 1 1 auto;
    font-size: 1.25rem; font-weight: bold; font-family: 'BiauKai', 'DFKai-SB', serif;
    background: #f0f0f0; padding: 15px; border-radius: 8px;
    align-self: center;
}
.writing-prompt-text {
    font-size: 1.25rem;
    font-weight: bold;
}
.no-title-note {
    font-size: 1.1rem; font-weight: normal; font-style: italic; color: #555;
    display: block; margin-top: 10px;
}

/* Digital Input Workspace */
.writing-workspace {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border-color);
}
#essay-input {
    width: 100%;
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 20px;
    font-size: 1.15rem;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s;
    margin-bottom: 20px;
}
#essay-input:focus {
    outline: none; border-color: var(--accent);
}
.writing-controls {
    display: flex; justify-content: space-between; align-items: center;
}
#word-count {
    font-size: 1.05rem; color: var(--text-muted); font-weight: 500;
}
.btn-essay-submit {
    background: var(--accent);
    color: white; border: none; padding: 14px 28px;
    border-radius: 12px; font-size: 1.1rem; font-weight: bold;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.btn-essay-submit:hover {
    transform: translateY(-2px); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) { .radar-box { flex: 1 1 100%; } }

@media (max-width: 900px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; padding: 18px; }
    .nav-menu { flex-direction: row; flex-wrap: wrap; margin-top: 12px; gap: 6px; }
    .nav-btn { padding: 9px 12px; font-size: 0.88rem; }
    .sidebar-footer { margin-top: 12px; }
    .main-content { padding: 20px; }
    .hero-usp-card { padding: 30px; }
    .responsive-title { font-size: 2rem; }
    .exam-header { padding: 12px 15px; flex-wrap: wrap; gap: 8px; }
    .btn-nav { padding: 14px 22px; min-width: 120px; font-size: 1.15rem; }
    .exam-footer { gap: 20px; padding: 18px 20px; }
    .settings-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .theme-grid { flex-direction: column; }
}
