@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

/* ==========================================
   공통 스타일 (전역)
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --accent-color: #0ea5e9;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --secondary-gradient: linear-gradient(135deg, #475569 0%, #64748b 100%);
    --bg-color: #f1f5f9;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.98);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 20px 60px rgba(15, 23, 42, 0.15);
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   메인 페이지 (index.html) 스타일
   ========================================== */

body {
    font-family: 'Noto Sans KR', 'Malgun Gothic', 'Batang', sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(30, 58, 138, 0.03) 0%, transparent 50%),
        linear-gradient(225deg, rgba(14, 165, 233, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    background: var(--primary-gradient);
    color: white;
    padding: 50px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.header h1 {
    flex: 1;
    margin: 0;
    font-size: 2.0em;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.header-actions {
    position: absolute;
    top: 95px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.point-badge {
    display: inline-block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: -0.1px !important;
}

.mypage-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 31px;
    padding: 0 11px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.mypage-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mypage-btn:active {
    transform: translateY(0);
}

.action-emoji {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    transform: translateY(-0.5px);
}

.logout-btn {
    height: 31px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: white;
    padding: 0 11px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logout-btn:active {
    transform: translateY(0);
}

.logout-icon {
    font-size: 12px;
    filter: brightness(0) invert(1);
}

.logout-text {
    font-family: 'Noto Sans KR', sans-serif;
}

@media (max-width: 768px) {
    .header-actions {
        top: 15px;
        right: 15px;
        gap: 6px;
    }

    .point-badge {
        font-size: 11px !important;
    }

    .mypage-btn {
        height: 27px;
        padding: 0 8px;
        font-size: 11px;
        gap: 4px;
    }

    .action-emoji {
        font-size: 11px;
    }

    .logout-btn {
        height: 27px;
        padding: 0 8px;
        font-size: 11px;
    }
    
    .logout-text {
        display: none;
    }
    
    .logout-icon {
        font-size: 15px;
    }
}

.header h1 {
    font-size: 2.0em;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.content {
    display: flex;
    min-height: 600px;
}

.sidebar {
    width: 380px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    padding: 30px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    position: relative;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    border-radius: 3px;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: #ffffff;
}

.section {
    margin-bottom: 30px;
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.section h2 {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #2d3748;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

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

/* 주제 통합: 주제 (나) 라벨·입력과 (가) 사이 여백 */
#topic-mixed-group label + input + label {
    margin-top: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.95em;
}

input[type="text"],
input[type="number"],
input[type="range"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: #2d3748;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="range"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 225px;
    line-height: 1.6;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232563eb' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-group {
    margin: 12px 0;
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition);
}

.checkbox-group:hover {
    background: rgba(37, 99, 235, 0.05);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    margin-bottom: 0;
}

.count-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.count-control label {
    font-size: 0.9em;
    color: #64748b;
    margin-bottom: 0;
    margin-right: auto;
}

.count-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.count-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #475569;
    transition: var(--transition);
    user-select: none;
}

.count-btn:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.count-btn:active {
    background: #cbd5e1;
}

.count-input {
    width: 60px;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    padding: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    background: white;
}

.count-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.3px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(-1px);
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    background: var(--secondary-gradient);
    margin: 0 5px 5px 0;
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
}

.result-container {
    margin-top: 30px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius);
    padding: 30px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    display: none;
    animation: fadeIn 0.5s ease-out;
    box-shadow: var(--shadow-md);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-container.show {
    display: block;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.result-actions .btn {
    margin-top: 0;
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.result-actions .btn-outline-danger {
    padding: 10px 20px;
    font-size: 14px;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    border-radius: 8px;
}

.preview-frame-wrapper {
    resize: both;
    overflow: auto;
    min-height: 400px;
    min-width: 320px;
    max-width: 100%;
    width: 100%;
    height: 1500px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.preview-frame-wrapper .preview-frame {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border: none;
    border-radius: 10px;
    display: block;
}

.preview-frame {
    width: 100%;
    height: 1500px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#loading-model {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#current-model {
    color: #2563eb;
    font-weight: 700;
}

#loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.download-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 300px;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.download-loading-content {
    background: white;
    padding: 40px 60px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 300px;
}

.download-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#download-loading-message {
    white-space: pre-line;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

.download-progress-log {
    width: 100%;
    max-width: 420px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    text-align: left;
    color: #475569;
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
}

.download-progress-log .progress-line {
    margin: 4px 0;
    padding: 2px 0;
    line-height: 1.4;
}

.download-progress-log .progress-line.try { color: #64748b; }
.download-progress-log .progress-line.skip { color: #94a3b8; }
.download-progress-log .progress-line.fail { color: #dc2626; }
.download-progress-log .progress-line.ok { color: #059669; }

.download-cancel-btn {
    margin-top: 10px;
    padding: 10px 30px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-cancel-btn:hover {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

.download-cancel-btn:active {
    background: #cbd5e1;
    transform: scale(0.98);
}

.error-progress-log {
    margin-top: 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
    max-height: 220px;
    overflow-y: auto;
}

.error-progress-log .progress-line { margin: 4px 0; line-height: 1.4; }
.error-progress-log .progress-line.try { color: #64748b; }
.error-progress-log .progress-line.skip { color: #94a3b8; }
.error-progress-log .progress-line.fail { color: #dc2626; }
.error-progress-log .progress-line.ok { color: #059669; }

.error-progress-log-title {
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.error {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    color: #c53030;
    padding: 16px 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #fc8181;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}

.radio-group {
    display: flex;
    gap: 12px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.radio-group label:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.radio-group input[type="radio"]:checked + span,
.radio-group label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.difficulty-slider {
    position: relative;
    padding: 10px 0;
}

.difficulty-slider input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.difficulty-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.difficulty-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.difficulty-slider input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
}

.difficulty-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85em;
    color: #64748b;
}

.difficulty-labels span.active {
    color: var(--primary-color);
    font-weight: 600;
}

.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    color: #64748b;
    font-size: 14px;
}

.footer p {
    margin: 0;
}

.grid-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ==========================================
   로그인 페이지 스타일
   ========================================== */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin-top: 8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group-login {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-login label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group-login input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: white;
    font-family: 'Noto Sans KR', sans-serif;
}

.form-group-login input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-btn:active {
    transform: translateY(0);
}

.toast-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
}

.toast-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 20px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 450px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border: 1px solid #fecaca;
}

.toast-message.show {
    opacity: 1;
    transform: scale(1);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-close {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.toast-close:hover {
    background: rgba(220, 38, 38, 0.1);
}

.toast-close:active {
    transform: scale(0.9);
}

.error-message {
    display: none;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    width: 100%;
    max-width: 420px;
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.remember-id-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: -10px;
}

.remember-id-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--primary-color);
}

.remember-id-container:hover {
    color: var(--text-primary);
}

.model-priority-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: var(--transition);
    cursor: move;
    user-select: none;
    position: relative;
}

.model-priority-item:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.model-priority-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.model-priority-item.drag-over {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    border-style: dashed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.model-priority-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.model-priority-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.model-priority-provider {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 8px;
}

.model-priority-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.model-priority-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
    transition: var(--transition);
    padding: 0;
}

.model-priority-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.model-priority-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.model-priority-btn:disabled:hover {
    background: white;
    color: #64748b;
    border-color: #e2e8f0;
}

@media (max-width: 1024px) {
    .content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
}

/* ==========================================
   상단 네비 (문제 생성 / 생성된 문제 목록) - 상단 왼쪽
   ========================================== */
.top-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 30px;
    top: 72%;
    transform: translateY(-50%);
    z-index: 5;
}

.top-nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.top-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.top-nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ==========================================
   생성된 문제 목록 (카드 + 페이징)
   ========================================== */
.content-full {
    display: block;
    padding: 30px 40px;
}

.exam-list-section {
    max-width: 1000px;
    margin: 0 auto;
}

.exam-list-section .section-title {
    font-size: 1.5em;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.exam-list-total {
    font-size: 15px;
    color: var(--text-secondary);
    margin: -8px 0 16px 0;
}

.exam-list-toolbar {
    margin-bottom: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.exam-list-delete-area {
    margin-left: auto;
    align-self: center;
}

.exam-list-toolbar .exam-list-delete-btn {
    margin-top: 0;
    margin-bottom: 0;
}

.exam-list-delete-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-danger {
    background: transparent;
    color: #b91c1c;
    border: 1.5px solid #b91c1c;
}

.btn-outline-danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

.exam-list-toolbar-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 14px;
}

.exam-list-toolbar-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    height: 34px;
    display: inline-flex;
    align-items: center;
}

.exam-list-mode-select {
    height: 34px;
    width: 260px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: var(--transition);
    box-sizing: border-box;
}

.exam-list-mode-select:hover {
    border-color: #cbd5e1;
}

.exam-list-mode-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.exam-list-search-input {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    width: 150px;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: var(--transition);
    box-sizing: border-box;
    vertical-align: middle;
}

.exam-list-search-input::placeholder {
    color: #94a3b8;
}

.exam-list-search-input:hover {
    border-color: #cbd5e1;
}

.exam-list-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.exam-list-search-btn {
    height: 34px;
    padding: 0 4px;
    min-width: 24px;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: var(--transition);
    box-sizing: border-box;
    vertical-align: middle;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.exam-list-search-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.exam-list-search-btn:active {
    transform: translateY(0);
}

/* 게시판형 목록 */
.exam-table-wrap {
    margin-bottom: 32px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.exam-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.exam-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid var(--border-color);
}

.exam-th {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-primary);
    vertical-align: middle;
}

.exam-th-check {
    width: 70px;
    text-align: center;
    vertical-align: middle;
}

.exam-th-type,
.exam-th-title,
.exam-th-date {
    text-align: center;
}

.exam-th-type {
    width: 90px;
}

.exam-th-date {
    width: 140px;
}

.exam-row {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.exam-row:hover {
    background: #f8fafc;
}

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

.exam-td {
    padding: 14px 16px;
    vertical-align: middle;
}

.exam-td-check {
    text-align: center;
}

.exam-table-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 헤더·목록 체크박스 동일 크기 */
.exam-table-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.exam-table-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.exam-type-badge {
    display: inline-block;
    min-width: 52px;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
}

.exam-type-badge.badge-nonfiction {
    background: #dbeafe;
    color: #1e40af;
}

.exam-type-badge.badge-fiction {
    background: #fce7f3;
    color: #9d174d;
}

.exam-title-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.exam-title-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.exam-td-date {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.exam-list-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

/* 페이징: 첫/이전/페이지번호(최대 10개)/다음/마지막 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px 0;
}

.pagination-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    font-size: 22px;
    font-weight: 600;
    line-height: 36px;
    transition: var(--transition);
    box-sizing: border-box;
}

.pagination-nav:hover:not(.disabled) {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--primary-dark);
}

.pagination-nav.disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

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

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: #f8fafc;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.pagination-page:hover {
    background: #e2e8f0;
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.pagination-page.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-page.active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* ==========================================
   문제 상세 (설정 + 미리보기)
   ========================================== */
.exam-detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    min-height: 500px;
}

.exam-detail-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exam-detail-top-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.exam-detail-top-actions .btn-back-list {
    flex: 1;
    min-width: 0;
    width: auto;
    text-align: center;
}

.exam-detail-delete-btn {
    white-space: nowrap;
}

.exam-detail-sidebar-col .btn-back-list {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
    text-decoration: none;
}
.exam-detail-sidebar-col .btn-back-list:hover {
    background: #cbd5e1;
    color: #334155;
}

.exam-detail-sidebar {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    height: fit-content;
}

.exam-detail-sidebar .section-title {
    font-size: 1.2em;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.exam-detail-meta p {
    margin: 0 0 10px 0;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.exam-detail-meta strong {
    flex-shrink: 0;
    min-width: 60px;
    color: var(--text-secondary);
}

/* 값이 길면 자기 영역 안에서만 다음 줄로 줄바꿈 (라벨 아래로 걸치지 않음) */
.exam-detail-meta-value {
    min-width: 0;
    flex: 1;
    color: var(--text-primary);
}

.exam-detail-settings-list {
    margin-top: 20px;
    font-size: 13px;
}

.exam-detail-settings-list strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.exam-detail-settings-dl {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
}

.exam-detail-settings-dl dt {
    margin: 10px 0 2px 0;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
}

.exam-detail-settings-dl dd {
    margin: 0 0 0 0;
    padding: 4px 0 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    word-break: break-word;
}

.exam-detail-settings-empty {
    margin: 8px 0 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.exam-detail-main .result-actions {
    margin-bottom: 16px;
}

.exam-detail-main .preview-frame-wrapper {
    min-height: 500px;
    height: 1500px;
    border: 1px solid var(--border-color);
}

.exam-detail-main .preview-frame-wrapper .preview-frame {
    min-height: 400px;
}

.exam-detail-main .preview-frame {
    width: 100%;
    min-height: 600px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
}

@media (max-width: 900px) {
    .exam-detail-layout {
        grid-template-columns: 1fr;
    }
}
