/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 0;
    overflow: hidden;
}

.pulse-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
}

.pulse-rings::before,
.pulse-rings::after {
    content: '';
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

.pulse-rings::before {
    width: 100%;
    height: 100%;
}

.pulse-rings::after {
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.decoration-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.controls {
    position: relative;
    z-index: 2;
}

.control-group {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.label {
    font-weight: 500;
    margin-right: 0.5rem;
}

.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn.active {
    background: white;
    color: #667eea;
}

/* Main Content */
.model-ranking {
    min-height: 100vh;
}

.categories {
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    transition: opacity 0.3s ease-in-out;
}

/* Category Card Styles - 完全透明，无背景 */
.category-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.category-header {
    padding: 0 0 2rem 0;
    border-left: none;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-icon {
    font-size: 2rem;
}

.category-name {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.category-desc {
    color: rgba(31, 41, 55, 0.6);
    font-size: 1rem;
    margin-left: 0.5rem;
}

.category-sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.sort-btn,
.chart-type-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.5rem;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sort-btn.active,
.chart-type-btn.active {
    background: var(--category-color);
    color: white;
    border-color: var(--category-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--category-color);
    transform: translateY(-1px);
}

.sort-btn:not(.active):hover,
.chart-type-btn:not(.active):hover {
    background: rgba(255, 255, 255, 1);
    color: #1f2937;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sort-btn::before,
.chart-type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    transition: left 0.5s ease;
}

.sort-btn:hover::before,
.chart-type-btn:hover::before {
    left: 100%;
}

.sort-btn svg,
.chart-type-btn svg {
    transition: transform 0.3s ease;
}

.sort-btn:hover svg,
.chart-type-btn:hover svg {
    transform: scale(1.1);
}

/* Main Content Area */
.main-content {
    position: relative;
    background: #ffffff;
    min-height: 100vh;
    overflow: hidden;
}

/* Particles Background */
.particles-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.2) 50%, transparent 100%);
    border-radius: 50%;
    animation: float linear infinite;
    opacity: 0;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(var(--random-x)) rotate(360deg);
        opacity: 0;
    }
}

.particle:nth-child(odd) {
    animation-direction: reverse;
    background: radial-gradient(circle, rgba(79, 124, 255, 0.25) 0%, rgba(16, 185, 129, 0.15) 50%, transparent 100%);
}

.particle:nth-child(3n) {
    background: radial-gradient(circle, rgba(245, 101, 101, 0.2) 0%, rgba(251, 191, 36, 0.1) 50%, transparent 100%);
}

/* Ensure content is above particles */
.container {
    position: relative;
    z-index: 2;
}

/* Chart Toggle Switch */
.chart-toggle-switch {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50px;
    padding: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-input {
    display: none;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    position: relative;
    white-space: nowrap;
    min-width: 100px;
    justify-content: center;
}

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

.toggle-input:checked + .toggle-option {
    background: var(--category-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.toggle-option svg {
    transition: transform 0.3s ease;
}

.toggle-input:checked + .toggle-option svg {
    transform: scale(1.1);
}

/* Card Content - 无背景 */
.card-content {
    padding: 0;
}

.charts-section {
    margin-bottom: 2rem;
}

/* Chart Item - 完全透明 */
.chart-item {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 2rem;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Ranking Section */
.ranking-section {
    margin-top: 0;
}

.ranking-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
    text-align: center;
}

.top-models {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Model Row - 卡片式设计，带渐变背景和阴影 */
.model-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 0.875rem 1.25rem;
    background: #fefefe;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.6s ease forwards;
    border: 1px solid rgba(226, 232, 240, 0.3);
    min-height: 68px;
    overflow: visible;
}

.model-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    cursor: pointer;
}

.model-row:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.model-row.champion {
    background: #fffbeb;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.rank {
    font-size: 0.8rem;
    font-weight: 700;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--category-color);
    color: white;
    margin-right: 0.875rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.rank.top-rank {
    background: linear-gradient(135deg, var(--category-color) 0%, var(--category-color) 100%);
}

.model-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-right: 3rem;
    padding-top: 0.125rem;
}

.model-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    flex: 1;
    margin-right: 0.875rem;
    max-width: 420px;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.model-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    text-align: right;
    min-width: 130px;
    white-space: nowrap;
    flex-shrink: 0;
}

.primary-stat {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--category-color);
    line-height: 1.2;
    white-space: nowrap;
    width: 100%;
    text-align: right;
    display: block;
}

.primary-stat span {
    font-size: 0.875rem;
    font-weight: 700;
}

.secondary-stat {
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 400;
    white-space: nowrap;
    width: 100%;
    text-align: right;
    display: block;
}

.secondary-stat span {
    font-weight: 600;
}

.highlight-number {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.highlight-number::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.primary-stat:hover .highlight-number::after,
.model-row.highlight-active .highlight-number::after {
    transform: scaleX(1);
}

/* Counter animation */
.counter-number {
    display: inline-block;
    transition: all 0.3s ease;
}

@keyframes countUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.counter-animate {
    animation: countUp 0.8s ease-out;
}

.model-badges {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 3;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem 0.3rem;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.badge.champion {
    background: #fbbf24;
    color: #92400e;
}

.badge.runner-up {
    background: #d1d5db;
    color: #374151;
}

.badge.third {
    background: #cd7c2f;
    color: #92400e;
}

.badge.top5 {
    background: #fecaca;
    color: #dc2626;
}

.badge.top10 {
    background: #ddd6fe;
    color: #7c3aed;
}

.click-indicator {
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    opacity: 0.7;
    transition: all 0.3s ease;
    transform: translateY(-50%);
}

.model-row:hover .click-indicator {
    opacity: 1;
    color: var(--category-color);
    transform: translateY(-50%) translateX(-2px);
}





/* Expand Toggle */
.expand-toggle {
    margin-top: 2rem;
    text-align: center;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(31, 41, 55, 0.2);
    border-radius: 25px;
    background: rgba(248, 250, 252, 0.8);
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.expand-btn:hover {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(31, 41, 55, 0.3);
}

.expand-icon {
    transition: transform 0.3s ease;
}

.expand-btn.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Category Colors */
.category-card[data-category="对话"] {
    --category-color: #6366f1;
}

.category-card[data-category="绘图"] {
    --category-color: #ec4899;
}

.category-card[data-category="视频"] {
    --category-color: #06b6d4;
}

.category-card[data-category="音乐"] {
    --category-color: #10b981;
}

.category-card[data-category="其他"] {
    --category-color: #8b5cf6;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-overlay p {
    color: white;
    font-size: 1.1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-sort-controls {
        align-self: stretch;
        justify-content: center;
    }
    
    .top-models {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .model-row {
        padding: 1rem 0.75rem;
    }
    
    .model-name {
        font-size: 0.9rem;
    }
    
    .model-badges {
        display: none;
    }
    
    .click-indicator {
        display: none;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 40px 0;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .control-group {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .category-name {
        font-size: 1.5rem;
    }
    
    .model-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
}