/* ==================== CSS变量定义 ==================== */
:root {
    /* 主色调 */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
    --primary-color: #6366f1;
    
    /* 强调色 */
    --accent-gradient: linear-gradient(90deg, #06b6d4, #0891b2);
    --accent-color: #06b6d4;
    
    /* 功能色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* 中性色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --white: #ffffff;
}

/* ==================== 全局重置样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #ffffff;
    min-height: 100vh;
}

/* ==================== 通用容器 ==================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 头部导航 ==================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

nav {
    display: flex;
    justify-content: center;  /* 改为 center */
    align-items: center;
    gap: 3rem;  /* 现在 gap 会生效 */
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}
.nav-item-home .nav-link {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    color: white !important;
    box-shadow: 
        0 4px 12px rgba(6, 182, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* 保留hover效果 */
.nav-item-home .nav-link:hover {
    transform: scale(1.02);
    box-shadow: 
        0 6px 16px rgba(6, 182, 212, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.nav-wrapper {
    position: relative;
    /* 删除 flex: 1 这一行 */
    display: flex;
    justify-content: center;
}
/* 药丸式导航容器 - 固定最小宽度 */
.nav-center {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.04);
    min-width: 500px;  /* 添加最小宽度 */
}

/* 导航菜单 - 均匀分布 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    justify-content: space-between;  /* 添加均匀分布 */
}

/* 导航项 - 固定宽度 */
.nav-item {
    position: relative;
    flex: 1;  /* 平均分配空间 */
    min-width: 0;  /* 允许收缩 */
}

/* 导航链接 - 优化文字显示 */
.nav-link {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1rem;  /* 减少左右内边距 */
    border-radius: 50px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;  /* 居中对齐 */
    gap: 0.25rem;
    font-size: 0.9rem;  /* 稍微减小字体 */
    white-space: nowrap;  /* 防止换行 */
    text-align: center;
}

/* 针对英文的特殊处理 */
html[lang="en-US"] .nav-link {
    font-size: 0.85rem;  /* 英文时字体更小 */
    padding: 0.6rem 0.8rem;  /* 英文时内边距更小 */
}

/* 或者用 JavaScript 动态添加类 */
body.lang-en .nav-link {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    letter-spacing: -0.01em;  /* 轻微压缩字间距 */
}

/* 优化 "Americas" 这种长单词 */
.nav-item-america .nav-link {
    padding: 0.6rem 0.7rem;  /* 特别优化美洲的内边距 */
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #0891b2;
}

.nav-link.active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 
        0 4px 12px rgba(6, 182, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 下拉箭头 */
.nav-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.3s;
}

.nav-item:hover .nav-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单容器 */
.region-dropdown-wrapper {
    position: absolute;  /* 改回absolute定位 */
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 0.75rem;  /* 保持间距 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
}

/* 透明桥接元素 */
.region-dropdown-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 0.75rem;
    background: transparent;
    pointer-events: auto;
}

/* 保持下拉框显示 */
.nav-item:hover .region-dropdown-wrapper,
.region-dropdown-wrapper:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 下拉菜单样式 */
.region-dropdown {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 14px;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 10px 40px -2px rgba(0, 0, 0, 0.12);
    padding: 0.75rem;  /* 调整容器内边距（原来是0.875rem） */
    border: 1px solid rgba(148, 163, 184, 0.2);
    width: 500px;
    position: relative;
    overflow: hidden;
    transform: translateX(var(--offset-x));
}
/* 调整每个下拉框的偏移量，使其与导航栏对齐 */
.nav-item-asia .region-dropdown { --offset-x: 150px; }
.nav-item-america .region-dropdown { --offset-x: 75px; }
.nav-item-europe .region-dropdown { --offset-x: 0px; }
.nav-item-africa .region-dropdown { --offset-x: -75px; }
.nav-item-oceania .region-dropdown { --offset-x: -150px; }

.region-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.8;
}

/* 地区网格布局 - 调整整体间距 */
.region-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;  /* 修改这个值调整项目之间的间距（原来是0.25rem） */
    position: relative;
}

/* 亚洲、美洲、欧洲 - 网格布局的行间距 */
.nav-item:nth-child(2) .region-grid,
.nav-item:nth-child(3) .region-grid,
.nav-item:nth-child(4) .region-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;  /* 调整列间距（原来是0.375rem） */
    row-gap: 0.5rem;  /* 调整行间距（原来是0.875rem） */
}

/* 地区链接 - 调整内部上下padding */
.region-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;  /* 调整上下padding（原来是0.625rem） */
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.5);
    backdrop-filter: blur(10px);
    position: relative;
}

.region-link:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(6, 182, 212, 0.3);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.1);
}

.region-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 50%;
    width: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 1px;
}

.region-link:hover::before {
    opacity: 1;
}

.region-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 地区标签 */
.region-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.region-badge.hot {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #ef4444;
}

.region-badge.sale {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #f59e0b;
}

.region-badge.new {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #3b82f6;
}

