html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    overflow-x: hidden;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; transition: all 0.3s; }
img { max-width: 100%; height: auto; display: block; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Hero Header */
.hero-header {
    background-color: #0275e9;
    background-image: 
        linear-gradient(135deg, rgba(5, 122, 238, 0.95) 0%, rgba(4, 122, 240, 0.95) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><defs><style>.a{fill:none;stroke:%23ffffff;stroke-width:0.5;opacity:0.15;}</style></defs><g class="a"><line x1="100" y1="50" x2="300" y2="150"/><line x1="300" y1="150" x2="500" y2="100"/><line x1="500" y1="100" x2="700" y2="200"/><circle cx="100" cy="50" r="3"/><circle cx="300" cy="150" r="3"/><circle cx="500" cy="100" r="3"/><circle cx="700" cy="200" r="3"/></g></svg>');
    background-size: cover;
    background-position: center;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: #fff;
    position: relative;
    padding-bottom: 20px;
    z-index: 1;
    overflow: hidden; /* Ensure canvas doesn't overflow */
}
#canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none; /* Let clicks pass through */
}

/* Top Navigation */
.top-nav {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}
.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.logo-link i { font-size: 22px; }

/* Sticky Navigation State */
.top-nav.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); /* Lighter shadow */
    padding: 10px 0;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}
.top-nav.sticky .logo-link,
.top-nav.sticky .menu-item,
.top-nav.sticky .nav-icon {
    color: #333; /* Dark text for white background */
}
.top-nav.sticky .menu-item:hover,
.top-nav.sticky .menu-item.active {
    background: rgba(0,0,0,0.05); /* Darker hover for white background */
    color: #1c5792;
}
.top-nav.sticky .nav-icon:hover {
    background: rgba(0,0,0,0.05);
    color: #1c5792;
}
.top-nav.sticky .nav-user {
    background: rgba(0,0,0,0.05);
    color: #333;
}
.top-nav.sticky .nav-login {
    /* Keep login button colorful relative to design, or make it fit */
    box-shadow: none; 
}

.main-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}
.menu-item {
    padding: 8px 18px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s;
}
.menu-item:hover, .menu-item.active {
    background: none !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 1;
}
.logo-link:hover {
    opacity: 0.9;
}

/* Dropdown Menu */
.menu-item-has-children {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 200px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    padding: 10px 0;
    display: none; /* Changed from opacity only to display none for robust hiding */
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    /* Add a transparent border to top to bridge gap if needed, but padding trick is cleaner if we adjust background clip */
    margin-top: 10px; /* Space for the arrow */
}
/* Invisible bridge */
.sub-menu::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}
.sub-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
}
.menu-item-has-children:hover .sub-menu {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.sub-menu li {
    list-style: none;
}
.sub-menu a {
    display: block;
    padding: 10px 20px;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}
.sub-menu a:hover {
    background: #f8f9fa;
    color: #1c5792;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.nav-icon {
    color: rgba(255,255,255,0.85);
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}
.nav-icon:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #fff;
}
.nav-user img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.nav-login {
    padding: 6px 20px;
    background: #0B73E4;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    border: none;
    box-shadow: 0 4px 15px rgba(209, 146, 159, 0.4);
    transition: all 0.3s;
}
.nav-login:hover {
    background: #0476f8;
    transform: translateY(-1px);
    
}

/* Hero Search Section */
.hero-search {
    padding: 60px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1; 
}
.hero-title {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: 1px;
}
.hero-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 40px;
}

