/* ==========================================
   🔒 전역 기본기 세팅 및 잔상/복제 완벽 차단 + 💡 전역 스크롤바 디자인
   ========================================== */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    
    /* 드래그 및 복제 차단 */
    user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;
    
    /* 모바일/PC 클릭 및 터치 시 발생하는 네모난 하이라이트 잔상 완전 제거 */
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
    outline: none !important;
    
    /* 파이어폭스 브라우저 스크롤바 대응 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 180, 216, 0.25) transparent;
}

/* 🚨 폼 요소(글쓰기/수정) 입력 활성화 (드래그/터치 차단 강제 예외 처리) */
input, textarea, select, option {
    user-select: auto !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    pointer-events: auto !important;
}

/* 모든 버튼류 터치 인식률 100% 보장 및 모바일 터치 딜레이 제거 */
button, .mgmt-btn, .tab-btn {
    position: relative;
    z-index: 50 !important; 
    pointer-events: auto !important;
    touch-action: manipulation !important; 
}

/* ✨ 크롬, 사파리, 엣지 전역 스크롤바 커스텀 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 180, 216, 0.25); border-radius: 10px; transition: background 0.3s, box-shadow 0.3s; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 180, 216, 0.5); box-shadow: 0 0 8px rgba(0, 180, 216, 0.3); }

button:focus, input:focus, textarea:focus, select:focus, a:focus,
button:active, input:active, textarea:active, select:active, a:active { outline: none !important; -webkit-tap-highlight-color: transparent !important; }
:focus-visible { outline: none !important; }

html { height: 100%; overflow: hidden; }
html, body { height: 100%; background-color: #02050d; }

body {
    color: #f1f5f9; overflow-x: hidden; position: relative;
    height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; 
    background-size: cover !important; background-repeat: no-repeat !important; background-position: center !important;
}

/* ==========================================
   🌅 유기적 밤바다 배경 레이어
   ========================================== */
.ocean-background { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; 
    isolation: isolate; -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0);
}
.ocean-deep-water { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent !important; }
.yoonseul-sunlight {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% -5%, rgba(255, 107, 61, 0.35) 0%, rgba(247, 163, 127, 0.15) 30%, rgba(0, 180, 216, 0.04) 60%, transparent 80%);
    animation: sunlightPulse 12s ease-in-out infinite alternate; -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.wave-ripple {
    position: absolute; top: -10%; left: -20%; width: 140%; height: 70%;
    background: radial-gradient(ellipse at 50% 20%, rgba(144, 224, 239, 0.09) 0%, transparent 70%),
                radial-gradient(ellipse at 30% 40%, rgba(255, 138, 101, 0.06) 0%, transparent 60%);
    mix-blend-mode: screen; filter: blur(1px); -webkit-backface-visibility: hidden; backface-visibility: hidden;
}

.ripple1 { opacity: 0.85; animation: waveSwell 24s ease-in-out infinite alternate; }
.ripple2 { opacity: 0.6; background: radial-gradient(ellipse at 70% 30%, rgba(0, 180, 216, 0.08) 0%, transparent 60%); animation: waveSwellReverse 18s ease-in-out infinite alternate; }
.ripple3 { opacity: 0.45; background: radial-gradient(ellipse at 40% 15%, rgba(255, 171, 64, 0.05) 0%, transparent 50%); animation: wavePulse 10s ease-in-out infinite alternate; }

@keyframes sunlightPulse { 0% { transform: translate3d(0, -1%, 0) scale(0.98); } 100% { transform: translate3d(0, 1%, 0) scale(1.02); } }
@keyframes waveSwell { 0% { transform: translate3d(-1.5%, -1%, 0) rotate(-1deg) scaleY(0.96); } 100% { transform: translate3d(1.5%, 1%, 0) rotate(1deg) scaleY(1.04); } }
@keyframes waveSwellReverse { 0% { transform: translate3d(1.5%, -0.5%, 0) rotate(1deg) scaleY(1.04); } 100% { transform: translate3d(-1.5%, 0.5%, 0) rotate(-1deg) scaleY(0.96); } }
@keyframes wavePulse { 0% { opacity: 0.3; transform: translate3d(0, 0.5%, 0) scale(0.97); } 100% { opacity: 0.7; transform: translate3d(0, -0.5%, 0) scale(1.03); } }

/* ==========================================
   🎵 고정 컴포넌트 삼각 정렬 및 위젯
   ========================================== */
