/* ============================================================
   common.css — 全站共享基础样式
   适用：index / members / publications / facilities /
        activities / join / tools / games / book
   提取自原各页面内联 <style> 的统一部分。
   各页面只需保留自己的专有内容样式。
   ============================================================ */

/* ---------- 全局变量（统一色板与字体） ---------- */
:root {
    --bg-color: #02050a;
    --cyan: #00f5d4;
    --blue: #00b4d8;
    --purple: #9d4edd;
    --pink: #ef476f;
    --dark-panel: rgba(10, 16, 30, 0.65);
    --border-cyan: rgba(0, 245, 212, 0.3);
    --border-purple: rgba(157, 78, 221, 0.3);
    --text-main: #e0fbfc;
    --text-muted: #8b9bb4;
    --font-mono: 'Courier New', Courier, monospace;
}

/* ---------- 全局重置与基准对齐 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    overflow-y: scroll; /* 强制显示垂直滚动条，防止页面切换横跳 */
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    background-color: var(--bg-color); color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    font-size: 1rem; line-height: 1.6; overflow-x: hidden;
    background-image:
        linear-gradient(to bottom, rgba(0, 245, 212, 0.03) 1px, transparent 1px),
        linear-gradient(to right, rgba(0, 245, 212, 0.02) 1px, transparent 1px);
    background-size: 50px 50px; background-attachment: fixed;
}

/* CRT 扫描线效果 */
body::before {
    content: " "; display: block; position: fixed; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 999; background-size: 100% 2px, 3px 100%; pointer-events: none; opacity: 0.3;
}

/* ---------- 背景层 ---------- */
canvas#particle-net {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2; pointer-events: none; opacity: 0.8;
}
.bg-glow {
    position: fixed; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 15% 30%, rgba(0, 180, 216, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 85% 70%, rgba(157, 78, 221, 0.08) 0%, transparent 40%);
    top: 0; left: 0; z-index: -3; pointer-events: none;
}

/* ---------- 中英双语控制 ---------- */
.zh { display: block; } .en { display: none; }
span.zh { display: inline-block; } span.en { display: none; }
body.en-mode .zh { display: none !important; } body.en-mode .en { display: block !important; }
body.en-mode span.en { display: inline-block !important; }

/* ---------- 顶部导航栏 ---------- */
.top-bar {
    display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 15px 30px; border-bottom: 1px solid var(--border-cyan);
    background: linear-gradient(90deg, rgba(0, 245, 212, 0.05), rgba(10, 16, 30, 0.8), rgba(0, 245, 212, 0.05));
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 100; height: 65px;
}
.top-bar::after {
    content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 250px; height: 2px;
    background: var(--cyan); box-shadow: 0 0 15px var(--cyan);
}
.nav-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; height: 100%; }
.nav-links a {
    color: var(--text-muted); text-decoration: none; font-size: 14px;
    font-weight: 600; font-family: var(--font-mono);
    border: 1px solid rgba(139, 155, 180, 0.3); padding: 6px 16px; transition: 0.3s; cursor: pointer;
    background: rgba(10, 16, 30, 0.4); box-sizing: border-box;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--bg-color); background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 15px rgba(0,245,212,0.6);
}
.nav-links a.lang-btn { background: rgba(0, 245, 212, 0.08); color: var(--cyan); border-color: var(--cyan); }
.nav-links a.lang-btn:hover { background: var(--cyan); color: #000; box-shadow: 0 0 20px var(--cyan); }
.nav-links a.special { border-color: var(--purple); color: var(--purple); }
.nav-links a.special:hover { background: var(--purple); color: #fff; box-shadow: 0 0 15px var(--purple); }

/* ---------- 标题区（logo + 标题文字）通用排版 ---------- */
.header-section { margin: 40px auto 40px; position: relative; z-index: 5; padding: 0 15px; }
.header-layout {
    display: flex; align-items: center; justify-content: center; gap: 35px;
    max-width: 1000px; margin: 0 auto; flex-wrap: wrap;
}
.logo-box { margin: 0; flex-shrink: 0; }
.logo { height: 105px; width: auto; filter: drop-shadow(0 0 15px rgba(0, 245, 212, 0.25)); }
.header-titles { text-align: left; }
/* 标题行：大标题与附加元素（如预约徽章）水平并排 */
.header-titles .title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.header-titles h1 {
    font-size: 44px; font-weight: 900; margin-bottom: 5px; letter-spacing: 4px; line-height: 1.3;
    background: linear-gradient(180deg, #ffffff 0%, var(--cyan) 100%);
    -webkit-background-clip: text; color: transparent; text-shadow: 0 0 35px rgba(0, 245, 212, 0.25);
}
.sub-title {
    color: var(--blue); font-size: 14px; letter-spacing: 3px; font-family: var(--font-mono);
    display: flex; align-items: center; justify-content: flex-start; gap: 15px; opacity: 0.8;
}
body.en-mode .sub-title.en { font-size: 13px; letter-spacing: 1.5px; }
.sub-title::before, .sub-title::after { content: '///'; color: rgba(0, 180, 216, 0.6); letter-spacing: -2px; }

/* ---------- 模块标题（多页面通用） ---------- */
.module-title-wrapper {
    display: flex; align-items: flex-start; gap: 15px; margin: 40px 0 20px; padding-bottom: 12px; position: relative;
}
.module-title-wrapper::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, var(--cyan) 0%, rgba(0,245,212,0.1) 40%, transparent 100%);
}
.module-title-wrapper span.badge {
    background: rgba(0, 245, 212, 0.08); color: var(--cyan); padding: 4px 10px; margin-top: 4px;
    font-size: 12px; font-family: var(--font-mono); border-left: 3px solid var(--cyan); letter-spacing: 2px;
}
.title-texts .title-cn { color: #fff; font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.title-texts .title-en { color: var(--blue); font-size: 12px; font-family: var(--font-mono); letter-spacing: 2px; opacity: 0.8; margin-top: 2px; }

/* ---------- 容器 ---------- */
.container { max-width: 1350px; margin: 0 auto; padding: 0 20px 80px; position: relative; z-index: 5; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .top-bar { padding: 10px; height: auto; }
    .nav-links { gap: 8px; }
    .nav-links a { padding: 6px 10px; font-size: 12px; }
    .header-layout { flex-direction: column; gap: 15px; }
    .logo { height: 75px; }
    .header-titles { text-align: center; }
    .header-titles h1 { font-size: 32px; }
    .header-titles .title-line { justify-content: center; gap: 12px; }
    .sub-title { justify-content: center; font-size: 12px; letter-spacing: 1px; }
    body.en-mode .sub-title.en { font-size: 11px; }
}
