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

body {
    font-family: 'Noto Sans SC', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a1a;
    min-height: 100vh;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 200px;
    background-color: #242424;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

.logo {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 32px;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.nav-item {
    display: inline-block;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: #fff;
    background-color: #333;
    text-decoration: none;
}

.nav-item:focus {
    outline: none;
    text-decoration: none;
}

.nav-item:active {
    text-decoration: none;
}

.nav-item.active {
    color: #fff;
    background-color: #3a3a3a;
    text-decoration: none;
}

.main-content {
    flex: 1;
    background-color: #f5f5f5;
    background-image: 
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    min-height: 100vh;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    border-bottom: 0px solid rgba(0,0,0,0.06);
    margin-bottom: 32px;
    padding-bottom: 20px;
}

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

.top-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.top-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.08));
    transition: transform 0.2s ease;
}

.top-logo:hover {
    transform: scale(1.05);
}

.top-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -1.5px;
    line-height: 1.2;
}

.subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-container {
    background-color: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    min-width: 360px;
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.search-container:focus-within {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.12);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: #999;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.search-container:focus-within .search-icon {
    color: #1a1a1a;
}

#searchInput {
    flex: 1;
    padding: 8px 0;
    border: none;
    font-size: 15px;
    outline: none;
    background: none;
    color: #1a1a1a;
    font-weight: 500;
}

#searchInput::placeholder {
    color: #bbb;
    font-weight: 400;
}

.filter-toggle {
    width: 46px;
    height: 46px;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
}

.filter-toggle:hover {
    color: #1a1a1a;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.filter-toggle:active {
    transform: translateY(0);
}

.filter-toggle svg {
    width: 20px;
    height: 20px;
}

.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.filter-modal.active {
    display: flex;
}

.filter-modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    overflow: hidden;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.filter-modal-close {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-modal-close:hover {
    color: #1a1a1a;
    background-color: #f5f5f5;
}

.filter-modal-close svg {
    width: 16px;
    height: 16px;
}

.filter-modal-body {
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-modal-item {
    padding: 10px 16px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-modal-item:hover {
    color: #1a1a1a;
    border-color: #1a1a1a;
}

.filter-modal-item.active {
    color: #fff;
    background-color: #1a1a1a;
    border-color: #1a1a1a;
}

.main-body {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.content-area {
    flex: 1;
    width: 100%;
}

.side-nav {
    width: 180px;
    flex-shrink: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    position: sticky;
    top: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    align-self: flex-start;
}

.side-nav.hidden {
    display: none;
}

.side-nav-header {
    padding: 16px 16px 16px 24px;
    border-bottom: none;
    background: none;
}

.side-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.side-nav-body {
    padding: 0;
}

.side-nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px 10px 24px;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    gap: 12px;
    position: relative;
}

.side-nav-item::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e0e0e0;
    transform: translateX(-50%);
}

.side-nav-item:hover {
    color: #1a1a1a;
    background: none;
}

.side-nav-item.active {
    color: #1a1a1a;
    background: none;
}

.side-nav-item.active::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #1a1a1a;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.side-nav-item.active::after {
    background-color: #1a1a1a;
}

.side-nav-item:not(.active)::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: transparent;
    flex-shrink: 0;
}

.category-section {
    width: 100%;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '▪';
    color: #1a1a1a;
    font-size: 18px;
}

.more-link {
    font-size: 14px;
    color: #888;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.more-link:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.bookmark-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.bookmark-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.site-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    flex-shrink: 0;
    background-color: #f5f5f5;
    background-image: 
        linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px);
    background-size: 6px 6px;
    font-family: 'Noto Sans SC', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.site-info {
    flex: 1;
    min-width: 0;
}

.site-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-domain {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
}

@media (max-width: 1200px) {
    .side-nav {
        display: none;
    }
    
    .main-body {
        gap: 0;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
        padding: 12px 16px;
        overflow-x: auto;
        white-space: nowrap;
        gap: 16px;
    }
    
    .nav-menu {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 0;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .logo {
        margin-bottom: 0;
        font-size: 18px;
        flex-shrink: 0;
    }
    
    .main-content {
        padding: 16px;
        padding-top: 8px;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }
    
    .top-bar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-container {
        min-width: auto;
        flex: 1;
        min-width: 0;
    }
    
    .title {
        font-size: 26px;
        letter-spacing: -1px;
    }
    
    .subtitle {
        font-size: 13px;
    }
    
    .top-logo {
        width: 40px;
        height: 40px;
    }
    
    .bookmark-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 12px;
    }
    
    .bookmark-card {
        padding: 16px;
    }
    
    .site-logo {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .side-nav {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 10px 12px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .nav-item {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .title {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .search-container {
        padding: 6px 10px;
    }
    
    .bookmark-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .bookmark-card {
        padding: 14px;
    }
    
    .site-logo {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}
