/* 银河牌局 - 天梯页面样式 */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #151b2e;
    --bg-card: #1a2236;
    --text-primary: #e8eaf6;
    --text-secondary: #9fa8da;
    --accent-gold: #ffd54f;
    --accent-blue: #42a5f5;
    --accent-purple: #ab47bc;
    --border-color: #2a3654;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 顶部导航 */
.top-nav {
    background: var(--bg-secondary);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 15px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-rank {
    background: var(--bg-card);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
}

/* 我的段位卡片 */
.my-rank-section {
    margin-bottom: 30px;
}

.rank-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #252d48 100%);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    border: 1px solid var(--border-color);
}

.rank-icon {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
}

.rating-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    width: 50%;
    transition: width 0.5s;
}

.rating-text {
    font-size: 18px;
    color: var(--text-secondary);
}

.rating-text span {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-gold);
}

.rank-stats {
    display: flex;
    gap: 40px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    display: block;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 匹配区域 */
.match-section {
    margin-bottom: 30px;
}

.match-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.match-status {
    margin-bottom: 30px;
}

.status-text {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.status-desc {
    font-size: 16px;
    color: var(--text-secondary);
}

.match-btn {
    padding: 18px 60px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.match-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(66, 165, 245, 0.3);
}

.match-btn.canceling {
    background: linear-gradient(135deg, #ef5350, #e53935);
}

.match-info {
    margin-top: 20px;
    color: var(--text-secondary);
}

/* 排行榜 */
.leaderboard-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.leaderboard-section h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.leaderboard-tabs .tab {
    padding: 8px 20px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.leaderboard-tabs .tab.active {
    background: var(--accent-blue);
    color: white;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table th {
    color: var(--text-secondary);
    font-weight: normal;
}

.leaderboard-table tr:hover {
    background: var(--bg-secondary);
}

.rank-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
}

.rank-badge.gold { background: #ffd54f; color: #000; }
.rank-badge.silver { background: #90a4ae; color: #000; }
.rank-badge.bronze { background: #a1887f; color: #fff; }

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
}

/* 对局历史 */
.history-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.history-section h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.history-item.win {
    border-left: 4px solid #66bb6a;
}

.history-item.loss {
    border-left: 4px solid #ef5350;
}

.history-result {
    font-weight: bold;
}

.history-result.win { color: #66bb6a; }
.history-result.loss { color: #ef5350; }

.history-rating {
    font-size: 14px;
    color: var(--text-secondary);
}

.history-rating .change.positive { color: #66bb6a; }
.history-rating .change.negative { color: #ef5350; }

/* 响应式 */
@media (max-width: 768px) {
    .rank-card {
        flex-direction: column;
        text-align: center;
    }
    
    .rank-stats {
        justify-content: center;
    }
    
    .leaderboard-table {
        font-size: 14px;
    }
}
