/* ============================================================
   tokens.css — 全局设计令牌（以 match.html 为基准统一所有页面）
   所有页面统一引用此文件，确保颜色、字体、间距、动画参数一致
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;900&display=swap');

/* ── CSS Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
* {
    font-family: 'Rajdhani', sans-serif;
}

/* Vue 未挂载时隐藏 #app，防止模板语法和未加载样式闪烁 */
[v-cloak] { display: none; }

/* ── 设计令牌 ── */
:root {
    /* 主色调 */
    --bg: #0f1923;
    --bg-alt: #0b121a;
    --red: #ff4655;
    --red-hover: #ff5f6c;
    --text: #ece8e1;
    --text-muted: rgba(236, 232, 225, 0.6);
    --gold: #ffc107;
    --gold-light: #ffc96f;
    --green: #08c18a;
    --green-glow: #4ade80;
    --blue: #60a5fa;
    --accent: #31d0ff;
    --warn: #ff9e2f;

    /* 表面 / 卡片 */
    --card: rgba(255, 255, 255, 0.05);
    --surface: rgba(12, 19, 27, 0.86);
    --surface-soft: rgba(16, 25, 35, 0.72);
    --hud-surface-1: linear-gradient(135deg, rgba(10, 20, 35, 0.92) 0%, rgba(15, 25, 40, 0.98) 100%);
    --hud-surface-2: rgba(0, 0, 0, 0.45);
    --hud-surface-3: rgba(255, 70, 85, 0.16);

    /* 边框 */
    --border: rgba(255, 255, 255, 0.12);
    --hud-border: rgba(255, 70, 85, 0.28);
    --hud-border-strong: rgba(255, 70, 85, 0.55);

    /* 发光 */
    --hud-glow: rgba(255, 70, 85, 0.5);
    --hud-glow-soft: rgba(255, 70, 85, 0.28);

    /* 圆角 */
    --hud-radius: 8px;
    --radius-lg: 14px;

    /* HUD 切角尺寸 */
    --hud-cut: 10px;
    --hud-cut-lg: 15px;

    /* 过渡 */
    --hud-transition-fast: 0.2s;
    --hud-transition-base: 0.3s;
    --hud-transition-slow: 0.5s;
    --hud-ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* 玻璃效果 */
    --glass-bg-main: linear-gradient(140deg, rgba(10, 20, 35, 0.56) 0%, rgba(15, 25, 40, 0.46) 100%);
    --glass-border-main: 1px solid rgba(255, 255, 255, 0.14);
    --glass-shadow-main: 0 12px 28px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    --glass-filter-main: blur(18px) saturate(125%);

    /* 弹窗遮罩 */
    --modal-overlay-bg: rgba(6, 10, 16, 0.58);
    --modal-overlay-blur: 6px;

    /* 滚动条 */
    --scrollbar-size: 8px;
    --scrollbar-track: rgba(0, 0, 0, 0.2);
    --scrollbar-thumb: var(--red);
    --scrollbar-thumb-hover: #ff5f6c;

    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* 字体大小 */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 20px;
    --text-xl: 24px;
    --text-2xl: 28px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.28);
    --shadow-glow-red: 0 0 20px rgba(255, 70, 85, 0.3);
    --shadow-glow-gold: 0 0 20px rgba(255, 193, 7, 0.3);
}

/* ── 按钮字体 ── */
button,
.btn,
.btn-hud-login,
.btn-hud-action,
.btn-hud-logout,
.btn-confirm-match,
.tab-btn-hud,
.week-nav-btn-hud {
    font-family: 'Orbitron', sans-serif;
}

/* ── Body 基础 ── */
body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── 背景图片 + 遮罩 ── */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image, url('/wallpaper/default.jpg'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 25, 35, 0.75);
    z-index: -1;
    pointer-events: none;
}

/* ── 扫描线效果 ── */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(255, 70, 85, 0.02) 51%
    );
    background-size: 100% 4px;
    z-index: 1;
    pointer-events: none;
    animation: scanline-move 8s linear infinite;
}

/* ── 粒子画布 ── */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── 滚动条 ── */
html {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ── 响应式容器 ── */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ── 通用 HUD 切角 ── */
.hud-clip {
    clip-path: polygon(
        0 var(--hud-cut),
        var(--hud-cut) 0,
        100% 0,
        100% calc(100% - var(--hud-cut)),
        calc(100% - var(--hud-cut)) 100%,
        0 100%
    );
}

.hud-clip-lg {
    clip-path: polygon(
        0 var(--hud-cut-lg),
        var(--hud-cut-lg) 0,
        100% 0,
        100% calc(100% - var(--hud-cut-lg)),
        calc(100% - var(--hud-cut-lg)) 100%,
        0 100%
    );
}