.mini-audio-player, .mini-backup-manager, .mini-library-btn {
    position: fixed; z-index: 9999;
    padding: 10px 18px; border-radius: 30px;
    background: rgba(6, 15, 31, 0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s, box-shadow 0.25s;
}

.mini-audio-player {
    bottom: 30px; right: 30px; border: 1px solid rgba(144, 224, 239, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 180, 216, 0.2);
}
.mini-audio-player:hover { transform: scale(1.03); border-color: #00b4d8; box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 245, 212, 0.4); }

.mini-backup-manager {
    bottom: 30px; left: 30px; border: 1px solid rgba(247, 163, 127, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(247, 163, 127, 0.15);
}
.mini-backup-manager:hover { transform: scale(1.03); border-color: #f7a37f; box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 138, 101, 0.35); }

/* ==========================================
   📖 서재 지침서 - 둥둥 뜬 상태로 본문 정중앙 정렬 (스크롤바 오프셋 완벽 보정)
   ========================================== */
.mini-library-btn {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    
    z-index: 9999 !important;
    padding: 10px 22px !important;
    border-radius: 30px !important;
    background: rgba(6, 15, 31, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    border: 1px solid rgba(144, 224, 239, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 15px rgba(0, 180, 216, 0.2) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s, box-shadow 0.25s !important;
}

.mini-library-btn:hover {
    transform: translate3d(-50%, -4px, 0) scale(1.03) !important;
    border-color: #90e0ef !important;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(144, 224, 239, 0.45) !important;
}

/* 💻 데스크탑 전용 스크롤바 시각적 오프셋 완벽 보정 */
@media (min-width: 769px) {
    .mini-library-btn {
        /* 우측 스크롤바 두께(약 17px)로 인해 푸터 중앙과 틀어지는 현상을 
           절반 두께(-8.5px)만큼 왼쪽으로 견인하여 완벽히 수직 일치시킵니다. */
        left: calc(50% - 7px) !important;
    }
}

/* 📱 모바일 디바이스 레이아웃 (스크롤바가 물리적 공간을 차지하지 않음) */
@media (max-width: 768px) {
    .mini-library-btn {
        bottom: 20px !important;
        padding: 8px 16px !important;
        left: 50% !important;
    }
    .mini-library-btn:hover {
        transform: translate3d(-50%, -2px, 0) scale(1.02) !important;
    }
}


.vinyl-disc { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #b89df5 0%, #90e0ef 100%); display: flex; justify-content: center; align-items: center; position: relative; flex-shrink: 0; will-change: transform; }
.vinyl-groove { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #030d1e; background: transparent; opacity: 0.85; }
.vinyl-center-hole { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #030d1e; }
.mini-audio-player.playing .vinyl-disc { animation: vinylRotate 3.5s linear infinite; }
@keyframes vinylRotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.backup-core-icon { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #ffd4ba 0%, #f7a37f 100%); display: flex; justify-content: center; align-items: center; position: relative; flex-shrink: 0; }
.backup-spin-ring { width: 18px; height: 18px; border-radius: 50%; border: 2px dashed #030d1e; background: transparent; opacity: 0.75; animation: vinylRotate 10s linear infinite; }
.backup-center-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #030d1e; }

.library-core-icon { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #90e0ef 0%, #0284c7 100%); display: flex; justify-content: center; align-items: center; flex-shrink: 0; font-size: 1.15rem; }

/* ==========================================
   🐚 소라게 (랜덤 메모리) 버튼
   ========================================== */
#random-memory-btn {
    position: fixed; z-index: 9999; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    background: rgba(6, 15, 31, 0.9); border: 1px solid rgba(144, 224, 239, 0.25); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    bottom: 30px; left: 30px; right: auto !important; 
    width: 72px; height: 56px; padding: 0; border-radius: 30px; font-size: 24px; 
}
#random-memory-btn:hover { transform: scale(1.05); border-color: #00b4d8; box-shadow: 0 6px 20px rgba(0, 180, 216, 0.3); }

body.admin-logged-in #random-memory-btn {
    bottom: 105px; left: 38px; width: 40px; height: 40px; border-radius: 50%; font-size: 18px;
}

@media (max-width: 768px) {
    #random-memory-btn { 
        bottom: 20px !important; left: 20px !important; right: auto !important; 
        width: 60px !important; height: 48px !important; padding: 0 !important; 
        border-radius: 30px !important; font-size: 20px !important; 
    }
    body.admin-logged-in #random-memory-btn { 
        bottomed80px !important; left: 26px !important; 
        width: 36px !important; height: 36px !important; 
        border-radius: 50% !important; font-size: 16px !important; 
    }
}

/* ==========================================
   ⏳ 로딩 화면
   ========================================== */
#loading-screen { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #02050d; display: flex; justify-content: center; align-items: center; 
    z-index: 99999; opacity: 1 !important; visibility: visible !important; pointer-events: auto;
    transition: opacity 0.4s ease, visibility 0.4s ease !important;
}
#loading-screen.fade-out { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.loader { position: relative; text-align: center; }
.sun-glow { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); width: 70px; height: 70px; background: radial-gradient(circle, #f7a37f 0%, transparent 70%); animation: pulse 2s infinite ease-in-out; }
.wave-loading { width: 44px; height: 44px; border: 3px solid transparent; border-top-color: #00b4d8; border-bottom-color: #f7a37f; border-radius: 50%; animation: spin 1.8s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(0.9); } 50% { opacity: 0.8; transform: translateX(-50%) scale(1.15); } }
#loading-screen p { color: #00b4d8; letter-spacing: 2px; font-size: 0.85rem; }

/* ==========================================
   🏛️ 메인 레이아웃 및 본문 구조
   ========================================== */
#app { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 60px 20px 20px 20px; }
header { text-align: center; margin-bottom: 40px; }
header .main-title {
    font-size: 3.2rem; font-weight: 800; letter-spacing: 8px; margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff 15%, #90e0ef 50%, #f7a37f 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(0, 180, 216, 0.2), 0 15px 35px rgba(2, 6, 15, 0.95);
}

header .subtitle { 
    font-size: 1rem; 
    letter-spacing: 2px; 
    font-weight: 500;
    background: linear-gradient(135deg, #ffb796 0%, #ffffff 50%, #90e0ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(255, 183, 150, 0.35);
}

.auth-box { margin-top: 25px; display: flex; justify-content: center; align-items: center; width: 100%; }
.auth-flex { display: flex; justify-content: center; align-items: center; gap: 10px; }

.view-tab-container { display: flex; justify-content: center; gap: 15px; margin-top: 35px; }
.tab-btn {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8; border-radius: 30px; padding: 10px 26px; font-size: 0.92rem;
    cursor: pointer; transition: all 0.3s ease; letter-spacing: 0.5px;
}
.tab-btn:hover { color: #fff; border-color: rgba(0, 180, 216, 0.4); background: rgba(255,255,255,0.05); }
.tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.2), rgba(247, 163, 127, 0.1));
    border-color: #00b4d8; color: #00b4d8; font-weight: bold; box-shadow: 0 0 15px rgba(0, 180, 216, 0.15);
}

button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
    color: #e2e8f0; border: 1px solid rgba(0, 180, 216, 0.2);
    padding: 8px 24px; border-radius: 20px; cursor: pointer; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    transition: border-color 0.25s, color 0.25s, box-shadow 0.25s; font-size: 0.85rem;
}
button:hover { border-color: #00b4d8; color: #fff; box-shadow: 0 0 12px rgba(0, 180, 216, 0.35); transform: translateY(-1.5px); }
.danger-btn { border-color: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.danger-btn:hover { border-color: #ef4444; color: #fff; box-shadow: 0 0 12px rgba(239, 68, 68, 0.3); }

.centered-title { 
    text-align: center; font-size: 1.7rem !important; font-weight: 600 !important; 
    letter-spacing: 4px; margin-bottom: 12px !important; width: 100%;
    background: linear-gradient(135deg, #a9efff 0%, #ffd4ba 60%, #ff9e79 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 12px rgba(0, 180, 216, 0.25); border-bottom: none !important; padding-bottom: 0 !important;
}

/* 🔍 검색창 및 필터 통합 레이아웃 */
.search-wrapper {
    width: 100%; max-width: 800px; margin: 0 auto 40px auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; 
}
.author-stats { display: flex; gap: 8px; justify-content: center; width: 100%; }
.stat-badge {
    background: rgba(0, 180, 216, 0.08); border: 1px solid rgba(0, 180, 216, 0.25);
    color: #90e0ef; padding: 0 18px; border-radius: 25px; font-size: 0.85rem; letter-spacing: 0.5px;
    height: 44px; display: flex; align-items: center; justify-content: center;
}
.search-container { width: 100%; max-width: 450px; padding: 0; margin: 0; display: flex; justify-content: center; }
#search-input {
    width: 100%; height: 44px; margin: 0 auto; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(0, 180, 216, 0.15);
    border-radius: 25px; padding: 0 20px; color: #ffffff; font-size: 0.9rem; outline: none; text-align: center; transition: all 0.25s ease;
}
#search-input:focus { border-color: #00b4d8; background: rgba(3, 10, 23, 0.85); box-shadow: 0 0 10px rgba(0, 180, 216, 0.2); }

.author-filter-container { width: 100%; text-align: center; }
#author-filter {
    display: block; height: 44px; width: 100%; max-width: 250px; -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-color: rgba(255, 255, 255, 0.03);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 20px center; background-size: 16px;
    border: 1px solid rgba(0, 180, 216, 0.15); color: #e2e8f0; padding: 0 45px 0 20px; 
    border-radius: 25px; font-size: 0.85rem; outline: none; cursor: pointer; transition: all 0.25s ease; margin: 0 auto; 
}
#author-filter:focus { border-color: #00b4d8; box-shadow: 0 0 10px rgba(0, 180, 216, 0.2); background-color: rgba(3, 10, 23, 0.85); }
#author-filter option { background: #030a16; color: #fff; }

#write-section, #letter-section {
    background: rgba(8, 19, 38, 0.85); border: 1px solid rgba(0, 180, 216, 0.15);
    padding: 30px; border-radius: 18px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    margin-bottom: 45px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
#write-section h3, #letter-section h3 { margin-bottom: 20px; color: #00b4d8; font-weight: 400; font-size: 1.05rem; letter-spacing: 0.5px; }

.write-buttons { display: flex; gap: 10px; }

input[type="text"], input[type="password"], textarea, select {
    width: 100%; background: rgba(3, 10, 23, 0.75); border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px; padding: 14px; color: #fff; margin-bottom: 16px; outline: none; transition: all 0.25s;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus { 
    border-color: #00b4d8; background: rgba(3, 10, 23, 0.9); 
}

.terms-container { margin-bottom: 20px; text-align: left; }
.terms-box { background: rgba(3, 10, 23, 0.5); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 14px; color: #94a3b8; font-size: 0.82rem; line-height: 1.6; margin-bottom: 12px; }
.terms-label { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 0.88rem; cursor: pointer; }
.terms-label input[type="checkbox"] { cursor: pointer; width: 16px; height: 16px; accent-color: #00b4d8; }

/* ==========================================
   🖼️ 리스트 및 그리드 갤러리 뷰 포맷
   ========================================== */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 30px; width: 100%; }
.post-card {
    background: linear-gradient(135deg, rgba(8, 22, 46, 0.95) 0%, rgba(4, 12, 28, 0.9) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.04); padding: 25px; border-radius: 16px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    position: relative; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    height: 250px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; word-break: break-all; 
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(0, 180, 216, 0.25); box-shadow: 0 12px 30px rgba(0, 180, 216, 0.15); }
.post-card h3 { color: #ffffff !important; margin-bottom: 12px; font-size: 1.22rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }

.post-content-area { 
    color: #cbd5e1 !important; line-height: 1.65; font-size: 0.92rem; white-space: pre-line; 
    flex-grow: 1; margin-bottom: 15px; text-align: justify; 
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; 
}
.post-content-area *, .post-content-area span, .post-content-area p {
    color: #cbd5e1 !important; font-size: inherit !important; line-height: inherit !important; background: transparent !important;
}

.post-footer { 
    display: flex; justify-content: space-between; align-items: center; 
    flex-shrink: 0; border-top: 1px solid rgba(255, 255, 255, 0.04); 
    padding-top: 12px; gap: 10px; 
    position: relative; z-index: 40; 
}

.post-card .date { font-size: 0.78rem; color: #94a3b8 !important; line-height: 1.4; word-break: keep-all; }
.card-mgmt-btns { display: flex; gap: 6px; flex-shrink: 0; }

.mgmt-btn { 
    padding: 4px 12px; border-radius: 8px; font-size: 0.75rem; 
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); 
    color: #cbd5e1; cursor: pointer; white-space: nowrap; flex-shrink: 0; 
}

/* 🔄 갤러리 모드 원본 규격 완전 롤백 포맷 */
.posts-grid-view { 
    display: grid !important; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; 
    gap: 20px !important; 
    width: 100% !important; 
    box-sizing: border-box; 
}
.posts-grid-view .post-card { margin: 0 !important; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }

/* ==========================================
   📱 모바일 디바이스 최적화
   ========================================== */
@media (max-width: 900px) { .posts-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) {
    #app { padding: 40px 14px 20px 14px; }
    header .main-title { font-size: 2.3rem; letter-spacing: 5px; }
    .wave-ripple { height: 55%; opacity: 0.7; }
    .posts-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 20px; }
    .post-card { padding: 20px; height: 230px; }
    .post-card h3 { font-size: 1.15rem; }
    .post-content-area { font-size: 0.88rem; -webkit-line-clamp: 3; }
    
    .mini-audio-player { bottom: 20px; right: 20px; padding: 8px 14px; }
    .vinyl-disc { width: 32px; height: 32px; }
    .mini-backup-manager { bottom: 20px; left: 20px; padding: 8px 14px; }
    .backup-core-icon { width: 32px; height: 32px; }
    .mini-library-btn { bottom: 20px; padding: 8px 16px; }
    .library-core-icon { width: 30px; height: 30px; font-size: 1rem; }
    
    #write-section, #letter-section { padding: 20px; }
    .author-stats { justify-content: center; order: -1; }
    .search-container { max-width: 100%; }
}

/* ==========================================
   📦 모달 및 알림 팝업 프레임
   ========================================== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(2, 6, 15, 0.9); z-index: 99999999 !important; justify-content: center; align-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-content { background: linear-gradient(145deg, #0a1b36, #040d1c) !important; border: 1px solid rgba(0, 180, 216, 0.2); padding: 35px; border-radius: 18px; width: 90%; max-width: 420px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.7); animation: popupScale 0.25s cubic-bezier(0.25, 1, 0.5, 1); }
@keyframes popupScale { 0% { transform: scale(0.95); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.modal-content h3 { margin-bottom: 20px; color: #fff; font-weight: 400; font-size: 1.25rem; letter-spacing: 0.5px; }
.modal-content input { width: 100%; padding: 12px; margin-bottom: 14px; background: rgba(0,0,0,0.45); border: 1px solid rgba(255, 255, 255, 0.05); color: #fff; border-radius: 6px; outline: none; }

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

.backup-modal-content { max-width: 540px !important; }
.backup-timeline-wrapper { max-height: 280px; overflow-y: auto; padding-right: 5px; margin: 15px 0; }

.backup-item { background: rgba(255, 255, 255, 0.02) !important; border: 1px solid rgba(255, 255, 255, 0.05) !important; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; display: flex !important; justify-content: space-between !important; align-items: center !important; text-align: left; transition: all 0.2s; }
.backup-item:hover { background: rgba(247, 163, 127, 0.05) !important; border-color: rgba(247, 163, 127, 0.2) !important; }
.backup-meta { flex-grow: 1; padding-right: 15px; }
.backup-time-title { font-size: 0.88rem; color: #fff !important; font-weight: 400; margin-bottom: 3px; }
.backup-badge-type { font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 6px; display: inline-block; }
.backup-badge-type.auto { background: rgba(0, 180, 216, 0.15) !important; color: #90e0ef !important; }
.backup-badge-type.manual { background: rgba(247, 163, 127, 0.15) !important; color: #f7a37f !important; }
.backup-counts { font-size: 0.76rem; color: #94a3b8 !important; }

.admin-tab-header-node { display: flex !important; border-bottom: 1px solid rgba(255,255,255,0.1) !important; margin-bottom: 20px; width: 100%; }
.admin-tab-node-btn { flex: 1; background: transparent; border: none; padding: 12px; cursor: pointer; font-weight: bold; font-size: 0.9rem; transition: all 0.25s ease; outline: none; }

.detail-popup-header { text-align: left; margin-bottom: 15px; border-bottom: 1px solid rgba(0, 180, 216, 0.15); padding-bottom: 12px; }
.detail-popup-header h3 { margin-bottom: 6px; font-size: 1.3rem; white-space: normal; line-height: 1.4; text-align: left; color:#fff !important; }
.detail-popup-header span { font-size: 0.8rem; color: #94a3b8 !important; }

.detail-popup-body { text-align: left; margin-bottom: 20px; }

#detail-text { color: #cbd5e1 !important; line-height: 1.75; font-size: 0.95rem; white-space: pre-wrap; max-height: 260px; overflow-y: auto; padding-right: 8px; text-align: justify; }
#detail-text *, #detail-text p, #detail-text span { color: #cbd5e1 !important; font-size: inherit !important; line-height: inherit !important; background: transparent !important; }

.system-modal-box p { color: #cbd5e1 !important; font-size: 0.95rem; line-height: 1.6; margin-bottom: 10px; white-space: pre-wrap; text-align: center; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 50px; flex-wrap: wrap; }
.page-btn { width: 34px; height: 34px; display: flex; justify-content: center; align-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.06); color: #cbd5e1; cursor: pointer; transition: all 0.25s; font-size: 0.85rem; }
.page-btn:hover { background: rgba(0, 180, 216, 0.15); color: #00b4d8; border-color: #00b4d8; }
.page-btn.active { background: linear-gradient(135deg, #00b4d8, #005f73) !important; color: #02050d !important; border-color: #00b4d8; box-shadow: 0 0 12px rgba(0, 180, 216, 0.45); font-weight: bold; }
.cancel-btn { background: rgba(255,255,245,0.04); border-color: rgba(255,255,255,0.08); color: #bbb; }

/* ==========================================
   🌌 푸터 및 저작권 표기 영역
   ========================================== */
footer { 
    position: relative; z-index: 10; text-align: center; margin-top: 60px; 
    padding: 35px 0 93px 0; color: #94a3b8; font-size: 0.85rem; letter-spacing: 2px; font-weight: 400; 
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); text-shadow: 0 0 8px rgba(144, 224, 239, 0.15); user-select: none; cursor: default;
}
footer p, footer span { color: inherit; font-size: inherit; }
footer::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 70%; max-width: 500px; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 180, 216, 0.4) 50%, transparent 100%); box-shadow: 0 1px 10px rgba(0, 180, 216, 0.2);
}
footer::after {
    content: '✦'; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
    color: rgba(144, 224, 239, 0.7); font-size: 0.7rem; text-shadow: 0 0 8px rgba(0, 180, 216, 0.6); animation: starTwinkle 3s infinite alternate;
}
footer:hover { color: #ffffff; text-shadow: 0 0 12px rgba(144, 224, 239, 0.8), 0 0 25px rgba(247, 163, 127, 0.4); transform: translateY(-2px); }

@keyframes starTwinkle { 0% { opacity: 0.4; transform: translateX(-50%) scale(0.9); } 100% { opacity: 1; transform: translateX(-50%) scale(1.1); } }

@media (max-width: 768px) {
    footer { padding: 35px 0 75px 0 !important; font-size: 0.78rem; letter-spacing: 1.5px; }
    footer::before { width: 85%; }
}

.update-toast {
    position: fixed; top: -200px; left: 50%; transform: translateX(-50%); background: rgba(6, 15, 31, 0.95); border: 1px solid rgba(0, 180, 216, 0.4);
    padding: 16px 24px; border-radius: 14px; z-index: 100000; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 180, 216, 0.2);
    display: flex; flex-direction: column; align-items: center; gap: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); text-align: center; width: 90%; max-width: 320px;
}
.update-toast.show { top: 40px; }
.update-toast p { color: #fff; font-size: 0.9rem; line-height: 1.5; margin: 0; letter-spacing: 0.5px; }
.update-buttons { display: flex; gap: 10px; width: 100%; justify-content: center; }
.update-buttons button { padding: 8px 20px; font-size: 0.85rem; width: 100%; }

body.no-scroll { overflow: hidden; touch-action: none; }

@media (max-width: 768px) {
    .post-card {
        backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
        background: linear-gradient(135deg, rgba(8, 22, 46, 0.98) 0%, rgba(4, 12, 28, 0.98) 100%) !important; 
        -webkit-transform: translateZ(0); transform: translateZ(0);
    }
}

/* ==========================================
    Pentecost 실시간 날씨 동기화 (GPU 가속 최적화 레이어)
   ========================================== */
.weather-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: 0; pointer-events: none; overflow: hidden;
    opacity: 0; transition: opacity 2s ease-in-out;
}
.weather-overlay::before, .weather-overlay::after {
    content: ""; position: absolute;
    pointer-events: none; background-repeat: repeat;
    will-change: transform; /* 브라우저 하드웨어 가속 강제 각인 */
    opacity: 0; transition: opacity 1s;
}

/* ==========================================
   🌧️ [비 효과 최종 보정] 필터 제거(렉 박멸) 및 대형 무작위 패턴(이질감 제거)
   ========================================== */
.weather-overlay.rain { opacity: 1; }

.weather-overlay.rain::before {
    opacity: 1;
    /* 💡 기계적인 반복을 숨기기 위해 가로세로 크기를 2배(400px * 800px)로 대폭 확장 */
    top: -800px; left: 0; width: calc(100% + 400px); height: calc(100% + 800px);
    /* 💡 선의 두께와 투명도 자체를 조절하여, blur 필터 없이도 부드럽고 투명한 원경 비 묘사 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="800"><line x1="320" y1="50" x2="295" y2="100" stroke="rgba(144,224,239,0.13)" stroke-width="1" stroke-linecap="round"/><line x1="120" y1="280" x2="95" y2="330" stroke="rgba(144,224,239,0.16)" stroke-width="1" stroke-linecap="round"/><line x1="260" y1="480" x2="235" y2="530" stroke="rgba(144,224,239,0.13)" stroke-width="1" stroke-linecap="round"/><line x1="70" y1="680" x2="45" y2="730" stroke="rgba(144,224,239,0.15)" stroke-width="1" stroke-linecap="round"/></svg>');
    
    /* 🚨 렉 유발의 주범이었던 물리 필터 완전 삭제 -> 100% 순수 하드웨어 가속 복구 */
    filter: none !important;
    
    /* 원경 비의 속도를 서정적이고 잔잔하게 조율 */
    animation: rain-diagonal-back-opt 2.2s linear infinite;
}

.weather-overlay.rain::after {
    opacity: 1;
    /* 전경 비 (패턴 규격: 가로 300px * 세로 600px) */
    top: -600px; left: 0; width: calc(100% + 300px); height: calc(100% + 600px);
    /* 빗줄기 위치를 겹치지 않게 완전히 무작위로 재배치 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="600"><line x1="220" y1="40" x2="190" y2="100" stroke="rgba(144,224,239,0.22)" stroke-width="1.2" stroke-linecap="round"/><line x1="60" y1="260" x2="30" y2="320" stroke="rgba(144,224,239,0.26)" stroke-width="1.5" stroke-linecap="round"/><line x1="180" y1="450" x2="150" y2="510" stroke="rgba(144,224,239,0.20)" stroke-width="1.2" stroke-linecap="round"/></svg>');
    
    filter: none !important;
    
    /* 앞쪽 비와 뒤쪽 비의 속도 차이(시차)를 2배 이상 벌려, 정적인 종이가 내려오는 느낌을 지우고 입체감 부여 */
    animation: rain-diagonal-front-opt 1.1s linear infinite;
}

/* 💡 확장된 대형 패턴 크기 단위에 맞춰 픽셀 오차 없이 정확히 순환 트랜스폼 */
@keyframes rain-diagonal-back-opt  { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-400px, 800px, 0); } }
@keyframes rain-diagonal-front-opt { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-300px, 600px, 0); } }


/* ❄️ [눈 효과] 기존의 자연스러운 상태 유지 및 여백 보정 동기화 */
.weather-overlay.snow { opacity: 1; }
.weather-overlay.snow::before {
    opacity: 1;
    top: -300px; height: calc(100% + 300px);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="300"><circle cx="40" cy="40" r="1.2" fill="rgba(255,255,255,0.4)"/><circle cx="150" cy="120" r="1.8" fill="rgba(255,255,255,0.3)"/><circle cx="90" cy="220" r="1.5" fill="rgba(255,255,255,0.4)"/></svg>');
    animation: snow-fall-back 16s linear infinite;
}
.weather-overlay.snow::after {
    opacity: 1;
    top: -400px; height: calc(100% + 400px);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"><circle cx="80" cy="60" r="2.5" fill="rgba(255,255,255,0.65)"/><circle cx="280" cy="160" r="3.5" fill="rgba(255,255,255,0.45)"/><circle cx="180" cy="300" r="2" fill="rgba(255,255,255,0.55)"/><circle cx="340" cy="360" r="3" fill="rgba(255,255,255,0.6)"/></svg>');
    animation: snow-fall-front 9.5s linear infinite;
}
@keyframes snow-fall-back  { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(0, 300px, 0); } }
@keyframes snow-fall-front { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(0, 400px, 0); } }

