/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #243044;
    --border-color: #2d3e58;
    --text-primary: #e8ecf4;
    --text-secondary: #8b9ab5;
    --text-muted: #5a6b82;
    --accent-gold: #f4c542;
    --accent-gold-dark: #d4a530;
    --accent-purple: #a855f7;
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --shadow-glow: 0 0 20px rgba(244, 197, 66, 0.15);
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 背景装饰 ===== */
.rank-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at top, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(244, 197, 66, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== 排行榜页面 ===== */
.rank-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.rank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow);
}

.title-section h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #ffdb70 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.rank-info {
    text-align: right;
    color: var(--text-muted);
    font-size: 13px;
}

.rank-info span {
    display: block;
    margin-bottom: 4px;
}

.total-count {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 15px;
}

.rank-body {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    overflow: hidden;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding-right: 8px;
}

.rank-list::-webkit-scrollbar {
    width: 6px;
}

.rank-list::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 3px;
}

.rank-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 16px;
}

/* 排行条目 */
.rank-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rank-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-gold);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(244, 197, 66, 0.1);
}

.rank-item.top-1 {
    background: linear-gradient(135deg, rgba(244, 197, 66, 0.15) 0%, var(--bg-card) 100%);
    border-color: var(--accent-gold);
}

.rank-item.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1) 0%, var(--bg-card) 100%);
    border-color: #a0aec0;
}

.rank-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1) 0%, var(--bg-card) 100%);
    border-color: #cd7f32;
}

.rank-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 20px;
}

.top-1 .rank-number {
    color: var(--accent-gold);
    font-size: 28px;
}

.top-2 .rank-number {
    color: #c0c0c0;
    font-size: 26px;
}

.top-3 .rank-number {
    color: #cd7f32;
    font-size: 26px;
}

.rank-user {
    flex: 1;
}

.rank-user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.rank-user-time {
    font-size: 12px;
    color: var(--text-muted);
}

.rank-score {
    text-align: right;
}

.rank-score-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    font-family: 'Consolas', monospace;
}

.rank-score-unit {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 2px;
}

.rank-footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== 详情弹窗 ===== */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.detail-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.detail-content::-webkit-scrollbar {
    width: 6px;
}

.detail-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--accent-red);
    color: white;
}

.detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-rank {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #ffdb70 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 24px;
}

.detail-info {
    flex: 1;
}

.detail-info h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.detail-score {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-gold);
    font-family: 'Consolas', monospace;
}

.detail-score .unit {
    font-size: 18px;
    color: var(--text-muted);
    margin-left: 4px;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Consolas', monospace;
}

.detail-gear {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.gear-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.gear-detail-card:hover {
    border-color: var(--accent-gold);
}

.gear-detail-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-secondary);
}

.gear-detail-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 32px;
}

.gear-detail-info {
    padding: 12px;
}

.gear-detail-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.gear-detail-attrs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gear-attr-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.gear-attr-line .attr-val {
    color: var(--text-primary);
    font-family: 'Consolas', monospace;
}

.gear-set-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-weight: 500;
}

