:root {
    /* Color Palette - Modern & Clean */
    --primary-color: #2d3436;
    --secondary-color: #6c5ce7;
    --accent-color: #a29bfe;
    --bg-color: #f8f9fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;
    --border-color: #dfe6e9;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --border-radius: 16px;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.logo-area {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid transparent;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.nav-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    margin-right: 12px;
    display: flex;
    justify-content: center;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(108, 92, 231, 0.08);
    color: var(--secondary-color);
}

.user-profile {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #dfe6e9;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-smooth);
    min-width: 0;
}

/* Header */
.top-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.toggle-sidebar {
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.toggle-sidebar:hover {
    background-color: rgba(0,0,0,0.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Content Body */
.content-body {
    padding: 32px;
}

.page-title {
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -1px;
}

.page-title p {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Featured Carousel (Hero) */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 240px 240px;
    gap: 24px;
    margin-bottom: 48px;
}

.hero-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.hero-card.large {
    grid-row: span 2;
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-card:hover img {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.hero-tag {
    background-color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: inline-block;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Masonry Grid */
.masonry-grid {
    column-count: 4;
    column-gap: 24px;
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 24px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.item-image {
    width: 100%;
    display: block;
    background-color: #eee;
}

.item-content {
    padding: 20px;
}

.item-category {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.4;
}

.item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.item-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    color: var(--text-muted);
    transition: color 0.2s;
    cursor: pointer;
}

.action-btn:hover {
    color: var(--accent-color);
}

/* Detail Page Styles */
.detail-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.detail-header {
    height: 400px;
    position: relative;
}

.detail-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-content-body {
    padding: 60px 80px;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-main);
    line-height: 1.2;
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    flex-wrap: wrap;
}

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

.detail-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #4a4a4a;
}

.detail-text p {
    margin-bottom: 24px;
}

.detail-text img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
    display: block;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .hero-card.large {
        grid-row: auto;
        height: 300px;
    }
    .hero-card {
        height: 200px;
    }
    
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .detail-content-body {
        padding: 40px;
    }

    /* Tablet optimizations */
    .top-header {
        padding: 0 24px;
    }
    
    .content-body {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
    .detail-title {
        font-size: 1.8rem;
    }
    
    .search-bar {
        width: 180px;
    }
    
    .hero-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
    .top-header {
        padding: 0 16px;
    }
    .content-body {
        padding: 16px;
    }
    
    .search-bar {
        display: none; /* Hide search on very small screens or make it an icon toggle */
    }
    
    .header-right .toggle-sidebar:last-child {
        margin-left: auto;
    }
    
    .detail-header {
        height: 250px;
    }
    
    .detail-content-body {
        padding: 24px 20px;
    }

    .detail-meta-row {
        gap: 16px;
        margin-bottom: 24px;
        padding-bottom: 16px;
    }
    
    .detail-title {
        font-size: 1.5rem; /* Slightly smaller for mobile */
    }
}

/* Footer */
.site-footer {
    padding: 60px 0 20px;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-brand p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.footer-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Collapsed Sidebar State (Desktop) */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .user-info {
    display: none;
    opacity: 0;
}

body.sidebar-collapsed .nav-link i {
    margin-right: 0;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}
/* Share Component */
.share-component {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    border: 2px dashed #eee;
}

.share-label {
    font-weight: bold;
    color: var(--text-main);
    font-size: 1.1rem;
}

.share-buttons {
    display: flex;
    gap: 15px;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.share-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.share-wechat { background: #07c160; }
.share-weibo { background: #e6162d; }
.share-qzone { background: #ffc107; }
.share-copy { background: #666; }

/* Wechat QR Modal */
.wechat-qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.qr-content {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 4px solid var(--text-main);
}

.qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.close-qr {
    cursor: pointer;
    font-size: 24px;
    color: #999;
    transition: color 0.2s;
}

.close-qr:hover { color: var(--primary-color); }

#qrcode img {
    margin: 0 auto;
    border: 10px solid white; /* padding for qr code */
}

