/* ===== 全局变量 & NVIDIA风格配色 ===== */
:root {
    --nv-green: #76B900;        /* NVIDIA标志绿 */
    --nv-black: #000000;
    --nv-dark-gray: #1A1A1A;
    --nv-gray: #333333;
    --nv-light-gray: #666666;
    --nv-white: #FFFFFF;
    --nv-off-white: #F5F5F5;
    --border-radius: 8px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--nv-black);
    color: var(--nv-white);
    line-height: 1.6;
}

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

/* ===== 导航栏 ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nv-green);
    transition: var(--transition);
}
.logo:hover {
    text-shadow: 0 0 10px rgba(118, 185, 0, 0.5);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    color: var(--nv-white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--nv-green);
    transition: width 0.3s;
}
.nav-links a:hover {
    color: var(--nv-green);
}
.nav-links a:hover::after {
    width: 100%;
}

/* 语言切换按钮 */
/* ===== 语言切换滑动开关（纯 CSS，滑块在文字下方） ===== */
.lang-switch {
    position: relative;
    display: flex;
    background: var(--nv-dark-gray);
    border-radius: 30px;
    padding: 4px;
    border: 1px solid rgba(118, 185, 0, 0.3);
    user-select: none;
}

/* 滑块 - 使用伪元素创建 */
.lang-switch::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--nv-green);
    border-radius: 30px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(118, 185, 0, 0.3);
    pointer-events: none;
}

/* 当第二个按钮（中文）激活时，滑块右移 */
.lang-switch:has(.lang-btn:last-child.active)::after {
    transform: translateX(100%);
}

/* 按钮样式 */
/* 按钮样式 - 调整大小并防止文字换行 */
.lang-btn {
    position: relative;
    z-index: 3;
    flex: 1;
    padding: 4px 10px;          /* 从原来的 8px 20px 改小，让按钮变窄 */
    font-size: 0.85rem;         /* 从 0.9rem 略微调小字体 */
    font-weight: 500;
    text-align: center;
    color: var(--nv-light-gray);
    background: transparent;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;        /* 关键！防止文字换行（竖排） */
}

/* 激活状态按钮文字变色 */
.lang-btn.active {
    color: var(--nv-black);
    font-weight: 600;
}

/* 悬停效果 */
.lang-btn:hover:not(.active) {
    color: var(--nv-green);
}




/* ===== 按钮 ===== */
/* ===== 按钮基础样式 ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* 轮廓按钮（注册/登录）调整大小 */
.btn-outline {
    padding: 6px 16px;
    font-size: 0.9rem;
    background: transparent;
    border: 2px solid var(--nv-green);
    color: var(--nv-green);
}

.btn-outline:hover {
    background: var(--nv-green);
    color: var(--nv-black);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 20px rgba(118, 185, 0, 0.6), 0 8px 20px rgba(118, 185, 0, 0.4);
}

/* 实心按钮 */
.btn-primary {
    background-color: var(--nv-green);
    color: var(--nv-black);
    box-shadow: 0 4px 14px rgba(118, 185, 0, 0.2);
}

.btn-primary:hover {
    background-color: #8ccf1a;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 20px rgba(118, 185, 0, 0.8), 0 8px 20px rgba(118, 185, 0, 0.4);
}

/* 导航栏右侧按钮组间距 */
.navbar > div:last-child {
    gap: 18px;
}

/* ===== 卡片样式 ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.card {
    background: var(--nv-dark-gray);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(118, 185, 0, 0.1);
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-8px);
    border-color: var(--nv-green);
    box-shadow: 0 20px 30px -10px rgba(118, 185, 0, 0.2);
}

.card h3 {
    color: var(--nv-green);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* ===== 页脚（多列布局） ===== */
footer {
    margin-top: 80px;
    padding: 50px 0 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background-color: #0a0a0a;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--nv-green);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--nv-light-gray);
    text-decoration: none;
    transition: var(--transition);
}
.footer-col a:hover {
    color: var(--nv-green);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--nv-light-gray);
    font-size: 0.9rem;
}

.footer-legal a {
    color: var(--nv-light-gray);
    text-decoration: none;
    margin-left: 20px;
    transition: var(--transition);
}
.footer-legal a:hover {
    color: var(--nv-green);
}

/* ===== 表单样式（备用，注册页现在不用） ===== */
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    color: var(--nv-off-white);
    font-weight: 500;
}
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--nv-dark-gray);
    border: 1px solid var(--nv-gray);
    border-radius: var(--border-radius);
    color: var(--nv-white);
    font-family: var(--font-family);
    font-size: 1rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--nv-green);
}

/* ===== 注册页专用浅色风格 ===== */
.register-light-mode {
    background: #ffffff !important;
    color: #1a1a1a !important;
}
.register-light-mode .navbar {
    border-bottom-color: #e0e0e0;
}
.register-light-mode .nav-links a {
    color: #1a1a1a;
}
.register-light-mode .nav-links a:hover {
    color: var(--nv-green);
}
.register-light-mode .lang-btn {
    border-color: #ccc;
    color: #555;
}
.register-light-mode .lang-btn.active {
    background: var(--nv-green);
    border-color: var(--nv-green);
    color: #000;
}
.register-light-mode h1,
.register-light-mode p {
    color: #1a1a1a;
}
.register-light-mode .tally-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.register-light-mode .iframe-loading {
    color: #666;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    .nav-links {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .footer-legal a {
        margin: 0 10px;
    }
}
@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}