.set-evil {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.set-hell {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.set-immortal {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.set-guling {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.set-dragon {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.set-chimo {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

.set-other {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

/* ===== 管理后台页面 ===== */
.admin-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

/* 登录页 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at center, rgba(168, 85, 247, 0.1) 0%, transparent 70%),
        var(--bg-primary);
}

.login-box {
    width: 400px;
    padding: 48px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--accent-gold);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.error-msg {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-box input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
}

.login-box input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.1);
}

.login-box button {
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 197, 66, 0.3);
}

/* 管理页主体 */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #ffdb70 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-link {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-link:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* 表单 */
.score-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.form-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--accent-gold);
}

.form-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.form-row label {
    min-width: 100px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-row input {
    flex: 1;
    max-width: 300px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-row input:focus {
    border-color: var(--accent-gold);
}

.form-row .set3pc-select {
    flex: 1;
    max-width: 420px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-row .set3pc-select:focus {
    border-color: var(--accent-gold);
}

.gear-sections {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.gear-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.gear-card:hover {
    border-color: var(--accent-purple);
}

.gear-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.gear-icon {
    font-size: 20px;
    margin-right: 8px;
}

.gear-header h3 {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
}

.set-select {
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.set-select:focus {
    border-color: var(--accent-gold);
}

.gear-body {
    padding: 16px;
}

.image-upload {
    margin-bottom: 16px;
}

.upload-area {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: var(--accent-gold);
    background: rgba(244, 197, 66, 0.05);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 12px;
    color: var(--text-muted);
}

.preview-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.attr-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.attr-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attr-item.full-width {
    grid-column: 1 / -1;
}

.attr-item label {
    font-size: 11px;
    color: var(--text-muted);
}

.attr-item input {
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.attr-item input:focus {
    border-color: var(--accent-gold);
}

.submit-section {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.btn-calculate {
    padding: 18px 48px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    border: none;
    border-radius: 12px;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(244, 197, 66, 0.3);
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(244, 197, 66, 0.4);
}

.btn-calculate:active {
    transform: translateY(-1px);
}

.btn-calculate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 结果弹窗 */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.result-content {
    width: 90%;
    max-width: 500px;
    padding: 48px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-gold);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(244, 197, 66, 0.2);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-content h2 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--accent-gold);
}

.score-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.score-label {
    font-size: 18px;
    color: var(--text-secondary);
}

.score-value {
    font-size: 64px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #ffdb70 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Consolas', monospace;
}

.score-unit {
    font-size: 24px;
    color: var(--text-muted);
}

.stats-display {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 24px;
}

.stats-display .stat-item {
    text-align: center;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #1a1a2e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 197, 66, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .gear-sections {
        grid-template-columns: repeat(3, 1fr);
    }
    .detail-gear {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gear-sections {
        grid-template-columns: 1fr;
    }
    .detail-gear {
        grid-template-columns: 1fr;
    }
    .detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-display {
        grid-template-columns: repeat(2, 1fr);
    }
    .rank-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .rank-info {
        text-align: center;
    }
}

/* ===== v16 排行榜视觉改版：古希腊黄金+深红（仅作用于排行榜页，admin不动） ===== */
body.rank-page {
    --bg-primary: #14100C;
    --bg-secondary: #1E1710;
    --bg-card: #241C14;
    --bg-card-hover: #2E2418;
    --border-color: #4a3a22;
    --text-primary: #F2E5C9;
    --text-secondary: #A89878;
    --text-muted: #7A6C54;
    --accent-gold: #C9A227;
    --accent-gold-dark: #B08D3C;
    --accent-red: #8E2F2F;
    --shadow-glow: 0 0 24px rgba(201, 162, 39, 0.18);
    background: #14100C;
}

body.rank-page::before {
    background:
        radial-gradient(ellipse at top, rgba(201, 162, 39, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(142, 47, 47, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(201, 162, 39, 0.06) 0%, transparent 50%);
}

/* 头图 */
.rank-banner {
    margin-bottom: 16px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #B08D3C;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(201, 162, 39, 0.20);
    line-height: 0;
}

.rank-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* 弱化原头部为窄信息条（头图已自带大标题） */
.rank-page .rank-header-slim {
    padding: 12px 24px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #241C14 0%, #1E1710 100%);
    border: 1px solid #B08D3C;
    border-radius: 12px;
    box-shadow: none;
}

.rank-page .rank-header-slim .subtitle {
    color: #A89878;
    font-size: 14px;
}

.rank-page .total-count {
    color: #FFD978;
}

/* 榜单容器与条目 */
.rank-page .rank-body {
    background: rgba(30, 23, 16, 0.85);
    border: 1px solid #4a3a22;
}

.rank-page .rank-list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.rank-page .rank-item {
    background: #241C14;
    border: 1px solid #4a3a22;
}

.rank-page .rank-item:hover {
    background: #2E2418;
    border-color: #C9A227;
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.15);
}

.rank-page .rank-item.top-1 {
    background: linear-gradient(135deg, rgba(255, 217, 120, 0.16) 0%, #241C14 100%);
    border-color: #C9A227;
    box-shadow: 0 0 18px rgba(201, 162, 39, 0.22);
}

.rank-page .rank-item.top-2 {
    background: linear-gradient(135deg, rgba(200, 200, 200, 0.10) 0%, #241C14 100%);
    border-color: #8a8a8a;
}

.rank-page .rank-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.12) 0%, #241C14 100%);
    border-color: #cd7f32;
}

.rank-page .top-1 .rank-number { color: #FFD978; }
.rank-page .top-2 .rank-number { color: #C8C8C8; }
.rank-page .top-3 .rank-number { color: #CD7F32; }

.rank-page .rank-score-value { color: #FFD978; font-size: 32px; }
.rank-page .rank-score-unit { font-size: 18px; font-weight: 700; color: #FFD978; }

.rank-page .rank-user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-size: 12px;
}
.rank-page .rank-user-id { color: #A89878; }
.rank-page .rank-user-sets {
    color: #C9A227;
    padding: 1px 8px;
    border: 1px solid #B08D3C;
    border-radius: 10px;
    font-size: 11px;
    background: rgba(201, 162, 39, 0.08);
    white-space: nowrap;
}
.sets-short { display: none; }
.sets-mobile { display: none; }

.rank-page .rank-list::-webkit-scrollbar-thumb { background: #B08D3C; }
.rank-page .rank-list::-webkit-scrollbar-track { background: #241C14; }

.rank-page .rank-footer { color: #7A6C54; }

/* 详情弹窗金红化 */
.rank-page .detail-content,
.detail-content {
    background: #1E1710;
    border: 1px solid #B08D3C;
}

.rank-page .detail-rank {
    color: #FFD978;
}

.rank-page .detail-score span:first-child { color: #FFD978; }

.rank-page .close-btn {
    background: #8E2F2F;
    color: #F2E5C9;
}

.rank-page .close-btn:hover { background: #a83a3a; }

/* ===== 详情弹窗 - 简洁版（金红暗棕） ===== */
.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.detail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 7, 4, 0.85);
    backdrop-filter: blur(4px);
}
.detail-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    max-height: 92vh;
    background: linear-gradient(145deg, #241C14 0%, #1A130C 100%);
    border: 1px solid #B08D3C;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 30px rgba(201, 162, 39, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-card .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #B08D3C;
    background: rgba(30, 23, 16, 0.85);
    color: #FFD978;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.detail-card .close-btn:hover {
    background: #8E2F2F;
    border-color: #8E2F2F;
    color: #fff;
}

/* 顶栏右栏：圆形标签徽章（异化/阵营） */
.detail-tags {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.tag-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    cursor: help;
    transition: transform 0.2s;
    line-height: 1;
    text-align: center;
    flex-shrink: 0;
}
.tag-badge:hover {
    transform: scale(1.1);
}
.tag-alien {
    background: radial-gradient(circle, #8E2F2F 0%, #5a1a1a 100%);
    color: #FFD7D7;
    border: 2px solid #C94F4F;
    box-shadow: 0 0 8px rgba(201, 79, 79, 0.4);
}
.tag-faction {
    background: radial-gradient(circle, #C9A227 0%, #8a6e14 100%);
    color: #1A130C;
    border: 2px solid #FFD978;
    box-shadow: 0 0 8px rgba(255, 217, 120, 0.4);
}

/* 套装文字（昵称后，小字） */
.detail-sets-inline {
    color: #A89878;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

/* 顶栏 */
.detail-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    padding-right: 56px;
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.12) 0%, rgba(201, 162, 39, 0.02) 100%);
    border-bottom: 1px solid #4a3a22;
}
.detail-top-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.detail-top-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}
.detail-top-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}
.detail-rank {
    color: #FFD978;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 217, 120, 0.3);
}
.detail-name {
    color: #F2E5C9;
    font-size: 18px;
    font-weight: 600;
}
.detail-score-row {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}
.detail-score-num {
    color: #FFD978;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 0 12px rgba(255, 217, 120, 0.3);
}
.detail-score-unit {
    color: #FFD978;
    font-size: 16px;
    font-weight: 600;
}
.detail-sets-badge {
    color: #C9A227;
    font-size: 12px;
    padding: 2px 10px;
    border: 1px solid #B08D3C;
    border-radius: 12px;
    background: rgba(201, 162, 39, 0.08);
}

/* 主体 */
.detail-body {
    display: flex;
    gap: 20px;
    padding: 18px 20px 20px;
    overflow-y: auto;
}

/* 左栏：装备图网格 */
.detail-gear-grid {
    flex: 1.6;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    align-content: start;
}
.gear-card {
    background: #1A130C;
    border: 1px solid #4a3a22;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}
.gear-card:hover {
    border-color: #C9A227;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.2);
}
.gear-weapon  { grid-column: 1 / 3; grid-row: 1 / 2; }
.gear-armor   { grid-column: 1 / 3; grid-row: 2 / 3; }
.gear-bracelet{ grid-column: 3 / 4; grid-row: 1 / 2; }
.gear-necklace{ grid-column: 3 / 4; grid-row: 2 / 3; }
.gear-ring    { grid-column: 3 / 4; grid-row: 3 / 4; }

.gear-card-img {
    flex: 1;
    min-height: 140px;
    background: #0f0b07;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    overflow: hidden;
}
.gear-card-img img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
}
.gear-placeholder {
    color: #6b5a40;
    font-size: 13px;
}
.gear-card-label {
    padding: 6px 10px;
    font-size: 12px;
    color: #C9A227;
    background: rgba(201, 162, 39, 0.06);
    border-top: 1px solid #4a3a22;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右栏：属性面板 */
.detail-stats-panel {
    flex: 1;
    min-width: 260px;
    background: #1A130C;
    border: 1px solid #4a3a22;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* 分数头部（属性面板顶部大字） */
.stats-score-header {
    text-align: left;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #4a3a22;
}
.stats-score-big {
    color: #FFD978;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-shadow: 0 0 15px rgba(255, 217, 120, 0.3);
}
.stats-score-unit {
    font-size: 18px;
    margin-left: 4px;
    color: #FFD978;
    font-weight: 600;
}
.stats-score-label {
    color: #A89878;
    font-size: 12px;
    margin-top: 4px;
    letter-spacing: 1px;
}
.stats-title {
    font-size: 13px;
    color: #A89878;
    margin-bottom: -4px;
}
.stats-ult-count {
    color: #C9A227;
    font-size: 13px;
    margin-bottom: 4px;
}
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.stat-row-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(74, 58, 34, 0.5);
    font-size: 14px;
}
.stat-row-item:last-child { border-bottom: none; }
.stat-row-icon {
    color: #B08D3C;
    font-size: 10px;
    margin-right: 8px;
    width: 12px;
    text-align: center;
}
.stat-row-label {
    flex: 1;
    color: #F2E5C9;
    font-weight: 500;
}
.stat-row-val {
    color: #F2E5C9;
    font-weight: 700;
    margin-right: 10px;
    min-width: 60px;
    text-align: right;
}
.stat-row-bonus {
    color: #4CAF50;
    font-weight: 600;
    font-size: 13px;
    min-width: 55px;
    text-align: right;
}

/* 套装效果区 */
.stats-set-effects {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #4a3a22;
}
.set-effects-title {
    color: #C9A227;
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}
.set-effect-item {
    color: #A89878;
    font-size: 12px;
    line-height: 1.6;
    padding: 4px 0 4px 10px;
    border-left: 2px solid #B08D3C;
    margin-bottom: 4px;
}

/* 异化词条 / 阵营专属 通用样式 */
.effect-title {
    color: #C9A227;
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}
.effect-item {
    font-size: 12px;
    line-height: 1.6;
    padding: 4px 0 4px 10px;
    margin-bottom: 4px;
}
.alien-title {
    color: #FFD978;
}
.alien-item {
    color: #F2E5C9;
    border-left: 2px solid #FFD978;
    background: rgba(255, 217, 120, 0.04);
}
.faction-title {
    color: #8BC34A;
}
.faction-item {
    color: #C5E1A5;
    border-left: 2px solid #8BC34A;
    background: rgba(139, 195, 74, 0.06);
}

/* 大图查看器 */
.img-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 40px;
}
.img-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 宽屏（>1024px）：装备横向一行排列 + 右侧属性面板（整体放大版） */
@media (min-width: 1024px) {
    .detail-card {
        max-width: 1400px;
    }
    .detail-top {
        padding: 18px 28px;
        padding-right: 72px;
    }
    .detail-rank {
        font-size: 28px;
    }
    .detail-name {
        font-size: 22px;
    }
    .detail-score-num {
        font-size: 38px;
    }
    .detail-score-unit {
        font-size: 20px;
    }
    .detail-sets-badge {
        font-size: 14px;
        padding: 3px 14px;
    }
    .detail-body {
        gap: 24px;
        padding: 22px 28px 28px;
    }
    .detail-gear-grid {
        flex: 2;
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: 1fr;
        gap: 12px;
    }
    .gear-weapon,
    .gear-armor,
    .gear-bracelet,
    .gear-necklace,
    .gear-ring {
        grid-column: auto;
        grid-row: auto;
    }
    .gear-card-img {
        min-height: 280px;
    }
    .gear-card-img img {
        max-height: 380px;
    }
    .gear-card-label {
        font-size: 14px;
        padding: 8px 12px;
    }
    .detail-stats-panel {
        flex: 0.9;
        min-width: 300px;
        padding: 20px;
        gap: 16px;
    }
    .stats-score-big {
        font-size: 44px;
    }
    .stats-score-unit {
        font-size: 22px;
    }
    .stats-score-label {
        font-size: 13px;
    }
    .stat-row-item {
        font-size: 17px;
        padding: 9px 0;
    }
    .stat-row-icon {
        font-size: 12px;
        margin-right: 10px;
        width: 14px;
    }
    .stat-row-val {
        margin-right: 14px;
        min-width: 80px;
    }
    .stat-row-bonus {
        font-size: 15px;
        min-width: 65px;
    }
    .set-effects-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    .set-effect-item {
        font-size: 13px;
        line-height: 1.7;
        padding: 5px 0 5px 12px;
        margin-bottom: 6px;
    }
    .effect-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    .effect-item {
        font-size: 13px;
        line-height: 1.7;
        padding: 5px 0 5px 12px;
        margin-bottom: 6px;
    }
    .detail-card .close-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        top: 16px;
        right: 16px;
    }
    .detail-sets-inline {
        font-size: 14px;
    }
    .detail-tags {
        gap: 10px;
    }
    .tag-badge {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }
}

/* 详情弹窗移动端：上下布局 */
@media (max-width: 768px) {
    .detail-modal { padding: 10px; }
    .detail-card {
        max-height: 95vh;
        border-radius: 12px;
    }
    .detail-top {
        padding: 10px 14px;
        padding-right: 48px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .detail-top-left,
    .detail-top-center,
    .detail-top-right {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
    }
    .detail-top-center {
        justify-content: flex-start;
    }
    .detail-sets-inline {
        font-size: 12px;
    }
    .detail-tags {
        gap: 6px;
        flex-wrap: wrap;
    }
    .tag-badge {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    .detail-score-num { font-size: 22px; }
    .detail-score-unit { font-size: 14px; }
    .detail-body {
        flex-direction: column;
        gap: 14px;
        padding: 14px;
    }
    .detail-gear-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .gear-weapon  { grid-column: 1 / 2; grid-row: 1 / 2; }
    .gear-armor   { grid-column: 2 / 3; grid-row: 1 / 2; }
    .gear-bracelet{ grid-column: 3 / 4; grid-row: 1 / 2; }
    .gear-necklace{ grid-column: 1 / 2; grid-row: 2 / 3; }
    .gear-ring    { grid-column: 2 / 3; grid-row: 2 / 3; }
    .gear-card-img { min-height: 80px; }
    .gear-card-img img { max-height: 100px; }
    .detail-stats-panel { min-width: 0; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .rank-banner { border-radius: 10px; margin-bottom: 10px; }
    .rank-page .rank-header-slim { padding: 10px 14px; flex-direction: column; gap: 6px; align-items: flex-start; }
    .rank-page .rank-info { text-align: left; }

    /* 移动端列表项：左奖牌 + 中(昵称/ID) + 右(分数/套装) */
    .rank-page .rank-item {
        padding: 10px 14px;
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 64px;
    }
    .rank-page .rank-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin: 0;
        position: static;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255, 217, 120, 0.08);
    }
    .rank-page .rank-user {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }
    .rank-page .rank-user-name {
        font-size: 15px !important;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .rank-page .rank-user-meta {
        flex-wrap: nowrap;
        font-size: 11px;
        margin-top: 0;
        gap: 0;
        padding-left: 0;
        flex-direction: column;
        align-items: flex-start;
    }
    .rank-page .rank-user-id {
        color: #A89878;
        font-size: 11px;
    }
    /* 移动端：套装放右侧下方 */
    .rank-page .rank-user-sets { display: none; }

    .rank-page .rank-score {
        position: static;
        text-align: right;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
        align-items: flex-end;
    }
    .rank-page .rank-score-value {
        font-size: 20px !important;
        line-height: 1;
        display: inline;
    }
    .rank-page .rank-score-unit {
        font-size: 12px !important;
        line-height: 1;
        margin-left: 1px;
        display: inline;
    }
    /* 分数行：用一个包裹器保证 value+unit 同一行 */
    .rank-page .rank-score .score-line {
        display: flex;
        align-items: baseline;
        justify-content: flex-end;
        line-height: 1;
        white-space: nowrap;
    }
    /* 套装放在分数下方，移动端显示短名 */
    .rank-page .rank-item .sets-mobile {
        display: block;
        color: #C9A227;
        font-size: 10px;
        padding: 1px 6px;
        border: 1px solid #B08D3C;
        border-radius: 8px;
        background: rgba(201, 162, 39, 0.08);
        white-space: nowrap;
        margin-top: 2px;
    }
    .sets-full { display: none; }
    .sets-short { display: inline; }
}
