/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 8px 8px 5px 8px;
    max-width: 1200px;
    width: 100%;
    min-height: auto;
    overflow: visible;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.8s ease-out;
}

/* 容器动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标题 */
h1 {
    text-align: center;
    color: #764ba2;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(118, 75, 162, 0.3);
    animation: titleGlow 2s ease-in-out infinite;
}

/* 标题动画 */
@keyframes titleGlow {

    0%,
    100% {
        text-shadow: 2px 2px 4px rgba(118, 75, 162, 0.3);
    }

    50% {
        text-shadow: 2px 2px 8px rgba(118, 75, 162, 0.4);
    }
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* 排行榜容器 */
#rankingContainer {
    min-height: 600px;
}

/* 排行榜布局 */
.ranking-wrapper {
    display: grid;
    grid-template-columns: 0.7fr 0.9fr;
    gap: 20px;
    height: 100%;
    max-width: 1100px;
    margin: 0 auto;
    margin-bottom: 10px;
}

/* 左侧列 */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

/* 冠军盒子 */
.champion-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(245, 87, 108, 0.4);
    flex: 2;
}

/* 冠军图片 */
.champion-image {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 7px solid white;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    margin-bottom: 25px;
    background: white;
}

/* 亚军图片 */
.runner-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    background: white;
}

/* 亚军盒子 */
.runner-up-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: 1;
}

/* 亚军列表 */
.runner-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 冠军样式 */
.champion {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    transform: scale(1.05);
    position: relative;
    overflow: hidden;
}

.champion::before {
    content: '👑';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 3em;
    opacity: 0.3;
    transform: rotate(15deg);
}

/* 亚军季军容器 */
.runners-up {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 亚军季军样式 */
.runner-up {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(192, 192, 192, 0.3);
    position: relative;
}

.runner-up.second {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.runner-up.third {
    background: linear-gradient(135deg, #cd7f32 0%, #e4a853 100%);
}

/* 冠军名称 */
.champion-name {
    color: white;
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 冠军积分 */
.champion-score {
    color: white;
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 亚军名称 */
.runner-name {
    color: #764ba2;
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 5px;
}

/* 亚军积分 */
.runner-score {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1em;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state .icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #764ba2;
}

.empty-state p {
    font-size: 1.2em;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* 右侧列 */
.right-column {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 排行榜表格 */
.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.ranking-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.ranking-table th:first-child {
    border-radius: 10px 0 0 10px;
}

.ranking-table th:last-child {
    border-radius: 0 10px 10px 0;
}

.ranking-table td {
    padding: 15px;
    background: white;
}

.ranking-table tr:hover td {
    background: #f8f9fa;
}

.ranking-table td:first-child {
    border-radius: 10px 0 0 10px;
}

.ranking-table td:last-child {
    border-radius: 0 10px 10px 0;
}

/* 排行榜项目 */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.rank-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5em;
    margin-right: 20px;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
    text-align: left;
}

.rank-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.rank-details {
    color: #666;
    font-size: 0.9em;
}

/* 冠军特殊样式 */
.champion .rank-number {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    font-size: 2em;
    width: 80px;
    height: 80px;
}

.champion .rank-name {
    font-size: 1.8em;
    color: #333;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ranking-item {
    animation: fadeIn 0.6s ease-out;
}

/* 旋转动画 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 底部文字 */
.container .footer {
    text-align: center;
    margin-top: 15px;
    color: #888;
    font-size: 1.3em;
}

/* 滚动动画 */
@keyframes autoScroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* 备案号链接 */
.icp-link {
    text-align: center;
    margin-top: 15px;
    color: #888;
    font-size: 0.9em;
}

.icp-link a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.settings-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-button button {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
    transition: all 0.3s ease;
}

.settings-button button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.5);
}

/* 设置面板 */
#settingsPanel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 300px;
    padding: 20px;
    background: rgba(249, 249, 249, 0.98);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
}

/* 登录按钮样式 */
#loginBtn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
}

#manageBtn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
    margin-bottom: 8px;
}

#logoutBtn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
}

#serverLoadBtn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
}

#fullscreenBtn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
}

/* 登录弹窗 */
#loginModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#loginModal > div {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

#closeLoginModalBtn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
}

#loginForm label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: bold;
}

#loginForm input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

#loginForm button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 排行榜列 */
.ranking-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
}

/* 右侧滚动列表 */
.ranking-list {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
    padding-left: 3px;
}

/* 右侧滚动容器 */
.scroll-container {
    position: relative;
    height: 100%;
    overflow: hidden;
    width: 100%;
}

/* 右侧滚动列表 */
.scroll-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0;
    list-style: none;
    margin: 0;
}

/* 滚动条样式 */
.ranking-list::-webkit-scrollbar {
    width: 8px;
}

