:root {
            --bg-color: #121212;
            --card-color: #1e1e1e;
            --sidebar-color: #1a1a1a;
            --text-color: #e0e0e0;
            --primary-color: #00b0ff;
            --correct-color: #00c853;
            --correct-bg: rgba(0, 200, 83, 0.1);
            --wrong-color: #ff1744;
            --wrong-bg: rgba(255, 23, 68, 0.1);
            --border-color: #333333;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            height: 100vh;
            overflow: hidden;
        }

        .wrapper {
            display: flex;
            width: 100%;
            height: 100%;
        }

        /* 왼쪽 사이드바 디자인 */
        .sidebar {
            width: 320px;
            background-color: var(--sidebar-color);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            padding: 25px 20px;
            box-sizing: border-box;
            flex-shrink: 0;
            overflow-y: auto;
        }

        .sidebar-title {
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 20px;
            color: #fff;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 15px;
        }

        .score-board {
            background-color: #252525;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 25px;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            text-align: center;
            gap: 10px;
        }

        .score-item { display: flex; flex-direction: column; }
        .score-label { font-size: 0.8rem; color: #aaa; margin-bottom: 5px; }
        .score-value { font-size: 1.2rem; font-weight: bold; }
        .score-value.total { color: var(--primary-color); }
        .score-value.correct { color: var(--correct-color); }
        .score-value.wrong { color: var(--wrong-color); }

        /* 문제 단추 그리드 레이아웃 */
        .question-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }

        .grid-item {
            background-color: #2a2a2a;
            border: 1px solid var(--border-color);
            color: #aaa;
            border-radius: 6px;
            padding: 12px 0;
            font-weight: bold;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.9rem;
            user-select: none;
        }
        .grid-item:hover {
            border-color: #666;
            color: #fff;
        }
        .grid-item.active {
            border-color: var(--primary-color);
            color: var(--primary-color);
            background-color: rgba(0, 176, 255, 0.05);
        }
        .grid-item.is-correct {
            background-color: var(--correct-bg);
            border-color: var(--correct-color);
            color: var(--correct-color);
        }
        .grid-item.is-wrong {
            background-color: var(--wrong-bg);
            border-color: var(--wrong-color);
            color: var(--wrong-color);
        }

        /* 오른쪽 문제 풀이 영역 */
        .main-content {
            flex: 1;
            padding: 40px;
            overflow-y: auto;
            display: flex;
            justify-content: center;
            align-items: flex-start;
        }

        .container {
            width: 100%;
            max-width: 800px;
        }

        .quiz-card {
            background-color: var(--card-color);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            box-sizing: border-box;
        }

        .quiz-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 15px;
            margin-bottom: 20px;
            font-size: 0.9rem;
            color: #aaa;
        }

        .subject-title { font-weight: bold; color: #ccc; }
        .quiz-info-right { display: flex; align-items: center; gap: 10px; }
        .quiz-type { background: #2a2a2a; padding: 4px 10px; border-radius: 6px; }

        .quiz-question {
            font-size: 1.1rem;
            line-height: 1.6;
            margin-bottom: 25px;
            white-space: pre-wrap;
            word-break: break-all;
        }

        pre[class*="language-"] {
            border-radius: 8px !important;
            margin: 20px 0 !important;
            background: #151515 !important;
            border: 1px solid #252525;
        }

        .options-list {
            display: flex;
            flex-direction: column !important;
            gap: 12px;
            margin-top: 25px;
            width: 100%;
            box-sizing: border-box;
        }

        .option-item {
            background-color: #252525;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 16px 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: all 0.2s ease;
            user-select: none;
            box-sizing: border-box;
            width: 100% !important;
        }
        .option-item:hover:not(.disabled) { border-color: #555; background-color: #2a2a2a; }
        .option-item.selected { border-color: var(--primary-color); background-color: rgba(0, 176, 255, 0.05); }

        .option-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 24px;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #3a3a3a;
            font-size: 0.85rem;
            margin-right: 15px;
            font-weight: bold;
            flex-shrink: 0;
        }
        .option-item.selected .option-number { background: var(--primary-color); color: #000; }
        .option-text { word-break: break-all; line-height: 1.4; }

        .option-item.correct-answer { border-color: var(--correct-color) !important; background-color: var(--correct-bg) !important; }
        .option-item.wrong-answer { border-color: var(--wrong-color) !important; background-color: var(--wrong-bg) !important; }

        .status-badge { margin-left: auto; font-weight: bold; flex-shrink: 0; padding-left: 10px; }
        .correct-answer .status-badge { color: var(--correct-color); }
        .wrong-answer .status-badge { color: var(--wrong-color); }

        .btn {
            border: none;
            padding: 12px 24px;
            font-size: 0.95rem;
            font-weight: bold;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .btn-nav { background-color: #333333; color: #ccc; flex: 1; }
        .btn-nav:hover:not(:disabled) { background-color: #444444; color: #fff; }
        .btn-nav:disabled { opacity: 0.3; cursor: not-allowed; }

        .btn-submit { background-color: #2e7d32; color: white; width: 100%; padding: 14px; }
        .btn-submit:hover:not(:disabled) { background-color: #388e3c; }
        .btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

        .explanation-box {
            display: none;
            margin-top: 25px;
            background-color: #1a1a1a;
            border-top: 4px solid var(--wrong-color);
            border-radius: 6px;
            padding: 20px;
            box-sizing: border-box;
        }
        .explanation-box.is-correct { border-top-color: var(--correct-color); }
        .result-summary { font-size: 1.1rem; font-weight: bold; margin-bottom: 15px; }
        .result-summary.correct { color: var(--correct-color); }
        .result-summary.wrong { color: var(--wrong-color); }
        .explanation-title { color: #888; font-size: 0.9rem; font-weight: bold; margin-bottom: 8px; }
        .explanation-text { line-height: 1.6; color: #ccc; font-size: 0.95rem; }
        .grid-item.active {
            border-color: var(--primary-color) !important;
            color: var(--primary-color) !important;
            box-shadow: 0 0 8px rgba(0, 176, 255, 0.4);
            background-color: rgba(0, 176, 255, 0.1) !important;
        
    }

    /* 사이드바 토글 버튼 (좌측 상단 고정) */
        .sidebar-toggle-btn {
            position: fixed;
            top: 15px;
            left: 20px;
            z-index: 1100;
            background-color: #252525;
            border: 1px solid var(--border-color);
            color: #fff;
            padding: 10px 14px;
            border-radius: 6px;
            font-weight: bold;
            font-size: 0.9rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            transition: background 0.2s;
        }
        .sidebar-toggle-btn:hover { background-color: #333; }

        /* 배경 어두워지는 레이어 (모바일/태블릿용 모달 백드롭) */
        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.6);
            z-index: 999;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .sidebar-overlay.active {
            display: block;
            opacity: 1;
        }

        /* 왼쪽 사이드바 기본 디자인 (PC 기준) */
        .sidebar {
            width: 320px;
            background-color: var(--sidebar-color);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            padding: 75px 20px 25px 20px; /* 토글 버튼 공간 확보를 위해 top 패딩 상향 */
            box-sizing: border-box;
            flex-shrink: 0;
            overflow-y: auto;
            transition: transform 0.3s ease;
            position: relative;
            z-index: 1000;
        }

        /* 오른쪽 문제 풀이 본문 영역 */
        .main-content {
            flex: 1;
            padding: 80px 40px 40px 40px; /* 상단 토글 버튼 여백 확보 */
            overflow-y: auto;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            transition: padding-left 0.3s ease;
        }

        /* 📱 데스크탑 이하 (태블릿, 모바일 화면 - 1024px 기준) 마크업 반응형 분기 */
        @media (max-width: 1024px) {
            .sidebar {
                position: fixed;
                top: 0;
                left: 0;
                height: 100vh;
                transform: translateX(-100%); /* 기본적으로 화면 왼쪽 밖으로 숨김 */
                box-shadow: 5px 0 25px rgba(0,0,0,0.5);
            }
            /* 사이드바가 열렸을 때 (본문을 밀지 않고 위로 떠오름) */
            .sidebar.active {
                transform: translateX(0);
            }
            .main-content {
                padding: 80px 20px 20px 20px; /* 모바일 대응 패딩 축소 */
            }
        }