/* 💡 X축 스냅 글리치 현상을 소멸시키고 y축 정수배 스크롤로 유기적 흐름 연출 */
@keyframes snow-fall-back  { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(0, 300px, 0); } }
@keyframes snow-fall-front { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(0, 400px, 0); } }

.section-subtitle {
    display: block !important;
    text-align: center !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 0 24px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    letter-spacing: 0px !important;
}
.section-subtitle * { text-align: center !important; margin-left: auto !important; margin-right: auto !important; padding-left: 0 !important; padding-right: 0 !important; }

/* ==========================================
   🌅 ⛅ 상단 위젯 공용 통합 디자인 (원본 규격 복구)
   ========================================== */
#theme-widget, #weather-widget {
    position: fixed !important;
    top: 25px !important;
    z-index: 999999 !important; 
    
    padding: 8px 16px !important;
    height: auto !important;
    box-sizing: border-box !important;
    
    background: rgba(3, 10, 23, 0.6) !important;
    border: 1px solid rgba(144, 224, 239, 0.25) !important;
    color: #e2e8f0 !important;
    border-radius: 20px !important;
    
    font-size: 0.85rem !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
    letter-spacing: 0.5px !important;
    
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    pointer-events: none !important;
}

#theme-widget { left: 25px !important; right: auto !important; }
#weather-widget { right: 25px !important; left: auto !important; }

