/* **********************************
AUTOTEST CSS
************************************** */

:root {
    --at-primary: #4361ee;
    --at-primary-dark: #3a56d4;
    --at-secondary: #3f37c9;
    --at-accent: #4895ef;
    --at-success: #2dc653;
    --at-warning: #f77f00;
    --at-danger: #ef233c;
    --at-dark: #212529;
    --at-gray: #6c757d;
    --at-light: #f8f9fa;
    --at-bg: #f0f2f5;
    --at-card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --at-radius: 10px;
}

/* ================================
   공통 / 레이아웃
================================ */
.at-page {
    min-height: 100vh;
    background: var(--at-bg);
}

.at-section {
    padding: 60px 0;
}

.at-section-alt {
    padding: 60px 0;
    background: #fff;
}

/* ================================
   네비게이션
================================ */
.at-navbar {
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    padding: 0.5rem 0;
}

.at-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--at-primary);
}

.at-navbar .nav-link {
    color: var(--at-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.at-navbar .nav-link:hover {
    color: var(--at-primary);
}

.at-navbar .btn-login {
    background: var(--at-primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 20px;
    font-weight: 500;
    transition: background 0.2s;
}

.at-navbar .btn-login:hover {
    background: var(--at-primary-dark);
    color: #fff;
}

.at-navbar .dropdown-menu {
    border: none;
    box-shadow: var(--at-card-shadow);
    border-radius: 8px;
}

.at-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 4px 14px 4px 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.at-profile-btn:hover {
    border-color: var(--at-primary);
}

.at-profile-btn .profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--at-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

/* ================================
   Home - 히어로 배너
================================ */
.at-hero {
    background: linear-gradient(135deg, var(--at-primary) 0%, var(--at-secondary) 100%);
    color: #fff;
    padding: 100px 0 80px;
    text-align: center;
}

.at-hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.at-hero p.lead {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

.at-hero .btn-hero {
    background: #fff;
    color: var(--at-primary);
    border: none;
    border-radius: 25px;
    padding: 12px 36px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.at-hero .btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Home - 사용방법 스텝 */
.at-step-card {
    background: #fff;
    border-radius: var(--at-radius);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--at-card-shadow);
    transition: transform 0.2s;
    height: 100%;
}

.at-step-card:hover {
    transform: translateY(-4px);
}

.at-step-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--at-primary), var(--at-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.at-step-num {
    display: inline-block;
    background: var(--at-primary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    line-height: 28px;
    margin-bottom: 12px;
}

/* Home - 장점/활용 */
.at-feature-card {
    background: #fff;
    border-radius: var(--at-radius);
    padding: 40px;
    box-shadow: var(--at-card-shadow);
    height: 100%;
}

.at-feature-card i {
    font-size: 36px;
    color: var(--at-primary);
    margin-bottom: 16px;
}

/* F9: 홈 공지사항 카드 */
.at-notices-section {
    padding: 40px 0;
}

.at-notices-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.at-notice-card {
    min-width: 260px;
    max-width: 300px;
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 20px;
    scroll-snap-align: start;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.at-notice-card:hover {
    transform: translateY(-3px);
}

.at-notice-content {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================================
   로그인 페이지
================================ */
.at-login-banner {
    background: linear-gradient(135deg, var(--at-primary), var(--at-secondary));
    color: #fff;
    padding: 40px;
    border-radius: var(--at-radius) var(--at-radius) 0 0;
    text-align: center;
}

.at-login-card {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    overflow: hidden;
    max-width: 420px;
    margin: 60px auto;
}

.at-login-body {
    padding: 30px 40px 40px;
}

.at-login-body .form-control {
    border-radius: 8px;
    padding: 10px 14px;
}

.at-login-body .btn-primary {
    background: var(--at-primary);
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
}

.at-login-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.at-login-links a {
    color: var(--at-gray);
    text-decoration: none;
}

.at-login-links a:hover {
    color: var(--at-primary);
}

/* F5: OAuth 소셜 로그인 버튼 */
.at-oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--at-gray);
    font-size: 0.85rem;
}

.at-oauth-divider::before,
.at-oauth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.at-oauth-divider span {
    padding: 0 12px;
}

.at-oauth-buttons {
    margin-bottom: 16px;
}

.at-btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}

.at-btn-google:hover {
    background: #f7f7f7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    color: #333;
}

.at-btn-naver {
    background: #03C75A;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.at-btn-naver:hover {
    background: #02b351;
    color: #fff;
}

.at-naver-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #fff;
    color: #03C75A;
    border-radius: 4px;
    font-weight: 800;
    font-size: 14px;
}

/* F6: 이메일 인증 안내 */
.at-verification-notice {
    margin-top: 16px;
    padding: 16px;
    background: #fff8e1;
    border-radius: 8px;
    border: 1px solid #ffe082;
    text-align: center;
}

.at-verification-notice i {
    font-size: 24px;
    margin-bottom: 8px;
}

/* ================================
   Admin 페이지
================================ */
.at-admin-wrap {
    display: flex;
    min-height: calc(100vh - 56px);
}

.at-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e9ecef;
    padding: 20px 0;
    flex-shrink: 0;
}

.at-sidebar-title {
    padding: 0 20px 16px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--at-dark);
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 8px;
}

.at-sidebar .list-group-item {
    border: none;
    padding: 10px 20px;
    font-size: 0.93rem;
    cursor: pointer;
    transition: background 0.15s;
}

.at-sidebar .list-group-item:hover {
    background: var(--at-bg);
}

.at-sidebar .list-group-item.active {
    background: rgba(67,97,238,0.08);
    color: var(--at-primary);
    font-weight: 600;
    border-left: 3px solid var(--at-primary);
}

.at-sidebar .btn-add-category {
    margin: 12px 20px;
    font-size: 0.85rem;
}

.at-sidebar-section {
    border-top: 1px solid #e9ecef;
    padding-top: 8px;
}

.at-sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 12px 16px;
}

