:root {
    /* 科技简约蓝调配色 */
    --primary-color: #2563eb;       /* 鲜亮的科技蓝 */
    --primary-hover: #1d4ed8;       /* 深一点的交互蓝 */
    --secondary-color: #64748b;     /* 柔和的次级文字色 */
    --background-color: #f8fafc;    /* 极淡的冷灰背景 */
    --surface-color: #ffffff;       /* 纯白卡片背景 */
    --text-color: #1e293b;          /* 深色主文字 */
    
    --card-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.1);
    --card-hover-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.2);
    
    --transition-speed: 0.3s;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden; /* 防止粒子溢出 */
}

/* 粒子背景容器 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 置于最底层 */
    pointer-events: none; /* 不遮挡点击 */
}

/* 导航栏优化 */
.navbar {
    background: rgba(255, 255, 255, 0.7) !important; /* 增加不透明度，确保背景偏白 */
    backdrop-filter: blur(20px); /* 增强磨砂 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 30px rgba(0,0,0,0.05);
    padding-top: 0.08rem;
    padding-bottom: 0.08rem;
    position: sticky;
    top: 0;
    z-index: 3000 !important;
    width: 100%;
    transition: all 0.3s ease;
}

.navbar:hover, .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important; /* 悬停/滚动时几乎不透明 */
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.navbar-brand {
    color: #0f172a !important; /* 改为深色文字，确保在浅色背景上可见 */
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    border: none !important;
}

.navbar-brand img {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.nav-link {
    color: #334155 !important;
    font-weight: 600;
    margin: 0 1rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0.2rem !important;
    border-radius: 0;
    background: transparent !important; /* 移除背景色 */
}

/* 移除之前的 hover 背景和阴影 */
.nav-link:hover, .nav-link.active {
    background: transparent !important;
    box-shadow: none !important;
    color: #2563eb !important;
}

/* 独特的下划线动画 - 科技感线条 */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 0.3s ease-in-out;
    border-radius: 2px;
}

.nav-link:hover::before {
    width: 100%;
}

/* 激活状态：底部常亮线条 + 顶部短线条呼应 */
.nav-link.active::before {
    width: 100%;
    height: 3px;
    background: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 2px;
    background: #60a5fa;
    border-radius: 2px;
    display: block; /* 恢复显示 */
}

/* 移除之前的复杂 hover 覆盖规则，统一使用深色主题 */
.navbar:hover .nav-link, .navbar.scrolled .nav-link {
    color: #334155 !important;
}

.navbar:hover .nav-link:hover, .navbar.scrolled .nav-link:hover,
.navbar:hover .nav-link.active, .navbar.scrolled .nav-link.active {
    color: #2563eb !important;
    background: transparent !important;
}

/* 确保 active 状态下下划线可见 */
.nav-link.active::after {
    display: block !important;
}

.navbar:hover .navbar-brand, .navbar.scrolled .navbar-brand {
    color: #0f172a !important;
}

/* 移除 active 状态下的下划线动画 */
.nav-link.active::before {
    width: 100%;
}

/* 语言切换下拉菜单优化 */
.navbar .nav-item.dropdown .dropdown-menu {
    background: rgba(255, 255, 255, 0.9); /* 白色背景 */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    margin-top: 10px;
    min-width: 120px;
    overflow: hidden;
    /* 覆盖 Bootstrap 默认样式 */
    left: auto !important;
    right: 0 !important;
}

.navbar .nav-item.dropdown .dropdown-item {
    color: #334155; /* 深灰色文字 */
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
}

.navbar .nav-item.dropdown .dropdown-item:hover,
.navbar .nav-item.dropdown .dropdown-item:focus {
    background: rgba(37, 99, 235, 0.1); /* 浅蓝背景 */
    color: #2563eb;
}

/* 当导航栏变为白色不透明时（悬停或滚动），下拉菜单也要适配深色文字 */
.navbar:hover .nav-item.dropdown .dropdown-menu,
.navbar.scrolled .nav-item.dropdown .dropdown-menu {
    background: rgba(255, 255, 255, 0.95); /* 几乎不透明的白色 */
    backdrop-filter: none; /* 移除模糊，避免在白色背景上看起来奇怪 */
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.navbar:hover .nav-item.dropdown .dropdown-item,
.navbar.scrolled .nav-item.dropdown .dropdown-item {
    color: #1e293b; /* 深色文字 */
}

.navbar:hover .nav-item.dropdown .dropdown-item:hover,
.navbar.scrolled .nav-item.dropdown .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.1); /* 悬停时淡蓝色背景 */
    color: #2563eb; /* 悬停时品牌蓝文字 */
}

/* 语言切换按钮本身在白色背景下也需要变色 */
.nav-link.dropdown-toggle {
    color: #334155 !important;
    background: transparent !important;
    border: none !important;
}

.nav-link.dropdown-toggle:hover {
    color: #2563eb !important;
    background: transparent !important;
    border: none !important;
}
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    background-color: #fff;
    padding: 0.5rem 0; /* 紧凑内边距 */
    margin-top: 10px;
    min-width: 100px; /* 只需要容纳文字 */
    width: auto;      /* 自动宽度 */
    left: 50%;
    transform: translateX(-50%); /* 居中对齐 */
    display: none;
    opacity: 0;
    z-index: 2000;
    transition: all 0.2s ease;
    text-align: center; /* 文字居中 */
}

