/* ===== 全站共享暗色主题：背景 + 顶部导航栏 =====
 * 从 index_style.css 抽取，供所有非豁免页面统一引用。
 * 豁免页面：web_ku / jiaogt / photo_manage（保留各自视觉风格）。
 * 引用本文件后，页面需在 <body> 顶部放置：
 *   <div class="bg-aurora" aria-hidden="true"></div>
 *   <canvas class="bg-particles" aria-hidden="true"></canvas>
 * 并引入 shared/bg-particles.js 启用粒子动效。
 */

/* ===== 全局 CSS 变量（Linear Aesthetic 暗色精密主题） ===== */
:root {
    font-size: clamp(14px, 0.6vw + 11px, 18px);
    --font: "Inter", "Geist Sans", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei UI", sans-serif;
    --canvas: #CFE5EB;
    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #EDEDEF;
    --text-secondary: #8A8F98;
    --accent: #6366F1;
    --accent-glow: #A855F7;
    --accent-weak: rgba(99, 102, 241, 0.18);
}

* { box-sizing: border-box }

/* 页面主体：近黑底色 + Inter/Geist 字体系列 */
body {
    margin: 0;
    font-family: var(--font);
    background: var(--canvas);
    color: var(--text-primary);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-bottom: 40px;
    position: relative;
    overflow-x: hidden;
}

/* ===== 暗色叠加层 + 靛蓝/紫色多色环境光晕 ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 65% at 15% 15%, rgba(99, 102, 241, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 70% 85% at 85% 20%, rgba(168, 85, 247, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 80% 60% at 50% 100%, rgba(14, 165, 233, 0.05) 0%, transparent 60%),
        var(--canvas);
    pointer-events: none;
    z-index: -2;
}

/* 极细科技网格层：中心清晰 → 四周淡出，营造精密感 */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    pointer-events: none;
    z-index: -2;
}

/* ===== 极光光晕层：静态模糊色块 ===== */
.bg-aurora {
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: -2;
    filter: blur(40px);
    opacity: 0.45;
    background:
        radial-gradient(42% 38% at 30% 34%, rgba(99, 102, 241, 0.20) 0%, transparent 70%),
        radial-gradient(38% 42% at 72% 26%, rgba(168, 85, 247, 0.16) 0%, transparent 70%),
        radial-gradient(45% 40% at 62% 82%, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
}

/* ===== 背景粒子层：轻量 Canvas 星尘 ===== */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* ===== 顶部导航（透明 + 胶囊式 TAB + 1px 白线分隔 + 粘性） ===== */
.site-header {
    width: 100%;
    background: transparent;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    margin: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 150ms ease;
}

.brand:hover { color: var(--accent); }

/* 胶囊式 TAB 容器：外围 1px 白线包裹 */
.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-wrap: wrap;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.nav-links .nav-item { position: relative; }

/* 未选中态：置灰、缩小、变细 */
.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    padding: 6px 16px;
    transition: color 200ms ease, background 200ms ease, transform 200ms ease, font-size 200ms ease;
    font-weight: 400;
    font-size: 0.88rem;
    display: inline-block;
    cursor: pointer;
    letter-spacing: -0.01em;
    border-radius: 999px;
    white-space: nowrap;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.1);
}

/* 选中态：放大、加粗、高亮反白 */
.nav-link.active {
    color: #111111;
    background: #FFFFFF;
    font-weight: 700;
    font-size: 0.95rem;
    transform: scale(1.06);
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.25);
}

/* 联系我下拉菜单：纯白背景 + 渐入渐出 */
.nav-links .dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    min-width: 120px;
    margin: 0;
    padding: 0.4rem;
    list-style: none;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-6px);
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
    pointer-events: none;
    z-index: 30;
}

/* 由 JS 控制 .open 类触发，实现 hover 250ms 延迟收回 + click 锁定 */
.nav-links .nav-item.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.nav-links .dropdown-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    color: #1D1D1F;
    font-size: 0.91rem;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
}

.nav-links .dropdown-menu a:hover,
.nav-links .dropdown-menu a:focus {
    background: rgba(0, 0, 0, 0.05);
    color: #000000;
}

/* ===== 极窄屏 (≤480px)：导航栏紧凑化 ===== */
@media (max-width: 480px) {
    .site-header .container { padding: 0.6rem 0.75rem; }
    .nav-links { gap: 0.25rem; }
    .nav-link { padding: 5px 9px; font-size: 0.85rem; }
    body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* [兼容] 触屏设备：关闭 hover 粘滞效果 */
@media (hover: none) and (pointer: coarse) {
    .nav-link:hover { transform: none; }
    .nav-link:hover::after { width: 0; }
}

/* [兼容] 图片防溢出兜底 */
img { max-width: 100%; height: auto; }