/* 🌟 [유령 박스 현상 완전 해결] 비동기 데이터 수신 대기 상태 시 스타일 빈 껍데기 대신 로딩 가이드 표출 */
#theme-widget:empty::before { content: "⏳ 서재 확인 중..."; }
#weather-widget:empty::before { content: "⏳ 바다 읽는 중..."; }

@media (max-width: 768px) {
    #theme-widget, #weather-widget { top: 20px !important; font-size: 0.8rem !important; padding: 6px 12px !important; }
    #theme-widget { left: 15px !important; }
    #weather-widget { right: 15px !important; }
}

/* ==========================================
   ⚙️ 환경 설정 모달 - 커스텀 선택 박스
   ========================================== */
.env-select-box {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 14px 40px 14px 16px !important; 
    border-radius: 10px !important;
    background-color: rgba(3, 10, 23, 0.8) !important;
    border: 1px solid rgba(144, 224, 239, 0.3) !important;
    color: #ffffff !important;
    font-size: 0.95rem !important;
    outline: none !important;
    cursor: pointer !important;
    
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-repeat: no-repeat !important;
    background-size: 18px !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
}

#time-select.env-select-box {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="rgba(144,224,239,0.8)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') !important;
    background-position: calc(100% - 14px) center !important;
}
#weather-select.env-select-box {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="rgba(247,163,127,0.8)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') !important;
    background-position: calc(100% - 14px) center !important;
}
.env-select-box:hover, .env-select-box:focus, .env-select-box:active {
    border-color: #00b4d8 !important;
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.2) !important;
    background-color: rgba(6, 15, 31, 0.95) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}