.ranking-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ranking-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.ranking-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 排行榜列标题 */
.ranking-column h3 {
    text-align: center;
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* 排行榜列表 */
.ranking-list {
    list-style: none;
}

/* 排行榜项 */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
    min-height: 50px;
    width: 100%;
}

/* 右侧滚动列表排行榜项 */
.scroll-list .ranking-item {
    animation: none;
}

/* 排行榜项悬停效果 */
.ranking-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
}

/* 排行榜项动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 排行榜项编号 */
.rank-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
    margin-right: 10px;
    flex-shrink: 0;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.rank-number.top-1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 0 30px rgba(245, 87, 108, 0.6);
}

@keyframes goldPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(245, 87, 108, 0.6);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 50px rgba(245, 87, 108, 1);
    }
}

.rank-number.top-2 {
    background: linear-gradient(135deg, #c3cfe2 0%, #7b9acc 100%);
}

.rank-number.top-3 {
    background: linear-gradient(135deg, #fae5d3 0%, #f5b041 100%);
}

.rank-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.rank-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-score {
    font-size: 1em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

/* 个人言语样式 */
.rank-personal-words {
    font-size: 0.8em;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: auto;
    flex-shrink: 0;
    max-width: 35%;
    align-self: center;
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.3);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 前三名个人言语样式 */
.champion-personal-words {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
    text-align: center;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.runner-personal-words {
    font-size: 0.8em;
    color: #764ba2;
    margin-top: 3px;
    text-align: center;
    padding: 3px 8px;
    background: rgba(118, 75, 162, 0.1);
    border-radius: 6px;
}

.score-value {
    color: #764ba2;
    font-weight: bold;
    font-size: 1.1em;
}

.medal {
    font-size: 1.5em;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 备案号链接 */
.icp-link {
    text-align: center;
    margin-top: 15px;
    color: #888;
    font-size: 0.9em;
}

.icp-link a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 设置按钮 */
.settings-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-button button {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
    transition: all 0.3s ease;
}

.settings-button button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.5);
}

/* 登录表单按钮样式 */
#loginForm button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

/* 登录状态和按钮容器样式 */
#loginButton {
    margin-bottom: 15px;
}

#notLoggedIn {
    display: block;
}

#loggedIn {
    display: none;
}

#serverLoadButton {
    margin-bottom: 15px;
}

#fullscreenButton {
    margin-bottom: 15px;
}

/* 登录状态文字样式 */
#loginStatus {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

#loginStatusLoggedIn {
    font-size: 0.85em;
    color: #22c55e;
    margin-top: 5px;
}

/* 描述文字样式 */
.description-text {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

/* 登录弹窗内部样式 */
.login-modal-header {
    text-align: right;
    margin-bottom: 15px;
}

.login-modal-title {
    text-align: center;
    color: #764ba2;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-form-group:last-child {
    margin-bottom: 25px;
}

.login-error {
    color: #ef4444;
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
    display: none;
}

/* 媒体查询 */
@media (max-width: 1200px) {
    .ranking-wrapper {
        grid-template-columns: 0.7fr 0.9fr;
        gap: 20px;
        height: auto;
        max-width: 900px;
        margin: 0 auto;
    }

    .left-column {
        grid-template-rows: auto auto;
    }

    .champion-box {
        padding: 15px;
    }

    .champion-image {
        width: 180px;
        height: 180px;
    }

    .champion-name {
        font-size: 1.8em;
    }

    .champion-score {
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    html body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 15px;
    }

    h1 {
        font-size: 2.2em;
    }

    .subtitle {
        font-size: 1.2em;
    }

    .champion-image {
        width: 150px;
        height: 150px;
    }

    .champion-name {
        font-size: 1.5em;
    }

    .champion-score {
        font-size: 1.3em;
    }

    .runner-image {
        width: 60px;
        height: 60px;
    }

    .runner-up-box {
        padding: 10px;
        gap: 8px;
    }

    .runner-name {
        font-size: 1em;
    }

    .runner-score {
        font-size: 0.9em;
    }

    .right-column {
        padding: 15px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 10px;
        font-size: 0.9em;
    }

    .member-avatar {
        width: 35px;
        height: 35px;
    }

    .score-badge {
        font-size: 0.9em;
        padding: 6px 12px;
    }

    .rank-number {
        width: 50px;
        height: 50px;
        font-size: 1.4em;
    }

    .rank-name {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    html body {
        padding: 5px;
    }

    .container {
        padding: 10px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    .champion-image {
        width: 120px;
        height: 120px;
    }

    .champion-name {
        font-size: 1.3em;
    }

    .champion-score {
        font-size: 1.1em;
    }

    .runner-image {
        width: 50px;
        height: 50px;
    }

    .runner-up-box {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 8px;
        font-size: 0.8em;
    }

    .member-avatar {
        width: 30px;
        height: 30px;
    }

    .score-badge {
        font-size: 0.8em;
        padding: 4px 8px;
    }
}