/* ══════════════════════════════════════════════════════════
   Hyrox PK - Dark Theme (inspired by repz.app)
   ══════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a28;
    --bg-card-hover: #222236;
    --bg-input: #15151f;
    --border: #2a2a3a;
    --border-hover: #3a3a50;
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --accent: #FF7A2F;
    --accent-dim: rgba(255, 122, 47, 0.15);
    --accent-hover: #FFB020;
    --danger: #ff4d6a;
    --info: #4da6ff;
    --success: #00d68f;
    --warning: #ffaa00;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --gradient-accent: linear-gradient(135deg, #FF7A2F, #FFB020);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── 顶部导航 ──────────────────────────────────── */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    /* Logo 左侧，菜单居中，语言切换右侧 */
    justify-content: space-between;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 2;
}

.logo span {
    color: var(--accent);
}

/* 菜单居中：绝对定位到父容器中央 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--accent-dim);
}

.nav-link.active {
    color: var(--accent);
}

.nav-link .arrow {
    font-size: 0.7em;
    transition: transform 0.2s;
}

@media (min-width: 769px) and (max-width: 1050px) {
    .nav-link { padding: 8px 8px; font-size: 0.82rem; }
    .logo { font-size: 1.2rem; }
}

.nav-item:hover .arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: var(--accent-dim);
}

.dropdown-item.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* ── 语言切换按钮 ──────────────────────────────── */

.nav-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 2;
}

.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.lang-btn:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.lang-btn .globe-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-btn .lang-arrow {
    font-size: 0.6em;
    transition: transform 0.2s;
}

.lang-switcher.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
}

.lang-option:hover {
    color: var(--text-primary);
    background: var(--accent-dim);
}

.lang-option.active {
    color: var(--accent);
    background: var(--accent-dim);
    font-weight: 600;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
    line-height: 1;
    order: -1;
    margin-right: 12px;
}
.menu-toggle:hover {
    color: var(--accent);
}
.menu-toggle.active {
    color: var(--accent);
}

/* ── 主内容区 ──────────────────────────────────── */

.main-content {
    margin-top: 64px;
    padding: 32px 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── 页面标题 ──────────────────────────────────── */

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.page-title .highlight {
    color: var(--accent);
}

.page-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.page-header.centered {
    text-align: center;
}

.toolbar.centered {
    justify-content: center;
}

/* ── 筛选器/工具栏 ──────────────────────────────── */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select, input[type="text"], input[type="search"] {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    min-width: 140px;
}

select:hover, input:hover {
    border-color: var(--border-hover);
}

select:focus, input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* 切换按钮组 */
.btn-group {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
}

.btn-toggle {
    padding: 6px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-toggle.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-toggle:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ── 表格 ──────────────────────────────────────── */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
.sortable-th:hover {
    color: var(--accent);
}
.sortable-th.active {
    color: var(--accent);
}

/* 表头提示图标 */
.th-tooltip-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.85em;
    color: var(--text-muted);
    cursor: help;
    position: relative;
    vertical-align: middle;
}
.th-tooltip-icon:hover {
    color: var(--accent);
}
/* 自定义 tooltip（使用 data-tip 属性，避免浏览器原生 title tooltip） */
.sortable-th {
    position: relative;
}
.th-tooltip-icon::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
    text-transform: none;
    letter-spacing: normal;
}
.th-tooltip-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
}
.th-tooltip-icon:hover::after,
.th-tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 分页器 */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}
.pager .btn-toggle { flex: none; }
.pager-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}
.pager button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
    white-space: nowrap;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

/* ── 分页 ──────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
}

.pagination-btn {
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    margin-left: -1px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.pagination-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.pagination-btn:hover:not(.disabled):not(.active):not(.dots) {
    background: var(--bg-card-hover);
}

.pagination-btn.active {
    background: transparent;
    color: #FFB020;
    font-weight: 700;
    border-color: var(--border);
}

.pagination-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-btn.dots {
    cursor: default;
    color: var(--text-secondary);
    pointer-events: none;
}

/* 排名特殊样式 */
.rank-cell {
    font-weight: 700;
    width: 50px;
    text-align: center;
}

.rank-1 { color: var(--gold); }
.rank-2 { color: var(--silver); }
.rank-3 { color: var(--bronze); }

.country-flag {
    font-size: 1.2rem;
    margin-right: 6px;
}

.time-cell {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 600;
    color: var(--accent);
}

