/* =====================================================================
   MSG 卡牌评级 · 游戏风格主题 (Game UI Theme)
   视觉基调: 像素掌机界面 + 宝可梦卡牌配色
   核心手法: 硬边描边(3px) + 无模糊硬投影(立体感) + 电光黄高亮
   ===================================================================== */

:root {
    /* 底色 */
    --primary-dark: #0b1130;
    --primary-blue: #16224f;
    --shell-dark: #060a1d;

    /* 主题色 (宝可梦: 蓝 / 电光黄 / 精灵球红) */
    --accent-blue: #4d7cff;
    --accent-teal: #ffcb05;      /* 全局高亮色: 电光黄 */
    --accent-red: #ff4d4d;
    --accent-green: #38d982;

    /* 面板 */
    --panel: #182552;
    --panel-2: #0e1636;
    --panel-3: #23336e;
    --panel-border: #3a56ad;

    --radius-md: 10px;
    --radius-lg: 16px;

    /* 硬投影: 营造 8-bit 立体感 */
    --shadow-hard: 0 6px 0 var(--shell-dark);
    --shadow-hard-sm: 0 4px 0 var(--shell-dark);

    --font-game: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-game);
    color: #e9eeff;
    line-height: 1.65;
    min-height: 100vh;
    background-color: var(--primary-dark);
    background-image:
        radial-gradient(circle at 50% -15%, rgba(77, 124, 255, 0.32), transparent 58%),
        radial-gradient(circle at 8% 104%, rgba(255, 77, 77, 0.16), transparent 52%),
        radial-gradient(circle at 94% 100%, rgba(255, 203, 5, 0.14), transparent 52%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 12px),
        radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1.4px);
    background-size: auto, auto, auto, auto, 24px 24px;
    background-attachment: fixed;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--accent-teal);
    outline-offset: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 通用游戏按钮 ===== */
.btn-primary,
.btn-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32);
    border: 2px solid var(--shell-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}

.btn-primary {
    background: linear-gradient(180deg, #ff6f62 0%, #ea3b34 55%, #c8271f 100%);
    box-shadow: 0 5px 0 #7d1410, 0 9px 16px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 0 #7d1410, 0 11px 20px rgba(0, 0, 0, 0.42);
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #7d1410;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: translateY(4px);
    box-shadow: 0 1px 0 #7d1410;
    filter: none;
}

.btn-secondary {
    background: linear-gradient(180deg, #4f70dd 0%, #3350b8 55%, #263c93 100%);
    box-shadow: 0 5px 0 #101c4d, 0 9px 16px rgba(0, 0, 0, 0.32);
}

.btn-secondary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 0 #101c4d, 0 11px 18px rgba(0, 0, 0, 0.38);
}

.btn-secondary:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #101c4d;
}

/* ===== 导航栏 ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, #22346f 0%, #141f4c 100%);
    border-bottom: 4px solid var(--shell-dark);
    box-shadow:
        inset 0 2px 0 rgba(255, 203, 5, 0.45),
        inset 0 -2px 0 rgba(255, 203, 5, 0.3),
        0 10px 26px rgba(0, 0, 0, 0.45);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
    padding: 2px;
    background: #0d1533;
    border: 2px solid rgba(255, 203, 5, 0.85);
    border-radius: 12px;
    box-shadow: 0 3px 0 var(--shell-dark), 0 0 16px rgba(255, 203, 5, 0.32);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-link {
    position: relative;
    padding: 9px 18px;
    color: rgba(233, 238, 255, 0.72);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    border: 2px solid transparent;
    border-radius: 999px;
    transition: all 0.18s ease;
}

.nav-link:hover {
    color: var(--accent-teal);
    border-color: rgba(255, 203, 5, 0.45);
    background: rgba(255, 203, 5, 0.1);
}

.nav-link.active {
    color: var(--accent-teal);
    text-shadow: 0 0 12px rgba(255, 203, 5, 0.55);
    border-color: rgba(255, 203, 5, 0.7);
    background: rgba(255, 203, 5, 0.12);
    box-shadow: 0 4px 0 rgba(6, 10, 29, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.12);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 8px;
    height: 8px;
    background: var(--accent-teal);
    border: 2px solid var(--shell-dark);
    transform: translateX(-50%) rotate(45deg);
}

/* ===== 语言切换按钮 (中/英) ===== */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: inherit;
    line-height: 1;
    color: var(--accent-teal);
    cursor: pointer;
    background: rgba(6, 10, 29, 0.55);
    border-color: rgba(255, 203, 5, 0.45);
}

