/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 加载状态样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4FC2D1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-container p {
    color: #666;
    font-size: 16px;
}

/* 错误状态样式 */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    text-align: center;
    padding: 20px;
}

.error-container h2 {
    color: #e74c3c;
    margin-bottom: 10px;
}

.error-container p {
    color: #666;
    margin-bottom: 20px;
}

.retry-btn {
    background-color: #4FC2D1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.retry-btn:hover {
    background-color: #3a9ca8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
    overflow-x: hidden;
}

/* 容器样式 */
.container {
    max-width: 100%;
    padding: 1rem;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 紧凑型标题样式 */
.header.compact {
    padding: 0.5rem;
}

.header.compact h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.header.compact h2 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.header h1 {
    font-size: 12rem;
    color: #4FC2D1;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.header h2 {
    font-size: 5.2rem;
    color: #4FC2D1;
    margin-bottom: 0.5rem;
}

.info-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.update-time, .total-votes, .countdown, .voting-ended {
    font-size: 1.5rem;
    color: #666;
}

.update-time, .total-votes {
    font-weight: bold;
    animation: pulse 2s infinite;
}

.total-votes {
    color: #ff5252;
}

.update-time {
    color: #007AFF;
}

/* 结束投票按钮样式 */
.end-vote-btn {
    padding: 8px 16px;
    background-color: #ff3b30;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.end-vote-btn:hover {
    background-color: #d81e12;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.end-vote-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.voting-ended {
    font-weight: bold;
    color: #ff3b30;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 投票数字显示框 */
.vote-numbers-container {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    padding: 0.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.vote-number-box {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    min-width: 3rem;
    transition: all 0.3s ease;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    position: relative;
    overflow: hidden;
}

/* 图表区域 */
.chart-area {
    flex: 1;
    position: relative;
    height: 100%;
    padding-bottom: 120px; /* 增加为头像区域预留的空间 */
    overflow: hidden;
}

/* 投票数据容器 */
.vote-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100%;
    padding-top: 10px;
    position: relative;
    z-index: 1;
}

/* 投票项目 */
.vote-item {
    flex: 1;
    height: calc(100% - 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    padding: 0 10px;
    transition: all 0.3s ease;
    min-width: 45px; /* 确保每个项目有最小宽度 */
}

/* 前10名样式 */
.vote-item.top-ten {
    transform: scale(1.15);
    z-index: 10;
}

.vote-item.top-ten .vote-bar {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.vote-item.top-ten .avatar-circle {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

/* 投票柱 */
.vote-bar {
    width: 100%;
    max-width: 40px;
    border-radius: 10px 10px 0 0;
    transition: height 0.5s ease;
}

/* 模特头像 */
.model-avatar {
    margin-top: 20px;
    position: absolute;
    bottom: -80px; /* 调整头像位置，使其更靠上 */
    width: 100%;
    display: flex;
    justify-content: center;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 3px solid white;
    transition: all 0.3s ease;
}

/* 晋级线样式 */
.qualification-line {
    position: absolute;
    top: 10px;
    bottom: 130px;
    left: auto;
    right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    width: 5px;
    pointer-events: none; /* 防止干扰点击 */
}

.qualification-line .line {
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 1), rgba(255, 215, 0, 0.3));
    box-shadow: 0 0 8px gold, 0 0 15px rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content, .vote-numbers-container {
    animation: fadeIn 0.5s ease-out;
}

/* 响应式设计 */
@media screen and (max-width: 1200px) {
    .vote-container {
        padding: 0 5px;
    }
    
    .vote-item {
        padding: 0 5px;
    }
    
    .avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .vote-number-box {
        font-size: 1.2rem;
        min-width: 2.5rem;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 3.6rem;
    }
    
    .header h2 {
        font-size: 3.1rem;
    }
    
    .vote-bar {
        max-width: 25px;
    }
    
    .avatar-circle {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .vote-number-box {
        font-size: 1rem;
        min-width: 2rem;
    }
    
    .info-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 排名变化动画 */
.vote-item.rank-up {
    animation: rankUp 2s ease;
}

.vote-item.rank-down {
    animation: rankDown 2s ease;
}

@keyframes rankUp {
    0% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-20px);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
        box-shadow: 0 0 20px rgba(52, 199, 89, 0.5);
        z-index: 10;
    }
    75% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes rankDown {
    0% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(20px);
    }
    50% {
        transform: translateY(20px) scale(0.95);
        opacity: 0.8;
    }
    75% {
        transform: translateY(20px);
    }
    100% {
        transform: translateY(0);
    }
}

/* 投票数字动画 */
.vote-number-box.rank-up {
    animation: numberUp 1.5s ease;
}

.vote-number-box.rank-down {
    animation: numberDown 1.5s ease;
}

@keyframes numberUp {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        color: #34C759;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes numberDown {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
        color: #FF3B30;
    }
    100% {
        transform: scale(1);
    }
}

/* 获胜者特效样式 */
.vote-item.winner {
    animation: winnerPulse 1.5s infinite alternate;
    z-index: 20;
}

.vote-item.winner .vote-bar {
    box-shadow: 0 0 30px gold;
    animation: winnerGlow 1.5s infinite alternate;
}

.vote-item.winner .avatar-circle {
    transform: scale(1.5);
    border: 5px solid gold;
    box-shadow: 0 0 20px gold;
    animation: winnerRotate 4s infinite linear;
}

.winner-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    pointer-events: none;
}

.winner-message {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    font-weight: bold;
    color: gold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: messageAppear 1s ease;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    max-width: 80%;
    text-align: center;
}

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(gold 2px, transparent 2px),
        radial-gradient(red 2px, transparent 2px),
        radial-gradient(blue 2px, transparent 2px),
        radial-gradient(green 2px, transparent 2px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px, 30px 10px, 10px 30px;
    animation: confettiMove 10s linear infinite;
}

@keyframes winnerPulse {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

@keyframes winnerGlow {
    0% {
        box-shadow: 0 0 15px gold;
    }
    100% {
        box-shadow: 0 0 30px gold, 0 0 50px white;
    }
}

@keyframes winnerRotate {
    0% {
        transform: scale(1.5) rotate(0deg);
    }
    100% {
        transform: scale(1.5) rotate(360deg);
    }
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes confettiMove {
    0% {
        background-position: 0 0, 20px 20px, 30px 10px, 10px 30px;
    }
    100% {
        background-position: 100px 100px, 120px 120px, 130px 110px, 110px 130px;
    }
}

/* 为logo添加样式 */
.logo-container {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 10;
}

.logo {
    width: 220px;
    height: auto;
} 