/* === Reset & Base === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: url(https://ani.cursors-4u.net/nature/nat-11/nat1054.cur), auto !important;
}




body {
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR",
        "Apple SD Gothic Neo", system-ui, sans-serif;
    background: #f5f6fb;
    color: #1f1f2e;
}

a {
    text-decoration: none;
    color: inherit;
}

/* === App Layout === */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}


/* ?�단 ?�더 공통 */
.top-bar {
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #e3e4ee;
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 14px;
    color: black;
    justify-content: space-between;


}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transform: translateY(-1px);
}

.back-btn:hover {
    background: #f2f3ff;
}

.top-title {
    font-weight: 500;
    margin-right: 8px;
}

.top-add {
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

/* 메인 ?�역 ?�이?�웃 */
.content {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* === 좌측 ?�이?�바 공통 === */
.sidebar {
    width: 90px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0;
    border-right: 1px solid #eee;
    height: 100%;
    position: relative;


}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* ?�단 ?�역 */
.sidebar-bottom {
    position: relative;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.sidebar-bottom .credits {
    font-size: 13px;
    color: #666;
}

/* ?�바?� 버튼 */
#sidebarAvatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: #2b7cff;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 계정 ?�오�?*/
.account-popover {
    position: absolute;
    left: 64px;
    /* ?�이?�바 ?�른쪽으�?조금 ?�?�나?�게 */
    bottom: 16px;
    min-width: 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 12px 0;
    display: none;
    /* 기본?� ?��? */
    z-index: 100;
}


.account-popover.open {
    display: block;
}

/* ?�오�?기본 ?�태 */
#accountPopover {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
    pointer-events: none;
    transition:
        opacity 0.18s ease-out,
        transform 0.18s ease-out;
}

/* open ?�래??붙으�?보임 */
#accountPopover.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}


.account-popover-header {
    display: flex;
    align-items: center;
    padding: 4px 16px 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

.account-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #2b7cff;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.account-popover-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-name {
    font-size: 14px;
    font-weight: 600;
}

.account-credits {
    font-size: 12px;
    color: #888;
}

.account-item {
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.account-item:hover {
    background: #f6f7fb;
}

.account-item-icon {
    width: 18px;
    text-align: center;
}

.account-logout {
    color: #e54b4b;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.side-item {
    display: flex;
    flex-direction: column;
    /* ?�이�??? ?�스???�래 */
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px 0;
    cursor: pointer;
    color: #444;
}

.side-item.active {
    background: #eef5ff;
    border-radius: 10px;
}

.side-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.side-text {
    font-size: 10px;
    margin-top: 4px;
}

.side-item.active .side-text {
    font-size: 14px;
    margin-top: 4px;
    font-weight: 700;
}

.credits {
    font-size: 10px;
    color: #999;
    text-align: center;
    line-height: 1.2;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #00a1ff;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* === 메인 공통 ?�역 === */
.main-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;

}



/* ?�크�??��???공통 */
.main-area::-webkit-scrollbar {
    width: 6px;
}

.main-area::-webkit-scrollbar-thumb {
    background: transparent;
}

.main-area:hover::-webkit-scrollbar-thumb {
    background: #d1d2e5;
    border-radius: 4px;
}

/* === ?�역 ?�로??공통 === */

.drawer {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e4f1;
    display: flex;
    flex-direction: column;
    padding: 10px 8px 10px 8px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.drawer-hidden {
    transform: translateX(-8px);
    opacity: 0;
    pointer-events: none;
    width: 0;
    padding: 0;
    border-right: none;
}

/* ?�로??기본 ?�태 */
#globalDrawer {
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    transform: translateX(0);
    opacity: 1;
    padding: 10px;

}

/* ?�겨�??�태???? ?�짝 ?�쪽?�로 빠�?면서 ?�명?�짐 */
#globalDrawer.drawer-hidden {
    transform: translateX(-16px);
    opacity: 0;
    pointer-events: none;
}


.drawer-header {
    padding: 4px 4px 6px;
    border-bottom: 1px solid #f0f1fa;
}

.drawer-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.drawer-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #e0e3f5;
    background: #ffffff;
    color: #989ab4;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-close-btn:hover {
    background: #f5f6ff;
}

.drawer-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
}

.drawer-tab {
    border-radius: 999px;
    border: none;
    background: #f3f4ff;
    color: #8a8cb0;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}

.drawer-tab.active {
    background: #4e63ff;
    color: #ffffff;
}

.drawer-subchips {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.drawer-subchip {
    border-radius: 999px;
    border: none;
    background: #f7f8ff;
    color: #8587a1;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
}

.drawer-subchip.active {
    background: #ffffff;
    color: #4f57ff;
    box-shadow: 0 1px 4px rgba(111, 120, 255, 0.3);
}

/* ?�로??리스??*/
.drawer-list-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 4px 8px;
    overflow: hidden;
}

.drawer-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #656783;
    padding: 4px 6px 6px;
}

.drawer-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.drawer-list::-webkit-scrollbar-thumb {
    background: #d4d6e7;
    border-radius: 3px;
}

.drawer-item {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px;
    border-radius: 10px;
    cursor: pointer;
}

