        body {
            margin: 0;
            font-family: 'Pretendard', sans-serif;
            background: #fafafa;
            display: flex;
            position: relative;
            min-height: 100vh;
        }

        /* 모달이 열렸을 때 body 상태 */
        body.modal-open {
            overflow: hidden;
        }

        /* 네비게이션 기본 설정 */
        .nav {
            position: fixed;
            width: 240px;
        }

        /* NAV BAR */
        .nav {
            width: 240px;
            background: #fff;
            border-right: 1px solid #eee;
            height: 100vh;
            display: flex;
            flex-direction: column;
            transition: width 0.3s, left 0.3s;
            position: fixed;
            left: 0;
            top: 0;
            z-index: 100;
        }

        .nav.collapsed {
            width: 72px;
        }

        .nav-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid #eee;
        }

        .nav-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }

        .icon-logo {
            width: 30px;
            height: 30px;
        }

        .logo-text {
            font-weight: bold;
            font-size: 16px;
            white-space: nowrap;
        }

        .nav.collapsed .logo-text {
            display: none;
        }

        .nav-toggle {
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
        }

        .nav.collapsed .nav-toggle {
            display: none;
        }

        .menu {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            height: calc(100vh - 65px);
        }

        .menu li {
            display: flex;
            align-items: center;
            padding: 14px 20px;
            gap: 12px;
            cursor: pointer;
            color: #444;
            transition: background 0.2s;
        }

        .menu li:hover {
            background: #f5f5f5;
        }

        .menu li.active {
            background: #e3f2fd;
            color: #1976d2;
            border-right: 3px solid #1976d2;
        }
        
        /* 메인페이지로 가기 메뉴 스타일 (맨 아래) */
        .menu li.home-menu {
            margin-top: auto;
            border-top: 1px solid #eee;
            padding-top: 14px;
            margin-bottom: 0;
        }
        
        .menu li.home-menu:hover {
            background: #007aff;
            color: white;
        }
        
        /* 현재 선택된 과목 헤더 */
        .menu li.current-subject {
            font-size: 12px;
            color: #8e8e93;
            background: none !important;
            cursor: default;
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 0.5px;
            margin-top: 10px;
            margin-bottom: 5px;
            pointer-events: none;
        }
        
        /* 회사 정보 스타일 */
        .menu li.company-info {
            font-size: 14px;
            color: #666;
            background: #f8f9fa !important;
            cursor: default;
            margin-bottom: 10px;
            border-bottom: 1px solid #eee;
            padding-bottom: 14px;
            pointer-events: none;
        }
        
        .menu li.company-info img {
            width: 24px;
            height: 24px;
            border-radius: 4px;
        }
        
        /* 현재 선택된 과목 카드 */
        .menu li.current-book {
            border: 2px solid #4169e1;
            margin-bottom: 10px;
        }

        .menu li img {
            width: 26px;
            height: 26px;
        }

        .menu li span {
            white-space: nowrap;
        }

        .nav.collapsed .menu li span {
            display: none;
        }

        .container {
            flex: 1;
            max-width: 960px;
            margin: 40px auto;
            margin-left: 260px;
            padding: 0 20px;
            transition: margin-left 0.3s;
            width: auto;
        }
        
        /* 콘텐츠 래퍼 */
        .content-wrapper {
            background: #fff;
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        }

        /* 네비게이션이 접혔을 때 컨테이너 조정 */
        .nav-collapsed .container {
            margin-left: 92px;
        }

        /* 이하 기존 스타일 유지 */
        h2.section-title {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 20px;
        }

        .subject-box {
            display: flex;
            border: 1px solid #eee;
            border-radius: 16px;
            overflow: hidden;
            /* ✅ 내부 이미지 둥글게 클립 */
            background: #fff;
        }

        .subject-image-wrapper {
            width: 160px;
            flex-shrink: 0;
        }

        .subject-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .subject-details {
            flex: 1;
            padding: 20px;
            display: flex;
            flex-direction: column;
        }

        .subject-title-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .subject-title {
            font-size: 18px;
            font-weight: bold;
            margin: 0;
        }

        .subject-meta {
            color: #888;
            font-size: 13px;
        }

        .run-btn {
            margin-left: auto;
            background: #4aa3f0;
            border: 1px solid #4aa3f0;
            color: white;
            font-weight: bold;
            padding: 10px 20px;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .run-btn:hover {
            background: #fff;
            color: #4aa3f0;
            border: 1px solid #4aa3f0;

        }

        .retry-btn {
            margin-left: auto;
            background: #28a745;
            color: white;
            font-weight: bold;
            padding: 10px 20px;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            transition: background 0.2s;
        }

        .retry-btn:hover {
            background: #218838;
        }

        /* 기존 파일 입력 스타일도 그대로 유지 */
        .file-inputs {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }


        .file-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #fdfdfd;
            border: 1px solid #eee;
            border-radius: 10px;
            padding: 10px 14px;
        }

        .file-left {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            min-width: 0;
        }

        .file-label {
            color: #bbb;
            font-size: 14px;
            width: 100px;
            flex-shrink: 0;
        }

        .remove-btn {
            background: none;
            border: none;
            color: #999;
            font-size: 16px;
            cursor: pointer;
            margin-right: 6px;
            flex-shrink: 0;
        }

        .file-icon {
            font-size: 15px;
            color: #aaa;
            flex-shrink: 0;
        }

        .file-name {
            color: #333;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 14px;
        }

        .load-btn {
            background: white;
            border: 1px solid #ccc;
            border-radius: 6px;
            padding: 6px 12px;
            font-size: 13px;
            cursor: pointer;
        }

        .load-btn:hover {
            background: #f2f2f2;
        }



        .result-box {
            display: flex;
            justify-content: space-between;
            text-align: center;
            margin-bottom: 30px;
        }




        .result-box {
            display: flex;
            justify-content: space-between;
            margin-bottom: 30px;
        }

        .score-cards {
            display: flex;
            gap: 20px;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }

        .score-card {
            background: #fff;
            border: 1px solid #eee;
            border-radius: 14px;
            flex: 1;
            min-width: 220px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 24px;
        }

        .score-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .icon-circle {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: 600;
        }

        .icon-circle.yellow {
            background: #ffedb3;
            color: #333;
        }

        .icon-circle.blue {
            background: #cce7ff;
            color: #333;
        }

        .icon-circle.red {
            background: #ffd5d5;
            color: #333;
        }

        .score-label {
            color: #888;
            font-size: 14px;
        }

        .score-value {
            font-size: 20px;
            font-weight: bold;
            color: #111;
        }

        .score-value.strong {
            font-size: 20px;
            font-weight: 800;
            color: #000;
        }

        .grading-box {
            display: flex;
            flex-direction: column;
            background: #fff;
            border: 1px solid #eee;
            border-radius: 12px;
            overflow: hidden;
        }

        .grading-row {
            display: grid;
            grid-template-columns: 80px 200px 140px 1fr auto;
            align-items: center;
            padding: 12px 20px;
            border-bottom: none;
            /* 기존 줄 제거 */
            position: relative;
            /* ::after 기준점 */

        }

        .grading-row::after {
            content: '';
            position: absolute;
            left: 20px;
            /* 왼쪽 여백 */
            right: 20px;
            /* 그래프 앞까지만 (조정 가능) */
            bottom: 0;
            height: 1px;
            background: #f1f1f1;
        }

        .grading-row:last-child::after {
            display: none;
            /* 마지막 줄은 줄 없음 */
        }


        .grading-row:last-child::after {
            display: none;
        }

        .grading-row:last-child {
            border-bottom: none;
        }

        .cell {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .cell.title {
            font-weight: 500;
            white-space: nowrap;
        }

        .cell.score-text {
            color: #888;
            font-size: 13px;
        }

        .cell.graph .bar {
            background: #eee;
            width: 100%;
            height: 20px;
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }

        .bar-fill {
            background: #4aa3f0;
            height: 100%;
            color: #fff;
            text-align: center;
            font-size: 12px;
            font-weight: bold;
            line-height: 20px;
            min-width: 0%;
        }

        .label {
            padding: 4px 10px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }

        .label.common {
            background: #fce3e3;
            color: #c44;
        }

        .label.q1 {
            background: #fff0db;
            color: #b88000;
        }

        .label.q2 {
            background: #e4f1ff;
            color: #247fd5;
        }

        .label.q3 {
            background: #fff0db;
            color: #b88000;
        }

        .title {
            min-width: 160px;
            font-weight: 500;
        }

        .score-wrap {
            font-size: 13px;
            color: #888;
        }

        .score-desc {
            display: inline-block;
            background: #f3f3f3;
            border-radius: 6px;
            padding: 3px 8px;
            margin-right: 6px;
            font-size: 12px;
        }

        .bar-box {
            position: relative;
            flex: 1;
            height: 20px;
            border-radius: 10px;
            background: #f1f1f1;
            overflow: hidden;
            min-width: 150px;
        }

        .bar {
            height: 100%;
            line-height: 20px;
            text-align: center;
            font-size: 12px;
            font-weight: bold;
            color: white;
        }

        .bar.blue {
            background: #4aa3f0;
            width: 45%;
        }

        .score-box {
            background: #ffdede;
            color: #e60000;
            font-weight: bold;
            border-radius: 6px;
            padding: 2px 10px;
            font-size: 14px;
        }

        .cell.actions button {
            margin-left: 6px;
            font-size: 13px;
            padding: 5px 10px;
            border: 1px solid #ccc;
            background: #fff;
            border-radius: 6px;
            cursor: pointer;
        }

        .cell.actions button:hover {
            background: #f0f0f0;
        }
        .cell.actions button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: #f0f0f0;
        }
        .tag {
            font-size: 12px;
            padding: 4px 8px;
            border-radius: 6px;
            font-weight: bold;
            white-space: nowrap;
        }

        .tag.common {
            background: #ffe0e0;
            color: #cc0000;
        }
        .tag.q0 {
            background: #ffe0e0;
            color: #cc0000;
        }
        .tag.q1 {
            background: #fff0d5;
            color: #b67b00;
        }

        .tag.q2 {
            background: #e4f1ff;
            color: #247fd5;
        }

        .tag.q3 {
            background: #fff0d5;
            color: #b67b00;
        }


        .title {
            min-width: 160px;
            font-weight: 500;
            color: #333;
        }

        .score {
            font-size: 13px;
            color: #999;
        }

        .bar-wrapper {
            flex: 1;
            min-width: 120px;
            height: 20px;
            background: #f0f0f0;
            border-radius: 10px;
            position: relative;
            overflow: hidden;
        }

        .bar {
            height: 100%;
            text-align: center;
            line-height: 20px;
            font-size: 12px;
            font-weight: bold;
            color: #fff;
        }

        .bar.blue {
            background: #4aa3f0;
            width: 50%;
        }

        .score-box {
            background: #ffdede;
            color: #e60000;
            font-weight: bold;
            border-radius: 6px;
            padding: 2px 10px;
            font-size: 14px;
        }

        .buttons {
            display: flex;
            gap: 6px;
        }

        .buttons button {
            padding: 5px 10px;
            font-size: 13px;
            border: 1px solid #ccc;
            background: #f8f8f8;
            border-radius: 6px;
            cursor: pointer;
        }

        .buttons button:hover {
            background: #eaeaea;
        }

        .light {
            background: #f3f3f3;
            padding: 3px 6px;
            border-radius: 6px;
            font-size: 12px;
        }

        .menu li.active {
            background: #e9f0ff;
            color: #2679ff;
            font-weight: 600;
        }

        .menu li.active i {
            color: #2679ff;
        }

    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0, 0, 0, 0.5);
        font-family: 'Pretendard', sans-serif;
    }


    .modal-content {
        background-color: #fff;
        margin: 10% auto;
        padding: 30px 24px;
        border-radius: 12px;
        width: 90%;
        max-width: 480px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
        position: relative;
        animation: fadeIn 0.3s ease-out;
    }

    .close {
        position: absolute;
        top: 8px;
        right: 16px;
        font-size: 26px;
        color: #888;
        cursor: pointer;
        transition: color 0.2s;
        z-index: 1;
    }

    .close:hover {
        color: #000;
    }

    .modal-title {
        margin: 0 0 20px;
        font-size: 20px;
        font-weight: 700;
        text-align: center;
        color: #333;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 600;
        color: #333;
    }

    .form-select {
        width: 100%;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid #ccc;
        font-size: 16px;
        background: #f9f9f9;
    }

    .form-select:disabled {
        background: #e5e5e5;
        color: #999;
        cursor: not-allowed;
    }

    .modal-buttons {
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }

    .modal-btn {
        flex: 1;
        padding: 12px;
        font-size: 16px;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        background-color: #eee;
        transition: background 0.2s;
    }

    .modal-btn:hover {
        background-color: #ddd;
    }

    .modal-btn.primary {
        background-color: #4a80ff;
        color: #fff;
        font-weight: bold;
    }

    .modal-btn.primary:hover {
        background-color: #3a6edc;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: scale(0.95); }
        to { opacity: 1; transform: scale(1); }
    }

    /* 상세 결과 모달 스타일 */
    .detail-modal {
        z-index: 1001 !important;
    }

    .detail-modal .modal-content {
        max-width: 90%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 2% auto;
    }

    /* 상세 결과 테이블 스타일 */
    .detail-modal table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
    }

    .detail-modal th,
    .detail-modal td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
    }

    .detail-modal th {
        background-color: #f5f5f5;
        font-weight: bold;
    }

    .detail-modal .score-perfect {
        background-color: #e8f5e8;
        color: #2e7d2e;
    }

    .detail-modal .score-partial {
        background-color: #fff3cd;
        color: #856404;
    }

    .detail-modal .score-fail {
        background-color: #f8d7da;
        color: #721c24;
    }

    /* 반응형 디자인 */
    @media (max-width: 768px) {
        .nav {
            left: -240px;
        }
        
        .nav.mobile-open {
            left: 0;
        }
        
        .container {
            margin-left: 20px;
            width: calc(100% - 40px);
            max-width: none;
            padding: 20px;
        }
        
        .nav-collapsed .container {
            margin-left: 20px;
        }
        
        .content-wrapper {
            padding: 20px;
        }
        
        .detail-modal {
            z-index: 1002 !important;
        }
    }

    @media (max-width: 480px) {
        .container {
            padding: 15px;
        }
        
        .content-wrapper {
            padding: 20px 15px;
        }
    }

    /* 로딩 모달 */
.loading-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-family: 'Pretendard', sans-serif;
}

.loading-modal.active {
    display: flex;
}

.loading-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #4a80ff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 책 공지 모달 스타일 */
.notice-content {
    padding: 20px 0;
    line-height: 1.8;
    color: #333;
    font-size: 15px;
    white-space: pre-wrap;
    word-break: keep-all;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

#bookNoticeModal .modal-title {
    color: #2c5aa0;
    font-size: 22px;
    margin-bottom: 0;
}

