/* ========================================
   렛츠코딩앤플레이 - Python Algorithm Platform
   Retro Terminal / Neon Aesthetic
   ======================================== */

/* 폰트는 base.html에서 <link preconnect> 방식으로 로드 (렌더 차단 방지) */

:root {
    /* Core Colors */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-elevated: #232a3b;

    /* Neon Accents */
    --neon-cyan: #00fff2;
    --neon-green: #39ff14;
    --neon-pink: #ff00ff;
    --neon-yellow: #ffff00;
    --neon-orange: #ff6b35;

    /* Text Colors */
    --text-primary: #e4e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Status Colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.4);
    --warning: #f59e0b;

    /* Shadows & Glows */
    --glow-cyan: 0 0 20px rgba(0, 255, 242, 0.3), 0 0 40px rgba(0, 255, 242, 0.1);
    --glow-green: 0 0 20px rgba(57, 255, 20, 0.3), 0 0 40px rgba(57, 255, 20, 0.1);
    --glow-pink: 0 0 20px rgba(255, 0, 255, 0.3);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);

    /* Typography - 영문 폰트에 한글 fallback 추가 */
    --font-display: 'Orbitron', 'Noto Sans KR', sans-serif;
    --font-mono: 'JetBrains Mono', 'Noto Sans KR', monospace;
    --font-body: 'Noto Sans KR', sans-serif;

    /* Spacing */
    --header-height: 80px;
    --footer-height: 50px;
}

/* ========================================
   COMMON STYLES - 공통 스타일 가이드
   ======================================== */

/* ----- 제목 스타일 1: 섹션 타이틀 (예: 클래스 목록, 선생님 목록) ----- */
.title-style-1 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin: 0;
    letter-spacing: 0.5px;
}

/* ----- 제목 스타일 2: 클래스/항목 이름 (예: // 2025 겨울방학특강) ----- */
.title-style-2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-cyan);
    letter-spacing: 0.5px;
}

.title-style-2::before {
    content: '// ';
    color: var(--text-muted);
}

/* ----- 그리드 스타일 1: 3열 카드 그리드 (반응형) ----- */
.grid-style-1 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-style-1 .section-header {
    grid-column: 1 / -1;
}

/* ----- 버튼 스타일 1: 헤더 버튼 (학생모드, 선생님, 로그아웃) ----- */
.btn-style-1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 242, 0.3);
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.1) 0%, rgba(0, 255, 242, 0.05) 100%);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-style-1:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

/* 버튼 스타일 1 변형: 시안 강조 */
.btn-style-1.accent-cyan {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15) 0%, rgba(0, 255, 242, 0.08) 100%);
    border-color: rgba(0, 255, 242, 0.4);
    color: var(--neon-cyan);
}

.btn-style-1.accent-cyan:hover {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.25) 0%, rgba(0, 255, 242, 0.15) 100%);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.3);
}

/* 버튼 스타일 1 변형: 핑크 강조 */
.btn-style-1.accent-pink {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15) 0%, rgba(255, 0, 255, 0.08) 100%);
    border-color: rgba(255, 0, 255, 0.4);
    color: var(--neon-pink);
}

.btn-style-1.accent-pink:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.25) 0%, rgba(255, 0, 255, 0.15) 100%);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

/* 버튼 스타일 1 변형: 로그아웃 (빨강) */
.btn-style-1.accent-danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 0.8);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.btn-style-1.accent-danger:hover {
    border-color: var(--error);
    color: var(--error);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

/* ----- 버튼 스타일 2: 액션 버튼 (클래스 추가, 학생 추가) ----- */
.btn-style-2 {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--neon-cyan);
    background: transparent;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-style-2:hover {
    background: var(--neon-cyan);
    color: var(--bg-primary);
}

/* ========================================
   END COMMON STYLES
   ======================================== */

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

/* 코드 영역 리가처 비활성화 (>=, *** 등이 합쳐지는 현상 방지) */
pre, code, .CodeMirror, textarea {
    font-variant-ligatures: none !important;
    -webkit-font-variant-ligatures: none !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-width: 1600px;
    position: relative;
    overflow-x: auto;
}

/* Scanline Effect Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 242, 0.01) 2px,
        rgba(0, 255, 242, 0.01) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Grid Background Pattern */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 242, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 242, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: clamp(16px, 4vw, 40px);
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 255, 242, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 0, 255, 0.08) 0%, transparent 50%),
        var(--bg-primary);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

.login-box {
    background: var(--bg-card);
    padding: clamp(28px, 5vw, 50px) clamp(20px, 4vw, 40px);
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 242, 0.2);
    box-shadow: var(--glow-cyan), var(--card-shadow);
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}

/* Corner Decorations */
.login-box::before,
.login-box::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--neon-cyan);
}

.login-box::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.login-box::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.login-box h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    text-align: center;
    margin-bottom: clamp(24px, 4vw, 40px);
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
}

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

/* 폼 가로 배치 */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row .form-group.flex-1 {
    flex: 1;
}

.form-row .form-group.flex-2 {
    flex: 2;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.form-group label::before {
    content: '> ';
    color: var(--neon-cyan);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: max(0.85rem, 16px);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--neon-cyan);
}

.password-toggle.active {
    color: var(--neon-cyan);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.2);
    background: var(--bg-secondary);
}

.form-group 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='%2300fff2' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}

/* 체크박스 라벨 스타일 */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.checkbox-label::before {
    content: none !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
    vertical-align: middle;
    margin: 0;
}

.checkbox-label span {
    color: var(--text-secondary);
    vertical-align: middle;
    position: relative;
    margin-left: 2px;
}

.class-code-hint {
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 255, 242, 0.05);
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-height: 62px;
    overflow-y: auto;
}

/* Role Checkbox Group - 두 개의 네모 박스 스타일 */
.role-checkbox-group {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

.role-checkbox-group > label.role-checkbox::before {
    display: none;
}

.role-checkbox {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.3);
    transition: all 0.2s ease;
    text-align: center;
}

.role-checkbox:first-child {
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.role-checkbox:last-child {
    border-radius: 0 4px 4px 0;
}

.role-checkbox:hover {
    background: rgba(0, 255, 242, 0.05);
    color: var(--text-primary);
}

.role-checkbox input[type="checkbox"] {
    display: none;
}

.role-checkbox span {
    user-select: none;
}

.role-checkbox:has(input[type="checkbox"]:checked) {
    background: rgba(0, 255, 242, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.role-checkbox:first-child:has(input[type="checkbox"]:checked) {
    border-right: 1px solid var(--neon-cyan);
}

.role-checkbox:last-child:has(input[type="checkbox"]:checked) {
    border-left: 1px solid var(--neon-cyan);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.2) 0%, rgba(0, 255, 242, 0.1) 100%);
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-cyan);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 242, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.3) 0%, rgba(0, 255, 242, 0.2) 100%);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.btn-primary:hover::before {
    left: 100%;
}

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

.btn-primary:disabled,
.btn-primary.btn-disabled {
    background: rgba(107, 114, 128, 0.2);
    border-color: var(--text-muted);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled::before,
.btn-primary.btn-disabled::before {
    display: none;
}

.btn-primary:disabled:hover,
.btn-primary.btn-disabled:hover {
    background: rgba(107, 114, 128, 0.2);
    transform: none;
    box-shadow: none;
}

.error-message {
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 4px;
    color: var(--error);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ===== 2FA 이메일 인증 ===== */

.two-factor-section {
    animation: twoFaFadeIn 0.3s ease;
}

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

.two-factor-header {
    text-align: center;
    margin-bottom: 28px;
}

.two-factor-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 12px 0;
}

.two-factor-desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.two-factor-section #verifyCode {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.two-factor-section #verifyCode::placeholder {
    letter-spacing: 8px;
    color: var(--text-muted);
    font-weight: 400;
}

.two-factor-timer {
    text-align: center;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--neon-cyan);
}

.two-factor-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 8px 4px;
    transition: color 0.2s;
}

.btn-text:hover:not(:disabled) {
    color: var(--neon-cyan);
}

.btn-text:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ========================================
   MAIN CONTAINER & HEADER
   ======================================== */
.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    min-width: 1600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    background: linear-gradient(180deg, rgba(10, 14, 23, 0.98) 0%, rgba(10, 14, 23, 0.95) 100%);
    border-bottom: 1px solid rgba(0, 255, 242, 0.15);
    backdrop-filter: blur(12px);
    z-index: 100;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--neon-cyan) 20%,
        var(--neon-pink) 50%,
        var(--neon-cyan) 80%,
        transparent 100%);
    opacity: 0.8;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

header h1 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    letter-spacing: 3px;
    text-transform: uppercase;
}

header h1#titleLink {
    cursor: pointer;
    transition: all 0.3s ease;
}

header h1#titleLink:hover {
    color: #fff;
    text-shadow: 0 0 30px rgba(0, 255, 242, 0.8);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* GNB 네비게이션 */
.gnb-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.gnb-nav-link {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.gnb-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.gnb-nav-link.active {
    color: var(--neon-cyan);
    background: rgba(0, 255, 242, 0.08);
}

/* ========================================
   FOOTER - 하단 고정
   ======================================== */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    min-width: 1600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background: var(--bg-primary);
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    z-index: 100;
}

footer .footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

footer .footer-legal {
    font-size: 0.75rem;
    font-weight: 100;
    color: var(--text-secondary);
    text-decoration: none;
}

footer .footer-legal:hover {
    text-decoration: underline;
}

footer .footer-copyright {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 푸터 팁 영역 */
.footer-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 100;
    color: var(--text-secondary);
}

.footer-tip .tip-icon {
    font-size: 1rem;
}

.footer-tip .tip-text {
    line-height: 1.5;
}

/* 사용자 정보 영역 - 컴팩트 스타일 */
.user-info-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-class-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 2px 8px;
    background: rgba(0, 255, 242, 0.08);
    border-radius: 4px;
}

.user-class-badge:empty {
    display: none;
}

.user-name-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-action-btn {
    display: flex;
    justify-content: center;
    height: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    padding-top: 4px;
}

.user-action-btn:hover {
    color: var(--neon-cyan);
}

.score-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--neon-green);
    padding-left: 8px;
}

.score-badge::before {
    content: '\26A1';
    font-size: 0.85rem;
}

.score-badge:empty {
    display: none;
}

.score-badge:empty::before {
    display: none;
}

/* 정답 시 번개 애니메이션 */
.score-badge.score-updated {
    animation: scorePopup 0.6s ease-out;
}

@keyframes scorePopup {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.4);
        color: var(--neon-yellow);
        text-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow);
    }
    100% {
        transform: scale(1);
        color: var(--neon-green);
        text-shadow: none;
    }
}

/* Buttons */
.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: var(--glow-pink);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.btn-success {
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid var(--success);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--success);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(16, 185, 129, 0.2) 100%);
    box-shadow: var(--glow-green);
}

/* Star Display */
.star-display {
    font-size: 1.5rem;
    display: flex;
    gap: 4px;
}

.star-silver {
    color: #a0aec0;
    text-shadow: 0 0 10px rgba(160, 174, 192, 0.5);
}

.star-gold {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
main {
    flex: 1;
    margin-top: var(--header-height);
    padding: 30px 30px 80px 30px;
    overflow-y: auto;
}

/* ========================================
   CATEGORIES & PROBLEM LIST (Student Dashboard)
   ======================================== */
#categoriesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    width: 100%;
}

.category {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category:hover {
    border-color: rgba(0, 255, 242, 0.3);
    box-shadow: var(--glow-cyan);
    transform: translateY(-4px);
}

.category h2 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--neon-cyan);
    padding: 20px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-progress-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-trophy {
    margin-left: 6px;
    font-size: 1rem;
    animation: trophy-bounce 0.6s ease-out;
}

@keyframes trophy-bounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.category-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

.category-header h2 {
    padding: 0;
    background: none;
    border-bottom: none;
    flex: 1;
}

.category-reset-btn {
    all: unset;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: 12px;
    transition: color 0.2s ease;
}

.category-reset-btn:hover {
    color: var(--neon-cyan);
}

/* 선택 초기화 모달 */
.batch-reset-modal-content {
    max-width: 400px;
}

.batch-reset-modal-content .modal-body {
    padding: 16px 24px;
    max-height: 40vh;
    overflow-y: auto;
}

.batch-reset-modal-content .modal-footer .btn-primary {
    flex: 1;
}

