/* ==========================================================
   1. CSS 变量 & 全局重置
   ========================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --accent-primary: #ff4d4d;
    --accent-secondary: #ff8c00;
    --accent-gradient: linear-gradient(135deg, #ff4d4d 0%, #ff8c00 100%);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 40px rgba(255, 77, 77, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

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

body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ==========================================================
   2. 背景特效：网格线 + 彩色光晕
   ========================================================== */

/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 1001;
    width: 0%;
    transition: width 0.1s ease;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 { top: -200px; right: -200px; background: var(--accent-primary); }
.bg-glow-2 { bottom: -200px; left: -200px; background: var(--accent-secondary); }

/* ==========================================================
   3. 顶部导航栏（胶囊浮动样式）
   ========================================================== */
.site-header {
    position: fixed;
    top: 18px;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
    transition: transform 400ms cubic-bezier(.4,0,.2,1);
}

.nav-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(14, 16, 21, 0.78);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    pointer-events: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 13px 7px 8px;
    font-weight: 750;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #090a0f;
    background: #f5f1e8;
    border-radius: 50%;
    font-size: 0.78rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 240ms ease, background 240ms ease, transform 240ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    flex-shrink: 0;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
    width: 17px;
    height: 2px;
    display: block;
    position: relative;
    background: currentColor;
    border-radius: 99px;
    transition: transform 240ms ease, opacity 240ms ease;
}

.menu-toggle span::before,
.menu-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }

body.menu-open .menu-toggle span { background: transparent; }
body.menu-open .menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
body.menu-open .menu-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================
   4. 移动端响应式（≤768px）
   ========================================================== */
@media (max-width: 768px) {
    /* 汉堡按钮：浮在遮罩上方，推到右侧 */
    .menu-toggle {
        display: grid;
        position: relative;
        z-index: 1000;
        margin-left: auto;
    }

    /* 隐藏品牌和导航栏背景，只保留汉堡按钮 */
    .brand { display: none; }
    .nav-shell {
        background: none;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
    }

    .nav-links .nav-divider { display: none; }

    .nav-links {
        position: fixed;
        inset: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 8px;
        background: rgba(10, 10, 15, 0.96);
        backdrop-filter: blur(20px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 300ms ease;
        z-index: 999;
    }
    body.menu-open .nav-links { opacity: 1; pointer-events: auto; }

    /* 移动端导航链接样式 */
    .nav-links > li > a {
        font-size: 1.2rem;
        padding: 12px 24px;
    }

    /* 移动端外部链接（报名等）保持边框样式，放大字号 */
    .nav-links .nav-external a {
        font-size: 1rem;
        padding: 10px 20px;
        border-color: rgba(255, 255, 255, 0.12);
    }

    /* 移动端内部链接（主站等）不显示背景高亮 */
    .nav-links > li > a:hover,
    .nav-links > li > a.is-active {
        background: none;
    }

    /* 移动端全屏遮罩内的所有链接居中 */
    .nav-links li { text-align: center; }

    .hero-stats { gap: 2rem; }
    .timeline { padding-left: 2.5rem; }
    .timeline-item::before { left: -2.5rem; }
    .card-grid, .penalty-grid, .settings-grid { grid-template-columns: 1fr; }
    .weight-visual { flex-direction: column; align-items: center; }
    .weight-item { width: 100%; max-width: 300px; }
    .footer-inner { flex-direction: column; text-align: center; }
}

/* ==========================================================
   5. Hero 首屏区域
   ========================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(255,77,77,0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255,140,0,0.08) 0%, transparent 50%);
}

.hero-content { position: relative; z-index: 1; max-width: 900px; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255,77,77,0.1);
    border: 1px solid rgba(255,77,77,0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.1s backwards;
}

.hero h1 .gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.3s backwards;
}

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

.hero-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
}

.hero-scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
}

/* ==========================================================
   6. 通用板块样式
   ========================================================== */
.section { position: relative; z-index: 1; padding: 6rem 2rem; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 4rem; }

.section-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-desc { color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

/* ==========================================================
   7. 卡片网格
   ========================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,77,77,0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.card:hover::before { opacity: 1; }

.card-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,77,77,0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }

.card-content { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }
.card-content strong { color: var(--text-primary); font-weight: 600; }
.card.text-center { text-align: center; }
.card.text-center .card-icon { margin: 0 auto 1.5rem; }

/* ==========================================================
   8. 时间轴（赛道赛程）
   ========================================================== */
.timeline { position: relative; padding-left: 3rem; }

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.timeline-item:hover { background: var(--bg-card-hover); border-color: rgba(255,77,77,0.2); }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -3rem;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(255,77,77,0.3);
    transform: translate(-50%, -50%);
}

.timeline-date { font-family: 'Orbitron', sans-serif; font-size: 0.85rem; color: var(--accent-primary); margin-bottom: 0.5rem; }
.timeline-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.timeline-subtitle { color: var(--text-secondary); font-size: 0.9rem; }

/* ==========================================================
   9. 配重展示卡片
   ========================================================== */
.weight-visual { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }

.weight-item {
    text-align: center;
    padding: 2rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    min-width: 160px;
    transition: all 0.3s ease;
}

.weight-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }

.weight-position { font-family: 'Orbitron', sans-serif; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.weight-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weight-unit { font-size: 1rem; font-weight: 400; }

/* ==========================================================
   10. 轮胎分配圆圈
   ========================================================== */
.tire-visual { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }

.tire-set {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tire-set:hover { border-color: var(--accent-primary); background: rgba(255,77,77,0.1); }

/* ==========================================================
   11. 服务器参数网格
   ========================================================== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }

.setting-item {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.setting-item:hover { background: var(--bg-card-hover); border-color: rgba(255,77,77,0.2); }
.setting-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.setting-value { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.setting-value .accent { color: var(--accent-primary); }

.setting-note {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: 0.25rem;
}

/* ==========================================================
   12. 积分表格
   ========================================================== */
.points-table-wrapper { overflow-x: auto; margin-top: 2rem; }

.points-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.points-table th,
.points-table td { padding: 1rem 1.25rem; text-align: center; border-bottom: 1px solid var(--border-color); }

.points-table th {
    background: rgba(255,77,77,0.08);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 1px;
}

.points-table td { font-size: 1rem; font-weight: 500; }
.points-table tr:last-child td { border-bottom: none; }
.points-table tr:hover td { background: rgba(255,255,255,0.02); }

.points-value { font-family: 'Orbitron', sans-serif; font-weight: 600; color: var(--accent-primary); }

/* ==========================================================
   13. 安全分处罚卡片
   ========================================================== */
.penalty-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }

.penalty-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s ease;
}

.penalty-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

.penalty-level { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }

.penalty-level-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.penalty-level-badge.safe     { background: rgba(34,197,94,0.15);  color: #22c55e; border: 2px solid rgba(34,197,94,0.3); }
.penalty-level-badge.warn     { background: rgba(234,179,8,0.15);  color: #eab308; border: 2px solid rgba(234,179,8,0.3); }
.penalty-level-badge.danger   { background: rgba(239,68,68,0.15);  color: #ef4444; border: 2px solid rgba(239,68,68,0.3); }
.penalty-level-badge.critical { background: rgba(168,85,247,0.15); color: #a855f7; border: 2px solid rgba(168,85,247,0.3); }
.penalty-level-badge.banned   { background: rgba(255,255,255,0.05); color: #666; border: 2px solid rgba(255,255,255,0.1); }

.penalty-level-text { font-weight: 600; }
.penalty-desc { color: var(--text-secondary); font-size: 0.9rem; padding-left: calc(48px + 0.75rem); }

/* ==========================================================
   14. 比赛规则手风琴
   ========================================================== */
.rules-accordion { display: flex; flex-direction: column; gap: 1rem; }

.accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.accordion-item:hover { border-color: rgba(255,77,77,0.2); }

.accordion-header {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.accordion-header:hover { color: var(--accent-primary); }

.accordion-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.accordion-item.active .accordion-icon { background: rgba(255,77,77,0.15); transform: rotate(180deg); }
.accordion-icon svg { width: 16px; height: 16px; stroke: currentColor; }

.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }

.accordion-body {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.accordion-body strong { color: var(--text-primary); }

.accordion-body .rule-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255,77,77,0.1);
    border: 1px solid rgba(255,77,77,0.2);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent-primary);
    margin-right: 0.5rem;
}

.rule-item {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(255,77,77,0.3);
}

.rule-item:last-child { margin-bottom: 0; }

.rule-item-title { font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }

/* ==========================================================
   15. 页脚
   ========================================================== */
.footer {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


.footer-copyright { color: var(--text-muted); font-size: 0.85rem; }

.footer-beian {
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-beian a { color: var(--text-muted); font-size: 0.75rem; transition: color 0.3s ease; }
.footer-beian a:hover { color: var(--text-secondary); }

/* ==========================================================
   16. 滚动渐显动画
   ========================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ==========================================================
   17. 导航栏自动隐藏
   ========================================================== */
.site-header.hidden {
    transform: translateY(calc(-100% - 40px));
    pointer-events: none;
}

/* ==========================================================
   18. 导航栏外部链接（主站 / 比赛数据）
   ========================================================== */
.nav-links .nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
    flex-shrink: 0;
}

.nav-links .nav-external a {
    padding: 6px 10px;
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 240ms ease, border-color 240ms ease, background 240ms ease, transform 240ms ease;
}

.nav-links .nav-external a:hover {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links .nav-external a.is-active {
    color: var(--text-primary);
    background: rgba(255, 77, 77, 0.1);
    border-color: rgba(255, 77, 77, 0.3);
}

/* ==========================================================
   19. 关键帧动画
   ========================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ==========================================================
   20. 滚动条美化
   ========================================================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-card-hover); }
