/* Universal Style Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    height: 1849px;
    min-height: 100vh;
    background: #101010;
    border-radius: 0px;
    color: #333;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.4;
    margin: 0 auto;
    scrollbar-width: thin; /* Firefox */
}

/* Custom scrollbar styles for webkit browsers */
body::-webkit-scrollbar {
    width: 8px;
}
body::-webkit-scrollbar-track {
    background: #1a1a1a;
}
body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Header Navigation Styles - Unified based on home.html design */
header {
    background-color: rgba(0, 0, 0, 0.82);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.78% 5%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    border-bottom: 1px solid #333;
    overflow: hidden;
    min-height: 60px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Logo Container - Desktop Styles */
.logo-container {
    display: flex;
    align-items: center;
    justify-self: start;
}

.logo-image {
    display: flex;
    align-items: center;
}

.logo-image img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.in-logocontainer {
    display: flex;
    align-items: center;
    gap: 0.78%;
}

.logo {
    width: 1.98%;
    height: 2.05%;
    background: linear-gradient(45deg, #ff0058, #ff5e00);
    border-radius: 0.42%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.94rem;
    color: white;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: bold;
    background: linear-gradient(to right, #ff0058, #ff5e00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #ff0058;
}

nav ul li a.active {
    color: #ff0058 !important;
    font-weight: 600;
}

/* Navigation - Center positioned */
nav {
    justify-self: center;
}

/* Nav-right - Right positioned with optimized spacing */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: end;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    flex-shrink: 0 !important;
}

.search-icon, .user-icon {
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
    flex-shrink: 0;
}

.user-icon-img {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain;
    display: block;
    flex-shrink: 0 !important;
}

.search-icon:hover, .user-icon:hover {
    color: #ff0058;
}

.download-btn {
    background: linear-gradient(45deg, #ff0058, #ff5e00);
    color: white;
    border: none;
    padding: 6px 12px !important;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
    min-width: 0;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-btn:hover {
    transform: scale(1.05);
}

/* Home Button Styles - for article page */
.home-btn {
    color:#777777;
    padding: 10px 20px;
    transition: transform 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.home-btn:hover {
    transform: scale(1.05);
}

/* Footer Styles - Unified based on home.html design */
footer {
    width: 1920px;
    height: 98px;
    background: #242424;
    border-radius: 0px;
    margin: 0 auto;
    padding: 20px 5%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    max-width: 100%;
    box-sizing: border-box;
}

.footer-brand {
    height: auto;
    max-height: 60px;
    object-fit: contain;
    display: block;
}

/* Unified Content Styles - Applied across all pages */
.content-section {
    width: 68.75%;
    padding: 30px 0;
    position: relative;
    background: #101010;
    min-height: calc(100vh - 200px);
    margin: 0 auto;
    max-width: 100%;
    box-sizing: border-box;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h2 {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-family: 'PingFang SC', 'PingFang SC', sans-serif;
    font-weight: 600;
    font-size: 32px;
    color: #FFFFFF;
    text-align: left;
    font-style: normal;
    text-transform: none;
    margin: 0;
}

.hot-icon {
    height: auto;
    max-height: 40px;
    object-fit: contain;
}

.view-all {
    width: auto;
    min-width: 86px;
    height: 34px;
    color: #AAAAAA;
    text-decoration: none;
    font-family: 'PingFang SC', 'PingFang SC', sans-serif;
    font-weight: 500;
    font-size: 24px;
    text-align: right;
    font-style: normal;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background-color: transparent;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 1;
    position: relative;
    z-index: 9999;
}

.view-all:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.view-all-icon {
    width: 20px;
    height: 20px;
    border-radius: 0px;
    object-fit: contain;
    display: inline-block !important;
    opacity: 1 !important;
    filter: none;
    vertical-align: middle;
    visibility: visible !important;
    position: relative;
    z-index: 10000;
}

.view-all-text {
    color: #AAAAAA;
    font-family: 'PingFang SC', 'PingFang SC', sans-serif;
    font-weight: 500;
    font-size: 24px;
    text-align: right;
    font-style: normal;
    text-transform: none;
    white-space: nowrap;
    line-height: 34px;
}

/* Unified Card Styles - Applied across all pages */
.card {
    width: calc((100% - 60px) / 4);
    min-height: 300px;
    height: auto;
    background: transparent;
    border-radius: 11px;
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    align-items: flex-start;
    max-width: 100%;
    box-sizing: border-box;
}

.card:hover {
    transform: scale(1.02);
    width: calc((100% - 60px) / 4);
    height: auto;
    border-radius: 11px;
    z-index: 1000;
}

.card-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    flex-shrink: 0;
    position: relative;
    border-radius: 11px;
}

.card-top-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    height: auto;
    max-height: 50px;
    object-fit: contain;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 8px;
    gap: 10px;
}

.card-badge {
    display: none;
    width: auto;
    min-width: 106px;
    height: 36px;
    background: #F54749;
    border-radius: 29px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.card:hover .card-badge {
    display: flex;
}

.card-badge:hover {
    background: #ff5a5c;
    transform: scale(1.05);
}

.play-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.play-text {
    font-family: 'PingFang SC', 'PingFang SC', sans-serif;
    font-weight: bold;
    font-size: 18px;
    color: #FFFFFF;
    line-height: 28px;
    text-align: left;
    font-style: normal;
    text-transform: none;
    white-space: nowrap;
}

.card-content {
    width: 100%;
    padding: 10px 0 !important;
    background: transparent;
    transition: all 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box;
    margin-top: 0px !important;
    position: relative;
    z-index: 100;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
    min-height: 50px !important;
    height: auto !important;
    max-width: 100%;
}

.card:hover .card-content {
    width: 100%;
    height: auto;
    background: #2B2B2B;
    border-radius: 0px 0px 11px 11px;
    padding: 20px 15px !important;
    margin-top: 0;
    min-height: 150px !important;
}

.card-title {
    font-family: 'PingFang SC', 'PingFang SC', sans-serif;
    font-weight: bold;
    font-size: 20px;
    color: #FFFFFF !important;
    line-height: 32px;
    text-align: left;
    font-style: normal;
    text-transform: none;
    margin: 0;
    transition: color 0.3s ease;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative;
    z-index: 101;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card:hover .card-title {
    color: #FFFFFF;
}

.card-desc,
.card-content p.card-desc,
.card-content .card-desc {
    font-family: 'PingFang SC', 'PingFang SC', sans-serif !important;
    font-weight: 500 !important;
    font-size: 16px !important;
    color: #777777 !important;
    text-align: left !important;
    font-style: normal !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    transition: color 0.3s ease;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative !important;
    z-index: 101 !important;
    margin: 0 !important;
    margin-top: 4px !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 20px !important;
    overflow: visible !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.card:hover .card-desc {
    color: #777777 !important;
}

/* 确保描述文字在所有情况下都显示 */
.card-content p,
.card-content .card-desc {
    color: #777777 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
    justify-content: flex-start;
    /* Smooth transition for content updates to reduce flicker */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Smooth content transition states */
.card-container.content-updating {
    opacity: 0.7;
    transform: translateY(2px);
}

.card-container.content-loaded {
    opacity: 1;
    transform: translateY(0);
}



/* Category Filter Section - Visible on both PC and Mobile */
.category-filter-section {
    width: 68.75%;
    margin: 0 auto;
    padding: 2.46% 0;
    padding-bottom: 3%;
    background: #101010;
    display: block;
    box-sizing: border-box;
    overflow: visible;
}

.category-filter-section .category-filter-title {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.category-filter-section .category-filter-tabs {
    width: 100%;
    margin-top: 1.97%;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 0 !important;
}

.category-filter-title {
    display: flex;
    align-items: center;
    gap: 0;
}

.category-back-btn {
    display: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.back-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.category-filter-title-text {
    font-family: 'PingFang SC', 'PingFang SC', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    color: #FFFFFF;
    text-align: left;
    font-style: normal;
    text-transform: none;
    margin: 0;
    width: auto;
    height: auto;
    line-height: 1.2;
    margin-right: 0;
    padding-right: 0;
}

.category-filter-icon {
    width: auto;
    height: 2rem;
    max-height: 32px;
    object-fit: contain;
    margin-left: 8px;
    flex-shrink: 0;
}

.category-filter-tab-home {
    display: block;
}

.category-filter-tabs {
    display: flex;
    gap: 3.2%;
    flex-wrap: nowrap;
    min-height: auto;
    overflow: visible;
    width: 100%;
}

.category-filter-tab {
    font-family: 'PingFang SC', 'PingFang SC', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #777777;
    text-align: left;
    font-style: normal;
    text-transform: none;
    background: transparent;
    border: none;
    padding: 8px 0;
    cursor: pointer;
    width: auto;
    height: auto;
    white-space: nowrap;
    min-height: 32px;
    line-height: 1.5;
    transition: color 0.3s;
}

.category-filter-tab.active {
    color: #F54749 !important;
}

/* Responsive Design - Mobile Header */
@media (max-width: 768px) {
    .content-section{
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .icon-search-alt.search-icon {
        display: none !important;
    }

    .mobile-category-section {
        display: block !important;
    }
    body {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    html {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }
    
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Mobile Header - Override grid layout for mobile */
    header {
        padding: 0 16px !important;
        background: transparent;
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        max-width: 100% !important;
        height: 60px !important; /* Fixed height for mobile header */
        min-height: 60px !important;
        z-index: 9999;
        border-bottom: none;
        display: flex !important; /* Override grid layout */
        grid-template-columns: none !important; /* Disable grid */
        justify-content: space-between !important;
        align-items: center !important;
        box-sizing: border-box !important;
        margin-bottom: 0;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    
    /* Mobile Back Button */
    .mobile-back-btn {
        display: block;
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        z-index: 10000;
    }
    
    .mobile-back-btn img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }
    
    /* Mobile Navigation - Hide and override grid positioning */
    nav {
        display: none;
        justify-self: auto !important; /* Override desktop grid positioning */
    }
    
    /* Header logo container - mobile positioning */
    header .logo-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 0;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        padding: 0;
        margin: 0;
    }
    
    /* Footer logo container - normal flow */
    footer .logo-container {
        position: static;
        transform: none;
        height: auto;
        display: flex;
        align-items: center;
        //justify-content: center;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* Footer brand image - mobile responsive */
    .footer-brand {
        height: auto !important;
        max-height: 50px !important;
        width: auto !important;
        max-width: 200px !important;
        object-fit: contain !important;
        display: block !important;
    }
    
    .logo-image {
        position: relative;
        height: 28px; /* Adjust logo height */
        display: flex;
        align-items: center;
    }
    
    .logo-image img {
        width: auto;
        height: 100%;
        object-fit: contain;
        display: block;
    }
    
    .nav-right {
        position: relative !important;
        top: 0;
        right: 0;
        gap: 8px !important; /* Increased from 0 to prevent cramping */
        display: flex !important;
        align-items: center !important;
        height: 100% !important;
        justify-self: auto !important; /* Override desktop grid positioning */
        margin-left: auto !important; /* Push to right if needed, but absolute positioning handles center logo */
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    
    .search-icon,
    .download-btn {
        display: none;
    }
    
    /* Hide language switcher on mobile based on mockup */
    .language-switcher {
        display: block; /* Keep it for now if user wants, but layout suggests specific design */
    }
    
    /* Special override for language switcher in this specific layout request if needed, 
       but user only asked for back button. Assuming standard right side items.
       If language switcher causes clutter, we might need to hide it or move it.
       For now, let's keep login status visible.
    */
    .language-switcher {
        display: none !important; /* Hide language switcher on mobile to match mockup clean look */
    }
    
    .login-status {
        order: 2;
    }
    
    .logged-out {
        display: flex;
        align-items: center;
        padding: 0;
        background: transparent;
    }
    
    .logged-out:hover {
        background: transparent;
    }
    
    .user-icon-img {
        width: 24px !important;
        height: 24px !important;
        object-fit: contain;
        display: block;
        flex-shrink: 0 !important;
    }
    
    .login-text {
        display: none;
    }
    
    .home-btn, .download-btn {
        display: none;
    }
    
    .logo-text {
        display: none;
    }
    
    .logo {
        display: none;
    }
    
    footer {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 80px !important;
        padding: 20px 16px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        box-sizing: border-box;
    }
    
    .card {
        max-width: 100% !important;
        box-sizing: border-box;

    }
    
    .card-img {
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .card-content {
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .section-title {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 4.27% 0 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    .title-with-icon {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0;
        min-width: 0;
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    .section-title h2 {
        font-size: 1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .hot-icon {
        width: auto !important;
        height: auto !important;
        max-height: 34px !important;
        flex-shrink: 0;
        object-fit: contain;
    }
    
    .view-all {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex-shrink: 0;
        min-width: auto;
    }
    
    .view-all-text {
        font-size: 0.7rem !important;
        white-space: nowrap;
    }
    
    .view-all-icon {
        width: 12px !important;
        height: 12px !important;
        flex-shrink: 0;
    }
    
    /* Unified Mobile Card Layout */
    .content-section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 30px 20px !important;
        margin: 20px auto 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    .category-filter-section {
        width: 100% !important;
        padding: 2.46% 20px !important;
        padding-bottom: 3% !important;
        margin-top: 18% !important;
        min-height: 7.88%;
        box-sizing: border-box;
    }
    
    .category-filter-section .category-filter-title {
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .category-filter-section .category-filter-tabs {
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        display: flex !important;
        gap: 15px !important;
    }

    .category-filter-section .category-filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .category-filter-tab {
        flex-shrink: 0 !important;
    }
    
    .category-back-btn {
        display: block !important;
        width: 24px;
        height: 24px;
    }
    
    .back-icon {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .category-filter-title {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px;
        position: relative;
        padding: 0 40px;
        box-sizing: border-box;
    }
    
    .category-filter-title-text {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        flex: 0 0 auto;
        width: auto;
        height: auto !important;
        line-height: 1.2 !important;
        max-width: calc(100% - 80px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        z-index: 1;
    }
    
    .category-back-btn {
        z-index: 2;
        flex-shrink: 0;
    }
    
    .category-filter-icon {
        margin-left: 0;
        z-index: 2;
        flex-shrink: 0;
    }
    
    .category-filter-tab-home {
        display: none !important;
    }
    
    .card-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100% !important;
        max-width: 100% !important;
        align-items: center;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    .card {
        width: 100%;
        max-width: 312px;
        height: auto;
        min-height: 300px;
        flex-direction: column;
    }
    
    .card-img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        aspect-ratio: 312 / 300;
        max-height: 300px;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .card-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 0;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }
    
    .card:hover .card-content {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .card-title-row {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .view-all {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
   
    
    /* Mobile Category Section */
    .mobile-category-section {
        width: 100% !important;
        padding: 2.46% 4.27% !important;
        padding-bottom: 3% !important;
        background: #101010;
        display: none;
        box-sizing: border-box;
        overflow: visible;
    }
    
    .mobile-category-title {
        display: flex;
        align-items: center;
        gap: 2.13%;
        margin-bottom: 1.97%;
    }
    
    .mobile-category-title-text {
        font-family: 'PingFang SC', 'PingFang SC', sans-serif;
        font-weight: 600;
        font-size: 1.15rem;
        color: #FFFFFF;
        text-align: left;
        font-style: normal;
        text-transform: none;
        margin: 0;
        width: 35.2%;
        height: 3.82%;
        line-height: 3.82%;
    }
    
    .mobile-category-icon {
        width: auto;
        height: 3.82%;
        max-height: 31px;
        object-fit: contain;
    }
    
    .mobile-category-tabs {
        display: flex;
        gap: 3.2%;
        flex-wrap: nowrap;
        min-height: auto;
        overflow: visible;
        width: 100%;
    }
    
    .mobile-category-tab {
        font-family: 'PingFang SC', 'PingFang SC', sans-serif;
        font-weight: 600;
        font-size: 0.78rem;
        color: #777777;
        text-align: left;
        font-style: normal;
        text-transform: none;
        background: transparent;
        border: none;
        padding: 8px 0;
        cursor: pointer;
        width: auto;
        height: auto;
        white-space: nowrap;
        min-height: 32px;
        line-height: 1.5;
        transition: color 0.3s;
    }
    
    .mobile-category-tab.active {
        color: #F54749 !important;
    }
    
    /* Mobile Card Styles */
    .card-badge {
        display: none !important;
    }
    
    .card {
        width: 100% !important;
        height: 19.58% !important;
        min-height: 159px !important;
        max-height: 159px !important;
        border-radius: 0.74% !important;
        flex-direction: row !important;
        align-items: stretch !important;
        padding: 0 !important;
        gap: 0 !important;
        overflow: visible !important;
        position: static !important;
    }
    
    .card-img {
        width: 44% !important;
        height: 100% !important;
        min-height: 159px !important;
        max-height: 159px !important;
        border-radius: 0.74% 0 0 0.74% !important;
        flex-shrink: 0 !important;
        object-fit: cover !important;
        cursor: pointer !important;
        position: relative !important;
    }
    
    .card-top-icon {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        z-index: 20 !important;
        height: auto !important;
        max-height: 24px !important;
        width: auto !important;
        object-fit: contain !important;
    }
    
    .card-content {
        width: 56% !important;
        padding: 2.13% !important;
        margin-top: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        height: 100% !important;
        box-sizing: border-box !important;
    }
    
    .card-title-row {
        width: 100% !important;
        margin-bottom: 1.48% !important;
    }
    
    .card-title {
        font-size: 0.73rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.48% !important;
    }
    
    .card-desc {
        font-size: 0.63rem !important;
        margin-top: 0 !important;
    }
    
    .card-container {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 20px !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }
    
    .card:hover {
        transform: none !important;
    }
    
    .card:hover .card-content {
        background: transparent !important;
        width: 56% !important;
        height: 100% !important;
        padding: 2.13% !important;
    }
    
    
    * {
        max-width: 100%;
    }
    
    img, video, iframe, svg {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Prevent any element from causing horizontal scroll */
    body > * {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Ensure all containers respect viewport width */
    .container, .wrapper, section, article, aside, main {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .card-title {
        font-size: 20px;
        line-height: 32px;
        margin-bottom: 8px;
    }
    
    .card-desc {
        font-size: 16px !important;
        margin-top: 4px;
        color: #777777 !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }
}

/* ==================== Login Status Styles ==================== */

.login-status {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    max-width: 200px !important;
}

.logged-out {
    display: flex;
    align-items: center;
    gap: 6px !important;
    cursor: pointer;
    padding: 8px 14px !important;
    border-radius: 15px;
    transition: background-color 0.3s;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: 0;
    max-width: 110px;
    overflow: hidden;
}

.logged-out:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.login-text {
    color: #fff;
    font-size: 14px !important;
    font-weight: 500;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.logged-in {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    max-width: 220px !important;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff0058, #ff5e00);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.avatar-text {
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.welcome-text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.hidden {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .login-text,
    .welcome-text {
        display: none;
    }
    
    .logged-out {
        padding: 6px;
    }
    
    .logout-btn {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* Small Mobile Devices - Further Optimization */
@media (max-width: 480px) {
    .nav-right {
        gap: 5px; /* 更緊湊的間距 */
    }
    
    .home-btn, .download-btn {
        padding: 6px 10px; /* 進一步縮小 */
        font-size: 13px;
    }
    
    .login-status {
        gap: 4px; /* 從8px縮小 */
    }
    
    .user-icon {
        font-size: 18px; /* 從20px縮小 */
    }
    
    .user-avatar {
        width: 28px; /* 從32px縮小 */
        height: 28px;
    }
    
    .logout-btn {
        padding: 2px 6px; /* 進一步縮小 */
        font-size: 10px;
    }
}

/* Very Small Mobile Devices */
@media (max-width: 360px) {
    .nav-right {
        gap: 3px;
    }
    
    .search-icon {
        font-size: 16px;
    }
}

/* Header Line Protection - Prevent wrapping on all screen sizes */
@media (max-width: 1024px) {
    header {
        padding: 8px 3%;
        min-height: 50px;
    }
    
    .nav-right {
        gap: 10px !important;
        flex-wrap: nowrap !important;
        overflow: hidden;
    }
    
    .download-btn, .home-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
    
    .login-status {
        gap: 6px !important;
    }
}

/* Extra protection for very small screens */
@media (max-width: 480px) {
    header {
        padding: 6px 2% !important;
        min-height: 48px;
    }
    
    .nav-right {
        gap: 6px !important;
    }
    
    .download-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .login-text {
        font-size: 14px !important;
    }
}

/* Universal Header Anti-Wrap Protection - Covers all screen sizes */
@media screen and (min-width: 320px) and (max-width: 1920px) {
    header {
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Force no-wrap on all header elements */
    .nav-right,
    .login-status,
    .logged-out,
    .logged-in {
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }
    
    /* Text truncation safety */
    .login-text,
    .welcome-text,
    .download-btn {
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }
    
    /* Maximum width constraints to prevent overflow */
    .download-btn {
        max-width: 100px !important;
    }
    
    .login-status {
        max-width: 140px !important;
    }
    
    .logged-in {
        max-width: 200px !important;
    }
}

/* ==================== User Dropdown Menu Styles ==================== */

.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    overflow: visible !important;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background-color 0.3s;
    user-select: none;
    white-space: nowrap;
}

.user-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    color: #fff;
    font-size: 10px;
    transition: transform 0.3s;
    margin-left: 4px;
}

.user-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: fixed;
    top: 68px; /* Header height + margin */
    right: 5%; /* Match header padding */
    min-width: 180px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 10000; /* Higher than header z-index */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    background: none;
    border: none;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item:active {
    background: #e8e8e8;
}

.dropdown-icon {
    font-size: 16px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.logout-item {
    border-top: 1px solid #f0f0f0;
    color: #e74c3c;
}

.logout-item:hover {
    background: #fff5f5;
}

/* Mobile dropdown styles */
@media (max-width: 768px) {
    .user-trigger {
        gap: 6px;
        padding: 4px 6px;
    }
    
    .dropdown-arrow {
        font-size: 8px;
    }
    
    .user-dropdown-menu {
        min-width: 160px;
        top: 60px; /* Mobile header height */
        right: 16px; /* Mobile padding */
    }
    
    .dropdown-item {
        padding: 14px 16px; /* Larger touch targets */
        font-size: 15px;
    }
    
    .dropdown-icon {
        font-size: 18px;
        width: 18px;
    }
}

/* Hide Profile link in dropdown menu */
.user-dropdown-menu a[href="profile.html"] {
    display: none !important;
}
