:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-gradient-1: #f72585;
    --accent-gradient-2: #4361ee;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --rank-bg: rgba(0, 0, 0, 0.1);
}

/*.dark {*/
/*    --bg-primary: #1a1a2e;*/
/*    --bg-secondary: #16213e;*/
/*    --bg-card: rgba(255, 255, 255, 0.1);*/
/*    --text-primary: #ffffff;*/
/*    --text-secondary: #cccccc;*/
/*    --border-color: rgba(255, 255, 255, 0.1);*/
/*    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);*/
/*    --rank-bg: rgba(255, 255, 255, 0.1);*/
/*}*/

/** {*/
/*    margin: 0;*/
/*    padding: 0;*/
/*    box-sizing: border-box;*/
/*    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;*/
/*}*/

/*body {*/
/*    background: var(--bg-primary);*/
/*    color: var(--text-primary);*/
/*    min-height: 100vh;*/
/*    padding: 20px;*/
/*    position: relative;*/
/*    overflow-x: hidden;*/
/*    transition: background 0.3s ease;*/
/*}*/

/* Background animation */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, var(--bg-secondary) 20%, var(--bg-secondary) 80%, transparent 80%, transparent),
                radial-gradient(circle, transparent 20%, var(--bg-secondary) 20%, var(--bg-secondary) 80%, transparent 80%, transparent) 50px 50px;
    background-size: 100px 100px;
    animation: backgroundMove 15s linear infinite;
    opacity: 0.3;
    z-index: -1;
    transition: background 0.3s ease;
}

@keyframes backgroundMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

/* Dynamic background */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-30px) translateX(15px);
    }
    50% {
        transform: translateY(-10px) translateX(30px);
    }
    75% {
        transform: translateY(-25px) translateX(5px);
    }
    100% {
        transform: translateY(0) translateX(0);
    }
}

.container {
    max-width: var(--mian-max-width);
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--main-bg-color);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: var(--card-shadow);
    position: relative;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--accent-gradient-1), var(--accent-gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.platform-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.platform-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.platform-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.platform-btn.active {
    background: linear-gradient(90deg, var(--accent-gradient-1), var(--accent-gradient-2));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.3);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

.card {
    background: var(--main-bg-color);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px; /* Fixed minimum height for all cards */
    width: 100%!important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.platform-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-gradient-1), var(--accent-gradient-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: white;
}

.platform-name {
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(90deg, var(--accent-gradient-1), var(--accent-gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.trending-list {
    list-style: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.trending-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
}

.trending-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.trending-rank {
    min-width: 24px;
    height: 24px;
    background: var(--rank-bg);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

.trending-rank.top1 {
    background: linear-gradient(45deg, #ff4d4d, #f9cb28);
}

.trending-rank.top2 {
    background: linear-gradient(45deg, #a2a2a2, #d4d4d4);
}

.trending-rank.top3 {
    background: linear-gradient(45deg, #cd7f32, #e6be8a);
}

.trending-title {
    font-size: 0.9rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.trending-title a {
    color: var(--key-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.trending-title a:hover {
    color: var(--accent-gradient-2);
}

.trending-hot {
    font-size: 0.8rem;
    color: var(--accent-gradient-1);
    white-space: nowrap;
    margin-left: 8px;
}

.loading {
    text-align: center;
    padding: 50px;
    grid-column: span 4;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-gradient-2);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4d4d;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .platform-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
}