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

html {
    background: #0f3460;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: auto;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.header-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 通用按钮样式 */
.rank-btn, .bilibili-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.rank-btn {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    box-shadow: 0 4px 15px rgba(72, 219, 251, 0.3);
}

.rank-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 219, 251, 0.4);
    background: linear-gradient(135deg, #0abde3, #48dbfb);
}

.bilibili-link {
    background: linear-gradient(135deg, #fb7299, #ff85a2);
    box-shadow: 0 4px 15px rgba(251, 114, 153, 0.3);
    gap: 8px;
}

.bilibili-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 114, 153, 0.4);
    background: linear-gradient(135deg, #ff85a2, #fb7299);
}

.bili-icon {
    background: white;
    color: #fb7299;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 30px;
    margin-bottom: 30px;
}

.map-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

.back-btn {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(72, 219, 251, 0.3);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 219, 251, 0.4);
    background: linear-gradient(135deg, #0abde3, #48dbfb);
}

.back-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

#china-map {
    width: 100%;
    height: 600px;
}

/* Loading 遮罩层 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(72, 219, 251, 0.3);
    border-top-color: #48dbfb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 20px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
}

.info-panel {
    width: 350px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

.info-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #a0a0a0;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.info-content {
    position: relative;
}

.close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 107, 107, 0.8);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    background: #ff6b6b;
}

.info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #48dbfb;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding-right: 8px;

    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: #48dbfb rgba(255, 255, 255, 0.1);
}

/* WebKit 滚动条样式 */
.video-list::-webkit-scrollbar {
    width: 8px;
}

.video-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.video-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

.video-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0abde3, #48dbfb);
}

.video-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    border-color: rgba(72, 219, 251, 0.5);
}

.video-title {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

.video-meta {
    color: #a0a0a0;
    font-size: 0.8rem;
}

footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
}

footer a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #00a1d6;
}

/* 排行榜面板 */
.rank-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.rank-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(72, 219, 251, 0.3);
    display: flex;
    flex-direction: column;
}

.rank-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 107, 107, 0.8);
    color: white;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.rank-close-btn:hover {
    background: #ff6b6b;
}

.rank-content h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #48dbfb;
    text-align: center;
    flex-shrink: 0;
}

.rank-desc {
    text-align: center;
    color: #a0a0a0;
    margin-bottom: 25px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* 切换按钮 */
.rank-toggle-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-shrink: 0;
}
.rank-toggle-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.rank-toggle-btn {
    flex: 1;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #a0a0a0;
    border: 1px solid rgba(72, 219, 251, 0.3);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.rank-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(72, 219, 251, 0.5);
}

.rank-toggle-btn.active {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(72, 219, 251, 0.3);
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    min-height: 0;

    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: #48dbfb rgba(255, 255, 255, 0.1);
}

/* WebKit 滚动条样式 */
.rank-list::-webkit-scrollbar {
    width: 8px;
}

.rank-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.rank-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

.rank-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0abde3, #48dbfb);
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px 20px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(72, 219, 251, 0.3);
    transform: translateX(5px);
}

.rank-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
    border-color: rgba(255, 215, 0, 0.5);
}

.rank-item.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(169, 169, 169, 0.1));
    border-color: rgba(192, 192, 192, 0.5);
}

.rank-item.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(184, 134, 11, 0.1));
    border-color: rgba(205, 127, 50, 0.5);
}

.rank-number {
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    text-align: center;
    margin-right: 15px;
}

.rank-1 .rank-number {
    color: #ffd700;
}

.rank-2 .rank-number {
    color: #c0c0c0;
}

.rank-3 .rank-number {
    color: #cd7f32;
}

.rank-name {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.rank-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.rank-coverage {
    font-size: 1.3rem;
    font-weight: bold;
    color: #48dbfb;
}

.rank-detail {
    font-size: 0.8rem;
    color: #a0a0a0;
}

.rank-bar-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #48dbfb, #0abde3);
    border-radius: 0 0 12px 12px;
    transition: width 0.5s ease;
}

.rank-item {
    position: relative;
}

/* 地区排行样式 */
.rank-rank-item {
    align-items: flex-start;
}

.rank-content-wrapper {
    flex: 1;
    min-width: 0;
}

.rank-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}

.region-provinces {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.region-province-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid rgba(72, 219, 251, 0.2);
}

.region-province-name {
    color: #fff;
    font-weight: 500;
}

.region-province-stats {
    color: #48dbfb;
    font-weight: 600;
}

/* 最期待榜样式 */
.expected-rank-item {
    align-items: flex-start;
}

.expected-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
    flex-shrink: 0;
}

.vote-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vote-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: #feca57;
}

.vote-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #feca57, #ff9f43);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(254, 159, 67, 0.3);
}

.vote-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 159, 67, 0.4);
}

.vote-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
}

.expected-desc {
    margin-top: 12px;
    padding: 10px;
    background: rgba(72, 219, 251, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fff;
    line-height: 1.5;
}

/* 投票界面样式 */
.vote-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.vote-ui-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

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

.vote-ui-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #feca57;
    margin-bottom: 12px;
}

.vote-ui-desc {
    font-size: 1rem;
    color: #a0a0a0;
    margin-bottom: 20px;
    line-height: 1.6;
}

.vote-ui-stats {
    margin-bottom: 20px;
}

.vote-ui-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: #48dbfb;
}

.vote-ui-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #feca57, #ff9f43);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(254, 159, 67, 0.3);
}

.vote-ui-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 159, 67, 0.4);
}

.vote-ui-btn.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
}

/* 投票确认对话框 */
.vote-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.vote-confirm-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease;
}

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

.vote-confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.vote-confirm-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #feca57;
    margin: 0 0 16px 0;
}

.vote-confirm-text {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 12px;
}

.vote-confirm-city {
    font-weight: bold;
    color: #48dbfb;
}

.vote-confirm-note {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin-bottom: 24px;
}

.vote-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.vote-confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.vote-confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.vote-confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vote-confirm-btn.confirm {
    background: linear-gradient(135deg, #feca57, #ff9f43);
    color: white;
    box-shadow: 0 4px 15px rgba(254, 159, 67, 0.3);
}

.vote-confirm-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 159, 67, 0.4);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .info-panel {
        width: 100%;
    }

    .video-list {
        max-height: 400px;
    }

    #china-map {
        height: 500px;
    }
}

@media (max-width: 640px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    #china-map {
        height: 400px;
    }

    .info-panel {
        padding: 20px;
    }

    .info-content h2 {
        font-size: 1.5rem;
    }

    .video-list {
        max-height: 300px;
    }
}
