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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

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

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.title h1 {
    font-size: 3em;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 1.2em;
    font-weight: 500;
}

.total-count {
    color: #667eea;
}

.last-update {
    color: #764ba2;
}

/* 主要内容 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 前三名展示 */
.top-three {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 40px;
    perspective: 1000px;
}

.top-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 280px;
    transform-style: preserve-3d;
}

.top-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.first-place {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    transform: scale(1.1);
    order: 2;
    z-index: 3;
}

.first-place .crown {
    font-size: 4em;
    animation: bounce 2s infinite;
}

.second-place {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: white;
    order: 1;
    z-index: 2;
}

.third-place {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
    order: 3;
    z-index: 1;
}

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

.crown {
    font-size: 3em;
    margin-bottom: 10px;
    display: block;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.rank {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    opacity: 0.9;
}

.name {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 10px;
    word-break: break-all;
}

.organization {
    font-size: 1.1em;
    margin-bottom: 20px;
    opacity: 0.9;
    word-break: break-all;
}

.target {
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 参与者列表 */
.participants-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.list-header h2 {
    font-size: 1.8em;
    color: #333;
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

.list-container {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 10px;
}

.participants-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.participants-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.participants-table th:first-child {
    border-radius: 10px 0 0 0;
}

.participants-table th:last-child {
    border-radius: 0 10px 0 0;
}

.participants-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.participants-table tbody tr {
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.participants-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(5px);
}

.participants-table tbody tr.highlight {
    background: rgba(102, 126, 234, 0.1);
    animation: highlight 1s ease-out;
}

@keyframes highlight {
    0% { background: rgba(255, 215, 0, 0.3); }
    100% { background: rgba(102, 126, 234, 0.1); }
}

.empty-state {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #666;
}

/* 底部状态栏 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.connection-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    font-weight: 500;
}

#connectionStatus.connected {
    color: #28a745;
}

#connectionStatus.disconnected {
    color: #dc3545;
}

#connectionStatus.connecting {
    color: #ffc107;
}

/* 加载动画 */
.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: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-text {
    font-size: 1.2em;
    font-weight: 500;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 50px;
    right: 20px;
    background: rgba(40, 167, 69, 0.95);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.error {
    background: rgba(220, 53, 69, 0.95);
}

.notification.warning {
    background: rgba(255, 193, 7, 0.95);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }

    .title h1 {
        font-size: 2.5em;
    }

    .top-three {
        gap: 15px;
    }

    .top-card {
        min-width: 240px;
        padding: 25px 20px;
    }
}

@media (max-width: 900px) {
    .top-three {
        flex-direction: column;
        align-items: center;
    }

    .first-place {
        transform: scale(1);
        order: 1;
    }

    .second-place {
        order: 2;
    }

    .third-place {
        order: 3;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .title h1 {
        font-size: 2em;
    }

    .header, .participants-list, .footer {
        padding: 20px;
    }

    .top-card {
        min-width: 100%;
        padding: 20px;
    }

    .name {
        font-size: 1.4em;
    }

    .target {
        font-size: 1.5em;
    }
}

/* 滚动条美化 */
.list-container::-webkit-scrollbar {
    width: 8px;
}

.list-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.list-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.list-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}