.batch-reset-loading {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.batch-reset-select-all {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.batch-reset-select-all input {
    width: 15px;
    height: 15px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
}

.batch-reset-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.batch-reset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.batch-reset-item:hover {
    background: rgba(0, 255, 242, 0.05);
    border-color: rgba(0, 255, 242, 0.3);
}

.batch-reset-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
    flex-shrink: 0;
}

.batch-reset-title {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-reset-solved {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #4ade80;
    white-space: nowrap;
}

.batch-reset-unsolved {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.batch-reset-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 16px;
    font-size: 0.85rem;
}

.category-problems {
    padding: 16px;
    max-height: 440px;
    overflow-y: auto;
}

.problem-item {
    padding: 16px 20px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.problem-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

.problem-item:hover {
    background: var(--bg-elevated);
    border-color: rgba(0, 255, 242, 0.2);
}

.problem-item:hover::before {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.problem-item.solved::before {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.problem-item.solved {
    border-color: rgba(16, 185, 129, 0.2);
}

/* 부모 문제 스타일 */
.problem-item.parent-problem {
    background: var(--bg-elevated);
    border-left: 4px solid var(--neon-cyan);
    margin-top: 12px;
}

.problem-item.parent-problem:first-child {
    margin-top: 0;
}

.problem-item.parent-problem::before {
    display: none;
}

.problem-item.parent-problem h3 {
    font-weight: 600;
    color: var(--neon-cyan);
}

.problem-item.parent-problem:hover {
    border-left-color: var(--neon-pink);
}

/* 부모 문제 진행률 표시 - 왼쪽 라인 투명도 */
.problem-item.parent-problem {
    --progress-opacity: 0.15;
    border-left-color: rgba(0, 255, 242, var(--progress-opacity));
}

.problem-item.parent-problem.all-solved {
    border-left-color: var(--success);
}

/* 자식 문제 스타일 */
.problem-item.child-problem {
    padding-left: 24px;
    background: var(--bg-secondary);
    border-left: 2px solid var(--text-muted);
    margin-bottom: 4px;
}

.problem-item.child-problem::before {
    display: none;
}

.problem-item.child-problem h3 {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.problem-item.child-problem:hover {
    border-left-color: var(--neon-cyan);
    border-left-style: solid;
}

.problem-item.child-problem:hover h3 {
    color: var(--text-primary);
}

.problem-item.child-problem.solved {
    border-left-color: var(--success);
    border-left-style: solid;
}

.problem-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0;
}

.problem-item h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.problem-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: none;
}

.problem-check-icon {
    font-size: 1.2rem;
    color: var(--success);
    text-shadow: 0 0 10px var(--success);
    margin-left: 12px;
}

.problem-check-icon.dimmed {
    color: #666;
    text-shadow: none;
}

/* Problem Difficulty Badge */
.problem-difficulty {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    margin-right: 16px;
    vertical-align: middle;
}

.problem-difficulty::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.problem-difficulty.diff-easy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.problem-difficulty.diff-medium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.problem-difficulty.diff-hard {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.problem-item:hover .problem-difficulty.diff-easy {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}

.problem-item:hover .problem-difficulty.diff-medium {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}

.problem-item:hover .problem-difficulty.diff-hard {
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* 어려운 문제 불 이모티콘 */
.problem-fire-icon {
    margin-left: 6px;
    font-size: 0.9em;
}

/* GUIDE 배지 (부모 문제용) */
.guide-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: #0a0e17;
    background: linear-gradient(135deg, var(--neon-cyan), #00c8ff);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    vertical-align: middle;
    margin-left: auto;
}

/* 자식 문제 토글 버튼 */
.toggle-children-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    flex-shrink: 0;
}

.toggle-children-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.toggle-children-btn.expanded {
    background: rgba(0, 255, 242, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* 자식 문제 컨테이너 */
.children-container {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
    border-left: 2px solid var(--border-subtle);
    margin-bottom: 8px;
}

.children-container.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-left: 0;
    border-left: none;
}

/* ========================================
   SOLVE PAGE
   ======================================== */
.solve-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: var(--header-height);
    padding: 24px;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.problem-panel {
    background: var(--bg-card);
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(0, 255, 242, 0.1);
    padding: 28px;
    overflow-y: auto;
    position: relative;
}


.problem-panel h2 {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--neon-cyan);
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    text-shadow: var(--glow-cyan);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

#problemTitleText {
    letter-spacing: 0.02em;
    color: #fff;
}

.level-number-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: transparent;
    border-left: 3px solid var(--neon-cyan);
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(0, 255, 242, 0.85);
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0.9;
}

.problem-panel h2 .problem-difficulty {
    font-size: 0.8rem;
    padding: 5px 14px;
    text-shadow: none;
    margin-left: 0;
    margin-right: 0;
}

.problem-panel h2 .problem-difficulty.diff-easy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.5);
}

.problem-panel h2 .problem-difficulty.diff-medium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.5);
}

.problem-panel h2 .problem-difficulty.diff-hard {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
}

.problem-panel h3 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--neon-green);
    margin-top: 24px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 문제 비디오 컨테이너 (Bunny Stream iframe) */
.video-container {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
    position: relative;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* 수정 모달 - 비디오 미리보기 */
.video-preview-container {
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.btn-delete-video {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 4px;
    transition: all 0.2s;
}

.btn-delete-video:hover {
    background: var(--error);
    color: #fff;
}

/* 수정 모달 - 비디오 업로드 */
.video-upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.btn-upload-video {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 255, 242, 0.3);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-upload-video:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 242, 0.3);
}

.video-file-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.video-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.video-upload-progress span {
    font-size: 0.75rem;
    color: var(--neon-cyan);
    min-width: 35px;
    text-align: right;
}

.btn-upload-start {
    font-size: 0.8rem;
    padding: 6px 16px;
    margin-bottom: 8px;
}

.video-upload-status {
    font-size: 0.8rem;
    display: block;
    margin-top: 4px;
}

.video-upload-status.success {
    color: var(--success);
}

.video-upload-status.error {
    color: var(--error);
}

#problemDescription {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    tab-size: 4;
    font-family: var(--font-body);
    margin: 0 0 36px 0;
    background: transparent;
}


/* 입출력 예시 테이블 */


.io-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.io-table thead th {
    background: rgba(0, 255, 242, 0.1);
    color: var(--neon-cyan);
    font-weight: 600;
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
}

.io-table thead th:nth-child(1) {
    width: 60px;
}

.io-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.io-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.io-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.io-table td.io-index {
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
}

.io-table td.io-input,
.io-table td.io-output {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.io-table td pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-left: none;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.io-table td.io-output pre {
    color: var(--neon-green);
}

.code-panel {
    background: var(--bg-card);
    border-radius: 0;
    border: none;
    border-left: 1px solid rgba(0, 255, 242, 0.1);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}


.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.code-header h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 코드 헤더 버튼 공통 스타일 */
.code-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-header-buttons button {
    width: 90px;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.code-header-buttons button:hover {
    transform: translateY(-1px);
}

.code-header-buttons button:active {
    transform: translateY(0);
}

/* 실행 버튼 (cyan) */
.code-header .btn-primary {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.2) 0%, rgba(0, 255, 242, 0.1) 100%);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
}

.code-header .btn-primary:hover {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.3) 0%, rgba(0, 255, 242, 0.2) 100%);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.3);
}

.code-header .btn-primary:disabled {
    background: rgba(107, 114, 128, 0.2);
    border-color: var(--text-muted);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 초기화 버튼 (gray) */
.code-header .btn-hint {
    background: rgba(107, 114, 128, 0.15);
    border: 1px solid rgba(156, 163, 175, 0.4);
    color: #9ca3af;
}

.code-header .btn-hint:hover {
    background: rgba(107, 114, 128, 0.25);
    border-color: rgba(156, 163, 175, 0.6);
    box-shadow: 0 0 10px rgba(156, 163, 175, 0.2);
}

/* 정답 버튼 (gray) */
.code-header .btn-solution {
    background: rgba(107, 114, 128, 0.15);
    border: 1px solid rgba(156, 163, 175, 0.4);
    color: #9ca3af;
}

.code-header .btn-solution:hover {
    background: rgba(107, 114, 128, 0.25);
    border-color: rgba(156, 163, 175, 0.6);
    box-shadow: 0 0 10px rgba(156, 163, 175, 0.2);
}

/* AI 나나 버튼 (pink-cyan gradient) */
.code-header .btn-ai-toggle {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.2), rgba(0, 255, 242, 0.1));
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
}

.code-header .btn-ai-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.3), rgba(0, 255, 242, 0.2));
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.code-header .btn-ai-toggle.active {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.4), rgba(0, 255, 242, 0.3));
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

#codeEditorWrapper {
    flex: 0 0 auto;
    min-height: 150px;
    height: 350px; /* 기본 높이, JS로 조절 가능 */
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

#codeEditorWrapper .CodeMirror {
    height: 100% !important;
    font-family: var(--font-mono) !important;
    font-size: 1rem;
    background: var(--bg-primary) !important;
    cursor: text !important;
}

#codeEditorWrapper .CodeMirror-lines {
    cursor: text !important;
}

#codeEditorWrapper .CodeMirror-code {
    cursor: text !important;
}

#codeEditorWrapper .CodeMirror-gutters {
    background: var(--bg-secondary) !important;
    border-right: 1px solid rgba(0, 255, 242, 0.1) !important;
}

#codeEditorWrapper .CodeMirror-linenumber {
    color: var(--text-muted) !important;
}

#codeEditorWrapper .CodeMirror-cursor {
    border-left: 2px solid var(--neon-cyan) !important;
}

#codeEditorWrapper .CodeMirror-selected {
    background: rgba(0, 255, 242, 0.1) !important;
}

#codeEditorWrapper .CodeMirror-activeline-background {
    background: rgba(0, 255, 242, 0.05) !important;
}

/* 읽기 전용 라인의 gutter (줄번호 영역) 회색 표시 */
.CodeMirror-linebackground.readonly-line {
    background: rgba(80, 80, 80, 0.2);
}

.readonly-gutter {
    background: rgba(80, 80, 80, 0.4) !important;
}

/* 읽기 전용 라인 텍스트 스타일 (선택적) */
.readonly-line-text {
    opacity: 0.7;
}

/* 폰트 크기 조절 버튼 */
.font-size-controls {
    position: absolute;
    right: 10px;
    top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.font-size-btn {
    width: 28px;
    height: 28px;
    background: rgba(30, 35, 50, 0.7);
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.font-size-btn:hover {
    background: rgba(50, 55, 70, 0.9);
    color: #d1d5db;
}

.font-size-btn:active {
    transform: scale(0.95);
}

/* Results Wrapper - 실행결과 + 테스트케이스 전체 스크롤 */
.results-wrapper {
    margin-top: 22px;
    margin-right: -30px;
    padding-right: 30px;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.output-section {
    flex-shrink: 0;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#testCounter {
    font-size: 0.85em;
    font-weight: 700;
    margin-left: 6px;
}

.correct-badge {
    display: none !important; /* 임시 테스트: 정답 배지 숨김 */
    /* display: inline-block; */
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: #0a0e17;
    background: linear-gradient(135deg, var(--neon-green), #2ecc71);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}

.output-section h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.output-section h3::before {
    content: '>> ';
    color: var(--neon-green);
}

.output-section pre {
    background: var(--bg-primary);
    padding: 16px 20px;
    border-radius: 6px;
    border: 1px solid rgba(57, 255, 20, 0.2);
    min-height: 80px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--neon-green);
}

#outputArea {
    background: transparent;
    color: var(--neon-green);
}

/* Test Results */
.test-results {
    margin-top: 20px;
    flex-shrink: 0;
}

.test-case {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 6px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.test-case.passed {
    background: rgba(16, 185, 129, 0.1);
}

.test-case.passed::before {
    content: '';
}

.test-case.failed {
    background: rgba(239, 68, 68, 0.1);
}

.test-case.failed::before {
    content: '';
}

.test-case h4 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.test-passed-text {
    color: var(--neon-green);
    font-weight: 700;
}

.test-failed-text {
    color: var(--error);
    font-weight: 700;
}

.test-case-detail {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.preserve-space {
    white-space: pre;
    background-color: rgba(0, 255, 242, 0.1);
    padding: 2px 0;
}

/* 테스트케이스 결과 테이블 */
.test-case-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-top: 4px;
}

.test-case-table th,
.test-case-table td {
    padding: 4px 8px 4px 0;
    text-align: left;
    vertical-align: top;
}

.test-case-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    width: 33.33%;
}

.test-case-table code {
    display: inline;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 풀이 방식 메시지 (실행 결과 타이틀 바로 밑) */
.approach-hint,
.approach-praise,
.approach-loading {
    padding: 4px 0;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

.approach-hint {
    color: #fbbf24;
}

.approach-praise {
    color: #10b981;
}

.approach-loading {
    color: var(--text-muted);
}

.approach-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: approach-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes approach-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   TEACHER DASHBOARD
   ======================================== */
.teacher-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
}

.tab-btn {
    padding: 16px 32px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-card);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--neon-cyan);
    border-color: rgba(0, 255, 242, 0.2);
    border-bottom-color: var(--bg-card);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.tab-content {
    display: none;
    background: var(--bg-card);
    padding: 28px;
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    border-top: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 레벨 탭 (기초/응용/심화) */
.level-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.15);
}

.level-tab-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.level-tab-btn:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 242, 0.05);
}

.level-tab-btn.active {
    background: rgba(0, 255, 242, 0.15);
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

/* 레벨별 색상 구분 */
.level-tab-btn[data-level="basic"].active {
    background: rgba(57, 255, 20, 0.15);
    color: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

.level-tab-btn[data-level="intermediate"].active {
    background: rgba(0, 255, 242, 0.15);
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

.level-tab-btn[data-level="advanced"].active {
    background: rgba(255, 0, 255, 0.15);
    color: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.2);
}

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

.tab-content h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tab-content h2::before {
    content: '// ';
    color: var(--text-muted);
}

/* ========================================
   교사 페이지 - 학생 목록
   ======================================== */
#studentsList {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* 클래스 3열 그리드 레이아웃 */
#studentsList.classes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

#studentsList.classes-grid .section-header {
    grid-column: 1 / -1;
}

/* ===== 공통 관리 그리드 스타일 (클래스 관리, 선생님 관리) ===== */
.management-grid .class-row {
    flex-direction: column;
}

.management-grid .class-label {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
    padding: 10px 14px;
    font-size: 0.9rem;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.management-grid .class-label::before {
    content: none;
}

.management-grid .class-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.management-grid .class-info::before {
    content: '// ';
    color: var(--text-muted);
}

.management-grid .class-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.management-grid .students-list {
    padding: 10px;
    gap: 6px;
}

/* 클래스 그리드 내 학생 카드 - 컴팩트 1행 레이아웃 */
#studentsList.classes-grid .student-card {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* 이름 + 비밀번호 아이콘 */
#studentsList.classes-grid .student-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: unset;
    flex-shrink: 0;
}

#studentsList.classes-grid .student-card-header h4 {
    font-size: 0.85rem;
    margin: 0;
}

#studentsList.classes-grid .student-card-header .btn-password-icon,
#studentsList.classes-grid .student-card-header .btn-reset-password {
    border: none;
    padding: 3px;
    background: transparent;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
}

#studentsList.classes-grid .student-card-header .btn-password-icon:hover,
#studentsList.classes-grid .student-card-header .btn-reset-password:hover {
    opacity: 1;
    color: var(--neon-orange);
}

/* 오늘/총 통계 */
#studentsList.classes-grid .student-stats-compact {
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* 접속 시간 */
#studentsList.classes-grid .student-login-info {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

/* ===== 이용권 관련 스타일 ===== */

/* 보유 이용권 표시 바 */
.ticket-info-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: var(--bg-elevated);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.2);
}

.ticket-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ticket-count {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neon-cyan);
}

