/* =====================================================================
   site-base.css — 星尘心理主站公共骨架
   2026-10-18 从 test/kepu/play 索引页内联样式抽取（优化批次 C3a）
   内容：主题核心变量 / 基础重置 / 导航栏 / 页脚 / 返回顶部 / 滚动渐入 / 移动端导航
   用法：<link rel="stylesheet" href="/css/site-base.css">
        页面只保留自己的差异样式（--gradient-hero、--cat-* 分类色、各区布局）
   ===================================================================== */

/* ===== CSS 核心变量（各页一致；主题切换覆盖见 themes.css） ===== */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #f59e0b;
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-heading: #f8fafc;
    --border: #2d2d4a;
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 基础重置 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== 导航栏（全站统一） ===== */
.main-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo { font-size: 1.25rem; font-weight: 700; color: var(--text-heading) !important; }
.nav-logo span { color: var(--primary-light); }
.nav-menu { display: flex; list-style: none; gap: 8px; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
    display: block; padding: 8px 16px; color: var(--text-muted);
    font-size: 0.95rem; border-radius: var(--radius-sm); transition: var(--transition);
}
.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    color: var(--text-heading);
    background: rgba(99, 102, 241, 0.15);
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 8px;
}
.nav-menu > li:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-radius: 6px;
    white-space: nowrap;
}
.dropdown-menu a:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-heading);
}
.nav-toggle {
    display: none;
    background: none; border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== 页脚 ===== */
.site-footer {
    border-top: 1px solid var(--border); padding: 60px 0 30px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer-section h4 { color: var(--text-heading); font-size: 1rem; margin-bottom: 16px; }
.footer-section p, .footer-section a { color: var(--text-muted); font-size: 0.9rem; line-height: 1.8; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a:hover { color: var(--primary-light); }
.footer-bottom {
    border-top: 1px solid var(--border); padding-top: 24px;
    text-align: center; color: var(--text-muted); font-size: 0.85rem;
}

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed; bottom: 32px; right: 32px;
    width: 48px; height: 48px;
    background: var(--gradient-primary); color: #fff;
    border: none; border-radius: 50%; font-size: 1.2rem;
    cursor: pointer; opacity: 0; visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4); z-index: 999;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); }

/* ===== 滚动渐入 ===== */
.fade-in {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== 移动端导航（页面自己的网格响应式仍留在页面样式里） ===== */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .nav-menu.active {
        display: flex; flex-direction: column;
        position: absolute; top: 64px; left: 0; right: 0;
        background: rgba(15, 15, 26, 0.98); backdrop-filter: blur(20px);
        padding: 16px; border-bottom: 1px solid var(--border);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-menu.active .dropdown-menu {
        display: block; position: static; transform: none;
        box-shadow: none; border: none; padding-left: 16px; min-width: auto;
    }
    .nav-toggle { display: block; }
    .footer-grid { grid-template-columns: 1fr; }
}