.at-sidebar-group-header {
    padding: 6px 20px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--at-gray, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* 2단계 메뉴 (시험 생성 등) */
.at-sidebar-lv2 .list-group-item {
    padding-left: 32px;
    font-size: 0.9rem;
}

/* 2단계 토글 헤더 (시험 카테고리) */
.at-sidebar-lv2-toggle {
    padding: 8px 20px 8px 32px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.at-sidebar-lv2-toggle:hover {
    background: var(--at-bg);
}
.at-sidebar-lv2-toggle .at-toggle-icon {
    font-size: 0.65rem;
    transition: transform 0.2s;
    display: inline-block;
    width: 12px;
}
.at-sidebar-lv2-toggle.collapsed .at-toggle-icon {
    transform: rotate(-90deg);
}

/* 3단계 카테고리 목록 */
.at-sidebar-lv3-wrap {
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.at-sidebar-lv3 .list-group-item {
    padding: 7px 20px 7px 48px;
    font-size: 0.83rem;
    color: #555;
    border: none;
}
.at-sidebar-lv3 .list-group-item:hover {
    background: var(--at-bg);
}
.at-sidebar-lv3 .list-group-item.active {
    background: rgba(67,97,238,0.08);
    color: var(--at-primary);
    font-weight: 600;
}
.at-sidebar-lv3 .list-group-item i {
    font-size: 0.75rem;
}
.at-sidebar-lv3-actions {
    padding: 4px 20px 8px 48px;
}
.at-sidebar-lv3-actions .btn {
    font-size: 0.78rem;
}

.at-main-content {
    flex: 1;
    padding: 24px;
    background: var(--at-bg);
    overflow-y: auto;
}

/* Admin - 시험 카드 */
.at-test-card {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.at-test-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.at-test-card .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.at-test-card .card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.at-test-card .badge-meta {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.at-test-card .card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.at-test-card .btn-sm {
    font-size: 0.82rem;
    border-radius: 6px;
}

/* F3: 태그 배지 */
.at-tag-badge {
    background: rgba(67,97,238,0.08) !important;
    color: var(--at-primary) !important;
    border: 1px solid rgba(67,97,238,0.2);
    font-weight: 500;
}
.at-points-badge {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    font-weight: 600;
    font-size: 0.75rem;
}
.at-badge-info {
    background: #fff3e0 !important;
    color: #e65100 !important;
    font-weight: 600;
    font-size: 0.8rem;
}

/* 9차: 탭 우측 아이콘 버튼 */
.at-tab-actions { align-self: flex-end; margin-bottom: -1px; }
.at-icon-btn { width: 34px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 0.88rem; }

/* 9차: 응시 형태 미리보기 모달 */
.at-take-preview-wrap { background: #f5f6fa; min-height: 300px; }
.at-take-q-card { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.at-take-q-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.at-take-q-num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--at-primary); color: #fff; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.at-take-q-text { font-size: 1.05rem; font-weight: 600; line-height: 1.5; }
.at-take-q-choices { display: flex; flex-direction: column; gap: 6px; }
.at-take-choice { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f8f9fa; border-radius: 8px; cursor: default; font-size: 0.92rem; }
.at-take-choice-label { font-weight: 600; color: var(--at-primary); min-width: 20px; }
.at-take-ox-choice { padding: 10px 20px; border-radius: 20px; }
.at-take-q-input { margin-top: 4px; }

/* F4: 유형 체크박스 그리드 */
.at-qtype-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.at-qtype-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--at-bg);
    border-radius: 8px;
}

.at-qtype-item .form-check-label {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
}

.at-qtype-item .qtype-count {
    width: 65px;
    text-align: center;
}

/* Admin - 생성 폼 */
.at-generate-form {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 30px;
}

.at-generate-form .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.at-generate-form .form-control,
.at-generate-form .form-select {
    border-radius: 8px;
}

.at-generate-form .btn-generate {
    background: var(--at-primary);
    border: none;
    border-radius: 8px;
    padding: 10px 32px;
    font-weight: 600;
    color: #fff;
}

.at-generate-form .btn-generate:hover {
    background: var(--at-primary-dark);
}

/* ================================
   Preview 페이지
================================ */
.at-preview-header {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.at-preview-header h4 {
    font-weight: 700;
    margin-bottom: 10px;
}

.at-preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Preview - 문제 카드 */
.at-question-card {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 24px;
    margin-bottom: 16px;
    position: relative;
}

.at-question-card .q-number {
    display: inline-block;
    background: var(--at-primary);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 10px;
}

.at-question-card .q-text {
    font-size: var(--at-q-font-size, 14px);
    margin-bottom: 12px;
    line-height: 1.6;
}

.at-question-card .q-choices {
    list-style: none;
    padding: 0;
    margin: 0;
}

.at-question-card .q-choices li {
    padding: 7px 14px;
    margin-bottom: 5px;
    background: var(--at-bg);
    border-radius: 8px;
    font-size: var(--at-c-font-size, 14px);

    display: flex;
    align-items: center;
    gap: 8px;
}

.at-question-card .q-choices li .choice-label {
    font-weight: 600;
    color: var(--at-primary);
    min-width: 24px;
}

.at-question-card .q-choices li.correct-answer.show-correct {
    background: rgba(45,198,83,0.1);
    border: 1px solid var(--at-success);
}

.at-question-card .q-answer-area {
    background: var(--at-bg);
    border-radius: 8px;
    padding: 14px;
    min-height: 60px;
    color: var(--at-gray);
    font-style: italic;
}

.at-question-card .q-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 6px;
}

.at-question-card .q-actions .btn {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.at-question-card .q-explanation {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff8e1;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #7c6a0a;
    display: none;
}

.at-question-card .q-explanation.show {
    display: block;
}

/* 31차: 해설 HTML 렌더링 스타일 */
.q-explanation .explanation-label { font-weight: bold; }
.q-explanation p { margin: 0.3em 0; }
.q-explanation ul, .q-explanation ol { margin: 0.3em 0; padding-left: 1.5em; }
.explanation-content p { margin: 0.3em 0; }
.explanation-content ul, .explanation-content ol { margin: 0.3em 0; padding-left: 1.5em; }

/* F4: 문제 유형 배지 */
.at-qtype-badge {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    vertical-align: middle;
}

.at-qtype-multiple_choice {
    background: var(--at-primary);
    color: #fff;
}

.at-qtype-short_answer {
    background: #6f42c1;
    color: #fff;
}

.at-qtype-short_form {
    background: #fd7e14;
    color: #fff;
}

.at-qtype-ox {
    background: #20c997;
    color: #fff;
}

/* F4: O/X 스타일 */
.at-ox-choices {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.at-ox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--at-bg);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--at-dark);
    transition: all 0.2s;
}

.at-ox-btn.at-ox-correct.show-correct {
    background: rgba(45,198,83,0.15);
    color: var(--at-success);
    border: 2px solid var(--at-success);
}

/* F4: 단답형 스타일 */
.at-short-form {
    min-height: 40px;
}

/* ================================
   게시판
================================ */
.at-board-wrap {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 56px);
    padding: 24px;
}

.at-board-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.at-board-sidebar .list-group-item {
    border: none;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.93rem;
}

.at-board-sidebar .list-group-item.active {
    background: var(--at-primary);
    border-color: var(--at-primary);
}

.at-board-main {
    flex: 1;
}

.at-board-table {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    overflow: hidden;
}

.at-board-table table {
    margin-bottom: 0;
}

.at-board-table th {
    background: var(--at-bg);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 12px 16px;
    border-bottom: 2px solid #dee2e6;
}

.at-board-table td {
    padding: 12px 16px;
    font-size: 0.93rem;
    vertical-align: middle;
}

.at-board-table .post-title {
    color: var(--at-dark);
    text-decoration: none;
    font-weight: 500;
}

.at-board-table .post-title:hover {
    color: var(--at-primary);
}

/* 게시글 상세 */
.at-post-detail {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 30px;
}

.at-post-detail .post-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.at-post-detail .post-header h4 {
    font-weight: 700;
    margin-bottom: 8px;
}

.at-post-detail .post-meta {
    color: var(--at-gray);
    font-size: 0.88rem;
}

.at-comment-list {
    margin-top: 30px;
}

.at-comment-item {
    padding: 14px 0;
    border-bottom: 1px solid #f0f2f5;
}

.at-comment-item .comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.at-comment-item .comment-date {
    color: var(--at-gray);
    font-size: 0.82rem;
}

.at-comment-form textarea {
    border-radius: 8px;
}

/* ================================
   공통 컴포넌트
================================ */
.at-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--at-gray);
}