.ticket-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 학생 카드 내 이용권 정보 */
.student-subscription-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--text-muted);
}

.subscription-remaining {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.subscription-normal {
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
}

.subscription-warning {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.15);
}

.subscription-critical {
    color: var(--error);
    background: rgba(239, 68, 68, 0.15);
    animation: pulse-critical 1s ease-in-out infinite;
}

.subscription-expired {
    color: #fff;
    background: var(--error);
    font-weight: 600;
}

.subscription-unlimited {
    color: var(--neon-cyan);
    background: rgba(0, 255, 242, 0.1);
}

/* 접속시간 옆 인라인 표시용 */
.subscription-remaining-inline {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 연장 버튼 */
.btn-extend {
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(156, 163, 175, 0.5);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-extend:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* 7일 이하 남은 경우 빨간색 강조 */
.btn-extend-urgent {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-extend-urgent:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

/* ===== 이용권 관리 페이지 ===== */

/* 이용권 관리 - 전체 레이아웃 */
.ticket-mgmt-main {
    flex: none;
    padding: 30px;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
}

.ticket-mgmt-container {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 3fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 16px;
}

.ticket-summary-section,
.ticket-history-section {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    padding: 20px;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ticket-summary-section > .subsection-title {
    height: 48px;
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
    display: block;
    padding-top: 5px;
}

.ticket-section-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
    flex-shrink: 0;
}

.ticket-mgmt-container .section-title {
    display: block;
    font-size: 1rem;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    line-height: 48px;
}

.ticket-mgmt-container .section-title::before {
    content: none;
}

.ticket-mgmt-container .section-header {
    display: flex !important;
    align-items: center !important;
    height: 48px;
    margin-bottom: 16px;
    padding: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1) !important;
    border-radius: 0 !important;
}

.ticket-summary-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.ticket-card-available {
    padding: 28px 16px;
}

.ticket-card-available .ticket-summary-value {
    font-size: 2.2rem;
}

.ticket-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ticket-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
}

.ticket-summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ticket-summary-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
}

.ticket-summary-value.purchased {
    color: var(--neon-cyan);
}

.ticket-summary-value.used {
    color: var(--error);
}

.ticket-summary-value.available {
    color: var(--neon-green);
}

.ticket-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
    flex-shrink: 0;
}

.ticket-search-input {
    margin-left: auto;
    height: 32px;
    box-sizing: border-box;
    padding: 0 12px;
    line-height: 32px;
    background: var(--bg-elevated);
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    outline: none;
    width: 200px;
}

.ticket-search-input::placeholder {
    color: var(--text-muted);
}

.ticket-search-input:focus {
    border-color: var(--neon-cyan);
}

.ticket-history-table-wrap {
    margin-top: 12px;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.ticket-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ticket-history-table th {
    padding: 10px 12px;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
    font-weight: 500;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.ticket-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-align: center;
}

/* 내용, 메모 컬럼은 왼쪽 정렬 유지 */
.ticket-history-table td:nth-child(8) {
    text-align: left;
}

.ticket-row-num {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.ticket-history-table tbody tr:hover {
    background: rgba(0, 255, 242, 0.03);
}

.ticket-history-table .empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 12px;
}

.ticket-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 12px 0 0;
    flex-shrink: 0;
}

.ticket-pagination .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    cursor: pointer;
}

.ticket-pagination .page-btn:hover:not(:disabled):not(.active) {
    background: rgba(0, 255, 242, 0.08);
    color: var(--text-primary);
}

.ticket-pagination .page-btn.active {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    border-color: var(--neon-cyan);
    font-weight: 600;
}

.ticket-pagination .page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.ticket-pagination .page-ellipsis {
    color: var(--text-muted);
    padding: 0 4px;
}

.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ticket-memo-input {
    width: 100%;
    min-width: 100px;
    padding: 4px 8px;
    background: var(--bg-elevated);
    border: 1px solid rgba(0, 255, 242, 0.1);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    outline: none;
}

.ticket-memo-input:focus {
    border-color: var(--neon-cyan);
}

.ticket-balance {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--neon-cyan);
    text-align: center;
}

.action-purchase {
    color: var(--neon-cyan);
    background: rgba(0, 255, 242, 0.12);
}

.action-extend {
    color: var(--error);
    background: rgba(239, 68, 68, 0.12);
}

.action-adjust {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
}

.action-terminate {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.12);
}

.amount-plus {
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-weight: 600;
}

.amount-minus {
    color: var(--error);
    font-family: var(--font-mono);
    font-weight: 600;
}

@media (max-width: 900px) {
    .ticket-mgmt-main {
        height: auto;
        overflow: auto;
    }

    .ticket-mgmt-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .ticket-summary-cards {
        flex-direction: row;
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .ticket-summary-card {
        padding: 12px 8px;
    }

    .ticket-summary-value {
        font-size: 1.2rem;
    }

    .ticket-history-table {
        font-size: 0.78rem;
    }

    .ticket-history-table th,
    .ticket-history-table td {
        padding: 8px 6px;
    }
}

/* ===== 선생님 관리 탭 - 그리드 레이아웃 ===== */

/* 선생님 목록 컨테이너: 3열 그리드 */
#membersList {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

#membersList .section-header {
    grid-column: 1 / -1;
}

/* 선생님 담당 클래스 목록 (1열) */
.teacher-classes-grid {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.teacher-classes-grid .student-card {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    box-sizing: border-box;
}

.teacher-classes-grid .student-card-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.teacher-classes-grid .student-card-header h4 {
    font-size: 0.85rem;
    margin: 0;
}

.teacher-classes-grid .student-card-header .btn-reset-password {
    border: none;
    padding: 3px;
    background: transparent;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
}

.teacher-classes-grid .student-card-header .btn-reset-password:hover {
    opacity: 1;
    color: var(--neon-orange);
}

.teacher-classes-grid .student-stats-compact {
    font-size: 0.8rem;
    margin-left: auto;
}

.teacher-classes-grid .students-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px;
}

/* ===== 클래스 관리 탭 - 선생님 관리 카드 ===== */

/* 선생님 관리 카드 행 */
.teacher-management-row {
    border-color: rgba(255, 165, 0, 0.3);
}

.teacher-management-row .class-label {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.1) 0%, var(--bg-elevated) 100%);
}

.teacher-management-row .class-name-text {
    color: var(--neon-orange);
}

.teacher-management-row .class-info::before {
    content: '';
}

/* 선생님 관리 목록 */
.teacher-management-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
}

/* 선생님 카드 - 학생 카드와 동일한 스타일 사용 */
.teacher-management-list .teacher-card {
    height: 40px;
    box-sizing: border-box;
    padding: 8px 12px;
}

/* 삭제 버튼 스타일 */
.btn-delete-teacher {
    color: var(--text-muted);
}

.btn-delete-teacher:hover {
    color: var(--error) !important;
    opacity: 1 !important;
}

/* ===== 학생 카드 액션 버튼 ===== */
.student-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-student-action {
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(156, 163, 175, 0.4);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-student-action:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-student-action.btn-extend {
    color: var(--text-secondary);
}

.btn-student-action.btn-extend:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-student-action.btn-extend-urgent {
    color: #ef4444;
    border-color: #ef4444;
}

.btn-student-action.btn-extend-urgent:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.btn-student-action.btn-progress {
    color: var(--text-secondary);
}

.btn-student-action.btn-progress:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* 학생 수정 모달 */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-footer-right {
    display: flex;
    gap: 8px;
}

.btn-danger {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--error);
    background: transparent;
    color: var(--error);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: var(--error);
    color: #fff;
}

/* 선생님 탭 - 클래스 카드 확장 (학생 목록 표시) */
.teacher-class-card {
    flex-wrap: wrap;
    transition: all 0.2s ease;
}

.teacher-class-card.expanded {
    background: var(--bg-elevated);
    border-color: rgba(0, 255, 242, 0.3);
}

.teacher-class-students {
    width: 100%;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(0, 255, 242, 0.1);
}

.teacher-class-student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 4px;
    position: relative;
}

.teacher-class-student-item:last-child {
    margin-bottom: 0;
}

.teacher-class-student-item .student-name-text {
    font-size: 0.8rem;
    color: var(--text-primary);
}

.teacher-class-student-item .student-name-text.online-name {
    color: var(--neon-green);
}

.teacher-class-student-item .student-quick-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.teacher-class-student-item .student-quick-stats .today-active {
    color: var(--neon-green);
    font-weight: 600;
}

.teacher-class-students .no-students,
.teacher-class-students .loading-small,
.teacher-class-students .error-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

/* 클래스 행: 왼쪽 클래스명 | 오른쪽 학생목록 */
.class-row {
    display: flex;
    flex-direction: row;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    overflow: hidden;
}

/* 왼쪽 클래스명 영역 */
.class-label {
    width: 180px;
    min-width: 180px;
    padding: 24px;
    background: var(--bg-elevated);
    border-right: 1px solid rgba(0, 255, 242, 0.1);
    display: flex;
    align-items: flex-start;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-cyan);
    letter-spacing: 0.5px;
}

.class-label::before {
    content: '// ';
    color: var(--text-muted);
}

/* 클래스 드래그 앤 드롭 */
.class-label[draggable="true"] {
    cursor: grab;
}

.class-label[draggable="true"]:active {
    cursor: grabbing;
}

.class-row.class-row-dragging {
    opacity: 0.4;
}

/* 리스트 레이아웃: 상/하 인디케이터 */
.class-row.drop-before {
    position: relative;
}

.class-row.drop-before::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    z-index: 10;
    border-radius: 2px;
}

.class-row.drop-after {
    position: relative;
}

.class-row.drop-after::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    z-index: 10;
    border-radius: 2px;
}

/* 그리드 레이아웃: 좌/우 인디케이터 */
.class-row.drop-left {
    position: relative;
}

.class-row.drop-left::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    z-index: 10;
    border-radius: 2px;
}

.class-row.drop-right {
    position: relative;
}

.class-row.drop-right::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    z-index: 10;
    border-radius: 2px;
}

/* 공용 섹션 헤더 */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    background: none;
    border-radius: 8px;
    margin-bottom: 12px;
    border: none;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin: 0;
}

.btn-action {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--neon-cyan);
    background: transparent;
    color: var(--neon-cyan);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: var(--neon-cyan);
    color: var(--bg-main);
}

.header-buttons {
    display: flex;
    gap: 8px;
}

/* 서브섹션 타이틀 */
.subsection-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 16px 0 8px 0;
}

/* 클래스명 영역 수정 */
.class-label {
    position: relative;
    justify-content: space-between;
}

.class-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* 클래스 관리 버튼 컨테이너 */
.class-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.class-name-text {
    flex-shrink: 0;
}

.class-student-count {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.class-student-count svg {
    opacity: 0.7;
}

.class-teacher-info {
    font-size: 0.8rem;
    color: #fff;
    font-weight: normal;
}

/* 클래스 관리 버튼 - badge 스타일 (user-class-badge 기반) */
.btn-class-action {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    border: none;
    background: rgba(0, 255, 242, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-class-action:hover {
    background: rgba(0, 255, 242, 0.15);
    color: var(--neon-cyan);
}

/* 진도 버튼 (삭제 버튼과 동일 스타일) */
.btn-class-progress {
    background: rgba(0, 255, 242, 0.08);
    color: var(--text-muted);
}

.btn-class-progress:hover {
    background: rgba(0, 255, 242, 0.15);
    color: var(--neon-cyan);
}

/* 삭제 버튼 */
.btn-delete-class {
    background: rgba(0, 255, 242, 0.08);
    color: var(--text-muted);
}

.btn-delete-class:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* 카테고리 체크박스 리스트 (진도 모달용) */
.category-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.category-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.category-checkbox-item:hover {
    background: rgba(0, 255, 242, 0.1);
}

.category-checkbox-item label {
    cursor: pointer;
    flex: 1;
}

.category-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--neon-cyan);
}

.modal-description {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* 체크박스 리스트 */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.teacher-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.teacher-checkbox-item:hover {
    background: rgba(0, 255, 242, 0.05);
}

.teacher-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
}

.teacher-checkbox-item span {
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* 학생 없음 메시지 */
.students-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    padding: 8px 0;
}

/* 담당 클래스 없음 안내 */
.no-class-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    min-height: 200px;
    grid-column: 1 / -1; /* 그리드 컨테이너에서 전체 너비 차지 */
}

.no-class-notice p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.no-class-notice .notice-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 오른쪽 학생 목록 영역 */
.students-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 8px;
}

/* 클래스 내 담당 선생님 행 */
.teacher-row-in-class {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    background: rgba(0, 255, 242, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 242, 0.15);
    margin-bottom: 4px;
}

.teacher-name-in-class {
    color: var(--text-primary);
    font-size: 0.85rem;
}

.btn-change-teacher {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    border: none;
    background: rgba(0, 255, 242, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-change-teacher:hover {
    background: rgba(0, 255, 242, 0.15);
    color: var(--neon-cyan);
}

/* 학생 카드 - 한 줄에 모든 정보 */
.student-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.student-card:hover {
    border-color: rgba(0, 255, 242, 0.2);
    background: var(--bg-elevated);
}

/* 드래그 앤 드롭 스타일 */
.student-card[draggable="true"] {
    cursor: grab;
}

.student-card[draggable="true"]:active {
    cursor: grabbing;
}

.student-card.dragging {
    opacity: 0.5;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 255, 242, 0.3);
}

.class-row.drop-target {
    position: relative;
}

.class-row.drop-target::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(0, 255, 242, 0.3);
    border-radius: 8px;
    pointer-events: none;
}

.class-row.drag-over {
    background: rgba(0, 255, 242, 0.05);
}

.class-row.drag-over::after {
    border-color: var(--accent-primary);
    background: rgba(0, 255, 242, 0.1);
}

/* 학생 카드 헤더 (이름 + 버튼) */
.student-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 20%;
    min-width: 80px;
}

.student-card-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* 학생 카드 버튼 */
.student-card-buttons {
    display: flex;
    gap: 6px;
}

