/* ============================================================
   EyouCMS Premium Design System v3.0
   导航优化版：二级菜单特效 + 深度响应式
   ============================================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    /* 主色系 */
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3a0ca3;
    --accent: #f72585;
    --accent-light: #ff6b9d;
    --success: #06d6a0;

    /* 渐变 */
    --gradient-nav: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-footer: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);

    /* 中性色 */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-muted: #9090a8;
    --border-light: #e8ecf1;
    --border-medium: #d0d5dd;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.16), 0 8px 20px rgba(0,0,0,0.08);
    --shadow-dropdown: 0 10px 40px rgba(0,0,0,0.18), 0 3px 12px rgba(0,0,0,0.10);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* 字体 */
    --font-sans: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;

    /* 过渡 */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* 内容宽度 */
    --content-width: 1200px;
    /* 导航高度 */
    --nav-height: 68px;
    --nav-height-mobile: 56px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, h4, h5, h6, p, blockquote,
dl, dt, dd, ul, ol, li, pre, code,
form, fieldset, legend, button, input, textarea, th, td {
    margin: 0; padding: 0;
}

body {
    font: 14px/1.6 var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    margin-top: var(--nav-height);
}

ol, ul { list-style: none; }
em, strong { font-style: normal; font-weight: normal; }
fieldset, img { border: 0; }
table { border-collapse: collapse; border-spacing: 0; }
a { text-decoration: none; color: var(--primary); transition: var(--transition-fast); }
a:hover { text-decoration: none; }
.clearfix:after { content: "\200B"; display: block; height: 0; clear: both; }
.clearfix { *zoom: 1; }
.fl { float: left; }
.fr { float: right; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ---------- Typography ---------- */
h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 2rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h5 { font-size: 1.1rem; font-weight: 600; line-height: 1.5; }

/* ============================================================
   NAVIGATION - Premium Dark Glass
   ============================================================ */
.head_v2 {
    width: 100%;
    height: var(--nav-height);
    background: var(--gradient-nav);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.05);
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    transition: height 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    will-change: transform;
}

/* 滚动后缩小 */
.head_v2.scrolled {
    height: 56px;
    background: rgba(15, 12, 41, 0.97);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.container_v2 {
    overflow: visible;
    margin: 0 auto;
    width: var(--content-width);
    max-width: 96%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

/* ── 汉堡（桌面端隐藏） ── */
.nav-toggle {
    display: none;
}

/* ── 主导航列表 ── */
.nav_v2 {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
    gap: 2px;
    justify-content: center;
}

/* 每个顶级菜单项 */
.nav_v2 > li {
    position: relative;
    height: 100%;
    margin: 0;
    padding: 0 8px;
    background: none;
    display: flex;
    align-items: center;
}

/* 顶级链接 */
.nav_v2 > li > a {
    color: rgba(255,255,255,0.82);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-decoration: none;
    white-space: nowrap;
    padding: 8px 12px 6px;
    border-radius: var(--radius-sm);
    position: relative;
    transition: color 0.2s ease, background 0.2s ease;
}

/* 有子菜单时显示箭头图标 */
.nav_v2 > li > a.has-sub::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.25s ease, border-color 0.25s ease;
    opacity: 0.7;
    flex-shrink: 0;
    margin-left: 1px;
}
.nav_v2 > li:hover > a.has-sub::after,
.nav_v2 > li.hover > a.has-sub::after {
    transform: rotate(-135deg) translateY(-2px);
    border-color: var(--accent-light);
    opacity: 1;
}

/* 底部高亮线 */
.nav_v2 > li > a::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    border-radius: 2px;
    transition: width 0.25s ease, left 0.25s ease;
    transform: translateX(-50%);
}

/* 悬停状态 */
.nav_v2 > li:hover > a,
.nav_v2 > li.hover > a {
    color: #fff;
    background: rgba(255,255,255,0.12);
}
.nav_v2 > li:hover > a::before,
.nav_v2 > li.hover > a::before {
    width: calc(100% - 16px);
}