.at-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.at-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.at-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--at-primary);
}

/* ================================
   모달 커스텀
================================ */
.at-modal .modal-content {
    border: none;
    border-radius: var(--at-radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.at-modal .modal-header {
    border-bottom: 1px solid #f0f2f5;
    padding: 16px 24px;
}

.at-modal .modal-body {
    padding: 24px;
}

.at-modal .modal-footer {
    border-top: 1px solid #f0f2f5;
    padding: 12px 24px;
}

/* ================================
   F11: 문제 재생성
================================ */
.regen-opt-btn.active {
    font-weight: 600;
}

.at-regen-preview {
    background: #f8f9fa;
    border-radius: var(--at-radius);
    padding: 16px;
    border: 1px solid #e9ecef;
}

.at-regen-preview .at-question-card {
    box-shadow: none;
    border: none;
    background: transparent;
}

/* ================================
   F12: 시험 응시 페이지
================================ */
.at-take-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    padding: 12px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.at-take-timer {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--at-primary);
    font-family: 'Courier New', monospace;
}

/* 19차: 응시 페이지 문제 텍스트 CSS 변수 기본값 */
#take-question-list {
    --at-q-font-size: 14px;
    --at-c-font-size: 14px;
}

.at-take-question {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 24px;
    margin-bottom: 16px;
    border-left: 4px solid #e9ecef;
    transition: border-color 0.3s;
}

.at-take-question .q-text {
    font-size: var(--at-q-font-size, 14px);
    line-height: 1.6;
    margin-bottom: 8px;
}

.at-take-question.at-take-answered {
    border-left-color: var(--at-primary);
}

.at-take-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.at-take-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s;
    font-size: var(--at-c-font-size, 14px);
}

.at-take-choice:hover {
    background: #f0f4ff;
    border-color: var(--at-primary);
}

.at-take-choice input[type="radio"] {
    display: none;
}

.at-take-choice:has(input:checked) {
    background: #e8edff;
    border-color: var(--at-primary);
    font-weight: 500;
}

.at-take-ox {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.at-take-ox-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.2s;
}

.at-take-ox-btn input[type="radio"] {
    display: none;
}

.at-take-ox-btn:has(input:checked) {
    background: var(--at-primary);
    border-color: var(--at-primary);
    color: #fff;
}

.at-take-ox-btn:hover {
    border-color: var(--at-primary);
}

/* ================================
   F13: 채점 상세
================================ */
.at-attempt-detail {
    max-height: 60vh;
    overflow-y: auto;
}

.at-attempt-answer {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    border-left: 4px solid;
}

.at-attempt-answer.border-success {
    border-left-color: #198754;
    background: #f0fdf4;
}

.at-attempt-answer.border-danger {
    border-left-color: #dc3545;
    background: #fef2f2;
}

.at-user-selected {
    font-weight: 600;
    color: var(--at-primary);
}

.at-correct-choice {
    color: #198754;
}

.at-user-selected.at-correct-choice {
    color: #198754;
    font-weight: 700;
}