.btn-curriculum-icon,
.btn-password-icon {
    background: transparent;
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-curriculum-icon:hover {
    background: rgba(0, 255, 242, 0.1);
}

.btn-password-icon {
    border-color: rgba(255, 107, 53, 0.3);
}

.btn-password-icon:hover {
    background: rgba(255, 107, 53, 0.1);
}

/* 학생 통계 정보 */
.student-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.student-stats > div {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.student-stats strong {
    color: var(--text-muted);
    font-weight: 400;
}

/* 학생 통계 컴팩트 스타일 (오늘/총 형식) */
.student-stats-compact {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    width: 15%;
    min-width: 70px;
}

.student-solved-count {
    display: inline-flex;
    align-items: baseline;
    min-width: 70px;
    justify-content: flex-end;
}

.student-solved-count .today-count {
    color: var(--text-primary);
    display: inline-block;
    min-width: 1.2em;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.student-solved-count .today-count.today-active {
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}

.student-solved-count .total-count {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.student-solved-count .total-count::before {
    content: '/';
}

/* "개" 글자 정렬을 위한 고정 너비 */
.student-solved-count .count-number {
    display: inline-block;
    min-width: 2.5em;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 온라인 학생 스타일 */
.student-card.online {
    border-color: rgba(0, 255, 100, 0.3);
    background: rgba(0, 255, 100, 0.05);
}

.student-card.online:hover {
    border-color: rgba(0, 255, 100, 0.5);
    background: rgba(0, 255, 100, 0.08);
}

.online-name {
    color: #00ff64 !important;
    text-shadow: 0 0 8px rgba(0, 255, 100, 0.5);
}

.online-status {
    color: #00ff64;
    font-weight: 500;
}

/* 24시간 이내 접속 (오프라인) */
.recent-24h {
    color: #ffcc00;
    font-weight: 500;
}

/* 최근 풀이 기록 버튼 */
.btn-recent-icon {
    background: none;
    border: 1px solid rgba(0, 255, 242, 0.3);
    color: var(--primary);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-recent-icon:hover {
    background: rgba(0, 255, 242, 0.1);
    border-color: var(--primary);
}

.btn-recent-icon.active {
    background: rgba(0, 255, 242, 0.15);
    border-color: var(--primary);
}

/* 최근 풀이 기록 목록 */
.recent-solved-list {
    width: 100%;
    flex-basis: 100%;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-solved-list::-webkit-scrollbar {
    width: 6px;
}

.recent-solved-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.recent-solved-list::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 242, 0.3);
    border-radius: 3px;
}

.recent-solved-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 242, 0.5);
}

.recent-solved-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.recent-solved-item:hover {
    background: rgba(0, 255, 242, 0.1);
}

.recent-solved-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.recent-solved-problem-id {
    color: var(--primary);
    font-size: 11px;
    font-weight: 500;
    min-width: 65px;
    flex-shrink: 0;
}

.recent-solved-time {
    color: var(--text-muted);
    font-size: 10px;
}

.recent-solved-title {
    color: var(--text);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.recent-solved-time {
    margin-left: auto;
    flex-shrink: 0;
}

.recent-solved-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

/* 카테고리별 그룹 헤더 */
.recent-solved-category-header {
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 10px 4px;
    border-left: 2px solid var(--primary);
    margin-bottom: 4px;
    background: rgba(0, 255, 242, 0.05);
}

.recent-solved-category-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.problem-list-item {
    background: var(--bg-secondary);
    padding: 18px 24px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.problem-list-item:hover {
    background: var(--bg-elevated);
    border-color: rgba(0, 255, 242, 0.2);
    transform: translateX(8px);
}

/* ========================================
   SIDEBAR (Solve Page)
   ======================================== */
.hamburger-btn {
    background: none;
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    color: var(--neon-cyan);
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: rgba(0, 255, 242, 0.1);
    box-shadow: var(--glow-cyan);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -380px;
    width: 380px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid rgba(0, 255, 242, 0.2);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    padding: 28px;
}

.sidebar.open {
    left: 0;
}

.sidebar h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--neon-cyan);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-category {
    margin-bottom: 16px;
}

.sidebar-category-title {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-category-title:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-left-color: var(--neon-cyan);
}

.sidebar-category-title::before {
    content: '▸ ';
    color: var(--neon-cyan);
    transition: transform 0.3s ease;
    display: inline-block;
}

.sidebar-category.open .sidebar-category-title::before {
    content: '▾ ';
}

.sidebar-problems {
    padding: 8px 0 8px 20px;
    display: none;
}

.sidebar-category.open .sidebar-problems {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-problem-item {
    padding: 12px 16px;
    margin-bottom: 4px;
    cursor: pointer;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.sidebar-problem-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-left-color: var(--neon-cyan);
}

.sidebar-problem-item.active {
    background: rgba(0, 255, 242, 0.1);
    color: var(--neon-cyan);
    border-left-color: var(--neon-cyan);
}

.sidebar-problem-item.solved::after {
    content: ' ✓';
    color: var(--success);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 242, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 242, 0.5);
}

/* ========================================
   CURRICULUM (진도 관리) PAGE
   ======================================== */
.header-buttons {
    display: flex;
    gap: 10px;
}

.curriculum-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.level-tabs {
    display: flex;
    gap: 8px;
}

.level-tab {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
}

.level-tab:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.level-tab.active {
    background: rgba(0, 255, 242, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.bulk-actions .btn-secondary,
.bulk-actions .btn-primary {
    white-space: nowrap;
    width: auto;
    padding: 10px 20px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

#curriculumList {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-bottom: var(--footer-height);
}

.curriculum-level-section {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.curriculum-level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
}

.curriculum-level-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--neon-cyan);
}

.level-select-all {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--neon-cyan);
}

.curriculum-categories-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.curriculum-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.curriculum-category-item:hover {
    background: rgba(0, 255, 242, 0.05);
}

.curriculum-category-item label {
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
    font-size: 0.95rem;
}

.category-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
}

/* ========================================
   ANIMATIONS & EFFECTS
   ======================================== */
@keyframes glitch {
    0%, 100% { clip-path: inset(0 0 0 0); }
    20% { clip-path: inset(10% 0 60% 0); }
    40% { clip-path: inset(40% 0 30% 0); }
    60% { clip-path: inset(80% 0 5% 0); }
    80% { clip-path: inset(25% 0 50% 0); }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid transparent;
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background: rgba(0, 255, 242, 0.3);
    color: #fff;
}

/* ========================================
   MODAL STYLES
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 8px;
    box-shadow: var(--glow-cyan), var(--card-shadow);
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-cyan));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 18px 22px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
}

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

.modal-body p {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-body .error-message {
    margin-top: 0;
    padding: 0;
    background: none;
    border: none;
    min-height: 0;
}

.modal-body .error-message:not(:empty) {
    margin-top: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    background: var(--bg-secondary);
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    width: auto;
    padding: 11px 24px;
    line-height: 1;
    font-size: 0.85rem;
}

/* 기본 폼 모달 스타일 */
.modal-form .modal-body {
    padding: 20px 24px;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form .form-group:last-of-type {
    margin-bottom: 0;
}

.modal-form .form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--neon-cyan);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.modal-form .form-group label::before {
    content: '>';
    margin-right: 6px;
    color: var(--neon-cyan);
}

.modal-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.modal-form .form-group input::placeholder {
    color: var(--text-muted);
}

.modal-form .form-group input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 242, 0.2);
}

.modal-form .modal-footer {
    padding: 20px 24px;
}

.modal-form .modal-footer .btn-primary {
    flex: 1;
}

/* 클래스 수정 모달 깔끔한 스타일 */
.modal-edit-class .modal-body {
    padding: 20px 24px;
}

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

.modal-edit-class .form-group:last-child {
    margin-bottom: 0;
}

.modal-edit-class .form-group label {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.modal-edit-class .checkbox-list {
    background: transparent;
    border: none;
    padding: 0;
    max-height: 180px;
}

.modal-edit-class .teacher-checkbox-item {
    padding: 10px 12px;
    background: rgba(0, 255, 242, 0.03);
    border: 1px solid rgba(0, 255, 242, 0.1);
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-edit-class .teacher-checkbox-item::before {
    display: none;
}

.modal-edit-class .teacher-checkbox-item input[type="checkbox"] {
    flex-shrink: 0;
}

.modal-edit-class .teacher-checkbox-item span {
    line-height: 1;
}

.modal-edit-class .teacher-checkbox-item:last-child {
    margin-bottom: 0;
}

.modal-edit-class .teacher-checkbox-item:hover {
    background: rgba(0, 255, 242, 0.08);
    border-color: rgba(0, 255, 242, 0.2);
}

/* 모달 푸터 깔끔한 스타일 */
.modal-footer-clean {
    background: transparent;
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    padding: 16px 24px;
    gap: 10px;
}


/* ========================================
   만14세 미만 법정대리인 동의 섹션
   ======================================== */

.minor-checkbox-label {
    font-family: var(--font-body);
}

.minor-checkbox-label span {
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.minor-checkbox-label::before {
    content: none !important;
}

.minor-consent-section {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 193, 7, 0.06);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    animation: fadeIn 0.3s ease;
}

.minor-consent-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffc107;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.minor-consent-content {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
}

.minor-consent-content p {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.minor-consent-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.minor-consent-content ul li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
}

.minor-consent-content ul li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: #ffc107;
}

.minor-consent-content ul li strong {
    color: #ffc107;
}

.minor-consent-confirm {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 193, 7, 0.15);
}

.minor-consent-confirm::before {
    content: none !important;
}

.minor-consent-confirm span {
    font-family: var(--font-body);
    font-size: 0.78rem !important;
    color: var(--text-secondary) !important;
    line-height: 1.5;
}

.form-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    margin: 4px 0 0 0 !important;
}


/* ========================================
   FAVORITES (즐겨찾기) STYLES
   ======================================== */

/* 필터 섹션 */
.filter-section {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-filter {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-filter:hover {
    border-color: rgba(255, 215, 0, 0.4);
    color: var(--text-primary);
}

.btn-filter.active {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

.filter-star,
.filter-icon {
    font-size: 0.85rem;
}

.btn-filter:hover .filter-star,
.btn-filter.active .filter-star,
.btn-filter:hover .filter-icon,
.btn-filter.active .filter-icon {
    transform: none;
}

/* 문제 목록의 즐겨찾기 별 버튼 */
.problem-favorite-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.problem-favorite-btn:hover {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.problem-favorite-btn.active {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* 오답 횟수 배지 (교사용) */
.wrong-count-badge {
    background: rgba(255, 80, 80, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 80, 80, 0.4);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    margin-left: 8px;
    flex-shrink: 0;
}

/* 문제 풀이 페이지의 즐겨찾기 버튼 */
.problem-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
}

.btn-favorite {
    background: none;
    border: none;
    padding: 4px 8px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-favorite:hover {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.btn-favorite.active {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.btn-favorite .star-empty,
.btn-favorite .star-filled {
    line-height: 1;
}

/* 즐겨찾기 로딩 스피너 */
.btn-favorite.loading,
.problem-favorite-btn.loading {
    pointer-events: none;
    animation: favorite-spin 0.6s linear infinite;
    color: rgba(255, 255, 255, 0.4) !important;
    text-shadow: none !important;
}

.btn-favorite.loading *,
.problem-favorite-btn.loading * {
    color: rgba(255, 255, 255, 0.4) !important;
    text-shadow: none !important;
}

@keyframes favorite-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 문제 헤더 제목과 즐겨찾기 버튼 정렬 */
.problem-panel h2#problemTitle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.problem-panel h2#problemTitle .guide-badge {
    margin-left: 4px;
}

/* GUIDE 텍스트 스타일 */
.guide-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neon-cyan);
    opacity: 0.8;
    letter-spacing: 0.05em;
}

/* ========================================
   PROBLEM EDIT BUTTON & MODAL (교사 전용)
   ======================================== */
.btn-edit {
    padding: 6px 8px;
    margin-top: 1px;
    background: transparent;
    border: 1px solid var(--neon-orange);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-orange);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    line-height: 1.4;
}

.btn-edit:hover {
    background: rgba(255, 107, 53, 0.15);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

/* Medium Modal for Solution */
.modal-content.modal-medium {
    max-width: 500px;
}

.modal-content.modal-medium .modal-body {
    max-height: 50vh;
    overflow-y: auto;
}

/* Solution Code Block */
.solution-code-block {
    margin: 0;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 6px;
    overflow-x: auto;
}

.solution-code-block code {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Large Modal for Edit */
.modal-content.modal-large {
    max-width: 600px;
}

.modal-content.modal-large .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Fullwidth Modal for Problem Edit */
.modal-content.modal-fullwidth {
    max-width: 1600px;
    width: 97vw;
}

.modal-content.modal-fullwidth .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-header-actions .btn-secondary,
.modal-header-actions .btn-primary {
    padding: 8px 20px;
    font-size: 0.9em;
    line-height: 1;
    width: auto;
}

.modal-content.modal-fullwidth .modal-body {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.edit-problem-body {
    padding: 16px;
}

.edit-columns {
    display: flex;
    gap: 24px;
}

.edit-columns-3 {
    display: flex;
    gap: 20px;
}

.edit-columns-3 > .edit-column:nth-child(1) {
    flex: 1.2;
}

.edit-columns-3 > .edit-column:nth-child(2) {
    flex: 1;
}

.edit-columns-3 > .edit-column:nth-child(3) {
    flex: 1;
}

.edit-column {
    flex: 1;
    min-width: 0;
}

.edit-column .form-group {
    margin-bottom: 10px;
}

.edit-column .form-group:last-child {
    margin-bottom: 0;
}

.edit-column .form-group textarea {
    min-height: 80px;
}

.edit-column .form-row {
    margin-bottom: 10px;
}

/* 테스트케이스 스타일 */
.testcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.testcase-header label {
    margin-bottom: 0;
}

.btn-add-testcase {
    padding: 4px 12px;
    background: rgba(0, 255, 242, 0.1);
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    color: var(--neon-cyan);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-testcase:hover {
    background: rgba(0, 255, 242, 0.2);
}

.testcases-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.testcase-item {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 6px;
}

.testcase-item .testcase-fields {
    flex: 1;
    display: flex;
    gap: 8px;
}

.testcase-item .testcase-field {
    flex: 1;
}

.testcase-item .testcase-field label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.testcase-item .testcase-field label::before {
    content: none;
}

.testcase-item textarea {
    width: 100%;
    min-height: 50px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    resize: vertical;
}

.testcase-item textarea:focus {
    outline: none;
    border-color: var(--neon-cyan);
}

.btn-remove-testcase {
    padding: 4px 8px;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.5);
    border-radius: 4px;
    color: #ff5252;
    font-size: 0.8rem;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 20px;
}

.btn-remove-testcase:hover {
    background: rgba(255, 82, 82, 0.2);
}

/* Textarea styling for edit modal */
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 80px;
}

.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.2);
    background: var(--bg-secondary);
}

/* ========================================
   LEVEL TABS (기초/응용/심화)
   ======================================== */
.level-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
}

.level-tab {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.level-tab.active {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15) 0%, rgba(0, 255, 242, 0.05) 100%);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.2);
}

