:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-highlight: rgba(0, 0, 0, 0.015);
    --card-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    background: radial-gradient(circle at 50% 0%, #f1f5f9 0%, #f8fafc 100%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
    transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.8s cubic-bezier(0.16, 1, 0.3, 1), color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 배경 캔버스 */
.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bg-canvas.active {
    opacity: 1;
}

/* 배경 선택 패널 */
.bg-selector-panel {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0.75rem;
    padding: 0.5rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.bg-selector-panel:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.1);
}

.bg-label {
    font-weight: 700;
    color: #4f46e5;
    letter-spacing: -0.02em;
}

.bg-select {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0.35rem;
    transition: background 0.2s;
}

.bg-select:hover {
    background: rgba(99, 102, 241, 0.08);
}

.bg-select option {
    background: #ffffff;
    color: #1e293b;
}

/* 마우스 좌표 HUD */
.hud-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 0.75rem;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #4f46e5;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05), 0 0 10px rgba(99, 102, 241, 0.03);
    display: flex;
    gap: 0.8rem;
    align-items: center;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.hud-label {
    opacity: 0.6;
    font-weight: 700;
    color: var(--text-primary);
}

.hud-value {
    font-weight: 600;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.1);
}

/* 메인 컨테이너 카드 */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 44rem;
    padding: 3rem;
    box-shadow: var(--card-shadow);
    z-index: 10;
}

/* 헤더 섹션 */
.header-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.title-gradient {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 50%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1.2rem;
}

.time-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 9999px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.time-label {
    color: var(--text-secondary);
}

.time-value {
    color: var(--accent-blue);
    font-weight: 600;
}

/* 주요 서비스 섹션 */
.links-section {
    margin-bottom: 3rem;
}

.links-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.2rem;
    padding-left: 0.2rem;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    list-style: none;
}

@media (min-width: 640px) {
    .nav-links {
        grid-template-columns: 1fr 1fr;
    }
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: var(--glass-highlight);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(139, 92, 246, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 0;
}

.nav-item:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.08), 0 0 1px 1px rgba(139, 92, 246, 0.05) inset;
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item:active {
    transform: translateY(0);
}

.nav-item .icon {
    font-size: 1.4rem;
    margin-right: 1rem;
    z-index: 1;
    transition: transform 0.25s ease;
}

.nav-item:hover .icon {
    transform: scale(1.15) rotate(5deg);
}

.nav-item .fan {
    width: 1.4rem;
    height: 1.4rem;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.5s ease, color 0.5s ease;
}

.nav-item .label {
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 1;
    flex-grow: 1;
}

.nav-item .desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    z-index: 1;
    font-weight: 400;
}

.status-badge-mini {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.status-off {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.status-on {
    background: #dcfce7;
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.1);
}



.fan {
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease, color 0.5s ease;
    color: #64748b;
}

.fan.spinning {
    animation: spin 2s linear infinite;
    color: #06b6d4;
}

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

/* ==========================================
   6. 3D 코스믹 오로라 성운 라이트 모드 스타일
   ========================================== */
body.bg-3d-active {
    background-color: #f1f5f9;
    background: radial-gradient(circle at 50% 50%, #f6f3ff 0%, #f8fafc 100%);
    color: #0f172a;
}

/* 3D 모드 글래스모피즘 카드 (화사한 밀크 글래스) */
body.bg-3d-active .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(99, 102, 241, 0.12);
    box-shadow: 0 30px 65px -15px rgba(99, 102, 241, 0.08), 
                0 0 0 1px rgba(99, 102, 241, 0.02);
}

/* 3D 모드 서브 텍스트 보정 */
body.bg-3d-active .subtitle,
body.bg-3d-active .links-section h2,
body.bg-3d-active .time-label,
body.bg-3d-active .nav-item .desc {
    color: #475569;
}

/* 3D 모드 헤더 시간 배지 */
body.bg-3d-active .time-badge {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.08);
}

body.bg-3d-active .time-value {
    color: #4f46e5;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.12);
}

/* 3D 모드 배경 선택기 및 HUD */
body.bg-3d-active .bg-selector-panel,
body.bg-3d-active .hud-container {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.05);
}

body.bg-3d-active .bg-select {
    color: #1e293b;
}

body.bg-3d-active .bg-select option {
    background: #ffffff;
    color: #1e293b;
}

body.bg-3d-active .bg-select:hover {
    background: rgba(99, 102, 241, 0.08);
}

/* 3D 모드 내비게이션 아이템 카드 */
body.bg-3d-active .nav-item {
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(99, 102, 241, 0.06);
    color: #0f172a;
}

body.bg-3d-active .nav-item:hover {
    border-color: rgba(139, 92, 246, 0.28);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.08), 
                0 0 1px 1px rgba(139, 92, 246, 0.05) inset;
}

body.bg-3d-active .nav-item::before {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

/* 3D 모드 팬 아이콘 색상 보정 */
body.bg-3d-active .fan {
    color: #64748b;
}

body.bg-3d-active .fan.spinning {
    color: #06b6d4;
}

/* 3D 모드 에어컨 상태 배지 */
body.bg-3d-active .status-off {
    background: #fee2e2;
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.1);
}

body.bg-3d-active .status-on {
    background: #dcfce7;
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.1);
}