/* ================================
   반응형
================================ */
@media (max-width: 991px) {
    .at-hero h1 { font-size: 2rem; }
    .at-hero p.lead { font-size: 1.05rem; }
    .at-qtype-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .at-hero { padding: 60px 0 50px; }
    .at-hero h1 { font-size: 1.7rem; }
    .at-section { padding: 40px 0; }
    .at-admin-wrap { flex-direction: column; }
    .at-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e9ecef; }
    .at-board-wrap { flex-direction: column; }
    .at-board-sidebar { width: 100%; }
    .at-login-body { padding: 24px; }
    .at-preview-actions { flex-direction: column; }
    .at-qtype-grid { grid-template-columns: 1fr; }
    .at-ox-choices { gap: 10px; }
    .at-ox-btn { width: 44px; height: 44px; font-size: 1.1rem; }
}

/* ============================================================
   분류 등록 패널 (admin)
   ============================================================ */
.at-class-block {
    border: 1px solid #e9ecef;
    border-radius: var(--at-radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.at-class-block-header {
    padding: 12px 18px;
    font-weight: 700;
    font-size: 0.97rem;
    display: flex;
    align-items: center;
}
.at-class-l1-header {
    background: linear-gradient(90deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-bottom: 1px solid #ffc107;
}
.at-class-l2-header {
    background: linear-gradient(90deg, #d1e7dd, #b2dfdb);
    color: #0a5c36;
    border-bottom: 1px solid #20c997;
}
.at-class-l3-header {
    background: linear-gradient(90deg, #cfe2ff, #bee3f8);
    color: #084298;
    border-bottom: 1px solid #0dcaf0;
}
.at-class-block-body {
    padding: 16px 18px;
    background: #fff;
}
.at-class-list {
    max-height: 180px;
    overflow-y: auto;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 4px;
}
.at-class-item {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.at-class-item:hover {
    background: #f8f9fa;
}

/* ============================================================
   카드형 시험 행 목록 (admin page)
   ============================================================ */
.at-test-row {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--at-radius);
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.15s, border-color 0.15s;
    overflow: hidden;
}
.at-test-row:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-color: #b8c1cc;
}
.at-test-row.selected {
    border-color: var(--at-primary);
    background: #f0f4ff;
}
.at-test-row-check {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-right: 1px solid #f0f0f0;
    background: #fafafa;
    cursor: default;
    flex-shrink: 0;
}
.at-test-row-check .form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.at-test-row-body {
    flex: 1;
    padding: 14px 16px;
    cursor: pointer;
    min-width: 0;
}
.at-test-row-body:hover {
    background: rgba(67, 97, 238, 0.03);
}
.at-row-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.at-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.at-row-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}
.at-row-time {
    margin-top: 6px;
    font-size: 0.8rem;
}
.at-test-row-actions {
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-left: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* ============================================================
   테이블형 시험 목록 (admin page - 신규)
   ============================================================ */
.at-test-table-wrap {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    overflow-x: auto;
}
.at-test-table {
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 900px;
}
.at-test-thead th {
    background: #f8f9fa;
    font-weight: 700;
    font-size: 0.82rem;
    color: #495057;
    padding: 10px 12px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.at-test-tr td {
    padding: 9px 12px;
    font-size: 0.88rem;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.at-test-tr:hover td {
    background: #f5f7ff;
}
.at-test-tr:last-child td {
    border-bottom: none;
}

/* 열 너비 */
.col-chk     { width: 42px;  min-width: 42px;  text-align: center; }
.col-title   { width: 200px; min-width: 160px; }
.col-cnt     { width: 56px;  min-width: 48px;  text-align: center; }
.col-diff    { width: 62px;  min-width: 56px;  text-align: center; }
.col-type    { width: 90px;  min-width: 72px;  }
.col-cat     { width: 100px; min-width: 72px;  }
.col-date    { width: 88px;  min-width: 80px;  }
.col-pub     { width: 50px;  min-width: 44px;  text-align: center; }
.col-source  { width: 72px;  min-width: 60px;  text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-actions { width: 48px;  min-width: 40px;  text-align: center; }
.col-type, .col-cat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-start { width: 130px; min-width: 110px; }
.col-end   { width: 130px; min-width: 110px; }

/* 제목 셀 */
.at-td-link {
    cursor: pointer;
    color: #1a1a2e;
}
.at-td-link:hover {
    color: var(--at-primary);
    text-decoration: underline;
}
.at-td-title {
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 일괄 선택 액션 바 */
.at-bulk-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--at-primary);
    border-radius: var(--at-radius);
    padding: 10px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.15);
    flex-wrap: wrap;
}
.at-test-tr.selected {
    background: rgba(74, 108, 247, 0.08) !important;
}
.at-test-tr.selected td { background: transparent; }
.col-chk .form-check-input { cursor: pointer; }

/* Tabler 호환: 체크박스 네이티브 렌더링 복원 */
.at-page .form-check-input[type="checkbox"],
.col-chk input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 16px !important;
    height: 16px !important;
    opacity: 1 !important;
    position: static !important;
    visibility: visible !important;
    cursor: pointer;
}

/* Tabler 호환: select 테두리 복원 */
.at-page .form-select {
    border: 1px solid #c0c4cc !important;
    border-radius: 4px;
}

/* Tabler 호환: form-control 경계선 제거 */
.at-page .form-control {
    border: none !important;
}

/* Tabler 호환: pre 글자색 복원 */
.at-page pre {
    color: #000 !important;
}

/* ============================================================
   탭 구조 (preview page)
   ============================================================ */
.at-preview-tabs {
    border-bottom: 2px solid #e9ecef;
    gap: 0;
}
.at-preview-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.at-preview-tabs .nav-link:hover {
    color: var(--at-primary);
    border-bottom-color: #b0bcf5;
}
.at-preview-tabs .nav-link.active {
    color: var(--at-primary);
    border-bottom-color: var(--at-primary);
    background: transparent;
}
.at-tab-pane {
    display: none;
}
.at-tab-pane.active {
    display: block;
}

/* 시험 설정 폼 섹션 */
.at-settings-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--at-radius);
    padding: 20px 24px;
    margin-top: 16px;
}
.at-settings-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* 9차: 표지 설정 영역 컴팩트 */
#cover-settings-section { padding: 16px 20px; }
#cover-settings-section .at-settings-title { margin-bottom: 8px; padding-bottom: 6px; }
#cover-settings-section .row.g-3 > [class*="col"] { margin-bottom: 0; }
#cover-settings-section .form-label { margin-bottom: 2px; font-size: 0.88rem; }
#cover-settings-section .form-text { margin-top: 2px; font-size: 0.78rem; }
#cover-settings-section .form-control { padding: 0.35rem 0.65rem; }
#cover-settings-section p.text-muted { margin-bottom: 8px !important; }

/* 26차: 표지 설정 접기/펼치기 */
.at-cover-toggle {
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}
.at-cover-toggle:hover .at-settings-title { color: var(--at-primary, #4361ee); }
.at-cover-chevron {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
    color: var(--at-gray, #6c757d);
}
.at-cover-toggle[aria-expanded="true"] .at-cover-chevron {
    transform: rotate(90deg);
}
.at-cover-summary {
    font-size: 0.8rem;
    color: var(--at-gray, #6c757d);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.at-cover-toggle[aria-expanded="true"] .at-cover-summary {
    display: none;
}

/* ─── 커버 화면 ─────────────────────────────────────── */
.at-take-cover {
    text-align: center;
    padding: 40px 20px;
}
.at-cover-card {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 48px 40px;
    max-width: 680px;
    margin: 0 auto;
}
.at-cover-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a1a2e;
}
.at-cover-subtitle {
    font-size: 1.1rem;
    color: var(--at-gray);
    margin-bottom: 20px;
}
.at-cover-desc {
    text-align: left;
    padding: 16px;
    background: var(--at-bg);
    border-radius: 8px;
    margin-bottom: 16px;
    white-space: pre-line;
    line-height: 1.7;
}
.at-cover-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    color: #856404;
    margin-bottom: 16px;
}
.at-cover-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ─── 종료 메시지 ──────────────────────────────────── */
.at-end-message {
    text-align: center;
    padding: 40px;
    background: #f0fdf4;
    border-radius: var(--at-radius);
}

/* ─── 결과 페이지 ──────────────────────────────────── */
.at-result-message {
    background: linear-gradient(135deg, var(--at-primary), var(--at-secondary));
    color: #fff;
    padding: 30px;
    border-radius: var(--at-radius);
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.7;
}
.at-result-score-card {
    background: #fff;
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    padding: 40px;
    text-align: center;
    margin-top: 20px;
}
.at-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--at-primary);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.at-result-answer-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--at-radius);
    padding: 20px;
    margin-bottom: 12px;
}
.at-result-answer-card.correct {
    border-left: 4px solid #28a745;
}
.at-result-answer-card.incorrect {
    border-left: 4px solid #dc3545;
}

/* ─── 응시 코드 배지 ────────────────────────────────── */
.at-attempt-code-badge {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid var(--at-primary);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #495057;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.at-attempt-code-badge .at-code-value {
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    color: var(--at-primary);
    letter-spacing: 0.1em;
}
.at-attempt-code-badge .at-code-note {
    display: block;
    width: 100%;
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 4px;
}

/* ─── 인라인 표지 (시험 응시 문제 리스트 상단) ──────── */
.at-take-inline-cover {
    margin-bottom: 24px;
    border-radius: var(--at-radius);
    overflow: hidden;
    box-shadow: var(--at-card-shadow);
}
.at-inline-cover-bg {
    min-height: 180px;
    background: linear-gradient(135deg, var(--at-primary) 0%, var(--at-secondary) 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 배경 이미지 있을 때: 어두운 오버레이 강화 */
.at-inline-cover-bg.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    border-radius: inherit;
}
/* 배경 이미지 없을 때: 그라디언트 위 밝은 오버레이 */
.at-inline-cover-bg:not(.has-image)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
}
.at-inline-cover-overlay {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 36px 32px;
    width: 100%;
}
.at-inline-cover-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    line-height: 1.25;
}
.at-inline-cover-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* 반응형 */
@media (max-width: 767px) {
    .at-test-row { flex-direction: column; }
    .at-test-row-check { padding: 10px 14px; border-right: none; border-bottom: 1px solid #f0f0f0; justify-content: flex-start; }
    .at-test-row-actions { padding: 10px 14px; border-left: none; border-top: 1px solid #f0f0f0; justify-content: flex-end; }
    .at-bulk-bar { flex-wrap: wrap; }
    .at-preview-tabs .nav-link { padding: 8px 12px; font-size: 0.85rem; }
    .at-cover-card { padding: 28px 20px; }
    .at-inline-cover-bg { min-height: 140px; }
    .at-inline-cover-overlay { padding: 24px 20px; }
    .at-inline-cover-title { font-size: 1.4rem; }
    .at-inline-cover-subtitle { font-size: 0.95rem; }
    .at-cover-title { font-size: 1.5rem; }
    .at-score-circle { width: 90px; height: 90px; font-size: 1.5rem; }
}

/* ============================================================
   10차: 템플릿 설정 스타일
============================================================ */

/* 프리셋 카드 */
.at-template-preset-card {
    border: 2px solid #e9ecef;
    border-radius: var(--at-radius);
    padding: 16px 20px;
    cursor: pointer;
    text-align: center;
    min-width: 140px;
    transition: all 0.2s;
    background: #fff;
}
.at-template-preset-card:hover {
    border-color: var(--at-primary);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.15);
}
.at-template-preset-card.active {
    border-color: var(--at-primary);
    background: rgba(67, 97, 238, 0.06);
    box-shadow: 0 2px 12px rgba(67, 97, 238, 0.2);
}
.at-preset-icon {
    font-size: 1.6rem;
    color: var(--at-primary);
    margin-bottom: 8px;
}
.at-preset-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.at-preset-desc {
    font-size: 0.78rem;
    color: #868e96;
}

/* 미리보기 영역 */
.at-template-preview-area {
    border: 1px solid #dee2e6;
    border-radius: var(--at-radius);
    padding: 16px;
    background: #f8f9fa;
    min-height: 200px;
}
.at-tpl-preview-page {
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 16px;
    border-radius: 4px;
    min-height: 180px;
    font-size: 0.82rem;
}
.at-tpl-preview-cover {
    text-align: center;
    padding: 12px 8px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
}
.at-tpl-cv-title { font-weight: 700; font-size: 1rem; }
.at-tpl-cv-sub { font-size: 0.78rem; color: #868e96; }
.at-tpl-preview-q {
    margin-bottom: 10px;
    break-inside: avoid;
}
.at-tpl-q-text { font-weight: 600; margin-bottom: 4px; }
.at-tpl-badge {
    background: #e9ecef;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.72rem;
    font-weight: 600;
}
.at-tpl-pts {
    font-size: 0.72rem;
    color: var(--at-primary);
}
.at-tpl-choices { margin-left: 16px; }
.at-tpl-choices-h { display: flex; flex-wrap: wrap; gap: 8px; }
.at-tpl-choices-h .at-tpl-choice { margin-bottom: 0; }
.at-tpl-choice {
    font-size: 0.78rem;
    color: #495057;
    margin-bottom: 2px;
}

/* 20차: 실시간 미리보기 패널 (3탭) */
#tpl-preview-tabs { border-bottom: 2px solid #dee2e6; margin-bottom: 0; }
#tpl-preview-tabs .nav-link { font-size: 0.85rem; padding: 6px 14px; color: #6c757d; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; }
#tpl-preview-tabs .nav-link.active { color: var(--at-primary); border-bottom-color: var(--at-primary); font-weight: 600; }
#tpl-preview-tabs .nav-link:hover { color: var(--at-primary-dark); }
.at-tpl-preview-container { border: 1px solid #dee2e6; border-top: none; border-radius: 0 0 var(--at-radius) var(--at-radius); background: #f8f9fa; min-height: 520px; max-height: 680px; overflow: hidden; position: relative; }
.at-tpl-preview-pane { display: none !important; width: 100%; height: 520px; }
.at-tpl-preview-pane.active { display: flex !important; flex-direction: column; align-items: center; justify-content: center; }
.at-tpl-preview-placeholder { text-align: center; padding: 40px 20px; }
.at-tpl-preview-iframe { width: 100%; height: 100%; border: none; background: #fff; }

/* 온라인 시험 가로 배치 선택지 */
.at-choices-horizontal {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
}
.at-choices-horizontal > li,
.at-choices-horizontal > .at-choice-item {
    flex: 0 0 auto;
}

/* 11차: 응시 페이지 다단 레이아웃 */
.at-take-multicolumn .at-take-question {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

/* 12차: 본문 블록 */
.q-body-block {
    margin: 8px 0 12px 28px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-left: 3px solid var(--at-primary);
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.7;
}
.q-body-block img { max-width: 100%; height: auto; border-radius: 4px; }
.q-body-block iframe { max-width: 100%; }
.at-take-body-block {
    margin: 8px 0 12px 0;
    padding: 10px 14px;
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    border-radius: 4px;
}
.at-take-body-block img { max-width: 100%; height: auto; }

/* 12차: 인라인 편집 */
.at-question-card.editing {
    border: 2px solid var(--at-primary);
    background: #fafbff;
}
.inline-edit-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}
.inline-edit-section {
    margin-bottom: 12px;
}
.inline-body-section {
    margin: 12px 0;
    padding: 12px;
    background: #f0f4ff;
    border: 1px dashed var(--at-primary, #4a6cf7);
    border-radius: 6px;
}
.inline-body-section .ck-editor__editable {
    min-height: 120px;
}
.inline-body-actions {
    display: flex;
    gap: 8px;
}
.inline-choice-row .ck-editor {
    flex: 1;
}

/* 17차: 일괄 글자 크기 CSS 변수 기본값 */
#question-card-list {
    --at-q-font-size: 14px;
    --at-c-font-size: 14px;
}

/* 54차: 커뮤니티 카드 / 55차: 템플릿 카드 */
.community-test-card,
.template-card {
    border: 1px solid #e0e0e0;
    border-radius: var(--at-radius);
    transition: transform 0.15s, box-shadow 0.15s;
}
.community-test-card:hover,
.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =============================================
   시험 생성 페이지 UI (리디자인)
============================================= */

/* 헤더 */
.at-gen-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.at-gen-breadcrumb {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.at-gen-breadcrumb .at-gen-crumb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f0fe;
    color: var(--at-primary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.at-gen-breadcrumb .at-gen-crumb .btn-close {
    font-size: 0.55rem;
    padding: 0;
    margin-left: 4px;
}

/* 탭 네비게이션 */
.at-gen-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0;
    list-style: none;
}
.at-gen-tab-nav .nav-link {
    font-weight: 600;
    font-size: 0.92rem;
    color: #888;
    padding: 10px 24px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: none;
    transition: all 0.2s;
}
.at-gen-tab-nav .nav-link:hover {
    color: var(--at-primary);
}
.at-gen-tab-nav .nav-link.active {
    color: var(--at-primary);
    border-bottom-color: var(--at-primary);
}

/* 2열 레이아웃 */
.at-gen-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}
.at-gen-left, .at-gen-right {
    min-width: 0;
}

/* 섹션 */
.at-gen-section {
    margin-bottom: 18px;
}
.at-gen-label {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: #333;
    margin-bottom: 6px;
}
.at-gen-label .text-muted {
    font-weight: 400;
    font-size: 0.8rem;
}

/* 분류 드롭다운 행 */
.at-gen-class-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.at-gen-class-row .form-select {
    flex: 1;
}
.at-gen-class-arrow {
    color: #bbb;
    font-size: 0.7rem;
}

/* 2컬럼 행 (과목+난이도) */
.at-gen-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 드래그앤드롭 영역 */
.at-gen-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 100px;
}
.at-gen-dropzone:hover, .at-gen-dropzone.dragover {
    border-color: var(--at-primary);
    background: #f0f6ff;
}
.at-gen-dropzone p {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}
.at-gen-file-list {
    margin-top: 10px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 14px;
    display: none;
}
.at-gen-file-preview-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
}
.at-gen-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid #eee;
    margin-bottom: 4px;
}
.at-gen-file-item:last-child { margin-bottom: 0; }
.at-gen-file-info {
    display: flex;
    align-items: center;
    min-width: 0;
}
.at-gen-file-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.at-gen-file-icon { font-size: 1.1rem; }
.at-gen-file-icon--pdf { color: #e74c3c; }
.at-gen-file-icon--doc, .at-gen-file-icon--docx { color: #2b579a; }
.at-gen-file-icon--txt { color: #7f8c8d; }
.at-gen-file-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* 파일 내용 미리보기 */
.at-gen-file-content-preview {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -4px;
    margin-bottom: 6px;
    overflow: hidden;
}
.at-gen-file-content-loading {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}
.at-gen-file-content-text {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px 14px;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
    background: #fafbfc;
    white-space: pre-wrap;
    word-break: break-word;
    border: none;
}
.at-gen-file-content-truncated {
    padding: 6px 14px;
    font-size: 0.75rem;
    color: #999;
    background: #f5f5f5;
    text-align: center;
    border-top: 1px solid #eee;
}
.at-gen-file-content-pdf {
    width: 100%;
}
.at-gen-pdf-iframe {
    width: 100%;
    height: 400px;
    border: none;
    display: block;
}
.at-gen-file-content-msg {
    padding: 16px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* 문제 유형 패널 */
.at-gen-qtype-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.at-gen-qtype-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 유형 카드 */
.at-gen-qtype-card {
    background: #f9f9fb;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.2s;
}
.at-gen-qtype-card:has(.gp-qtype-check:checked) {
    border-color: var(--at-primary);
    background: #f5f8ff;
}
.at-gen-qtype-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
}
.at-gen-qtype-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    margin: 0;
}
.at-gen-qtype-total {
    width: 65px;
    text-align: center;
    font-weight: 700;
}
.text-purple { color: #6f42c1; }
.text-orange { color: #fd7e14; }
.text-teal { color: #20c997; }

/* 난이도별 하위 개수 */
.at-gen-qtype-detail {
    padding: 6px 14px 10px;
    background: #f0f2f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}
.at-gen-diff-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.at-gen-diff-row .badge {
    min-width: 24px;
    font-size: 0.72rem;
}
.at-gen-diff-row .form-control {
    width: 55px;
    text-align: center;
    font-weight: 600;
}

/* 총 문제 수 */
.at-gen-qtype-summary {
    text-align: right;
    font-size: 0.9rem;
    color: #555;
    padding-top: 12px;
    border-top: 1px solid #eee;
    margin-top: 6px;
}
.at-gen-qtype-summary strong {
    font-size: 1.1rem;
    color: var(--at-primary);
}

/* 생성 버튼 */
.at-gen-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5c518;
    color: #333;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 40px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(245,197,24,.3);
}
.at-gen-submit-btn:hover {
    background: #e6b800;
    box-shadow: 0 4px 12px rgba(245,197,24,.5);
    transform: translateY(-1px);
}

/* 검색바 (템플릿/커뮤니티) */
.at-gen-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.at-gen-search-input {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.at-gen-search-input i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.85rem;
}
.at-gen-search-input .form-control {
    padding-left: 32px;
}
.at-gen-search-bar .form-select {
    max-width: 140px;
}

/* 카드 미리보기 아이템 */
.at-gen-preview-item {
    font-size: 0.82rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 0;
    line-height: 1.5;
}

/* 반응형 */
@media (max-width: 991px) {
    .at-gen-layout {
        grid-template-columns: 1fr;
    }
    .at-gen-tab-nav .nav-link {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}
@media (max-width: 767px) {
    .at-gen-class-row {
        flex-direction: column;
    }
    .at-gen-class-arrow {
        display: none;
    }
    .at-gen-row-2col {
        grid-template-columns: 1fr;
    }
    .at-gen-qtype-detail {
        flex-direction: column;
        gap: 6px;
    }
    .at-gen-search-bar .form-select {
        max-width: 100%;
    }
}

/* 반응형 */
@media (max-width: 767px) {
    .at-template-preset-card { min-width: 120px; padding: 12px 14px; }
    .at-preset-icon { font-size: 1.3rem; }
    .at-tpl-preview-page { font-size: 0.75rem; }
    /* 모바일에서는 다단 해제 */
    .at-take-multicolumn {
        column-count: 1 !important;
        column-rule: none !important;
    }
}

/* =============================================
   63차: Wizard 5단계 시험 생성
============================================= */

/* Step Indicator */
.at-wizard-indicator { padding: 18px 0 22px; }
.at-wizard-track {
    display: flex; align-items: center; justify-content: space-between; position: relative;
}
.at-wizard-step {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    flex: 0 0 auto; position: relative; z-index: 1;
}
.at-wizard-connector {
    flex: 1; height: 2px; background: #dee2e6; margin: 0 4px; margin-bottom: 20px;
    transition: background 0.3s;
}
.at-wizard-connector.done { background: var(--at-primary); }
.at-wizard-dot {
    width: 36px; height: 36px; border-radius: 50%; border: 2px solid #dee2e6;
    background: #fff; color: #aaa; font-weight: 700; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center; transition: all 0.3s;
}
.at-wizard-step.done .at-wizard-dot {
    border-color: var(--at-primary); background: var(--at-primary); color: #fff;
}
.at-wizard-step.active .at-wizard-dot {
    border-color: var(--at-primary); background: #fff; color: var(--at-primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}
.at-wizard-label {
    font-size: 0.75rem; color: #aaa; white-space: nowrap; font-weight: 500;
    transition: color 0.3s;
}
.at-wizard-step.done .at-wizard-label,
.at-wizard-step.active .at-wizard-label { color: var(--at-primary); font-weight: 700; }

/* Slide Viewport */
.at-wizard-viewport { overflow: hidden; position: relative; }
.at-wizard-slides {
    display: flex; width: 500%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform;
}
.at-wizard-slide { width: 20%; flex-shrink: 0; box-sizing: border-box; }
.at-wizard-slide-inner { padding: 4px 2px 16px; }

/* Step 타이틀 */
.at-wizard-title {
    font-weight: 700; font-size: 1.05rem; color: #333; margin-bottom: 20px;
    padding-bottom: 12px; border-bottom: 2px solid #e9ecef;
    display: flex; align-items: center; gap: 10px;
}
.at-wizard-step-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; background: var(--at-primary);
    color: #fff; font-size: 0.85rem; font-weight: 700; flex-shrink: 0;
}
.at-wizard-field-hint { font-size: 0.8rem; color: #888; margin-top: 6px; }

/* Nav 버튼 */
.at-wizard-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 20px; border-top: 1px solid #e9ecef; margin-top: 8px;
}
.at-wizard-nav-spacer { flex: 1; }
#btn-gp-next:disabled { opacity: 0.45; cursor: not-allowed; }

/* RAG 패널 (3단계) */
.at-wizard-rag-panel {
    background: #f8f9fb; border: 1px solid #e0e4ea; border-radius: 10px;
    padding: 16px; margin-bottom: 18px; min-height: 80px;
}
.at-wizard-rag-header { font-size: 0.92rem; color: #333; margin-bottom: 10px; }
.at-wizard-rag-list { display: flex; flex-direction: column; gap: 8px; }
.at-wizard-rag-item {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 10px 14px; font-size: 0.84rem;
}
.at-wizard-rag-item-title { font-weight: 700; color: var(--at-primary); margin-bottom: 2px; }
.at-wizard-rag-item-meta { color: #888; font-size: 0.78rem; }

/* 프롬프트 옵션 토글 (3단계) */
.at-wizard-prompt-options {
    background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 16px;
}
.at-wizard-options-title { font-weight: 700; font-size: 0.9rem; color: #555; margin-bottom: 12px; }
.at-wizard-option-row { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.at-wizard-option-row:last-child { border-bottom: none; }
.at-wizard-toggle-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.at-wizard-toggle-label input[type="checkbox"] { display: none; }
.at-wizard-toggle-switch {
    flex-shrink: 0; width: 40px; height: 22px; background: #ccc; border-radius: 11px;
    position: relative; transition: background 0.2s; margin-top: 2px;
}
.at-wizard-toggle-switch::after {
    content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px;
    background: #fff; border-radius: 50%; transition: left 0.2s;
}
.at-wizard-toggle-label input:checked + .at-wizard-toggle-switch { background: var(--at-primary); }
.at-wizard-toggle-label input:checked + .at-wizard-toggle-switch::after { left: 21px; }

/* 최종 확인 요약 (5단계) */
.at-wizard-summary {
    background: #f8f9fb; border: 1px solid #e0e4ea; border-radius: 10px; padding: 20px 24px;
}
.at-wizard-summary-row {
    display: flex; align-items: flex-start; gap: 16px; padding: 8px 0;
    border-bottom: 1px solid #eee; font-size: 0.88rem;
}
.at-wizard-summary-row:last-child { border-bottom: none; }
.at-wizard-summary-key { font-weight: 700; color: #555; min-width: 110px; flex-shrink: 0; }
.at-wizard-summary-val { color: #333; flex: 1; }

/* 75차: 레이아웃 선택 카드 */
.at-layout-selector { display: flex; gap: 12px; flex-wrap: wrap; }
.at-layout-card {
    flex: 1; min-width: 160px; max-width: 240px;
    border: 2px solid #e0e0e0; border-radius: 10px;
    padding: 18px 14px 14px; cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    background: #fff; text-align: center;
}
.at-layout-card:hover {
    border-color: var(--at-primary-light, #90caf9);
    background: #f5f9ff;
}
.at-layout-card.active {
    border: 3px solid var(--at-primary);
    background: #f0f3ff;
    box-shadow: inset 0 0 0 1px var(--at-primary), 0 2px 12px rgba(67, 97, 238, 0.13);
}
.at-layout-card-icon { font-size: 1.6rem; color: #bbb; margin-bottom: 8px; transition: color 0.18s ease; }
.at-layout-card.active .at-layout-card-icon { color: var(--at-primary); }
.at-layout-card-name { font-weight: 700; font-size: 0.9rem; color: #888; margin-bottom: 3px; transition: color 0.18s ease; }
.at-layout-card.active .at-layout-card-name { color: var(--at-primary); }
.at-layout-card-desc { font-size: 0.75rem; color: #bbb; line-height: 1.35; }
.at-layout-card.active .at-layout-card-desc { color: #888; }

/* Wizard 반응형 */
@media (max-width: 767px) {
    .at-wizard-label { display: none; }
    .at-wizard-track { gap: 2px; }
    .at-wizard-dot { width: 28px; height: 28px; font-size: 0.78rem; }
    .at-wizard-connector { margin-bottom: 0; }
    .at-layout-card { min-width: 140px; }
}

/* ===================================================
   88차: 응시 Landing 화면
=================================================== */
.take-landing-card {
    max-width: 480px;
    margin: 60px auto;
    padding: 36px 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 28px rgba(0,0,0,.10);
}
.take-landing-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a2e;
}
.take-landing-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.5;
}
.take-landing-form .form-control {
    border-radius: 8px;
}
.take-landing-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
@media (max-width: 540px) {
    .take-landing-card {
        margin: 24px 12px;
        padding: 24px 18px;
    }
}

/* 라디오 버튼 border 가시성 개선 (tabler border 단축속성 완전 차단) */
input[type="radio"],
.form-check-input[type="radio"] {
    --tblr-border-color-translucent: #000 !important;
    border-width: 1.5px !important;
    border-style: solid !important;
    border-color: #000 !important;
}