/* Search Box */
.search-box {
    max-width: 700px;
    margin: 0 auto 25px;
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}
.search-box:hover, .search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}
.search-category {
    width: 120px;
    padding: 0 15px;
    border: none;
    outline: none;
    font-size: 14px;
    color: #444;
    background: transparent;
    cursor: pointer;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.search-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
}
.search-input::placeholder {
    color: #999;
}
.search-btn {
    width: 60px;
    background: #1c5792;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}
.search-btn:hover {
    background: #0B73E4;
}

/* Hot Tags */
.hot-tags {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tag-label {
    font-size: 13px;
    opacity: 0.8;
}
.hot-tag {
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}
.hot-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Site Activity Bar */
.activity-bar {
    background: #f1f3f6;
    border-bottom: 1px solid #eef0f5;
    height: 44px;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.02);
}
.activity-flex {
    display: flex;
    align-items: center;
    height: 44px;
    gap: 12px;
}
.activity-badge {
    background: #4b525e;
    color: #fff;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    z-index: 10;
    font-weight: 500;
}
.activity-badge i { font-size: 14px; opacity: 0.9; }

.activity-swiper {
    flex: 1;
    overflow: hidden;
    height: 44px;
    position: relative;
    cursor: grab;
}
.activity-swiper:active {
    cursor: grabbing;
}
.activity-list {
    display: flex;
    flex-direction: row;
    list-style: none;
    transition: transform 0.1s ease-out;
    padding: 0;
    margin: 0;
    width: max-content;
}
.activity-list li {
    height: 44px;
    line-height: 44px;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
    white-space: nowrap;
    user-select: none;
    box-sizing: border-box;
    padding: 0 10px;
}
.activity-avatar {
    width: 24px;
    height: 24px;
    background: #ccc;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.activity-avatar i { font-size: 14px; }
.activity-user { color: #333; font-weight: 500; }
.activity-action { color: #666; }
.activity-time { color: #999; font-size: 12px; }

.activity-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding-left: 15px;
    border-left: 1px solid #e0e0e0;
}
.activity-nav i {
    font-size: 14px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.activity-nav i:hover {
    color: #666;
    transform: scale(1.1);
}
.activity-nav i:active {
    transform: scale(0.9);
}

/* Reference Alignment Utilities */
.d-flex { display: flex !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.overflow-hidden { overflow: hidden !important; }
.rounded { border-radius: 8px !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-5 { margin-right: 3rem !important; }
.ms-3 { margin-left: 1rem !important; }
.p-2 { padding: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pb-0 { padding-bottom: 0px !important; }
.bg-secondary { background-color: #6c757d !important; color: #fff; }
.bg-opacity-10 { --bg-opacity: 0.1; background-color: rgba(108, 117, 125, 0.1) !important; color: inherit; }
.badge { display: inline-block; padding: 0.35em 0.65em; font-size: 0.75em; font-weight: 700; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 4px; }
.bg-secondary.badge { background-color: #6c757d; color: #fff; }

/* Category Filter Icons */
.category-icons {
    background: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
}
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}
.cat-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s;
}
.cat-icon:hover { background: #e9ecef; transform: translateY(-2px); }
.cat-icon i { font-size: 32px; margin-bottom: 8px; }
.cat-icon span { font-size: 13px; color: #666; }

/* Main Content Area */
.main-content {
    padding: 30px 0;
    display: flex;
    gap: 30px;
}
.content-left { flex: 1; }
.content-right { width: 300px; flex-shrink: 0; }

/* Section Title */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 4px solid #2c5aa0;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.resource-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid #e5e5e5;
}
.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.card-thumb {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.resource-card:hover .card-thumb img { transform: scale(1.1); }

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,107,107,0.95);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}
.card-badge.vip { background: rgba(255,193,7,0.95); color: #000; }

.card-price {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 700;
}

.card-body { padding: 15px; }
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.4;
    height: 42px;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

/* Sidebar Widget */
.widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
}
.widget-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* User Widget */
.user-info {
    text-align: center;
    padding: 15px 0;
}
.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid #f0f0f0;
}
.user-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.user-vip {
    display: inline-block;
    padding: 3px 12px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 15px;
}
.user-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    background: #f8f9fa;
    border-radius: 8px;
}
.stat-item {
    text-align: center;
}
.stat-num {
    font-size: 18px;
    font-weight: 700;
    color: #2c5aa0;
}
.stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Hot List */
.hot-list { list-style: none; }
.hot-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.hot-item:last-child { border-bottom: none; }
.hot-rank {
    width: 24px;
    height: 24px;
    background: #e0e0e0;
    color: #666;
    text-align: center;
    line-height: 24px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.hot-item:nth-child(-n+3) .hot-rank {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
}
.hot-info { flex: 1; overflow: hidden; }
.hot-title {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}
.hot-views {
    font-size: 12px;
    color: #999;
}

/* VIP Promo Card */
.vip-promo {
    background: linear-gradient(135deg, #1c5792 0%, #0B73E4 100%);
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    border-radius: 8px;
}
.vip-promo h3 {
    font-size: 20px;
    margin-bottom: 10px;
}
.vip-promo p {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 20px;
}
.vip-btn {
    display: inline-block;
    padding: 10px 30px;
    background: #fff;
    color: #667eea;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
}
.vip-btn:hover { background: #f0f0f0; }

/* Footer */
.site-footer {
    background: #191A1F;
    color: rgba(255,255,255,0.8);
    padding: 50px 0 20px;
    margin-top: 50px;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}
.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
}
.footer-links { list-style: none; }
.footer-links li {
    margin-bottom: 10px;
}
.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

/* Utility */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}
.btn-primary {
    background: #1c5792;
    color: #fff;
}
.btn-primary:hover { background: #154370; }

@media (max-width: 768px) {
    .main-content { flex-direction: column; }
    .content-right { width: 100%; }
    .resource-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .header-search { margin: 0 15px; }
}