/* 当前激活 */
.nav_v2 .hover > a,
.nav_v2 .current_v2 > a,
.nav_v2 .current_v3 > a,
.nav_v2 .current_v4 > a {
    color: #fff !important;
    background: rgba(255,255,255,0.22) !important;
    font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.nav_v2 .hover > a::before,
.nav_v2 .current_v2 > a::before,
.nav_v2 .current_v3 > a::before,
.nav_v2 .current_v4 > a::before {
    width: calc(100% - 16px) !important;
    background: var(--accent) !important;
}

/* ── 下拉子菜单 ── */
.nav_v2 li .subnav {
    display: block;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    margin: 0;
    padding: 8px 0;
    min-width: 130px;
    width: auto;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0,0,0,0.07);
    overflow: hidden;
}

/* 子菜单顶部小三角 */
.nav_v2 li .subnav::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    background: #fff;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.nav_v2 li:hover .subnav,
.nav_v2 li.hover .subnav {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* 子菜单 li */
.nav_v2 li .subnav li {
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    display: block;
    position: relative;
}

/* 子菜单 a */
.nav_v2 li .subnav li a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    padding: 9px 18px 9px 14px;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 400;
    height: auto;
    line-height: 1.5;
    white-space: nowrap;
    transition: all 0.18s ease;
    position: relative;
    border-left: 3px solid transparent;
}

/* 子菜单 a 前面的小圆点图标 */
.nav_v2 li .subnav li a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-medium);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* 子菜单 a 右侧箭头 */
.nav_v2 li .subnav li a::after {
    content: '›';
    margin-left: auto;
    font-size: 16px;
    line-height: 1;
    color: transparent;
    transform: translateX(-4px);
    transition: all 0.2s ease;
}

.nav_v2 li .subnav li a:hover {
    background: rgba(67, 97, 238, 0.06);
    color: var(--primary);
    font-weight: 500;
    border-left-color: var(--primary);
    padding-left: 16px;
}

.nav_v2 li .subnav li a:hover::before {
    background: var(--primary);
    transform: scale(1.3);
}

.nav_v2 li .subnav li a:hover::after {
    color: var(--primary);
    transform: translateX(0);
}

/* 子菜单 li 之间的分隔线（仅内部） */
.nav_v2 li .subnav li + li {
    border-top: 1px solid rgba(0,0,0,0.04);
}

/* ============================================================
   FOOTER - Dark Premium
   ============================================================ */
.global-footer {
    width: 100%;
    background: var(--gradient-footer);
    color: rgba(255,255,255,0.8);
    padding: 50px 0 30px;
    margin-top: 60px;
    border-top: 4px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}
.global-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), rgba(247,37,133,0.3), rgba(255,255,255,0.1), transparent);
}
.footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}
.footer-col h4 {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 14px;
    position: relative;
    letter-spacing: 0.5px;
}
.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px; height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    border-radius: 2px;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    line-height: 1.8;
}
.footer-links a {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    text-decoration: none;
    padding: 6px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
    border: 1px solid rgba(255,255,255,0.05);
    display: inline-block;
}
.footer-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.14);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.15);
}
.footer-info {
    font-size: 14px;
    line-height: 1.9;
    color: rgba(255,255,255,0.7);
}
.footer-info p { margin-bottom: 6px; }
.footer-info a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    display: inline-block;
    padding: 3px 0;
}
.footer-info a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: var(--accent);
    transition: var(--transition-base);
}
.footer-info a:hover { color: var(--accent-light); }
.footer-info a:hover::after { width: 100%; }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--gradient-hero);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-base);
    box-shadow: var(--shadow-lg);
    border: none;
    line-height: 1;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ============================================================
   RESPONSIVE - Tablet (768px ~ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    :root { --content-width: 100%; }
    body { margin-top: var(--nav-height); }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
    .nav_v2 > li { padding: 0 4px; }
    .nav_v2 > li > a { font-size: 13.5px; padding: 0 10px; }
}

