:root {
    --nv-green: #00C73C;
    --nv-black: #101010;
    --bg-gray: #f5f6f8;
    --white: #ffffff;
    --gray-500: #8e8e93;
    --gray-400: #abb1b9;
    --gray-100: #eeeeee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
    letter-spacing: -0.5px;
}

body {
    background-color: var(--bg-gray);
    color: var(--nv-black);
    -webkit-font-smoothing: antialiased;
}

/* Base Mobile Shell */
.app-shell {
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-gray);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Mobile Header */
header.mobile-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: -8px;
    cursor: pointer;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -1.2px;
    color: var(--nv-black);
    text-decoration: none;
}

/* Main Toggle Navigation */
.main-toggle-nav {
    background: var(--white);
    padding: 10px 16px 20px;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.toggle-item {
    font-size: 24px;
    font-weight: 800;
    color: #d1d1d6;
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-item.active {
    color: var(--nv-black);
}

/* Sub Tab Nav */
.sub-tab-nav {
    display: flex;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
}

.sub-tab-item {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    position: relative;
}

.sub-tab-item.active {
    color: var(--nv-black);
}

.sub-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    background: var(--nv-black);
    border-radius: 3px 3px 0 0;
}

/* Section Common Styles */
.section-container {
    background: var(--white);
    margin-bottom: 10px;
    padding: 20px 0 24px;
}

.section-title {
    padding: 0 16px 16px;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.section-title span {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

/* Mobile Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 430px;
    height: 70px;
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    justify-items: center;
    z-index: 1000;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gray-500);
    text-decoration: none;
}

.nav-tab.active {
    color: var(--nv-black);
}

.nav-tab.write {
    color: var(--nv-green);
}

.nav-tab span {
    font-size: 11px;
    font-weight: 600;
}

/* Button UI */
.btn-primary {
    background-color: var(--nv-green);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.btn-outline {
    background-color: transparent;
    color: var(--nv-black);
    border: 1px solid var(--gray-400);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Post list style used in index */
.post-list-section {
    background: var(--white);
    padding: 20px 0;
}

.post-item {
    padding: 22px 16px;
    display: flex;
    gap: 18px;
    border-bottom: 1px solid var(--bg-gray);
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #111;
    letter-spacing: -0.8px;
}

.post-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
    align-items: center;
}

.post-img {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    object-fit: cover;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================
   Bottom Sheet (Comments UI)
   ========================================================== */
.sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}
.sheet-overlay.active {
    opacity: 1; 
    visibility: visible;
}
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 430px;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    z-index: 2001;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 80vh;
}
.bottom-sheet.active {
    transform: translateX(-50%) translateY(0);
}
.sheet-header {
    padding: 24px 20px 16px;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
}
.sheet-content {
    padding: 24px 20px;
    overflow-y: auto;
    flex: 1;
}

/* Comment Item Style */
.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.comment-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    flex-shrink: 0;
    object-fit: cover;
}
.comment-body { flex: 1; }
.comment-author { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.comment-text { font-size: 15px; line-height: 1.5; color: #222; margin-bottom: 10px; }
.comment-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--gray-400); }


/* ==========================================================
   PC Responsive Desktop System (min-width: 768px)
   ========================================================== */
.pc-header {
    display: none;
}

.pc-layout-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 모바일 전용: pc-main과 pc-aside를 해체하고 자식들을 flex-direction: column으로 관리 -> order 속성으로 기존 모바일 배치 완벽 복원 */
@media (max-width: 767px) {
    .pc-main, .pc-aside {
        display: contents;
    }
}

@media (min-width: 768px) {
    body {
        background-color: var(--white) !important;
    }
    
    * {
        box-shadow: none !important;
    }

    .app-shell {
        max-width: 1080px;
        margin: 0 auto;
        background: var(--white) !important;
        padding-bottom: 40px;
    }

    /* Hide Mobile Navigation Elements */
    header.mobile-header, .bottom-nav {
        display: none !important;
    }

    /* PC Header */
    .pc-header {
        display: block;
        border-bottom: 1px solid var(--gray-100);
        margin-bottom: 24px;
        background: var(--white);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .pc-header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        gap: 40px;
        max-width: 1080px;
        margin: 0 auto;
    }

    .pc-search-bar {
        flex: 1;
        max-width: 500px;
        display: flex;
        align-items: center;
        background: var(--bg-gray);
        border-radius: 20px;
        padding: 10px 18px;
        gap: 12px;
        border: 1px solid transparent;
    }

    .pc-search-bar:focus-within {
        border-color: var(--nv-green);
        background: var(--white);
    }

    .pc-search-bar input {
        border: none;
        background: transparent;
        font-size: 16px;
        width: 100%;
        outline: none;
        color: var(--nv-black);
    }

    .pc-search-bar input::placeholder {
        color: var(--gray-400);
    }

    .pc-header-actions {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .pc-header-actions .icon-btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--nv-black);
        cursor: pointer;
        text-decoration: none;
    }
    
    .pc-header-actions .profile-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--bg-gray);
        overflow: hidden;
        cursor: pointer;
        margin-left: 8px;
    }

    .pc-header-bottom {
        display: flex;
        align-items: center;
        gap: 32px;
        padding: 0 20px;
        height: 48px;
        max-width: 1080px;
        margin: 0 auto;
    }

    .pc-nav-item {
        font-size: 15px;
        font-weight: 700;
        color: var(--gray-500);
        text-decoration: none;
        padding: 12px 0;
        position: relative;
    }

    .pc-nav-item.active {
        color: var(--nv-black);
    }
    
    .pc-nav-item.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: var(--nv-black);
    }

    /* Layout Grids */
    .pc-layout-wrapper {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: 40px;
        padding: 0 20px;
    }

    .write-layout, .login-layout {
        display: block;
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }

    /* Reset background colors on elements */
    .section-container, .post-list-section, .main-toggle-nav, .sub-tab-nav {
        background: var(--white) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .section-title {
        padding-left: 0;
        padding-right: 0;
    }

    /* Article enhancements for PC */
    .article-cover {
        height: 400px;
        border-radius: 12px;
        margin-bottom: 30px;
    }

    .article-fab {
        position: static !important;
        background: transparent !important;
        border: none !important;
        padding: 24px 0 !important;
        justify-content: flex-start !important;
        gap: 32px;
    }

    /* Comments formatting for PC */
    .sheet-overlay { display: none !important; }
    .bottom-sheet {
        position: static !important;
        transform: none !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 12px !important;
        border: 1px solid var(--gray-100);
        margin-top: 60px;
        margin-bottom: 40px;
    }
    .sheet-header {
        border-bottom: 1px solid var(--gray-100);
        padding: 24px;
    }
    .sheet-header i {
        display: none; /* Hide close button on PC */
    }
    .sheet-content {
        padding: 24px;
        overflow: visible;
    }
}