.lang-toggle i {
    font-size: 14px;
}

.lang-toggle:hover {
    color: #fff;
    background: rgba(255, 203, 5, 0.2);
    border-color: var(--accent-teal);
}

.lang-toggle:active {
    transform: translateY(2px);
}

/* ===== 区块 ===== */
section {
    padding: 70px 0;
}

/* ===== 页脚 ===== */
.footer {
    padding: 60px 0 28px;
    background: linear-gradient(180deg, rgba(10, 16, 42, 0.94), rgba(6, 9, 26, 0.97));
    border-top: 4px solid var(--panel-border);
    box-shadow: inset 0 3px 0 rgba(255, 203, 5, 0.35);
}

.footer-links {
    display: flex;
    gap: 60px;
}

/* 层级: body 背景 < 深色晕影 < 页面内容(弹窗不会被压暗) */
.page-content {
    position: relative;
    z-index: 2;
}

/* 页面内容之下叠加一层深色晕影, 保证背景与文字对比度 */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(125% 95% at 50% -10%, transparent 35%, rgba(4, 7, 20, 0.5) 100%),
        linear-gradient(180deg, transparent 62%, rgba(4, 7, 20, 0.5) 100%);
}

@media (prefers-reduced-motion: reduce) {
    body {
        background-image:
            radial-gradient(circle at 50% -15%, rgba(77, 124, 255, 0.32), transparent 58%),
            radial-gradient(rgba(255, 255, 255, 0.08) 1.4px, transparent 1.6px);
        background-size: auto, 300px 300px;
    }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    /* 区块留白收紧, 短屏幕不再被拉得过长 */
    section { padding: 44px 0; }

    /* 导航: 中屏收紧内距 */
    .nav-content { height: 62px; }
    .logo-img { height: 40px; }
    .nav-links { gap: 2px; }
    .nav-link { padding: 8px 9px; font-size: 13px; letter-spacing: 0.5px; }
    .nav-link.active::after { display: none; }
    .lang-toggle { gap: 0; letter-spacing: 0; }
    .lang-toggle i { display: none; }
    .footer-links { gap: 32px; }
}

/* 小屏手机/窄窗口: 导航改两行(Logo 居中在上, 链接居中在下), 任何宽度都不截断 */
@media (max-width: 520px) {
    .nav-content { flex-direction: column; height: auto; padding: 10px 0 6px; gap: 4px; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 4px; }
    .nav-link { padding: 8px 12px; font-size: 13px; }
}

/* =====================================================================
   UI 质感打磨层
   原则: 不改配色 / 不改布局 / 不改硬投影语言, 只补光泽与层次细节
   ===================================================================== */

/* --- 文本选中色: 与电光黄主题一致 --- */
::selection {
    background: rgba(255, 203, 5, 0.9);
    color: var(--primary-dark);
    text-shadow: none;
}

/* --- 主题化滚动条 --- */
html { scrollbar-color: #3350b8 #0b1130; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #0b1130; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4f70dd, #263c93);
    border: 3px solid #0b1130;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffcb05, #f0a500); }

/* --- 平滑锚点滚动(尊重系统减少动效设置) --- */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* --- 输入光标颜色统一为主题黄 --- */
input, textarea { caret-color: var(--accent-teal); }

/* --- 按钮糖霜高光: 顶部一条柔和反光, 更有"糖豆"质感 --- */
.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.07) 42%, transparent 70%);
}

/* 悬停时按钮内图标轻微前移, 强化"可点"暗示 */
.btn-primary i,
.btn-secondary i { transition: transform 0.18s ease; }
.btn-primary:hover i,
.btn-secondary:hover i { transform: translateX(3px); }