.level-tab.active::before {
    content: '▸ ';
}

/* 기초 탭 - 녹색 */
.level-tab[data-level="basic"].active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--success);
    color: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* 응용 탭 - 주황색 */
.level-tab[data-level="intermediate"].active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: var(--warning);
    color: var(--warning);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

/* 심화 탭 - 빨간색/핑크 */
.level-tab[data-level="advanced"].active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: var(--error);
    color: var(--error);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

/* 빈 메시지 */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px dashed rgba(0, 255, 242, 0.2);
    width: 100%;
    grid-column: 1 / -1;
}

/* ========================================
   HINT BUTTON (코드 틀 버튼)
   ======================================== */
.code-header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-hint {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgb(216, 184, 0);
    color: #ffd700;
    cursor: pointer;
}

.btn-hint::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.25), transparent);
}

.btn-hint:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    transform: translateY(-1px);
}

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



/* ========================================
   LOADING SPINNER
   ======================================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    min-height: 200px;
    grid-column: 1 / -1; /* 그리드 컨테이너에서 전체 너비 차지 */
}

.loading-container p {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 242, 0.1);
    border-top: 3px solid var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner.hidden,
.loading-container.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 242, 0.1);
    border-top: 3px solid var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* ========================================
   SKELETON LOADING (Progressive Rendering)
   ======================================== */

.skeleton-text {
    color: var(--text-muted);
    opacity: 0.5;
}

.problem-item.skeleton-item {
    padding: 16px 20px;
    margin-bottom: 4px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid transparent;
    pointer-events: none;
}

.skeleton-line {
    height: 16px;
    width: 60%;
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 25%,
        rgba(0, 255, 242, 0.05) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.problem-item.skeleton-item:nth-child(2) .skeleton-line {
    width: 75%;
}

.problem-item.skeleton-item:nth-child(3) .skeleton-line {
    width: 50%;
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.filter-section .disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

/* ========================================
   TIP BANNER
   ======================================== */
.tip-banner {
    margin-top: auto;
    padding: 12px 16px;
    background: rgba(0, 255, 242, 0.05);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tip-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tip-text {
    line-height: 1.5;
}

.problem-panel {
    display: flex;
    flex-direction: column;
}

/* ========================================
   MEMO SECTION
   ======================================== */
.memo-section {
    margin-top: auto;
    margin-left: -30px;
    margin-right: -30px;
    margin-bottom: -20px;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    border-radius: 0;
}

.memo-status {
    display: block;
    text-align: right;
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.memo-status:empty {
    display: none;
}

.memo-status.saving {
    color: var(--neon-yellow);
}

.memo-status.saved {
    color: var(--success);
}

.memo-status.error {
    color: var(--error);
}

.memo-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: none;
    transition: all 0.3s ease;
    line-height: 1.6;
}

.memo-textarea::placeholder {
    color: var(--text-muted);
}

.memo-textarea:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.15);
    background: var(--bg-secondary);
}

/* ========================================
   VOCAB HINTS (영단어 힌트 - 메모 영역 내)
   ======================================== */
.vocab-hints-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.vocab-hint-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.vocab-hint-chip:hover {
    background: rgba(167, 139, 250, 0.14);
    border-color: rgba(167, 139, 250, 0.35);
}

.vocab-hint-word {
    color: #c4b5fd;
    font-weight: 600;
}

.vocab-hint-type {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.vocab-hint-meaning {
    color: var(--text-secondary);
}

/* 수정 모달 내 영단어 힌트 편집 */
.vocab-hints-edit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vocab-hint-edit-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.vocab-hint-edit-row input {
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.vocab-hint-edit-row input:focus {
    outline: none;
    border-color: var(--neon-cyan);
}

.vocab-hint-edit-row input.vocab-word {
    flex: 2;
}

.vocab-hint-edit-row input.vocab-type {
    flex: 1;
    max-width: 80px;
}

.vocab-hint-edit-row input.vocab-meaning {
    flex: 3;
}

.vocab-hint-edit-row .btn-remove-vocab {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.vocab-hint-edit-row .btn-remove-vocab:hover {
    opacity: 1;
}

/* ========================================
   STUDENT MEMOS SECTION (교사용)
   ======================================== */
.student-memos-section {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 8px;
}

.student-memos-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.student-memos-label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.student-memos-count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.student-memos-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.student-memo-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid var(--neon-cyan);
}

.student-memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.student-memo-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neon-cyan);
}

.student-memo-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.student-memo-content {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========================================
   MY MEMOS MODAL (메모 모아보기)
   ======================================== */
.my-memos-search-wrap {
    padding: 16px 24px;
}

.my-memos-search {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.my-memos-search:focus {
    border-color: var(--neon-cyan);
}

.my-memos-search::placeholder {
    color: var(--text-muted);
}

.my-memos-body {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
}

.my-memos-loading,
.my-memos-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.my-memos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-memo-item {
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid var(--neon-purple);
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-memo-item:hover {
    background: rgba(0, 0, 0, 0.5);
    border-left-color: var(--neon-cyan);
    transform: translateX(4px);
}

.my-memo-hidden {
    opacity: 0.55;
    border-left-color: #555;
    cursor: default;
}

.my-memo-hidden:hover {
    border-left-color: #555;
    transform: none;
}

.my-memo-hidden .my-memo-title {
    color: var(--text-muted);
}

.my-memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.my-memo-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--neon-cyan);
}

.my-memo-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.my-memo-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-memo-delete {
    padding: 0;
    background: transparent;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 90%;
}

.btn-memo-delete:hover {
    color: var(--neon-orange);
}

.my-memo-content {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ========================================
   HEADER COMPONENTS (헤더 구성요소)
   ======================================== */

/* 역할 배지 - 선생님/학생 모드 */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.role-badge.teacher {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15) 0%, rgba(255, 0, 255, 0.08) 100%);
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: var(--neon-pink);
}

.role-badge.teacher:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.25) 0%, rgba(255, 0, 255, 0.15) 100%);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.role-badge.student {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15) 0%, rgba(0, 255, 242, 0.08) 100%);
    border: 1px solid rgba(0, 255, 242, 0.4);
    color: var(--neon-cyan);
}

/* 헤더 버튼 개선 */
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

a.header-btn {
    text-decoration: none;
    line-height: 36px;
    vertical-align: middle;
}

.header-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

/* 이전/다음 네비게이션 버튼 */
.header-btn.nav-btn {
    gap: 4px;
}

#prevBtn.header-btn.nav-btn {
    padding-left: 10px;
}

#nextBtn.header-btn.nav-btn {
    padding-right: 10px;
}

.header-btn.nav-btn svg {
    flex-shrink: 0;
    vertical-align: middle;
    margin-top: -2px;
    transition: transform 0.2s ease;
}

.header-btn.nav-btn:hover svg {
    transform: translateX(-2px);
}

#nextBtn.header-btn.nav-btn:hover svg {
    transform: translateX(2px);
}

.header-btn.logout {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.header-btn.logout:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

.header-btn.mode-switch {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15) 0%, rgba(255, 0, 255, 0.08) 100%);
    border-color: rgba(255, 0, 255, 0.4);
    color: var(--neon-pink);
}

.header-btn.mode-switch:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.25) 0%, rgba(255, 0, 255, 0.15) 100%);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}


/* 헤더 구분선 */
.header-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin: 0 8px;
}


/* ========================================
   Admin Page Styles
   ======================================== */

/* Admin Page - PC Version */
.admin-container {
    padding: 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-tab {
    padding: 14px 32px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.admin-tab.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
    background: transparent;
}

/* Tab Content */
.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Admin Section */
.admin-section {
    margin-bottom: 32px;
}

.admin-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-section h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
}

.admin-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Admin Table */
.admin-table-wrapper {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: rgba(255, 255, 255, 0.03);
}

.admin-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
    padding: 16px 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Table Cell Types */
.cell-name {
    font-weight: 600;
    color: var(--text-primary) !important;
}

.cell-code {
    font-family: var(--font-mono);
}

.code-badge {
    display: inline-block;
    background: rgba(0, 255, 242, 0.12);
    color: var(--neon-cyan);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.cell-number {
    font-family: var(--font-mono);
    text-align: center;
}

.cell-date {
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted) !important;
    opacity: 0.6;
}

.text-online {
    color: var(--neon-green);
}

/* Loading & Empty States */
.loading-cell,
.empty-cell,
.error-cell {
    text-align: center !important;
    padding: 48px 20px !important;
    color: var(--text-muted) !important;
}

.error-cell {
    color: var(--error) !important;
}

/* ========================================
   MANAGEMENT TABLE (기관/교사/클래스 관리)
   ======================================== */
.management-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 242, 0.1);
}

.management-table thead {
    background: rgba(0, 255, 242, 0.05);
}

.management-table th {
    padding: 14px 16px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

.management-table td {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.management-table td.class-name-cell {
    padding: 8px 16px;
}

.management-table td.class-name-cell .class-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.management-table td.class-name-cell .class-teachers {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.management-table tbody tr:last-child td {
    border-bottom: none;
}

.management-table tbody tr:hover {
    background: rgba(0, 255, 242, 0.03);
}

.org-link {
    color: var(--neon-cyan);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.org-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* 선생님 관리 - 클래스 관리와 동일한 레이아웃 */
.teachers-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 선생님 수정 버튼 */
.btn-edit-teacher {
    font-size: 0.85rem;
}

.btn-edit-teacher:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

/* 액션 버튼 컨테이너 */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 삭제 버튼 */
.btn-delete {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--error);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--error);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* 학생모드 버튼 */
.header-btn.student-mode {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15) 0%, rgba(0, 255, 242, 0.08) 100%);
    border-color: rgba(0, 255, 242, 0.4);
    color: var(--neon-cyan);
}

.header-btn.student-mode:hover {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.25) 0%, rgba(0, 255, 242, 0.15) 100%);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.3);
}

/* 관리 목록 컨테이너 */
.management-list {
    background: transparent;
}

/* 폼 그룹 select 스타일 */
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.2);
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 다중 선택 select */
.form-group select[multiple] {
    min-height: 100px;
}

.form-group select[multiple] option {
    padding: 8px 12px;
}

.form-group select[multiple] option:checked {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.2) 0%, rgba(0, 255, 242, 0.1) 100%);
    color: var(--neon-cyan);
}

/* ========================================
   학생 관리 탭 스타일
   ======================================== */

.student-management-container {
    padding: 20px 0;
}

.student-count-info {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-left: 4px;
}

.search-container {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* 학생 관리 테이블 */
.student-table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
}

.student-management-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
}

.student-management-table thead {
    background: var(--bg-secondary);
}

.student-management-table th {
    padding: 14px 16px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
}

.student-management-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.student-management-table tbody tr:hover {
    background: rgba(0, 255, 242, 0.03);
}

.student-management-table tbody tr.online {
    background: rgba(57, 255, 20, 0.03);
}

.student-management-table tbody tr.online:hover {
    background: rgba(57, 255, 20, 0.06);
}

/* 테이블 셀 스타일 */
.student-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-name {
    font-weight: 500;
}

