/* ===== 排行榜 & 任务面板样式 ===== */

/* 标签导航 */
.lb-tabs {
    display: flex; gap: 0;
    border-bottom: 3px solid #8b5a2b;
    margin-bottom: 20px;
}
.lb-tab {
    padding: 12px 28px;
    font-size: 14px; font-weight: 800;
    color: #8b5a2b; background: transparent;
    border: none; cursor: pointer;
    position: relative; transition: all 0.2s;
    font-family: inherit;
}
.lb-tab:hover { color: #3a2a1a; background: rgba(139,90,43,0.06); }
.lb-tab.active {
    color: #3a2a1a;
    background: #faf6f0;
    border: 3px solid #8b5a2b;
    border-bottom-color: #faf6f0;
    margin-bottom: -3px;
}

/* 筛选栏 */
.lb-filter-bar {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.lb-filter-bar select {
    padding: 8px 14px; border: 2px solid #8b5a2b;
    background: #faf6f0; font-size: 13px;
    font-family: inherit; color: #3a2a1a;
    cursor: pointer; outline: none; font-weight: 700;
}
.lb-filter-bar select:focus { border-color: #3a2a1a; }
.lb-period-info {
    margin-left: auto; font-size: 13px;
    font-weight: 700; color: #8b5a2b;
    display: flex; align-items: center; gap: 8px;
}
.lb-countdown {
    background: #2c1810; color: #ffd700;
    padding: 4px 12px; font-size: 13px;
    font-weight: 800; font-family: 'Courier New', monospace;
    border: 2px solid #8b5a2b; letter-spacing: 1px;
}

/* 排行榜表格 */
.lb-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}
.lb-table {
    width: 100%; border-collapse: collapse;
    min-width: 700px;
}
.lb-table th {
    padding: 12px 14px; text-align: left;
    font-size: 11px; font-weight: 800;
    color: #8b5a2b; text-transform: uppercase;
    background: rgba(139,90,43,0.06);
    border-bottom: 3px solid #8b5a2b;
}
.lb-table td {
    padding: 12px 14px; font-size: 13px;
    border-bottom: 2px solid rgba(139,90,43,0.1);
    font-weight: 600; color: #3a2a1a;
}
.lb-table tbody tr { transition: background 0.15s; }
.lb-table tbody tr:hover { background: rgba(139,90,43,0.04); }

/* 前三名高亮 */
.lb-rank-1 { background: rgba(255,215,0,0.1) !important; }
.lb-rank-1 td { border-bottom-color: rgba(255,215,0,0.3); }
.lb-rank-2 { background: rgba(192,192,192,0.1) !important; }
.lb-rank-2 td { border-bottom-color: rgba(192,192,192,0.3); }
.lb-rank-3 { background: rgba(205,127,50,0.1) !important; }
.lb-rank-3 td { border-bottom-color: rgba(205,127,50,0.3); }

/* 排名单元格 */
.rank-cell {
    display: flex; align-items: center; gap: 8px;
    font-size: 16px; font-weight: 900;
}
.rank-num { min-width: 28px; text-align: center; }
.rank-gold { color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.4); }
.rank-silver { color: #c0c0c0; text-shadow: 0 0 8px rgba(192,192,192,0.4); }
.rank-bronze { color: #cd7f32; text-shadow: 0 0 8px rgba(205,127,50,0.4); }
.rank-icon { font-size: 20px; }

/* 玩家名单元格 */
.player-cell {
    display: flex; align-items: center; gap: 10px;
}
.player-cell img {
    width: 32px; height: 32px;
    border: 2px solid #8b5a2b;
    image-rendering: pixelated;
}
.player-cell .name { font-weight: 800; }

/* 稀有度计数 */
.rarity-count {
    font-weight: 800; font-size: 13px;
}
.rarity-rare { color: #2196f3; }
.rarity-epic { color: #9c27b0; }
.rarity-legendary { color: #ff9800; }
.rarity-mythic { color: #f44336; }

/* 幸运得分 */
.luck-score {
    font-weight: 900; font-size: 15px;
    color: #b8860b;
    display: flex; align-items: center; gap: 4px;
}

/* 自己的排名底栏 */
.lb-my-rank {
    position: sticky; bottom: 0;
    background: linear-gradient(135deg, #2c1810, #3d2415);
    border: 3px solid #8b5a2b;
    border-top: 4px solid #ffd700;
    padding: 14px 24px;
    display: flex; align-items: center; gap: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 10;
}
.lb-my-rank .my-rank-label {
    color: #8b5a2b; font-size: 12px;
    font-weight: 800; text-transform: uppercase;
}
.lb-my-rank .my-rank-num {
    color: #ffd700; font-size: 24px;
    font-weight: 900;
}
.lb-my-rank .my-rank-stats {
    display: flex; gap: 16px; margin-left: auto;
    color: #f5e6d3; font-size: 13px; font-weight: 700;
}
.lb-my-rank .my-rank-stats span {
    display: flex; align-items: center; gap: 4px;
}

/* 奖励预览区 */
.lb-rewards-section { margin-top: 30px; }
.lb-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; margin-top: 16px;
}
.lb-reward-card {
    background: #faf6f0; border: 3px solid #8b5a2b;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
    padding: 16px; transition: all 0.2s;
}
.lb-reward-card:hover {
    transform: translateY(-3px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
}
.lb-reward-rank {
    font-size: 13px; font-weight: 800;
    color: #8b5a2b; margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}
.lb-reward-name {
    font-size: 16px; font-weight: 900;
    color: #3a2a1a;
}

/* 结算信息 */
.lb-settle-info {
    display: flex; align-items: center; gap: 12px;
    background: rgba(139,90,43,0.08);
    border: 2px solid rgba(139,90,43,0.2);
    padding: 12px 18px; margin-bottom: 20px;
    font-size: 13px; font-weight: 700; color: #3a2a1a;
}
.lb-settle-info i { color: #8b5a2b; font-size: 16px; }

/* ===== 任务面板样式 ===== */

/* 任务分组 */
.quest-group { margin-bottom: 32px; }
.quest-group-title {
    font-size: 18px; font-weight: 900; color: #3a2a1a;
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
    padding-bottom: 10px; border-bottom: 2px solid rgba(139,90,43,0.2);
}
.quest-group-title i { color: #8b5a2b; }
.quest-group-timer {
    margin-left: auto; font-size: 12px;
    font-weight: 700; color: #8b5a2b;
    display: flex; align-items: center; gap: 6px;
}

/* 任务卡片网格 */
.quest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.quest-card {
    background: #faf6f0; border: 3px solid #8b5a2b;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    padding: 18px; transition: all 0.2s;
    position: relative; overflow: hidden;
}
.quest-card:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
}
.quest-card.completed {
    border-color: #4caf50;
}
.quest-card.claimed {
    opacity: 0.6; border-color: #9e9e9e;
}

/* 任务头部 */
.quest-header {
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 12px;
}
.quest-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5a2b, #654321);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.quest-icon i { color: #ffd700; font-size: 18px; }
.quest-icon.completed-icon { background: linear-gradient(135deg, #4caf50, #388e3c); }
.quest-icon.claimed-icon { background: #9e9e9e; }

.quest-name { font-size: 15px; font-weight: 800; color: #3a2a1a; }
.quest-desc {
    font-size: 12px; color: #8b5a2b; margin-top: 2px;
    font-style: italic;
}

/* 进度条 */
.quest-progress-wrap { margin-bottom: 12px; }
.quest-progress-bar {
    width: 100%; height: 20px;
    background: rgba(139,90,43,0.1);
    border: 2px solid rgba(139,90,43,0.2);
    position: relative; overflow: hidden;
}
.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #b8860b, #daa520);
    transition: width 0.5s ease;
}
.quest-progress-fill.full {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}
.quest-progress-text {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; color: #3a2a1a;
}

/* 任务奖励和按钮 */
.quest-footer {
    display: flex; align-items: center; justify-content: space-between;
}
.quest-reward {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; color: #b8860b;
}
.quest-reward i { font-size: 16px; }
.btn-quest-claim {
    padding: 8px 18px; font-size: 13px; font-weight: 800;
    font-family: inherit; cursor: pointer;
    border: 2px solid; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}
.btn-quest-claim:hover { transform: translateY(-1px); }
.btn-quest-claim.claimable {
    background: linear-gradient(135deg, #b8860b, #daa520);
    color: white; border-color: #8b6914;
    animation: claimPulse 2s ease-in-out infinite;
}
.btn-quest-claim.in-progress {
    background: #f5e6d3; color: #8b5a2b;
    border-color: #8b5a2b; cursor: default;
}
.btn-quest-claim.claimed-btn {
    background: #e0e0e0; color: #999;
    border-color: #ccc; cursor: default;
}
@keyframes claimPulse {
    0%, 100% { box-shadow: 2px 2px 0 rgba(0,0,0,0.15); }
    50% { box-shadow: 2px 2px 0 rgba(0,0,0,0.15), 0 0 12px rgba(255,215,0,0.3); }
}

/* 完成标记 */
.quest-check {
    position: absolute; top: 12px; right: 12px;
    width: 28px; height: 28px;
    background: #4caf50; color: white;
    border-radius: 50%; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

/* 空状态 */
.lb-empty, .quest-empty {
    text-align: center; padding: 60px 20px;
    color: #8b5a2b;
}
.lb-empty i, .quest-empty i {
    font-size: 48px; opacity: 0.3;
    display: block; margin-bottom: 12px;
}

/* 加载动画 */
.lb-loading {
    text-align: center; padding: 60px 20px;
    color: #8b5a2b;
}
.lb-loading i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* 响应式 */
@media (max-width: 768px) {
    .lb-tabs { overflow-x: auto; }
    .lb-tab { padding: 10px 16px; font-size: 13px; white-space: nowrap; }
    .lb-filter-bar { flex-direction: column; align-items: stretch; }
    .lb-period-info { margin-left: 0; }
    .lb-my-rank { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
    .lb-my-rank .my-rank-stats { margin-left: 0; flex-wrap: wrap; }
    .lb-rewards-grid { grid-template-columns: 1fr; }
    .quest-grid { grid-template-columns: 1fr; }
    .quest-footer { flex-direction: column; gap: 10px; align-items: stretch; }
    .btn-quest-claim { width: 100%; justify-content: center; }
}