.drawer-item:hover {
    background: #f4f5ff;
}

.drawer-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f0f1ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    overflow: hidden;
}

.drawer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drawer-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    text-align: left;

}

.drawer-title {
    font-size: 12px;
    color: #373951;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.drawer-subline {
    font-size: 10px;
    color: #9a9cb1;
}

.drawer-type-badge {
    font-size: 10px;
    color: #7a7cff;
    border-radius: 999px;
    border: 1px solid #d6d7ff;
    padding: 2px 6px;
}

.drawer-empty {
    font-size: 11px;
    color: #a2a4b8;
    text-align: center;
    padding: 16px 8px;
    border-radius: 10px;
    border: 1px dashed #dcdff2;
    background: #fafbff;
    margin: 8px 4px;

}

.drawer-group+.drawer-group {
    margin-top: 10px;

}

.drawer-sublist {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;

}

.drawer-group .drawer-section-title {
    margin-bottom: 6px;

}








/* ============================
   모바???�이?�웃
============================ */
@media (max-width: 768px) {

    /* ?�체 ?�이?�웃: 좌우 -> ?�하 ?�낌 */
    .content {
        flex-direction: column;
    }

    /* ?�스?�탑 ?�이?�바/?��??� ?��? */
    .sidebar {
        display: none;
    }

    .drawer-toggle {
        display: none;
    }

    /* ?�단바는 고정 */
    .top-bar {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .top-bar-left {
        gap: 8px;
    }

    /* ?�버�?버튼 ?�낌?�로 ?�간 ?�우�?*/
    .back-btn {
        width: 32px;
        height: 32px;
        border-radius: 999px;
        border: 1px solid transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        cursor: pointer;
    }

    .back-btn:hover {
        background: #f5f6ff;
    }

    /* 메인 ?�역 ?�딩 조금 줄이�?*/
    .main-area {
        justify-content: stretch;
        padding: 0 12px 24px;
        display: flex;
    }

    .home-wrapper {
        width: 100%;
        padding: 24px 0 40px;
    }

    /* ========== ?�로?��? 모바???�버?�이처럼 ========== */

    .drawer {
        position: fixed;
        top: 48px;
        /* ?�더 ?�이?� 맞춤 */
        left: 0;
        height: calc(100vh - 48px);
        width: 100%;
        max-width: 420px;
        /* ?�른�?조금 비워?�는 ?�낌 */
        background: #ffffff;
        border-right: 1px solid #e2e4f1;
        border-radius: 0 16px 16px 0;
        box-shadow: 4px 0 24px rgba(15, 18, 46, 0.25);
        z-index: 1000;

        /* 기본?� 보여지???�태 */
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* ?��? ?�태 (JS?�서 .drawer-hidden ?��?) */
    .drawer.drawer-hidden {
        transform: translateX(-110%);
        opacity: 0;
        pointer-events: none;
    }

    /* ?�로?????�크�????�도�?*/
    .drawer-list-wrap {
        max-height: calc(100vh - 48px - 80px);
        /* ?��??�단/?�단 ?�백 ?�외 */
    }

    /* 모바?�에??리스??�??�백 조금 ?�유 */
    .drawer-header {
        padding: 8px 12px 10px;
    }

    .drawer-list-wrap {
        padding: 8px 8px 12px;
    }
}



/* 기본(PC)?�서???�로???�비 ?��? */
.drawer-nav {
    display: none;
}

@media (max-width: 768px) {
    /* ... 기존 모바???��??�들 ... */

    .drawer-nav {
        margin-top: 10px;
        padding: 8px 4px 4px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        border-bottom: 1px solid #f0f1fa;
    }

    .drawer-nav-item {
        width: 100%;
        border: none;
        background: transparent;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 4px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 14px;
        color: #33354d;
    }

    .drawer-nav-item:hover {
        background: #f5f6ff;
    }

    .drawer-nav-icon {
        width: 22px;
        height: 22px;
        object-fit: contain;
    }

    .drawer-nav-item.active {
        background: #eef3ff;
        color: #3056ff;
    }
}




/* ?�스?�톱?�서 drawer ?�이 �?채우�?*/
@media (min-width: 769px) {
    #drawer-container {
        display: flex;
        flex-direction: column;
        /* .content???�이�?그�?�?받도�?기본 flex item ?�태 ?��? */
    }

    #drawer-container .drawer {
        height: 100%;
    }
}

/* Drawer image modal */
.drawer-image-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.drawer-image-modal.hidden {
    display: none;
}

.drawer-image-modal .dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.drawer-image-modal .modal-inner {
    position: relative;
    background: #0f1115;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-image-modal .image-frame {
    max-width: 80vw;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    border-radius: 10px;
    overflow: hidden;
}

.drawer-image-modal img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.drawer-image-modal .close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.drawer-image-modal .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 32px;
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
}

.drawer-image-modal .nav-btn.prev {
    left: -44px;
}

.drawer-image-modal .nav-btn.next {
    right: -44px;
}

.drawer-image-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
}


.drawer-group+.drawer-group {
    margin-top: 10px;

}

.drawer-sublist {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;

}

.drawer-group .drawer-section-title {
    margin-bottom: 6px;

}