/* ========================================
   Modern Minimal Design with Morandi Colors
   ======================================== */

:root {
    --sidebar-bg: #E8E4E1;
    --sidebar-hover: #DEDAD7;
    --sidebar-active: #C4B8AD;
    --main-bg: #FAFAF9;
    --card-bg: #FFFFFF;
    --text-primary: #4A4A48;
    --text-secondary: #7D7D7B;
    --accent: #9B8E7E;
    --accent-hover: #8A7D6E;
    --highlight: #C4B8AD;
    --shadow: rgba(0, 0, 0, 0.06);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    
    --sidebar-width: 260px;
    --card-radius: 8px;
    --transition: 0.25s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   Mobile Header
   ======================================== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--sidebar-bg);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    padding: 40px 0;
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 0 28px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 14px 28px;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
}

.nav-item.active {
    background: var(--highlight);
    border-left-color: var(--accent);
    font-weight: 500;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 48px;
}

.content-wrapper {
    max-width: 1200px;
}

.content-section {
    margin-bottom: 64px;
    scroll-margin-top: 32px;
}

.section-header {
    margin-bottom: 28px;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-count {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   Card Grid
   ======================================== */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.site-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 12px var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.site-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
}

.site-card:active {
    transform: translateY(-2px);
}

.site-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.site-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
}

.site-link-icon {
    align-self: flex-end;
    margin-top: 16px;
    color: var(--accent);
    font-size: 14px;
    opacity: 0;
    transform: translateX(-8px);
    transition: var(--transition);
}

.site-card:hover .site-link-icon {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .main-content {
        padding: 40px 32px;
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 834px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        padding-top: 68px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 32px 24px;
        padding-top: 88px;
    }
    
    .content-section {
        margin-bottom: 48px;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 80px 16px 32px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .site-card {
        padding: 24px 20px;
        min-height: auto;
    }
    
    .site-link-icon {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    animation: fadeIn 0.4s ease forwards;
}

.content-section:nth-child(2) {
    animation-delay: 0.1s;
}

.content-section:nth-child(3) {
    animation-delay: 0.2s;
}

.content-section:nth-child(4) {
    animation-delay: 0.3s;
}