.student-name.online-name {
    color: var(--neon-green);
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.stat-cell {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-cell.today-active {
    color: var(--neon-green);
    font-weight: 600;
}

.login-cell {
    font-size: 0.85rem;
}

.login-cell .online-status {
    color: var(--neon-green);
    font-weight: 600;
}

.login-cell .recent-login {
    color: var(--neon-cyan);
}

.login-cell .no-login {
    color: var(--text-muted);
}

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.btn-detail {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-cyan);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-detail:hover {
    background: rgba(0, 255, 242, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

/* ========================================
   학생 상세 페이지 스타일
   ======================================== */

.student-detail-main {
    flex: none;
    padding: 30px;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
}

.student-detail-container {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 2fr 2fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 16px;
}

.student-info-section {
    grid-column: 1;
    grid-row: 1;
}

.solving-history-section {
    grid-column: 2;
    grid-row: 1;
}

.ai-feedback-section {
    grid-column: 3;
    grid-row: 1;
}

/* 섹션 공통 스타일 */
.student-info-section,
.solving-history-section,
.ai-usage-section,
.ai-feedback-section {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    padding: 20px;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.student-detail-container .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
    flex-shrink: 0;
}

.student-detail-container .section-title {
    font-size: 1rem;
}

.student-detail-container .section-title::before,
.student-detail-container h2::before {
    content: none;
}

.student-info-section .btn-action:hover {
    background: transparent;
}

.student-info-section .btn-action.btn-muted {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.student-info-section .btn-action.btn-danger {
    border-color: var(--error);
    color: var(--error);
}

/* 학생 정보 그리드 */
.student-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.info-card {
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-card-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

/* 학생 메모 */
.student-memo-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.student-memo-card .info-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-memo-status {
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    transition: color 0.3s ease;
}

.student-memo-status:empty { display: none; }
.student-memo-status.saving { color: var(--neon-yellow); }
.student-memo-status.saved { color: var(--success); }
.student-memo-status.error { color: var(--error); }

.student-memo-textarea {
    width: 100%;
    flex: 1;
    min-height: 60px;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    resize: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    line-height: 1.5;
}

.student-memo-textarea::placeholder {
    color: var(--text-muted);
}

.student-memo-textarea:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 242, 0.1);
}

.student-memo-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
    font-family: var(--font-mono);
}

.student-memo-meta:empty { display: none; }

/* 카테고리별 진도 */
.category-progress-card {
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.category-progress-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.cat-tab-btn {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 6px 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.cat-tab-btn.active {
    background: rgba(0, 255, 242, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.cat-tab-btn:hover:not(.active) {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
}

.category-progress-chart-wrap {
    height: 180px;
    position: relative;
}

.btn-student-action-danger {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.btn-student-action-danger:hover {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.info-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.info-value.highlight-cyan {
    color: var(--neon-cyan);
}

.info-value.highlight-green {
    color: var(--neon-green);
}

.info-value.highlight-yellow {
    color: var(--neon-yellow);
}

.detail-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reset-pw-icon {
    border: none;
    padding: 3px;
    background: transparent;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-reset-pw-icon:hover {
    opacity: 1;
    color: var(--neon-orange);
}

/* AI 학습 분석 - 스크롤 영역 */
.ai-feedback-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* 풀이 기록 섹션 - 차트 + 날짜별 목록 + AI 사용내역 */
.solving-history-section {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.solving-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.period-buttons {
    display: flex;
    gap: 4px;
}

.period-btn {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:hover {
    border-color: rgba(0, 255, 242, 0.5);
    color: var(--text-primary);
}

.period-btn.active {
    background: rgba(0, 255, 242, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.chart-container {
    position: relative;
    height: 200px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.date-solved-container {
    display: flex;
    flex-direction: column;
}

.date-solved-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.date-solved-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    font-weight: 600;
}

.date-solved-count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.date-solved-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-solved-item {
    display: grid;
    grid-template-columns: 100px 1fr auto 100px;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    font-size: 0.9rem;
}

.date-solved-item:hover {
    background: rgba(0, 255, 242, 0.05);
    border-left: 2px solid var(--neon-cyan);
}

.record-time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.record-video-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    opacity: 0.8;
    cursor: default;
}

.record-video-icon:hover {
    opacity: 1;
}

/* AI 사용 내역 섹션 */
/* ai-usage-subsection: 풀이기록 섹션 내부 */
.ai-usage-subsection {
    margin-top: 16px;
    padding-top: 30px;
    flex-shrink: 0;
}

.subsection-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin: 0 0 12px 0;
}

.ai-usage-container {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-usage-item {
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ai-usage-item:hover {
    background: rgba(0, 255, 242, 0.05);
    border-left: 2px solid var(--neon-cyan);
}

.ai-usage-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-usage-feature {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.ai-usage-problem {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-cyan);
}

.ai-usage-time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

.ai-usage-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 4px;
}

.ai-usage-stat {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-usage-stat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.ai-usage-question {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 4px;
    line-height: 1.4;
}

/* 코드 비교 예시 */
.code-example-item {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 242, 0.08);
}

.code-example-item:last-child {
    margin-bottom: 0;
}

.code-example-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-cyan);
    margin-bottom: 8px;
    font-weight: 600;
}

.code-compare {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.code-block {
    flex: 1;
    border-radius: 4px;
    overflow: hidden;
}

.code-block-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 8px;
    font-weight: 600;
}

.code-student .code-block-label {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.code-better .code-block-label {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.code-block pre {
    margin: 0;
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
}

.code-arrow {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 0 2px;
}

.code-example-explanation {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 4px;
}

/* AI 피드백 섹션 */
.coming-soon-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning);
    color: var(--warning);
    padding: 4px 10px;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-feedback-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.ai-feedback-placeholder p {
    margin-bottom: 8px;
}

.ai-feedback-placeholder .placeholder-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* 돌아가기 버튼 */
.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-right: 10px;
}

.back-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* 로딩 컨테이너 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 242, 0.1);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   개발 어휘 표시 영역 (필터 바 좌측 인라인)
   ======================================== */
.dev-vocabulary-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.dev-vocabulary-label {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    font-weight: 500;
    flex-shrink: 0;
}

.dev-vocabulary-en {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #fff;
    font-weight: 500;
}

.dev-vocabulary-ko {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 모바일에서 개발 어휘 숨김 */
@media (max-width: 768px) {
    .dev-vocabulary-inline {
        display: none;
    }
}

/* ========================================
   AI 기능 관련 스타일
   ======================================== */

/* ----- 리사이저블 3단 레이아웃 ----- */
.solve-container-3col {
    display: flex;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    margin-top: var(--header-height);
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* ===== 녹화 모드 ===== */
.code-header .btn-record {
    background: rgba(107, 114, 128, 0.15);
    border: 1px solid rgba(156, 163, 175, 0.4);
    color: #9ca3af;
}
.code-header .btn-record:hover {
    background: rgba(107, 114, 128, 0.25);
    border-color: rgba(156, 163, 175, 0.6);
    box-shadow: 0 0 10px rgba(156, 163, 175, 0.2);
}

body.recording-mode .btn-record {
    opacity: 0;
}
body.recording-mode .btn-record:hover {
    opacity: 0.1;
}

body.recording-mode header,
body.recording-mode footer,
body.recording-mode .memo-section,
body.recording-mode .btn-favorite,
body.recording-mode .btn-edit,
body.recording-mode .btn-solution {
    display: none !important;
}

body.recording-mode .solve-container-3col {
    height: 100vh;
    margin-top: 0;
}

/* 좌측 섹션 (문제 + 메모) */
.solve-container-3col > .left-section {
    flex: 0 0 auto;
    width: 400px;
    min-width: 400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-right: 1px solid rgba(0, 255, 242, 0.1);
}

/* 문제 영역 (스크롤 가능) */
.solve-container-3col > .left-section > .problem-panel {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 30px;
    background: var(--bg-primary);
    border: none;
    border-radius: 0;
}

/* 메모 영역 (하단 고정) */
.solve-container-3col > .left-section > .memo-section {
    flex: 0 0 auto;
    margin: 0;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    border-radius: 0;
}

.solve-container-3col > .code-panel {
    flex: 1 1 auto;
    min-width: 600px;
    overflow-y: auto;
    height: 100%;
    padding: 20px 30px;
    background: var(--bg-primary);
}

/* AI 패널 */
.solve-container-3col > .ai-panel {
    display: none;
    flex: 0 0 auto;
    width: 0;
    min-width: 0;
    overflow: hidden;
    height: 100%;
    opacity: 0;
}

/* AI 패널 열림 상태 */
.solve-container-3col.ai-open > .ai-panel {
    display: flex;
    width: 320px;
    min-width: 280px;
    opacity: 1;
    overflow-y: auto;
}

/* AI 핸들 숨김: AI 패널이 열리지 않았을 때 */
.resize-handle.ai-handle {
    display: none;
}

.solve-container-3col.ai-open .resize-handle.ai-handle {
    display: block;
}

/* ----- 리사이저 핸들 스타일 ----- */
.resize-handle {
    flex: 0 0 auto;
    width: 6px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    z-index: 10;
    transition: background 0.2s ease;
}

.resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: rgba(0, 255, 242, 0.3);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.resize-handle:hover {
    background: rgba(0, 255, 242, 0.1);
}

.resize-handle:hover::before {
    height: 60px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

.resize-handle.dragging {
    background: rgba(0, 255, 242, 0.15);
}

.resize-handle.dragging::before {
    height: 80px;
    background: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.7);
}

/* ----- 수직 리사이저 핸들 (코드 에디터 - 실행 결과 사이) ----- */
.resize-handle-vertical {
    flex: 0 0 auto;
    height: 6px;
    background: transparent;
    cursor: row-resize;
    position: relative;
    z-index: 10;
    transition: background 0.2s ease;
    margin: 24px -30px 0 -30px; /* 상단 간격 + 좌우 패딩 무시 */
    padding: 3px 30px; /* 드래그 영역은 패딩 안쪽까지 */
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

.resize-handle-vertical::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 2px;
    background: rgba(0, 255, 242, 0.3);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.resize-handle-vertical:hover {
    background: rgba(0, 255, 242, 0.1);
}

.resize-handle-vertical:hover::before {
    width: 60px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

.resize-handle-vertical.dragging {
    background: rgba(0, 255, 242, 0.15);
}

.resize-handle-vertical.dragging::before {
    width: 80px;
    background: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.7);
}

/* 수직 리사이징 중 선택 방지 */
body.resizing-vertical {
    user-select: none;
    cursor: row-resize !important;
}

body.resizing-vertical * {
    cursor: row-resize !important;
}

/* AI 패널 리사이저 (시안 계열로 통일 - 기본 핸들과 동일) */

/* 리사이징 중 선택 방지 */
body.resizing {
    user-select: none;
    cursor: col-resize !important;
}

body.resizing * {
    cursor: col-resize !important;
}

/* 반응형 레이아웃 */
@media (max-width: 1200px) {
    .solve-container-3col > .left-section {
        width: 280px;
        min-width: 200px;
    }
    .solve-container-3col > .code-panel {
        min-width: 350px;
    }
    /* 작은 화면에서는 AI 패널 오버레이로 표시 */
    .solve-container-3col > .ai-panel {
        position: fixed;
        right: 0;
        top: var(--header-height);
        height: calc(100vh - var(--header-height) - var(--footer-height));
        z-index: 100;
        border-radius: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }
    .solve-container-3col.ai-open > .ai-panel {
        width: 320px;
    }
    .resize-handle.ai-handle {
        display: none;
    }
}

@media (max-width: 768px) {
    .solve-container-3col {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }
    .solve-container-3col > .left-section,
    .solve-container-3col > .code-panel {
        width: 100% !important;
        min-width: unset !important;
        max-width: unset !important;
        height: auto;
        flex: 0 0 auto;
    }
    .resize-handle {
        display: none;
    }
    .solve-container-3col.ai-open > .ai-panel {
        width: 100%;
        border-radius: 0;
    }
}

/* ----- AI 패널 기본 스타일 ----- */
.ai-panel {
    background: var(--bg-secondary);
    border: none;
    border-left: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
}

.ai-panel-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.12), rgba(0, 255, 242, 0.12));
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-panel-header h3 {
    color: var(--neon-pink);
    font-family: var(--font-display);
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.ai-usage-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.usage-ring {
    flex-shrink: 0;
}

.usage-ring-fill {
    transition: stroke-dashoffset 0.5s ease;
}   

/* AI 패널 닫기 버튼 */
.ai-panel-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    margin-top: 1px;
    line-height: 1;
    transition: all 0.2s ease;
}

.ai-panel-close:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* AI 대화 초기화 버튼 */
.ai-panel-reset {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: all 0.2s ease;
}

.ai-panel-reset:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

/* AI 토글 버튼 */
.btn-ai-toggle {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.2), rgba(0, 255, 242, 0.2));
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: var(--neon-pink);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600 !important;
    transition: all 0.3s ease;
}

.btn-ai-toggle:hover {
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.3), rgba(0, 255, 242, 0.3));
}

.btn-ai-toggle.active {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.4), rgba(0, 255, 242, 0.4));
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

/* ----- AI 기능 버튼 그리드 ----- */
.ai-feature-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
}

.ai-btn {
    background: var(--bg-card);
    border: 1px solid rgba(0, 255, 242, 0.3);
    color: var(--text-primary);
    padding: 8px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    text-align: center;
    font-family: var(--font-mono);
}

.ai-btn:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
    background: rgba(0, 255, 242, 0.05);
}

.ai-btn .icon {
    display: block;
    font-size: 16px;
    margin-bottom: 2px;
}

.ai-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(107, 114, 128, 0.3);
}

.ai-btn:disabled:hover {
    box-shadow: none;
    background: var(--bg-card);
}

/* ----- 채팅 영역 ----- */
.ai-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 200px;
}

/* 스크롤바 스타일링 */
.ai-chat-area::-webkit-scrollbar {
    width: 8px;
}

.ai-chat-area::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.ai-chat-area::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 242, 0.3);
    border-radius: 4px;
}

.ai-chat-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 242, 0.5);
}

/* ----- AI 환영 메시지 ----- */
.ai-welcome {
    text-align: center;
    padding: 20px;
}

.ai-welcome .ai-avatar {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.ai-welcome p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    font-family: var(--font-body);
}

/* AI 퀵 버튼 */
.ai-quick-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ai-quick-btn {
    padding: 5px 12px;
    border-radius: 14px;
    border: 1px solid rgba(167, 139, 250, 0.4);
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
    font-size: 12px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-quick-btn:hover {
    background: rgba(167, 139, 250, 0.25);
    border-color: rgba(167, 139, 250, 0.6);
    transform: translateY(-1px);
}

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

/* ----- 채팅 메시지 스타일 ----- */
.ai-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
    padding: 12px;
    border-radius: 12px;
}

/* 사용자 메시지 */
.ai-message-user {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.1), rgba(0, 255, 242, 0.05));
    border: 1px solid rgba(0, 255, 242, 0.3);
    margin-left: 20px;
}

/* AI 메시지 */
.ai-message-assistant {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.08), rgba(255, 0, 255, 0.02));
    border: 1px solid rgba(255, 0, 255, 0.2);
    margin-right: 20px;
}

/* 발신자 라벨 */
.ai-message-label {
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.ai-message-user .ai-message-label {
    color: var(--neon-cyan);
}

.ai-message-assistant .ai-message-label {
    color: var(--neon-pink);
}

/* 메시지 내용 */
.ai-message-content {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-word;
}

/* 기능 배지 */
.ai-feature-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 8px;
    background: rgba(255, 0, 255, 0.15);
    color: var(--neon-pink);
    font-family: var(--font-mono);
    border: 1px solid rgba(255, 0, 255, 0.3);
}

/* 타이핑 인디케이터 (로딩 애니메이션) */
.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--neon-pink);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.ai-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.ai-typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 로딩 메시지 */
.ai-message-loading {
    opacity: 0.8;
}

/* 경고 메시지 (부적절한 발언) */
.ai-message-warning {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.15), rgba(255, 50, 50, 0.08)) !important;
    border: 1px solid rgba(255, 100, 100, 0.4) !important;
}

.ai-message-warning .ai-message-label {
    color: #ff6b6b !important;
}

.ai-message-warning .ai-message-content {
    color: #ffcccc;
}