.env-select-box option { background-color: #040d1c; color: #ffffff; padding: 10px; }

.env-panel-area {
    margin-bottom: 25px; text-align: left; background: rgba(255, 255, 255, 0.02); 
    padding: 18px 16px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.04); 
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}
.env-label { font-size: 0.9rem; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; font-weight: bold; letter-spacing: 0.5px; }

/* ==========================================
   ⚙️ 환경 설정 수동 조작 톱니바퀴 버튼 디자인
   ========================================== */
#time-gear-btn {
    position: fixed; z-index: 9999; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    background: rgba(6, 15, 31, 0.9); border: 1px solid rgba(144, 224, 239, 0.25); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    bottom: 105px; right: 38px; 
    width: 40px; height: 40px; 
    border-radius: 50%;
    font-size: 18px; 
}
#time-gear-btn:hover { transform: scale(1.1); border-color: #00b4d8; box-shadow: 0 6px 20px rgba(0, 180, 216, 0.3); }



/* ==========================================
   🚨 [최종 해결] 모바일 로그인 시 소라게 버튼 높이 강제 견인 (우선순위 완전 정복)
   ========================================== */
@media (max-width: 768px) {
    /* 톱니바퀴(환경설정) 버튼 높이 기준점 (75px) */
    #time-gear-btn {
        bottom: 80px !important;
        right: 26px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
    }

    /* 💡 html과 body 태그까지 정밀하게 엮은 초고강도 선택자를 사용하여 
       기존의 모든 !important 간섭을 무조건 깨부수고 위로 들어 올립니다. */
    html body.admin-logged-in #random-memory-btn {
        bottom: 80px !important;       /* 톱니바퀴 버튼 높이와 자석처럼 100% 일치 */
        left: 26px !important;         /* 좌측 여백도 대칭 일치 */
        width: 36px !important;
        height: 36px !important;
        border-radius: 50% !important; /* 완벽한 원형 유지 */
        font-size: 16px !important;
        position: fixed !important;
        display: flex !important;
    }
}