.time-cell-dim {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.name-cell {
    font-weight: 600;
    color: var(--text-primary);
}

/* ── 图表容器 ──────────────────────────────────── */

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.chart-canvas {
    width: 100%;
    height: 400px;
}

/* ── 双栏布局（左右饼图/表格） ──────────────────── */

.chart-dual-wrap,
.table-dual-wrap {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-half,
.table-half {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .chart-dual-wrap,
    .table-dual-wrap {
        flex-direction: column;
    }
}

/* ── 对比卡片（运动员PK） ──────────────────────────── */

.compare-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.athlete-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    position: relative;
}

.card-win {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.12);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 4px;
    padding: 4px 10px;
}
.compare-container > .athlete-card:first-child .card-win {
    right: 16px;
}
.compare-container > .athlete-card:last-child .card-win {
    left: 16px;
}

.athlete-card .name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.athlete-card .meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.vs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 900;
    font-size: 1.1rem;
    border-radius: 50%;
    align-self: center;
}

.compare-bars {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.compare-bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px 1fr 80px;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 42, 58, 0.3);
}

.compare-bar-row:last-child {
    border-bottom: none;
}

.bar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
}

.bar-value {
    font-family: 'SF Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.bar-value.left { text-align: right; color: var(--info); }
.bar-value.right { text-align: left; color: var(--accent); }

.bar-track {
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.bar-fill.left {
    background: linear-gradient(90deg, transparent, var(--info));
    float: right;
}

.bar-fill.right {
    background: linear-gradient(90deg, var(--accent), transparent);
}

.bar-fill.winner {
    opacity: 1;
}

.bar-fill.loser {
    opacity: 0.4;
}

.bar-win {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff4444;
    opacity: 0.85;
}
.bar-win.left {
    left: 8px;
}
.bar-win.right {
    right: 8px;
}

/* ── 搜索框 ──────────────────────────────────── */

.search-container {
    position: relative;
    max-width: 400px;
}

.search-container.history-search-wide {
    max-width: 800px;
    width: 800px;
}

.search-input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results.show { display: block; }

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(42, 42, 58, 0.3);
}

.search-result-item:hover {
    background: var(--accent-dim);
}

.search-result-item .sr-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.search-result-item .sr-meta {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ── VS对比 - 搜索框+赛事选择 ──────────────────────── */

.compare-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.compare-search-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 320px;
    max-width: 420px;
    flex: 1;
}

.compare-vs-label {
    font-weight: 900;
    color: var(--accent);
    font-size: 1.2rem;
    flex-shrink: 0;
    height: 42px;
    line-height: 42px;
}

.compare-race-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.race-select-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.race-select-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.race-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
    gap: 8px;
}

.race-select-item:hover {
    background: var(--accent-dim);
    color: var(--text-primary);
}

.race-select-item.selected {
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--text-primary);
}

.race-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.race-tag.latest {
    background: var(--accent);
    color: var(--bg-primary);
}

