/* =========================================
   1. 全局变量与排版设定
   ========================================= */
:root {
    /* 深色沉浸式配色 */
    --bg-base: #0f1016;         /* 极暗的深灰偏蓝背景 */
    --text-primary: #e2e2e2;    /* 主文本颜色 */
    --text-secondary: #8b8d96;  /* 次要文本，用于描述 */
    --accent-color: #6366f1;    /* 点缀色 */

    /* 毛玻璃特效变量 */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    /* 字体与排版 */
    --font-family: "LXGW WenKai Lite", "PingFang SC", "Microsoft YaHei", sans-serif;
    --line-height: 1.8;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: var(--line-height);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* 给整体页面增加呼吸感 */
    padding-bottom: 4rem; 
}

/* =========================================
   2. 氛围光（背景几何图形），让毛玻璃更立体
   ========================================= */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
}
.shape-1 {
    width: 400px;
    height: 400px;
    background: #2a2550;
    top: -100px;
    left: -100px;
}
.shape-2 {
    width: 500px;
    height: 500px;
    background: #0f3460;
    bottom: -150px;
    right: -100px;
}

/* =========================================
   3. 首页布局与组件
   ========================================= */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero .title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* =========================================
   4. 核心：毛玻璃卡片样式 (Glassmorphism)
   ========================================= */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.3s ease,
                border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.glass-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   5. 子页面通用组件
   ========================================= */
.top-nav {
    padding: 2rem 0;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0);
}

/* =========================================
   6. 动态特效样式 (Canvas粒子 & 鼠标点击涟漪)
   ========================================= */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2; /* 放在背景和内容之间 */
    pointer-events: none; /* 防止阻挡点击事件 */
}

/* 确保主体内容层级高于背景特效 */
.container {
    position: relative;
    z-index: 10;
}

/* =========================================
   7. Swup PJAX 过渡动画 (柔和的景深滑入切换)
   ========================================= */
/* 正常状态 (默认渲染完成的状态) */
.transition-fade {
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
}

/* 离开旧页面时的状态 (向上滑动、缩小、淡出并模糊) */
html.is-animating.is-leaving .transition-fade {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
    filter: blur(5px);
}

/* 准备渲染新页面时的初始状态 (向下滑动、缩小、准备淡入) */
html.is-animating.is-rendering .transition-fade {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(5px);
}

.click-ripple {
    position: fixed;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: ripple-animation 0.6s linear forwards;
    z-index: 9999;
}

@keyframes ripple-animation {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        border-width: 2px;
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
        border-width: 0px;
    }
}