/* 语言切换菜单项样式 */
.navbar .nav-item.dropdown.lang-dropdown .dropdown-item {
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.navbar .nav-item.dropdown.lang-dropdown .dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

/* 确保父元素相对定位，以便子元素绝对定位 */
.navbar .nav-item.dropdown {
    position: relative;
}

/* 修复 Hover 间隙问题：使用伪元素填充导航项与菜单之间的空隙 */
.navbar .nav-item.dropdown::after {
    content: '';
    position: absolute;
    bottom: -15px; /* 覆盖 margin-top 的区域 */
    left: 0;
    width: 100%;
    height: 30px; /* 增加高度确保覆盖间隙 */
    background: transparent;
    z-index: 1040;
}

/* 显示 Mega Menu */
.navbar .nav-item.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mega Menu 卡片样式 - 紧凑版 */
.mega-menu-card {
    display: block;
    padding: 1rem; /* 减小内边距 */
    background-color: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    height: 100%;
}

.mega-menu-card:hover {
    background-color: #eff6ff;
    transform: translateY(-3px); /* 减小上浮幅度 */
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.1);
}

.mega-menu-card h6 {
    color: var(--text-color);
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1rem; /* 减小字号 */
}

.mega-menu-card:hover h6 {
    color: var(--primary-color);
}

.mega-menu-card p {
    color: var(--secondary-color);
    font-size: 0.8rem; /* 减小描述字号 */
    margin-bottom: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制描述为2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片样式升级 - 大间距、柔和阴影、悬停上浮 */
.card {
    border: none;
    border-radius: 16px;
    background-color: var(--surface-color);
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    margin-bottom: 2rem; /* 增加 Margin */
}

.bg-dark {
    background-color: #0f172a !important; /* 深蓝黑色 */
}

.bg-secondary {
    background-color: rgba(30, 41, 59, 0.7) !important; /* 带有透明度的深蓝灰 */
    backdrop-filter: blur(10px);
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.8) !important; /* 提高文字清晰度 */
}

/* 视差固定背景 - 移除独立的图片设置，复用 Hero 的轮播图 */
.bg-fixed-tech {
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: transparent; /* 背景透明，透出底部的 fixed 轮播图 */
}

/* 全局统一的固定模糊遮罩层 - 位于轮播图之上，内容之下 */
.global-overlay-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* 1. 基础深色遮罩 */
    background-color: rgba(15, 23, 42, 0.3); 
    
    /* 2. 点阵纹理叠加 - 增加科技感并掩盖图片模糊 */
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 24px 24px;

    /* 3. 强力毛玻璃效果 - 将背景彻底虚化为氛围光 */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    
    z-index: -1; /* 确保在轮播图(z-index: -2)之上，内容之下 */
    pointer-events: none;
}

/* 添加噪点纹理层，进一步增加质感 */
.global-overlay-fixed::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.08;
    pointer-events: none;
}

@media (max-width: 768px) {
    .global-overlay-fixed {
        background-color: rgba(15, 23, 42, 0.12);
        background-image: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .global-overlay-fixed::after {
        opacity: 0;
    }
}

/* 独立的遮罩层 - 已被全局遮罩替代，废弃 */
.bg-overlay {
    display: none;
}

.text-shadow-dark {
    /* 1. 增加行高和字间距，解决紧凑问题 */
    line-height: 2.2 !important;
    letter-spacing: 0.05em;
    
    /* 2. 科技感文字样式 */
    color: #e2e8f0; /* 使用更柔和的亮灰色，避免纯白刺眼 */
    font-weight: 400; /* 细字体更有科技感 */
    font-size: 1.35rem; /* 增大字号 (原 1.15rem -> 1.35rem) */
    
    /* 3. 增强文字阴影，使文字从背景中浮起 */
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5);
        
    /* 4. 添加微弱的背景渐变，增强可读性 */
    background: linear-gradient(to right, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.3));
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05); /* 极细的边框 */
    backdrop-filter: blur(5px);
}

.card-body {
    padding: 2rem; /* 增加 Padding */
}

.card:hover {
    transform: translateY(-10px); /* 向上浮动 */
    box-shadow: var(--card-hover-shadow);
}

/* 图片容器优化 */
.card-img-top {
    height: 240px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05); /* 图片微放大 */
}

/* 按钮样式 - 渐变、圆角 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transition: all var(--transition-speed);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

/* 标题样式 */
h1, h2, h3, h4, h5 {
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

/* 呼吸感动画类 */
@keyframes breathe {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.breathing-element {
    animation: breathe 3s infinite ease-in-out;
}

/* 首页 Hero 区域优化 */
.bg-light.rounded-3 {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 20px 40px rgba(0,0,0,0.03);
    padding: 4rem !important;
}

/* 页脚优化 */
footer {
    background-color: #0f172a !important; /* 更深的蓝黑色 */
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

footer h5 {
    color: #60a5fa !important; /* 亮蓝色 */
    margin-bottom: 1.5rem;
}

/* Markdown 样式适配 */
.markdown-body img {
    max-width: 100%;
    height: auto;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .text-shadow-dark {
        font-size: 1.05rem;
        padding: 1rem;
        line-height: 1.6 !important;
        text-indent: 1.5em;
    }
    .bg-light.rounded-3 {
        padding: 2rem !important;
    }
    .navbar-brand span {
        font-size: 1.1rem;
    }
    .navbar-brand img {
        height: 32px;
    }
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 12px;
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }
    .nav-link {
        margin: 0.5rem 0;
        text-align: center;
    }
    .navbar .nav-item.dropdown .dropdown-menu {
        text-align: center;
        position: static !important;
        float: none !important;
        width: auto !important;
        box-shadow: none !important;
        background: transparent !important;
        border: none !important;
        margin-top: 0 !important;
    }
}