.race-info {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.race-division {
    color: var(--accent);
    font-weight: 600;
}

.race-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.compare-race-label {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════
   首页 - Home Page
   ══════════════════════════════════════════════════ */

.home-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Hero 区域 ── */
.hero {
    text-align: center;
    padding: 70px 20px 50px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease;
}

.hero-title span {
    color: var(--accent);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 6px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-tagline {
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hero-stat-num {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* ── Showcase 模块 ── */
.showcase-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 48px 0;
    border-top: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

.showcase-section:hover {
    transform: translateY(-2px);
}

.showcase-section.reverse {
    direction: rtl;
}

.showcase-section.reverse > * {
    direction: ltr;
}

.showcase-section.trend-banner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 56px 0;
    background: linear-gradient(135deg, rgba(255,122,47,0.06) 0%, rgba(77,166,255,0.06) 100%);
    border-radius: var(--radius);
    margin-bottom: 40px;
}

.showcase-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.showcase-hook {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    line-height: 1.5;
}

.showcase-questions {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.showcase-questions li {
    position: relative;
    padding: 8px 0 8px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.showcase-questions li::before {
    content: '?';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.showcase-cta {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.showcase-section:hover .showcase-cta {
    background: #ff8f4f;
    transform: translateX(4px);
}

/* ── 预览卡片 ── */
.showcase-preview {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-loading {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.preview-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.preview-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.preview-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.85rem;
}

.preview-bar-rank {
    width: 20px;
    text-align: center;
    font-weight: 800;
    color: var(--accent);
    font-size: 0.8rem;
}

.preview-bar-flag {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.preview-bar-name {
    min-width: 80px;
    max-width: 120px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}

.preview-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), #ff9a5c);
    width: 0;
    animation: barGrow 0.8s ease forwards;
}

.preview-bar-fill.accent2 {
    background: linear-gradient(90deg, #4da6ff, #80c4ff);
}

.preview-bar-fill.accent3 {
    background: linear-gradient(90deg, #00d68f, #4dffc3);
}

.preview-bar-value {
    min-width: 60px;
    text-align: right;
    font-weight: 700;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
}

.preview-bar-value.accent {
    color: var(--accent);
}

@keyframes barGrow {
    from { width: 0; }
    to { width: var(--target-width, 100%); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── 首页响应式 ── */
@media (max-width: 768px) {
    .hero { padding: 40px 12px 30px; }
    .hero-title { font-size: 2.6rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-tagline { font-size: 0.9rem; margin-bottom: 28px; }
    .hero-stats { gap: 16px; flex-wrap: wrap; }
    .hero-stat-num { font-size: 1.8rem; }
    .hero-stat-label { font-size: 0.7rem; }
    .hero-stat-divider { height: 30px; }

    .showcase-section {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 32px 0;
    }
    .showcase-section.reverse {
        direction: ltr;
    }
    .showcase-title { font-size: 1.3rem; }
    .showcase-hook { font-size: 1rem; }
    .showcase-questions li { font-size: 0.85rem; }
    .showcase-cta { font-size: 0.85rem; padding: 8px 20px; }

    .preview-card { padding: 16px; }
    .preview-bar-name { max-width: 80px; min-width: 60px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .hero-stats { gap: 12px; }
    .hero-stat-num { font-size: 1.5rem; }
    .preview-bar-row { gap: 6px; font-size: 0.8rem; }
    .preview-bar-name { max-width: 60px; min-width: 50px; font-size: 0.75rem; }
    .preview-bar-value { min-width: 48px; font-size: 0.75rem; }
}

/* ── 统计卡片 ──────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── 加载状态 ──────────────────────────────────── */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ── 响应式 ──────────────────────────────────── */

@media (max-width: 768px) {
    html { font-size: 13px; }

    .navbar { padding: 0 12px; height: 56px; }

    .navbar-inner {
        position: relative;
    }

    .logo { font-size: 1.3rem; }

    .menu-toggle { display: block; }

    /* ── 移动端隐藏 PC 导航菜单（使用独立面板代替） ── */
    .nav-menu {
        display: none !important;
    }

    /* 语言切换移动端适配 */
    .nav-right {
        margin-left: auto;
    }

    .lang-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    /* 主内容区 */
    .main-content {
        margin-top: 56px;
        padding: 16px 12px;
    }

    .page-header { margin-bottom: 20px; }
    .page-title { font-size: 1.4rem; }
    .page-desc { font-size: 0.85rem; }

    /* 工具栏 */
    .toolbar {
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar.centered {
        align-items: center;
    }

    .filter-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-label {
        width: 100%;
        font-size: 0.75rem;
    }

    select, input[type="text"], input[type="search"] {
        min-width: unset;
        width: 100%;
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .btn-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-toggle {
        padding: 8px 12px;
        font-size: 0.8rem;
        flex: 1;
        min-width: 60px;
        text-align: center;
    }

    /* 搜索框 */
    .search-container {
        max-width: 100%;
    }

    .search-container.history-search-wide {
        max-width: 100%;
        width: 100%;
    }

    /* VS对比 */
    .compare-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .compare-search-box {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    .compare-vs-label {
        text-align: center;
        font-size: 1rem;
        height: 32px;
        line-height: 32px;
    }

    .compare-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .vs-badge {
        margin: 0 auto;
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
    }

    .athlete-card {
        padding: 16px;
    }

    .athlete-card .name {
        font-size: 1.1rem;
    }

    .card-win {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .compare-container > .athlete-card:first-child .card-win,
    .compare-container > .athlete-card:last-child .card-win {
        right: 12px;
        left: auto;
    }

    .compare-bar-row {
        grid-template-columns: 50px 1fr 40px 1fr 50px;
        gap: 4px;
        padding: 8px 0;
    }

    .bar-label { font-size: 0.7rem; }
    .bar-value { font-size: 0.75rem; }
    .bar-track { height: 20px; }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: 0.7rem; }

    /* 图表 */
    .chart-container {
        padding: 16px 12px;
        margin-bottom: 16px;
    }

    .chart-canvas { height: 260px; }

    .chart-title { font-size: 0.9rem; }

    /* 表格 */
    .table-container {
        border-radius: var(--radius-sm);
    }

    thead th {
        padding: 10px 12px;
        font-size: 0.7rem;
    }

    tbody td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    /* 分页 */
    .pagination {
        justify-content: center;
        padding: 16px 8px;
        flex-wrap: wrap;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.8rem;
    }

    /* Sub-tabs */
    .sub-tabs {
        gap: 2px;
        margin-bottom: 16px;
    }

    .sub-tab {
        padding: 8px 12px;
        font-size: 0.75rem;
        flex: 1;
        min-width: 0;
        text-align: center;
    }

    /* 赛事选择列表 */
    .race-select-list { max-height: 160px; }

    .race-select-item { font-size: 0.75rem; padding: 8px 10px; }

    /* 双栏布局 */
    .chart-dual-wrap,
    .table-dual-wrap {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .compare-bar-row {
        grid-template-columns: 40px 1fr 32px 1fr 40px;
        gap: 3px;
    }

    .bar-label { font-size: 0.65rem; }
    .bar-value { font-size: 0.7rem; }
    .bar-track { height: 18px; }
    .bar-win { font-size: 0.6rem; }

    .btn-group {
        width: 100%;
    }

    .btn-toggle {
        flex: 1;
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    .chart-canvas { height: 220px; }

    .page-title { font-size: 1.2rem; }

    .athlete-card .name { font-size: 1rem; }
    .athlete-card { padding: 12px; }
}

/* ── 移动端导航背景遮罩 ──────────────────────────── */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}
.mobile-overlay.show {
    display: block;
}

/* ── 移动端独立全屏菜单面板 ──────────────────────── */
.mobile-menu-panel {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
}
.mobile-menu-panel.open {
    display: block;
}

/* 一级菜单并排 3 列卡片布局 */
.mobile-menu-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: start;
    list-style: none;
    padding: 12px;
    margin: 0;
}

.mobile-menu-list .mob-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.mobile-menu-list .mob-item.open {
    border-color: rgba(255, 122, 47, 0.45);
    background: rgba(255, 122, 47, 0.06);
}

.mobile-menu-list .mob-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    padding: 12px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    color: rgba(255, 255, 255, 0.85);
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    word-break: break-word;
}

.mobile-menu-list .mob-link:active {
    background: rgba(255, 255, 255, 0.06);
}

.mobile-menu-list .mob-link .mob-arrow {
    flex: none;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    transition: transform 0.3s, color 0.3s;
}

.mobile-menu-list .mob-item.open .mob-link {
    color: var(--accent);
}

.mobile-menu-list .mob-item.open .mob-link .mob-arrow {
    transform: rotate(90deg);
    color: var(--accent);
}

.mobile-menu-list .mob-sub {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    padding: 0;
    margin: 0;
    list-style: none;
}

.mobile-menu-list .mob-item.open .mob-sub {
    display: block;
}

.mobile-menu-list .mob-sub-item {
    display: block;
    padding: 10px 12px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    word-break: break-word;
}

.mobile-menu-list .mob-sub-item:last-child {
    border-bottom: none;
}

.mobile-menu-list .mob-sub-item:active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.mobile-menu-list .mob-sub-item.active {
    color: var(--accent);
    background: rgba(255, 122, 47, 0.08);
}

/* 仅在 PC 端隐藏移动端面板 */
@media (min-width: 769px) {
    .mobile-menu-panel {
        display: none !important;
    }
    .mobile-overlay {
        display: none !important;
    }
}

/* ── 滚动条 ──────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── Tab内容切换 ──────────────────────────────── */

.sub-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sub-tab {
    padding: 8px 18px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.sub-tab.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.sub-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.sub-content {
    display: none;
}

.sub-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.page-desc p + p { margin-top: 8px; }
.hero-explanation { margin-top: 12px; color: var(--text-secondary); font-size: 0.9rem; }
.hero-explanation p + p { margin-top: 8px; }

/* ══════════════════════════════════════════════════════════
   Footer - 页脚
   ══════════════════════════════════════════════════════════ */

.site-footer {
    background: #000000;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* ── 快捷导航区 ── */
.footer-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-nav-inner {
    display: flex;
    justify-content: space-evenly;
    gap: 32px;
}

.footer-col-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    letter-spacing: 0.3px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1.8;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ── 版权声明区 ── */
.footer-copyright {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px;
    text-align: center;
}

.footer-copyright p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
    line-height: 1.6;
}

.footer-copyright p:last-child {
    margin-bottom: 0;
}

.footer-author {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-author:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ── Footer 响应式 ── */
@media (max-width: 1024px) {
    .footer-nav-inner {
        flex-wrap: wrap;
        justify-content: space-evenly;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .site-footer {
        margin-top: 40px;
    }

    .footer-nav {
        padding: 32px 16px 24px;
    }

    .footer-nav-inner {
        flex-wrap: wrap;
        justify-content: space-evenly;
        gap: 24px;
    }

    .footer-col {
        min-width: 140px;
    }

    .footer-col-title {
        font-size: 0.85rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .footer-links a {
        font-size: 0.8rem;
    }

    .footer-copyright {
        padding: 20px 16px;
    }

    .footer-copyright p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .footer-nav-inner {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .footer-col-title {
        font-size: 0.8rem;
    }
}