.region-badge.count {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

/* 右侧工具栏 */
.nav-tools {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* 语言/货币切换开关 */
.toggle-switch {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 50px;
    padding: 0.25rem;
    display: flex;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05),
        0 2px 6px rgba(0, 0, 0, 0.03);
}

.toggle-switch:hover {
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05),
        0 4px 10px rgba(0, 0, 0, 0.06);
}

.toggle-option {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    position: relative;
    z-index: 2;
    transition: color 0.3s;
    user-select: none;
}

.toggle-option.active {
    color: #0891b2;
    font-weight: 600;
}

.toggle-slider {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    height: calc(100% - 0.5rem);
    width: calc(50% - 0.25rem);
    background: white;
    border-radius: 50px;
    transition: transform 0.3s;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
}

.toggle-switch[data-value="en"] .toggle-slider,
.toggle-switch[data-value="usd"] .toggle-slider {
    transform: translateX(100%);
}

/* ==================== 页脚 ==================== */
footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1.5rem 0 1rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.5), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.4rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copyright {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}
/* 客户系统按钮 */
.customer-btn {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.customer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}
/* ==================== 通用工具类 ==================== */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: #6c757d;
}

/* ==================== 全局动画 ==================== */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* ==================== 移动端响应式 ==================== */
@media (max-width: 768px) {
    /* 隐藏Logo */
    .logo {
        display: none;
    }
        html[lang="en-US"] .nav-link {
        font-size: 0.7rem;  /* 英文时字体更小 */
        padding: 0.3rem 0.5rem;  /* 英文时内边距更小 */
    }
    
    /* 或者用 JavaScript 动态添加类 */
    body.lang-en .nav-link {
        font-size: 0.7rem;  /* 移动端也调整为更小字体 */
        padding: 0.3rem 0.5rem;  /* 移动端内边距 */
        letter-spacing: -0.01em;  /* 轻微压缩字间距 */
    }
    /* 缩小导航 */
    .nav-center {
        min-width: unset;
        width: calc(100vw - 40px);
    }
    
    .nav-link {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* 隐藏导航工具栏 */
    .nav-tools {
        display: none;
    }
    
    .region-dropdown-wrapper {
        position: fixed;
        top: 60px;  /* 可以根据导航高度调整 */
        left: 10px;  /* 左边距 */
        right: 10px;  /* 右边距 */
        transform: none;  /* 移除居中变换 */
        width: auto;
        max-width: calc(100vw - 20px);  /* 确保不超出屏幕 */
    }
    
    /* 下拉菜单 - 缩小并调整 */
    .region-dropdown {
        width: 100%;
        max-height: 70vh;  /* 限制最大高度 */
        overflow-y: auto;  /* 内容过多时滚动 */
        padding: 0.5rem;  /* 减小内边距 */
        font-size: 0.85rem;  /* 缩小字体 */
        --offset-x: 0 !important;  /* 移除偏移 */
        transform: none;  /* 确保没有额外的变换 */
    }
    
    /* 地区网格 - 改为2列更紧凑 */
    .nav-item:nth-child(2) .region-grid,
    .nav-item:nth-child(3) .region-grid,
    .nav-item:nth-child(4) .region-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2列布局 */
        gap: 0.4rem;  /* 减小间距 */
    }
    
    /* 地区链接 - 缩小尺寸 */
    .region-link {
        padding: 0.5rem 0.6rem;  /* 减小内边距 */
        font-size: 0.8rem;  /* 缩小字体 */
    }
    
    .region-name {
        font-size: 0.8rem;
    }
    
    .region-badge {
        font-size: 0.55rem;
        padding: 0.1rem 0.3rem;
    }

    
     .footer-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 0;
    }
    
    /* 隐藏第2、3列 */
    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        display: none;
    }
    
    /* 第一列 - 只显示标题 */
    .footer-section:nth-child(1) {
        flex: 0 0 auto;
    }
    
    .footer-section:nth-child(1) h3 {
        margin: 0;
        font-size: 1.1rem;
    }
    
    .footer-section:nth-child(1) p {
        display: none;  /* 隐藏描述文字 */
    }
    
    /* 第四列 - 只显示按钮 */
    .footer-section:nth-child(4) {
        flex: 0 0 auto;
    }
    
    .footer-section:nth-child(4) h3 {
        display: none;  /* 隐藏标题 */
    }
    
    /* 调整客户按钮样式 */
    .customer-btn {
        margin-top: 0;
    }
    
    /* 版权信息居中 */
    footer > .container > div:last-child {
        padding-top: 1rem !important;
        margin-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    /* 版权文字 - 调整字体大小确保一行显示 */
    footer > .container > div:last-child p {
        font-size: 0.75rem;  /* 基础字体大小 */
        white-space: nowrap;  /* 强制不换行 */
        overflow: hidden;  /* 隐藏溢出 */
        text-overflow: ellipsis;  /* 文字过长显示省略号 */
        margin: 0;
        line-height: 1.4;
    }
}