/* AI 응답 코드 블록 */
.ai-code-block {
    background: #1a1a2e;
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
}

.ai-code-block code {
    background: transparent;
    padding: 0;
    color: #e0e0e0;
    font-family: var(--font-mono);
}

/* 인라인 코드 */
.ai-inline-code {
    background: rgba(0, 255, 242, 0.1);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--neon-cyan);
}

/* ----- 입력 영역 ----- */
.ai-input-area {
    padding: 12px;
    border-top: 1px solid rgba(0, 255, 242, 0.2);
    background: var(--bg-secondary);
}

.ai-input-wrapper {
    display: flex;
    gap: 8px;
}

#aiChatInput {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid rgba(0, 255, 242, 0.3);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    resize: none;
    font-family: var(--font-body);
    font-size: 13px;
    transition: all 0.2s ease;
}

#aiChatInput:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.2);
}

#aiChatInput::placeholder {
    color: var(--text-muted);
}

.ai-send-btn {
    background: linear-gradient(135deg, #ff00ff, #00fff2);
    border: none;
    color: #0a0e17;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--font-body);
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 60px;
}

.ai-send-btn:hover {
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5), 0 0 30px rgba(0, 255, 242, 0.3);
    transform: translateY(-2px);
}

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

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #4a5568;
}

.ai-send-btn:disabled:hover {
    box-shadow: none;
    transform: none;
}

/* ----- 로딩 애니메이션 ----- */
.ai-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.ai-loading-dots {
    display: flex;
    gap: 4px;
}

.ai-loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--neon-cyan);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

.ai-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* ========================================
   AI 피드백 UI 스타일 (학생 상세 페이지)
   ======================================== */

/* 피드백 생성 버튼 */
.btn-generate-feedback {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 12px;
    border: 1px solid var(--neon-pink);
    border-radius: 4px;
    background: transparent;
    color: var(--neon-pink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-generate-feedback:hover {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.3) 0%, rgba(255, 0, 255, 0.15) 100%);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.btn-generate-feedback:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 피드백 로딩 */
.feedback-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* 피드백 카드 목록 */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 피드백 페이지네이션 */
.feedback-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    margin-bottom: 12px;
}

.feedback-page-btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--neon-cyan);
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.feedback-page-btn:hover:not(:disabled) {
    opacity: 0.7;
}

.feedback-page-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.feedback-page-input {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    width: 36px;
    padding: 3px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    line-height: 1;
    -moz-appearance: textfield;
    padding
}

.feedback-page-input::-webkit-outer-spin-button,
.feedback-page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.feedback-page-input:focus {
    color: var(--neon-cyan);
}

.feedback-page-info {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feedback-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 8px;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

.feedback-card-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-cyan);
}

.feedback-card-actions {
    display: flex;
    gap: 4px;
}

.btn-feedback-action {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-feedback-action:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 242, 0.05);
}

.btn-feedback-delete:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.recommended-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recommended-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 4px 10px;
    background: rgba(0, 255, 242, 0.08);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 4px;
    color: var(--text-primary);
}

.analyzed-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.analyzed-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: var(--text-secondary);
}

.code-badge {
    font-size: 0.65rem;
    padding: 1px 4px;
    background: rgba(0, 255, 242, 0.15);
    border-radius: 2px;
    color: var(--neon-cyan);
    margin-left: 2px;
}

.feedback-analyzed {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 피드백 섹션 */
.feedback-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

.feedback-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.feedback-period {
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.feedback-period p {
    font-family: var(--font-mono, monospace);
    font-size: 0.9rem;
    color: var(--neon-cyan);
    opacity: 0.85;
}

.feedback-section h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin: 0 0 16px 0;
    letter-spacing: 0.5px;
}

.feedback-section p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.feedback-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feedback-section ul li {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 8px 0 8px 20px;
    position: relative;
    line-height: 1.6;
}

.feedback-section ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
    font-weight: bold;
}

/* 스킬 바 */
.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 스킬 분석 - 원형 인디케이터 */
.skill-circles-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.skill-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.skill-circle-svg {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 0 4px rgba(0, 255, 242, 0.3));
}

.skill-circle-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
}

/* 추천 문제 카드 */
.recommended-problems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.recommended-problem-card {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 242, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.recommended-problem-card:hover {
    background: rgba(0, 255, 242, 0.05);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 242, 0.2);
}

.recommended-problem-card .problem-id {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    font-weight: 600;
    margin-bottom: 8px;
}

.recommended-problem-card .problem-reason {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 부적절 발언 알림 */
.inappropriate-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 6px;
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--error);
}

.inappropriate-alert span {
    font-weight: 700;
    color: var(--error);
}

.inappropriate-alert button {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--error);
    border-radius: 4px;
    color: var(--error);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.inappropriate-alert button:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* 데이터 없음 표시 */
.no-data {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    font-size: 0.9rem;
}

/* ========================================
   AI 채팅형 피드백 UI
   ======================================== */

.ai-chat-section {
    display: flex;
    flex-direction: column;
}

.ai-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 2px 12px;
    scroll-behavior: smooth;
}

/* 메시지 공통 */
.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 92%;
    animation: chatFadeIn 0.3s ease;
}

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

/* AI 메시지 (왼쪽) */
.chat-ai {
    align-self: flex-start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(0, 255, 242, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan);
    flex-shrink: 0;
}

.chat-ai .chat-bubble {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 242, 0.1);
    border-radius: 4px 12px 12px 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.chat-ai .chat-bubble p {
    margin: 0 0 6px 0;
}

.chat-ai .chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* 유저 메시지 (오른쪽) */
.chat-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-user .chat-bubble {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15), rgba(0, 255, 242, 0.08));
    border: 1px solid rgba(0, 255, 242, 0.25);
    border-radius: 12px 4px 12px 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 환영 메시지 (중앙 정렬, AI 나나 스타일) */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
    text-align: center;
    gap: 10px;
}

.chat-welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15), rgba(139, 92, 246, 0.15));
    border: 1.5px solid rgba(0, 255, 242, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan);
    margin-bottom: 6px;
}

.chat-welcome-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
}

.chat-welcome-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* 하단 고정 영역 (칩 + 입력) */
.ai-chat-bottom {
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 255, 242, 0.1);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 추천 질문 칩 */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-chip {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 6px 14px;
    border: 1px solid rgba(0, 255, 242, 0.25);
    border-radius: 20px;
    background: rgba(0, 255, 242, 0.05);
    color: var(--neon-cyan);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-chip:hover {
    background: rgba(0, 255, 242, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 255, 242, 0.15);
}

/* AI 피드백 응답 카드 (채팅 버블 내) */
.chat-bubble-feedback {
    max-width: 100%;
}

.chat-feedback-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-feedback-section:last-of-type {
    border-bottom: none;
    margin-bottom: 8px;
    padding-bottom: 0;
}

.chat-feedback-section h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin: 0 0 8px 0;
    letter-spacing: 0.3px;
}

.chat-feedback-section p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-primary);
}

.chat-feedback-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-feedback-section ul li {
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 4px 0 4px 16px;
    position: relative;
    line-height: 1.5;
}

.chat-feedback-section ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
    font-weight: bold;
    font-size: 0.8rem;
}

.chat-recommended-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* 스킬 바 (채팅 내) */
.chat-skill-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-skill-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 70px;
    flex-shrink: 0;
}

.chat-skill-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.chat-skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), #22c55e);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.chat-skill-score {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--neon-cyan);
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}

/* 피드백 메타 (시간 + 액션 버튼) */
.chat-feedback-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-feedback-time {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.chat-feedback-actions {
    display: flex;
    gap: 4px;
}

.chat-action-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-action-btn:hover {
    color: var(--neon-cyan);
    border-color: rgba(0, 255, 242, 0.4);
    background: rgba(0, 255, 242, 0.05);
}

/* 타이핑 인디케이터 */
.chat-typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-right: 8px;
}

.chat-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-cyan);
    animation: chatTyping 1.4s infinite ease-in-out both;
}

.chat-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatTyping {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-typing-text {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* 채팅 입력 영역 */
.ai-chat-input-area {
    display: flex;
    gap: 8px;
}

.ai-chat-input {
    flex: 1;
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.ai-chat-input::placeholder {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.ai-chat-input:focus {
    border-color: rgba(0, 255, 242, 0.4);
    box-shadow: 0 0 0 2px rgba(0, 255, 242, 0.08);
}

.ai-chat-send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 8px;
    background: rgba(0, 255, 242, 0.08);
    color: var(--neon-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chat-send-btn:hover {
    background: rgba(0, 255, 242, 0.2);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 255, 242, 0.2);
}

.ai-chat-send-btn:active {
    transform: scale(0.95);
}

/* 데모 표시 (미리보기용 - 나중에 제거) */
.chat-demo {
    opacity: 1;
}

/* ===== AI 사용 내역 탭 스타일 ===== */

.ai-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ai-usage-header h2 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--neon-cyan);
}

.ai-usage-filters {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--neon-cyan);
    outline: none;
}

/* AI 통계 카드 그리드 */
.ai-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.ai-stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.ai-stat-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 4px 20px rgba(0, 255, 242, 0.1);
}

.ai-stat-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ai-stat-value {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

/* AI 사용 섹션 */
.ai-usage-section {
    margin-bottom: 32px;
}

.ai-usage-section h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

/* 학생별 AI 사용 목록 */
.ai-usage-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.ai-usage-student-card {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-usage-student-card:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 242, 0.03);
    transform: translateY(-2px);
}

.ai-usage-student-card .student-name {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-usage-student-card .student-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ai-usage-student-card .stat-item {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ai-usage-student-card .stat-item strong {
    color: var(--neon-cyan);
}

.ai-usage-student-card .last-used {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* AI 사용 내역 테이블 */
.ai-usage-table-container {
    overflow-x: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 242, 0.1);
}

.ai-usage-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
}

.ai-usage-table th {
    padding: 14px 16px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 255, 242, 0.05);
    border-bottom: 1px solid rgba(0, 255, 242, 0.2);
}

.ai-usage-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.ai-usage-table tbody tr:hover {
    background: rgba(0, 255, 242, 0.03);
}

.ai-usage-table .content-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.ai-usage-table .empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* 기능 뱃지 */
.feature-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.feature-badge.hint {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.feature-badge.review {
    background: rgba(0, 255, 242, 0.2);
    color: var(--neon-cyan);
}

.feature-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.feature-badge.concept {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.feature-badge.chat {
    background: rgba(57, 255, 20, 0.2);
    color: var(--neon-green);
}

/* 페이지네이션 */
.ai-usage-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
}

.btn-pagination {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pagination:hover:not(:disabled) {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 242, 0.1);
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#aiUsagePageInfo {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* AI 대화 내역 모달 */
.modal-large .modal-content {
    max-width: 800px;
    width: 90%;
}

.ai-conversation-list {
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-conversation-item {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-conversation-item.user {
    background: rgba(0, 255, 242, 0.05);
    border-color: rgba(0, 255, 242, 0.2);
}

.ai-conversation-item.assistant {
    background: rgba(57, 255, 20, 0.05);
    border-color: rgba(57, 255, 20, 0.2);
}

.ai-conversation-item .conv-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.ai-conversation-item .conv-role {
    font-weight: 600;
    color: var(--neon-cyan);
}

.ai-conversation-item.assistant .conv-role {
    color: var(--neon-green);
}

.ai-conversation-item .conv-feature {
    color: var(--text-secondary);
}

.ai-conversation-item .conv-time {
    color: var(--text-muted);
    margin-left: auto;
}

.ai-conversation-item .conv-content {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-conversation-item .conv-problem {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 클릭 가능한 테이블 행 */
.ai-usage-table .clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.ai-usage-table .clickable-row:hover {
    background-color: var(--bg-hover);
}

/* AI 사용 내역 상세 메타 정보 */
.ai-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ai-detail-meta .detail-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ai-detail-meta .detail-problem {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== 학부모 전화번호 편집 ===== */
.parent-phone-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-edit-phone {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
    color: #ffffff;
}

.btn-edit-phone:hover {
    opacity: 1;
}

.phone-edit-form {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin-top: 4px;
}

.phone-edit-form input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.btn-phone-save, .btn-phone-cancel {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-phone-save {
    background: #6366f1;
    color: white;
}

.btn-phone-save:hover {
    background: #4f46e5;
}

.btn-phone-cancel {
    background: #e5e7eb;
    color: #374151;
}

.btn-phone-cancel:hover {
    background: #d1d5db;
}

/* 전달 버튼 */
.btn-feedback-share {
    color: var(--text-muted);
}

.btn-feedback-share:hover {
    color: var(--text-primary);
}

.btn-feedback-share.shared {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.btn-feedback-share.shared:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-feedback-copy-link {
    color: #22c55e;
}

.btn-feedback-copy-link:hover {
    background: rgba(34, 197, 94, 0.1);
}

.btn-feedback-action.hidden {
    display: none;
}


/* ========================================
   타자연습 (Typing Practice)
   ======================================== */

.typing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === 스테이지 선택 화면 === */
.typing-stage-select {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.typing-title-area {
    text-align: center;
    padding: 20px 0 16px;
    flex-shrink: 0;
}

.typing-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--neon-cyan);
    margin: 0;
    letter-spacing: 3px;
    text-shadow: var(--glow-cyan);
}

.typing-subtitle {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 6px 0 0;
}

.typing-stage-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    padding: 0 8px 12px;
    overflow-y: auto;
    align-content: start;
}

.typing-stage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    gap: 3px;
    min-height: 82px;
}

.typing-stage-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 255, 242, 0.15);
    transform: translateY(-1px);
}

.typing-stage-card.cleared {
    border-color: rgba(57, 255, 20, 0.3);
    background: rgba(57, 255, 20, 0.05);
}

.typing-stage-card.played {
    opacity: 1;
    cursor: pointer;
}

.typing-stage-card.played:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 255, 242, 0.15);
    transform: translateY(-1px);
}

.typing-stage-card .stage-num {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.typing-stage-card .stage-word {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
}

.typing-stage-card .stage-clear-badge {
    font-family: var(--font-display);
    font-size: 0.5rem;
    color: var(--neon-green);
    letter-spacing: 1px;
    text-shadow: var(--glow-green);
}

.typing-stage-card .stage-played-badge {
    font-family: var(--font-display);
    font-size: 0.45rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    opacity: 0.6;
}

.typing-stage-card .stage-top3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: 100%;
    margin-top: 2px;
}

.typing-stage-card .stage-rank {
    font-family: var(--font-mono);
    font-size: 0.45rem;
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.typing-stage-card .stage-rank-1 {
    color: #ffd700;
}

.typing-stage-card .stage-rank-2 {
    color: #c0c0c0;
    opacity: 0.8;
}

.typing-stage-card .stage-rank-3 {
    color: #cd7f32;
    opacity: 0.7;
}

.typing-org-total {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-green);
    margin: 8px 0 0;
    text-shadow: var(--glow-green);
}

/* === 게임 화면 === */
.typing-game {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.typing-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.typing-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.typing-back-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.typing-stage-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-stage-badge {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.typing-stage-word-display {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.typing-stage-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.typing-timer-area {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.typing-timer {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--neon-cyan);
    min-width: 36px;
    text-align: right;
}

.typing-timer-warning {
    color: var(--error) !important;
    animation: typing-timer-pulse 0.5s ease-in-out infinite;
}

@keyframes typing-timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.typing-timer-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === 워드 클라우드 (랜덤 흩뿌리기) === */
.typing-word-cloud {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.typing-cloud-word {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.1);
    transition: color 0.2s, text-shadow 0.2s;
    user-select: none;
    white-space: nowrap;
}

.typing-cloud-word-done {
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}

/* === 입력 영역 === */
.typing-input-area {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.typing-score-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 80px;
}

.typing-score-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

.typing-score-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.typing-input-wrapper {
    flex: 1;
}

.typing-input {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    transition: all 0.15s;
    box-sizing: border-box;
}

.typing-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 255, 242, 0.15);
}

.typing-input:disabled {
    opacity: 0.4;
}

.typing-input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2) !important;
}

.typing-input-success {
    border-color: var(--neon-green) !important;
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.2) !important;
}

