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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

.sidebar {
    width: 260px;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 20px 10px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 15px;
    padding: 0 10px 10px;
    border-bottom: 2px solid #667eea;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    color: #ddd;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.sidebar-menu a:hover {
    background: rgba(102, 126, 234, 0.4);
    color: #fff;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
}

.menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.header {
    background: #000;
    color: #fff;
    padding: 20px 30px;
    margin-bottom: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-left h1 {
    font-size: 22px;
    margin-bottom: 5px;
}

.header-left h2 {
    font-size: 38px;
    font-weight: 900;
}

.header-left .date {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

.header-right {
    text-align: right;
}

.header-right .logo {
    width: 60px;
    height: 60px;
    background: #666;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.header-right .site {
    font-weight: bold;
    font-size: 15px;
}

.header-right .handle {
    color: #999;
    font-size: 13px;
}

.header-right .count {
    font-size: 11px;
    color: #999;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-box {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #ddd;
}

.category-icon {
    font-size: 20px;
}

.category-title {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 20px;
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.service-item:hover {
    transform: translateY(-3px);
}

.service-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    cursor: pointer;
}

.service-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    font-weight: 500;
}

.footer {
    background: #0b0b0f;
    color: #e5e7eb;
    padding: 60px 70px 35px;
    border-radius: 16px;
    border-top: 3px solid #6d28d9;
    box-shadow: inset 0 0 25px rgba(109, 40, 217, 0.3);
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 60px;
    margin-bottom: 40px;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section {
    flex: 1 1 0;
    min-width: 220px;
}

.footer-section h3 {
    font-size: 17px;
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 18px;
    position: relative;
}

.footer-section h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
    border-radius: 2px;
}

.footer-section p,
.footer-section a {
    font-size: 14px;
    line-height: 1.9;
    color: #d1d5db;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.footer-section a:hover {
    color: #fff;
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 14px;
    margin-top: 14px;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #4f46e5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
}

.social-links a:hover {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.submenu-portal {
    position: fixed;
    z-index: 1000;
    max-width: 600px; /* 늘어난 가로폭 */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: scale(0.95);
    display: none;
    pointer-events: none;
}

.submenu-portal.visible {
    opacity: 1;
    transform: scale(1);
    display: block;
    pointer-events: auto;
}

.submenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 12px 16px;
}

.submenu-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.submenu-content {
    display: flex;
    gap: 16px;
    padding: 16px;
}

.submenu-review {
    flex: 1;
}

.submenu-review h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.submenu-review p {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.submenu-screenshots {
    flex-basis: 200px;
}

.submenu-screenshots h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.screenshot-placeholder {
    margin-bottom: 10px;
}

.screenshot-placeholder img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #eee;
}

.submenu-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 16px 16px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.submenu-link:hover {
    background: #667eea;
    color: #fff;
}

.close-btn {
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}



@media (max-width: 1200px) {
    .footer-content {
        flex-wrap: wrap;
        gap: 40px;
    }
    .footer-section {
        flex: 1 1 calc(50% - 40px);
        min-width: 320px;
    }
}

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        display: none; /* Sidebar is hidden on mobile */
    }
    .main-content {
        margin-left: 0;
        padding: 10px;
    }
    .header {
        padding: 15px;
    }
    .header-left h2 {
        font-size: 28px;
    }
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 15px;
    }
    .footer-content {
        flex-direction: column;
        gap: 24px;
    }
    .footer-section {
        flex: 1 1 100%;
        min-width: 0;
    }
    
    /* Mobile Submenu Portal */
    .submenu-portal {
        position: fixed;
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        bottom: 8px !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 14px;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
        animation: slideUp 0.25s ease-out;
    }

    .submenu-portal.visible {
        transform: none; /* Disable desktop transform on mobile */
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 10px;
    }
    .service-icon {
        width: 48px;
        height: 48px;
    }
    .service-name {
        font-size: 11px;
    }
}

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