/* ============================================================
   RESPONSIVE - Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    body { margin-top: var(--nav-height-mobile); }

    /* ── 导航栏高度 ── */
    .head_v2 { height: var(--nav-height-mobile) !important; }
    .container_v2 {
        width: 100%;
        max-width: 100%;
        padding: 0 16px;
        justify-content: space-between;
    }

    /* ── 汉堡按钮 ── */
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 38px;
        height: 38px;
        cursor: pointer;
        border: none;
        background: rgba(255,255,255,0.1);
        border-radius: var(--radius-sm);
        padding: 8px;
        z-index: 1002;
        flex-shrink: 0;
        transition: var(--transition-base);
        margin-left: auto;
        -webkit-tap-highlight-color: transparent;
    }
    .nav-toggle:hover,
    .nav-toggle:active { background: rgba(255,255,255,0.2); }
    .nav-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: rgba(255,255,255,0.9);
        border-radius: 2px;
        transition: var(--transition-base);
        margin: 2.5px 0;
    }
    .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

    /* ── 移动端菜单面板 ── */
    .nav_v2 {
        display: none !important;
        position: fixed !important;
        top: var(--nav-height-mobile) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: calc(100vh - var(--nav-height-mobile)) !important;
        max-height: none !important;
        background: linear-gradient(180deg, #16213e 0%, #0f3460 100%) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 8px 0 20px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 1001 !important;
        border-radius: 0 !important;
        gap: 0 !important;
        -webkit-overflow-scrolling: touch;
    }
    .nav_v2.nav-open { display: flex !important; }

    /* 顶级菜单项 */
    .nav_v2 > li {
        float: none !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid rgba(255,255,255,0.06) !important;
        display: block !important;
        flex-shrink: 0;
    }
    .nav_v2 > li > a {
        font-size: 15px !important;
        padding: 0 20px !important;
        justify-content: space-between !important;
        border-radius: 0 !important;
        height: 52px !important;
        min-height: 52px !important;
        display: flex !important;
        color: rgba(255,255,255,0.85) !important;
        gap: 0 !important;
        -webkit-tap-highlight-color: transparent;
    }
    /* 移动端箭头图标（下拉指示器） */
    .nav_v2 > li > a.has-sub::after {
        content: '' !important;
        display: inline-block !important;
        width: 8px !important;
        height: 8px !important;
        border-right: 2px solid rgba(255,255,255,0.5) !important;
        border-bottom: 2px solid rgba(255,255,255,0.5) !important;
        transform: rotate(45deg) !important;
        transition: transform 0.25s ease !important;
        border-top: none !important;
        border-left: none !important;
        border-radius: 0 !important;
        background: none !important;
        clip-path: none !important;
        flex-shrink: 0 !important;
    }
    .nav_v2 > li.hover > a.has-sub::after {
        transform: rotate(-135deg) translateY(3px) !important;
    }
    /* 底部高亮线移动端隐藏 */
    .nav_v2 > li > a::before { display: none !important; }

    /* 激活状态 */
    .nav_v2 .hover > a {
        background: rgba(67,97,238,0.18) !important;
        border-left: 3px solid var(--primary) !important;
        color: #fff !important;
    }
    .nav_v2 .current_v2 > a,
    .nav_v2 .current_v3 > a,
    .nav_v2 .current_v4 > a {
        background: rgba(247,37,133,0.18) !important;
        border-left: 3px solid var(--accent) !important;
        color: #fff !important;
    }

    /* ── 移动端子菜单（内联展开） ── */
    .nav_v2 > li > .subnav {
        position: static !important;
        display: none !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        margin: 0 !important;
        padding: 4px 0 8px !important;
        box-shadow: none !important;
        border: none !important;
        border-top: none !important;
        border-radius: 0 !important;
        background: rgba(0,0,0,0.2) !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        overflow: hidden !important;
        max-height: 0 !important;
        transition: max-height 0.3s ease !important;
    }
    .nav_v2 > li > .subnav::before { display: none !important; }
    .nav_v2 > li.hover > .subnav {
        display: block !important;
        max-height: 400px !important;
    }
    /* 移动端子菜单链接 */
    .nav_v2 > li > .subnav > li > a {
        color: rgba(255,255,255,0.7) !important;
        padding: 12px 20px 12px 36px !important;
        font-size: 13.5px !important;
        border-left: 3px solid transparent !important;
        background: none !important;
        gap: 10px !important;
        -webkit-tap-highlight-color: transparent;
    }
    .nav_v2 > li > .subnav > li > a::before {
        background: rgba(255,255,255,0.3) !important;
        width: 5px !important;
        height: 5px !important;
    }
    .nav_v2 > li > .subnav > li > a::after { display: none !important; }
    .nav_v2 > li > .subnav > li > a:hover,
    .nav_v2 > li > .subnav > li > a:active {
        color: #fff !important;
        background: rgba(67,97,238,0.2) !important;
        border-left-color: var(--primary-light) !important;
    }
    .nav_v2 > li > .subnav li + li {
        border-top: 1px solid rgba(255,255,255,0.04) !important;
    }

    /* ── Footer mobile ── */
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .global-footer { padding: 36px 0 24px; margin-top: 40px; }
    .footer-links a { padding: 5px 10px; font-size: 12px; }

    /* ── Back to top mobile ── */
    .back-to-top { bottom: 20px; right: 16px; width: 42px; height: 42px; font-size: 16px; }
}