.typing-input-shake {
    animation: typing-shake 0.3s ease;
}

@keyframes typing-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* === 카운트다운 오버레이 === */
.typing-countdown-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 23, 0.85);
    z-index: 10;
}

.typing-countdown-number {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.typing-countdown-animate {
    animation: typing-countdown-pop 0.8s ease-out;
}

@keyframes typing-countdown-pop {
    0% { transform: scale(1.5); opacity: 0; }
    30% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* === 결과 오버레이 === */
.typing-result-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 23, 0.9);
    z-index: 10;
}

.typing-result-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 32px;
    text-align: center;
    min-width: 320px;
    max-width: 400px;
    box-shadow: var(--card-shadow);
}

.typing-result-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
    letter-spacing: 2px;
}

.typing-result-score {
    margin-bottom: 8px;
}

.typing-result-number {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

.typing-result-unit {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

.typing-result-record {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.typing-result-clear {
    color: var(--neon-green);
    font-size: 1.4rem;
    animation: typing-clear-glow 1s ease-in-out infinite alternate;
}

@keyframes typing-clear-glow {
    from { text-shadow: 0 0 4px rgba(57, 255, 20, 0.4); }
    to { text-shadow: 0 0 20px rgba(57, 255, 20, 0.9); }
}

.typing-result-fail {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* === 랭킹 === */
.typing-ranking-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin: 16px 0 10px;
}

.typing-ranking-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.typing-ranking-top {
    background: rgba(255, 255, 255, 0.03);
}

.typing-ranking-rank {
    width: 28px;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-muted);
}

.typing-ranking-name {
    flex: 1;
    text-align: left;
    color: var(--text-primary);
}

.typing-ranking-score {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--neon-cyan);
}

.typing-ranking-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 12px 0;
}

/* === 결과 버튼 === */
.typing-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    justify-content: center;
}

.typing-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.typing-btn-primary {
    background: var(--neon-cyan);
    color: var(--bg-primary);
}

.typing-btn-primary:hover {
    box-shadow: var(--glow-cyan);
}

.typing-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.typing-btn-secondary:hover {
    border-color: var(--neon-cyan);
}

.typing-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.typing-btn-ghost:hover {
    color: var(--text-primary);
}

/* === 반응형 === */
@media (max-width: 768px) {
    .typing-stage-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }

    .typing-stage-card {
        min-height: 60px;
        padding: 6px 2px;
    }

    .typing-stage-card .stage-word {
        font-size: 0.7rem;
    }

    .typing-cloud-word {
        font-size: 0.9rem;
    }

    .typing-input {
        font-size: 1rem;
    }

    .typing-result-card {
        min-width: auto;
        margin: 0 16px;
    }
}

/* CodeMirror 주석 색상 오버라이드 */
.cm-s-material-darker .cm-comment {
    color: #ccc !important;
}

/* ============================================================
   커뮤니티(모두의 문제) 스타일
   ============================================================ */

/* 상단 액션 바 */
.community-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-community-create {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15), rgba(0, 255, 242, 0.05));
    border: 1px solid rgba(0, 255, 242, 0.3);
    color: var(--neon-cyan);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    height: 36px;
    flex-shrink: 0;
    margin-left: 8px;
}

.btn-community-create:hover {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.25), rgba(0, 255, 242, 0.1));
    border-color: rgba(0, 255, 242, 0.5);
    transform: translateY(-1px);
}

.btn-community-create-small {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 14px;
    background: rgba(0, 255, 242, 0.1);
    border: 1px solid rgba(0, 255, 242, 0.3);
    color: var(--neon-cyan);
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-community-create-small:hover {
    background: rgba(0, 255, 242, 0.2);
}

/* 검색 */
.community-search-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    position: relative;
}

.community-search-input {
    flex: 1;
    padding: 7px 30px 7px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.community-search-input:focus {
    border-color: rgba(0, 255, 242, 0.4);
}

.community-search-btn {
    padding: 7px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    height: 36px;
}

.community-search-btn:hover {
    color: var(--neon-cyan);
    border-color: rgba(0, 255, 242, 0.4);
}

.community-search-clear {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.community-search-clear:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.community-search-status {
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.community-search-status .search-status-keyword {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* 필터 & 정렬 바 */
.community-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.community-difficulty-tabs {
    display: flex;
    gap: 4px;
}

.community-tab {
    padding: 5px 14px 6px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.community-tab:hover {
    border-color: rgba(0, 255, 242, 0.3);
    color: var(--text-primary);
}

.community-tab.active {
    background: rgba(0, 255, 242, 0.1);
    border-color: rgba(0, 255, 242, 0.4);
    color: var(--neon-cyan);
}

.community-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.community-sort-wrap .btn-filter {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: normal;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s;
}

.community-sort-select {
    padding: 4px 10px 5px 10px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}

/* 문제 카드 목록 */
.community-problem-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .community-problem-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .community-problem-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .community-problem-list {
        grid-template-columns: 1fr;
    }
}

.community-card {
    position: relative;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.community-favorite-btn {
    position: absolute;
    top: 17px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
}

.community-favorite-btn:hover {
    opacity: 1;
}

.community-favorite-btn.active {
    color: #ffd700;
    opacity: 1;
}

.community-card:hover {
    border-color: rgba(0, 255, 242, 0.2);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px);
}

.community-card.solved {
    border-left: 3px solid rgba(76, 175, 80, 0.5);
}

.community-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.community-card-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.community-difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.community-solved-mark {
    color: #4caf50;
    font-weight: bold;
    font-size: 1rem;
}

.community-hot {
    font-size: 0.85rem;
}

.community-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.community-creator {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.community-solve-count {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.community-card-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.community-keyword {
    display: inline-block;
    padding: 1px 7px;
    background: rgba(0, 255, 242, 0.06);
    border: 1px solid rgba(0, 255, 242, 0.15);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: rgba(0, 255, 242, 0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.community-keyword:hover {
    background: rgba(0, 255, 242, 0.15);
    border-color: rgba(0, 255, 242, 0.4);
    color: var(--neon-cyan);
}

.community-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    justify-content: flex-end;
}

.community-edit-btn,
.community-delete-btn {
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.community-edit-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

.community-edit-btn:hover {
    border-color: rgba(0, 255, 242, 0.4);
    color: var(--neon-cyan);
}

.community-delete-btn {
    background: rgba(239, 83, 80, 0.05);
    border: 1px solid rgba(239, 83, 80, 0.2);
    color: rgba(239, 83, 80, 0.7);
}

.community-delete-btn:hover {
    background: rgba(239, 83, 80, 0.15);
    border-color: rgba(239, 83, 80, 0.5);
    color: #ef5350;
}

/* 빈 상태 & 로딩 */
.community-empty,
.community-loading {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

/* 페이지네이션 */
.community-pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.community-page-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

.community-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.community-page-btn:hover {
    border-color: rgba(0, 255, 242, 0.3);
    color: var(--text-primary);
}

.community-page-btn.active {
    background: rgba(0, 255, 242, 0.1);
    border-color: rgba(0, 255, 242, 0.4);
    color: var(--neon-cyan);
}

.community-page-arrow {
    padding: 0;
    width: 32px;
    border-radius: 50%;
}

.community-page-arrow svg {
    display: block;
}

/* 삭제 경고 */
.community-delete-warning {
    color: #ef5350;
    font-size: 0.85rem;
    margin-top: 8px;
}

.btn-danger {
    background: rgba(239, 83, 80, 0.2) !important;
    border-color: rgba(239, 83, 80, 0.5) !important;
    color: #ef5350 !important;
}

.btn-danger:hover {
    background: rgba(239, 83, 80, 0.35) !important;
}

/* ============================================================
   커뮤니티 - 문제 출제/수정 페이지
   ============================================================ */

/* ========== 출제 페이지: 3단 레이아웃 ========== */
.community-create-main {
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 30px 30px 30px 30px;
}

.community-create-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    flex-shrink: 0;
}

.community-create-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* 3단 그리드 */
.community-create-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr 0.9fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.community-col {
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.community-col::-webkit-scrollbar {
    width: 4px;
}

.community-col::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* 폼 그룹 (컴팩트) */
.community-form-group {
    margin-bottom: 10px;
}

.community-form-group > label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.community-form-group > label small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.community-form-group .required {
    color: #ef5350;
}

.community-form-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.community-form-input:focus {
    border-color: rgba(0, 255, 242, 0.4);
}

.community-form-textarea {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    outline: none;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.community-form-textarea:focus {
    border-color: rgba(0, 255, 242, 0.4);
}

.char-count {
    display: block;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 테스트케이스 (컴팩트) */
.community-testcase {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
}

.community-testcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.community-testcase-header span {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.community-testcase-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 1px 5px;
    border-radius: 3px;
    transition: all 0.2s;
}

.community-testcase-remove:hover {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.1);
}

.community-testcase-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.community-testcase-field label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.community-testcase-field textarea {
    width: 100%;
    padding: 4px 7px;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.community-testcase-field textarea:focus {
    border-color: rgba(0, 255, 242, 0.3);
}

/* 추가 버튼 */
.btn-community-add {
    padding: 4px 12px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.btn-community-add:hover {
    border-color: rgba(0, 255, 242, 0.3);
    color: var(--neon-cyan);
}

/* CodeMirror 에디터 - 크기 변형 */
.community-code-editor {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.community-code-sm .CodeMirror {
    height: 70px;
    font-size: 0.82rem;
}

.community-code-md .CodeMirror {
    height: 120px;
    font-size: 0.82rem;
}

/* 힌트 (컴팩트) */
.community-vocab-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.community-vocab-hint input {
    flex: 1;
    padding: 5px 8px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    outline: none;
    box-sizing: border-box;
}

.community-vocab-hint input:focus {
    border-color: rgba(0, 255, 242, 0.3);
}

/* 동의 체크박스 (컴팩트) */
.community-agreement {
    margin: 10px 0 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

.community-agreement-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 5px;
}

.community-agreement-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--neon-cyan);
}

.community-agreement-list {
    margin: 0;
    padding-left: 28px;
    list-style: disc;
}

.community-agreement-list li {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 순차 버튼 (① → ② → ③) */
.community-step-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.btn-community-step {
    width: 100%;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-community-step:hover:not(:disabled) {
    border-color: rgba(0, 255, 242, 0.3);
    color: var(--neon-cyan);
}

.btn-community-step:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-community-step.step-done {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.3);
    color: #66bb6a;
}

.btn-community-submit-final {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.15), rgba(0, 255, 242, 0.05));
    border-color: rgba(0, 255, 242, 0.3);
    color: var(--neon-cyan);
}

.btn-community-submit-final:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 255, 242, 0.25), rgba(0, 255, 242, 0.1));
}

/* 결과 영역 */
.community-result-area {
    margin-top: 8px;
}

.community-result-loading {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.82rem;
}

.community-result-success {
    padding: 12px;
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
}

.community-result-success h3 {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    color: #4caf50;
    margin-bottom: 6px;
}

.community-result-success p {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 3px 0;
}

.community-result-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.community-result-error {
    padding: 12px;
    background: rgba(239, 83, 80, 0.08);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: 6px;
}

.community-result-error h3 {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    color: #ef5350;
    margin-bottom: 6px;
}

.community-result-error p {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 3px 0;
}

.community-result-diff {
    margin: 6px 0;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: 5px;
}

.community-result-diff div {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 3px 0;
}

.community-result-diff code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--text-primary);
}

.community-result-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* 반응형 */
@media (max-width: 1200px) {
    .community-create-grid {
        grid-template-columns: 1fr 1.2fr 0.8fr;
        gap: 12px;
    }
}

@media (max-width: 900px) {
    .community-create-main {
        height: auto;
        overflow: visible;
    }

    .community-create-grid {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .community-col {
        overflow: visible;
    }

    .community-code-sm .CodeMirror {
        height: 80px;
    }

    .community-code-md .CodeMirror {
        height: 150px;
    }
}

@media (max-width: 640px) {
    .community-action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .community-search-wrap {
        max-width: 100%;
    }

    .community-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .community-sort-wrap {
        flex-wrap: wrap;
    }

    .community-testcase-fields {
        grid-template-columns: 1fr;
    }
}