/* =====================================================================
   宽屏 HUD 装饰层: 填充两侧留白, 增强游戏机界面氛围
   ===================================================================== */

/* --- 视口两侧霓虹导轨: 渐变竖线 + 上下刻度, 纯装饰不挡内容 --- */
.page-content::before,
.page-content::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 24px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.9;
    background:
        /* 外圈柔光(比主线宽, 模拟辉光) */
        linear-gradient(180deg,
            transparent 2%,
            rgba(255, 203, 5, 0.14) 24%,
            rgba(77, 124, 255, 0.14) 55%,
            rgba(255, 203, 5, 0.14) 80%,
            transparent 98%) 6px 0 / 10px 100% no-repeat,
        /* 主体霓虹线 */
        linear-gradient(180deg,
            transparent 3%,
            rgba(255, 203, 5, 0.55) 24%,
            rgba(77, 124, 255, 0.55) 55%,
            rgba(255, 203, 5, 0.55) 80%,
            transparent 97%) 10px 0 / 3px 100% no-repeat,
        /* 顶部刻度 */
        linear-gradient(90deg, transparent, var(--accent-teal), transparent) 0 110px / 24px 2px no-repeat,
        /* 底部刻度 */
        linear-gradient(90deg, transparent, var(--accent-teal), transparent) 0 calc(100% - 110px) / 24px 2px no-repeat;
}

.page-content::before { left: 14px; }
.page-content::after { right: 14px; }

/* 中屏以下隐藏导轨, 避免挤占内容空间 */
@media (max-width: 1180px) {
    .page-content::before, .page-content::after { display: none; }
}

/* --- 宽屏流式布局: 内容区随分辨率平滑伸缩 --- */
/* 1366 及以下: 保持 1200px 不变; 1500 以上: 随视口加宽, 上限 1500px 保证可读性 */
@media (min-width: 1500px) {
    .container {
        max-width: clamp(1280px, calc(100vw - 380px), 1500px);
    }
}

/* =====================================================================
   2K 大屏适配 (≥2000px): 内容等比升级, 比例保持协调
   ===================================================================== */
@media (min-width: 2000px) {
    .container {
        max-width: clamp(1600px, calc(100vw - 520px), 1760px);
    }

    section { padding: 92px 0; }

    /* 导航与页脚 */
    .nav-content { height: 86px; }
    .logo-img { height: 60px; }
    .nav-link { font-size: 17px; padding: 11px 24px; }
}

/* =====================================================================
   4K 超大屏适配 (≥2800px): 进一步等比放大, 保持中央构图
   ===================================================================== */
@media (min-width: 2800px) {
    .container {
        max-width: clamp(2000px, calc(100vw - 700px), 2240px);
    }

    section { padding: 110px 0; }

    .nav-content { height: 100px; }
    .logo-img { height: 70px; }
    .nav-link { font-size: 20px; padding: 13px 28px; letter-spacing: 3px; }
}

/* =====================================================================
   全局触摸与滚动细节 (含移动端)
   ===================================================================== */
* { -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: clip; }

/* =====================================================================
   移动端体验同步优化 (≤768px, 风格不变)
   ===================================================================== */
@media (max-width: 768px) {
    /* iPhone 等刘海屏底部安全区 */
    .footer { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

    /* 导航激活项阴影简化, 避免小屏拥挤 */
    .nav-link.active { box-shadow: none; }
}

/* =====================================================================
   科技感细节层
   原则: 不改配色 / 不改布局 / 不改硬投影语言, 加"机器在运转"的细节
   ===================================================================== */

/* --- 数字等宽: 统计数字/编号对齐, 仪表盘质感 --- */
body { font-variant-numeric: tabular-nums; }

/* --- 主按钮: 呼吸辉光(独立伪元素承载, 不干扰按压位移) --- */
.btn-primary { position: relative; }

.btn-primary::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(closest-side, rgba(255, 107, 98, 0.42), transparent);
    opacity: 0;
    animation: btnGlow 3.4s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary::after { animation: none; }
}
