
/* 基礎樣式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主容器 */
.main {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px 0;
}

.ranking-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 38px 20px; padding-bottom: 60px;
    background-color: #f5f5f5;
}

.ranking-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.ranking-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ranking-header {
    background: #CC0303;
    color: white;
    padding: 20px;
    text-align: center;
}

.ranking-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.ranking-title.rank-txt{
    line-height: 26px; font-size: 20px;
}

.ranking-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tab-item {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-item.active {
    background: white;
    color: darkred;
    font-weight: bold;
}

.tab-item:hover {
    background: white;
    color: darkred;
    font-weight: bold;
}

.ranking-content {
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 盈利排行榜樣式 */
.profit-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profit-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
}

.profit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 排名徽章 */
.rank-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 15px;
    flex-shrink: 0;
}

.rank-badge.rank-1 {
    background: #ff4757;
    color: white;
}

.rank-badge.rank-2 {
    background: #ffa502;
    color: white;
}

.rank-badge.rank-3 {
    background: #2ed573;
    color: white;
}

.rank-badge.rank-0 {
    background: #747d8c;
    color: white;
}

/* 用戶區域 */
.user-section {
    display: flex;
    align-items: center;
    flex: 1;
    margin-right: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.username {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.user-record {
    font-size: 12px;
    color: #666;
}

/* 投注區域 */
.bet-section {
    text-align: center;
    margin-right: 15px;
    min-width: 80px;
}

.bet-category {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.bet-type {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* 盈利區域 */
.profit-section {
    text-align: center;
    min-width: 100px;
}

.profit-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.profit-value {
    font-size: 16px;
    font-weight: bold;
}

.profit-value.positive {
    color: #28a745;
}

.profit-value.negative {
    color: #dc3545;
}

/* 重心榜樣式 */
.focus-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    border-color: #e9ecef;
}

.ranking-item .rank-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 15px;
    flex-shrink: 0;
}

.ranking-item .rank-number.rank-1 {
    background:#ff4757;
    color: white;
}

.ranking-item .rank-number.rank-2 {
    background: #ff6b35;
    color: white;
}

.ranking-item .rank-number.rank-3 {
    background: #ff6b35;
    color: white;
}

.ranking-item .rank-number.rank-4 {
    background: #007bff;
    color: white;
}

.ranking-item .rank-number.rank-5 {
    background: #007bff;
    color: white;
}

.ranking-item .rank-number.rank-6,
.ranking-item .rank-number.rank-7,
.ranking-item .rank-number.rank-8 {
    background: #6c757d;
    color: white;
}

.ranking-item .user-info {
    display: flex;
    align-items: center;
    flex: 1;
    margin-right: 15px;
}

.ranking-item .user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.ranking-item .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 用戶徽章 */
.ranking-item .user-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    display: none;
}

/* 用戶詳情 */
.ranking-item .user-details {
    flex: 1;
}

.ranking-item .username {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.ranking-item .user-id {
    font-size: 12px;
    color: #007bff;
    display: flex;
    align-items: center;
}

.ranking-item .user-id::before {
    content: "🔵";
    margin-right: 4px;
    font-size: 8px;
}

/* 盈利信息 */
.ranking-item .profit-info {
    text-align: center;
    margin-right: 15px;
    min-width: 100px;
}

.ranking-item .profit-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.ranking-item .win-rate {
    font-size: 16px;
    font-weight: bold;
    color: #28a745;
}

/* 箭頭圖標 */
.ranking-item .arrow-icon {
    color: #ccc;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.ranking-item:hover .arrow-icon {
    color: #CC0303;
    transform: translateX(3px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .ranking-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ranking-container {
        padding: 0 15px;
    }

    .profit-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-section {
        width: 100%;
        margin-right: 0;
    }

    .bet-section,
    .profit-section {
        width: 100%;
        text-align: left;
        margin-right: 0;
    }

    .ranking-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-item {
        padding: 6px 15px;
        font-size: 12px;
    }

    .ranking-item .arrow-icon {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .ranking-title {
        font-size: 20px;
    }

    .ranking-title.rank-txt{
        line-height: 24px; font-size: 17px;
    }

    .profit-card,
    .ranking-item {
        padding: 12px;
    }

    .ranking-item .user-avatar {
        width: 35px;
        height: 35px;
    }

    .ranking-item .username {
        font-size: 13px;
    }

    .ranking-item .user-record,
    .bet-category,
    .ranking-item .profit-label {
        font-size: 11px;
    }

    .ranking-item .arrow-icon {
        font-size: 18px;
    }

    .ranking-item .win-rate {
        font-size: 14px;
    }
}


/* 響應式設計 - 修復手機端 */
@media (max-width: 768px) {
    .ranking-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ranking-container {
        padding: 20px 15px;
    }

    .ranking-header {
        padding: 15px;
    }

    .ranking-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .ranking-content {
        padding: 15px;
    }

    /* 盈利卡片手機端佈局 */
    .profit-card {
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
    }

    .rank-badge {
        width: 25px;
        height: 25px;
        font-size: 12px;
        margin-right: 10px;
    }

    .user-section {
        flex: 1 1 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }

    .profit-card .user-avatar {
        width: 35px;
        height: 35px;
        margin-right: 8px;
    }

    .profit-card .username {
        font-size: 13px;
    }

    .profit-card .user-record {
        font-size: 11px;
    }

    .bet-section {
        flex: 1 1 auto;
        text-align: left;
        margin-right: 15px;
        min-width: auto;
    }

    .profit-section {
        flex: 1 1 auto;
        text-align: right;
        min-width: auto;
    }

    .bet-category,
    .profit-label {
        font-size: 11px;
    }

    .bet-type {
        font-size: 13px;
    }

    .profit-value {
        font-size: 14px;
    }

    .ranking-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-item {
        padding: 6px 15px;
        font-size: 12px;
    }

    .ranking-item .arrow-icon {
        font-size: 28px;
        width: 35px;
        height: 35px;
    }

    .ranking-item .user-avatar {
        width: 40px;
        height: 40px;
    }

    .ranking-item .user-badge {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .ranking-title {
        font-size: 18px;
    }

    .ranking-title.rank-txt {
        line-height: 22px;
        font-size: 16px;
    }

    .ranking-header {
        padding: 12px;
    }

    .ranking-content {
        padding: 12px;
    }

    /* 超小屏幕盈利卡片佈局 */
    .profit-card {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        position: relative;
    }

    .rank-badge {
        align-self: flex-start;
        margin-right: 0;
        margin-bottom: 0px;
        position: absolute;
        top: 10px;
        right: 8px;
    }

    .user-section {
        flex: none;
        width: 100%;
        margin-bottom: 10px;
    }

    .profit-card .username {
        font-size: 12px;
        white-space: normal;
        line-height: 1.3;
    }

    .profit-card .user-record {
        font-size: 10px;
    }

    .bet-section,
    .profit-section {
        flex: none;
        width: 100%;
        text-align: left;
        margin-right: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-top: 1px solid #e9ecef;
    }

    .bet-section {
        border-top: none;
    }

    .bet-category,
    .profit-label {
        font-size: 13px;
        margin-bottom: 0;
    }

    .bet-type,
    .profit-value {
        font-size: 14px;
        font-weight: bold;
    }

    .tab-item {
        padding: 5px 12px;
        font-size: 11px;
    }

    .ranking-item .arrow-icon {
        font-size: 22px;
        width: 25px;
        height: 30px;
        text-align: right;
    }

    .ranking-item .user-avatar {
        width: 35px;
        height: 35px;
    }

    .ranking-item .username {
        font-size: 12px;
    }

    .ranking-item .user-record,
    .ranking-item .profit-label {
        font-size: 10px;
    }

    .ranking-item .win-rate {
        font-size: 13px;
    }
    
    
    .ranking-item .profit-info{
        min-width: 60px; max-width: 82px;
    }
    
    .ranking-item{
        justify-content: space-between;
    }
    
    .ranking-item .user-badge{
        display: none;
    }
    
    .ranking-item .user-info{
        min-width: 143px; margin-right: 0;
    }
    
    .ranking-item{
        padding-left: 9px; padding-right: 6px;
    }
    
    
    
    
}