/* ============================================================
   RESPONSIVE - Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    .nav_v2 > li > a { font-size: 14px !important; }
    .footer-links a { padding: 4px 8px; font-size: 11px; }
}

/* ============================================================
   FOOTER SLOGAN BAR
   ============================================================ */
.footer-slogan-bar {
    width: 100%;
    background: linear-gradient(135deg, #141028 0%, #1e1b3a 50%, #1a1733 100%);
    text-align: center;
    padding: 24px 24px;
    position: relative;
    overflow: hidden;
}
.footer-slogan-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(72,149,239,0.4),
        rgba(247,37,133,0.4),
        rgba(72,149,239,0.4),
        transparent);
}
.footer-slogan {
    margin: 0;
    font-size: 18px;
    color: #ffffff;
    letter-spacing: 4px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 8px rgba(72,149,239,0.25);
}
.footer-slogan::before,
.footer-slogan::after {
    content: '◆';
    display: inline-block;
    vertical-align: middle;
    font-size: 8px;
    color: rgba(72,149,239,0.7);
    margin: 0 16px;
    position: relative;
    top: -1px;
}
@media (max-width: 768px) {
    .footer-slogan-bar { padding: 18px 16px; }
    .footer-slogan { font-size: 15px; letter-spacing: 2px; }
    .footer-slogan::before,
    .footer-slogan::after { margin: 0 10px; font-size: 6px; }
}
@media (max-width: 480px) {
    .footer-slogan-bar { padding: 14px 12px; }
    .footer-slogan { font-size: 13px; letter-spacing: 1px; }
    .footer-slogan::before,
    .footer-slogan::after { margin: 0 6px; font-size: 5px; }
}

/* ============================================================
   TOUCH OPTIMIZATION
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备增大点击热区 */
    .nav_v2 > li > a { min-height: 48px; }
    .nav_v2 .subnav li a { min-height: 44px; }
    .back-to-top { width: 52px; height: 52px; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}
.nav_v2 a:focus-visible {
    outline: 2px solid rgba(255,255,255,0.6);
    outline-offset: 2px;
}
