/* =========================================
   1. 全局变量与重置 (Variables & Reset)
   ========================================= */
:root {
    --bg-color: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-blue: #0071e3;
    --accent-orange: #ff9500;
    --font-stack: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Apple-like easing */
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: opacity 0.3s; }
a:hover { opacity: 0.7; }

/* =========================================
   2. 导航栏 (Navbar)
   ========================================= */
.navbar {
    position: fixed; top: 0; width: 100%; height: 52px; z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.3s;
}
.navbar.scrolled { background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.nav-content {
    max-width: 1000px; margin: 0 auto; height: 100%;
    display: flex; justify-content: space-between; align-items: center; padding: 0 20px;
}

.logo-placeholder img { height: 60px; width: auto; display: block; }
.nav-center { position: absolute; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.nav-title-main { font-size: 14px; font-weight: 600; color: #000; letter-spacing: -0.01em; }
.nav-title-sub { font-size: 11px; color: #666; font-weight: 400; }
.user-icon-link svg { width: 20px; height: 20px; fill: #333; transition: fill 0.3s; }
.user-icon-link:hover svg { fill: var(--accent-blue); }

/* =========================================
   3. 通用全屏模块 (Hero & Modules)
   ========================================= */
.hero-section, .module-section {
    position: relative; width: 100%; height: 100vh; min-height: 600px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; cursor: pointer; color: #fff;
}
.hero-section { cursor: default; } /* Hero 不跳转 */

/* 背景与遮罩 */
.bg-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    z-index: 0; transition: transform 0.8s ease-out; /* 视差基础 */
}
.overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.25); z-index: 1;
}
.hero-content, .content-layer {
    position: relative; z-index: 10; text-align: center;
}

/* 字体排版 */
#hero-title { font-size: 64px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
#hero-subtitle { font-size: 28px; font-weight: 400; opacity: 0.9; }
.module-title {
    font-size: 56px; font-weight: 700; letter-spacing: -0.01em;
    transition: var(--transition-smooth);
}

/* =========================================
   4. 主页特定模块交互效果 (Index Specific)
   ========================================= */

/* 通用：模块悬停时背景微放大 */
.module-section:hover .bg-layer { transform: scale(1.05); }

/* (A) 科技区: 蓝光 + 放大 */
.module-tech .module-title { color: #fff; }
.module-tech:hover .module-title {
    transform: scale(1.1);
    text-shadow: 0 0 30px rgba(0, 113, 227, 1), 0 0 60px rgba(0, 113, 227, 0.6);
}

/* (B) 学习区: 白光 + 放大 */
.module-learning .module-title { color: #f5f5f7; }
.module-learning:hover .module-title {
    transform: scale(1.1);
    text-shadow: 0 0 30px rgba(255, 255, 255, 1), 0 0 60px rgba(255, 255, 255, 0.8);
}

/* (C) 图图区: 橙色 + 晃动 */
.module-tutu .module-title { color: var(--accent-orange); } /* 默认俏皮橙色 */
.module-tutu:hover .module-title {
    animation: shakeEffect 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeEffect {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* =========================================
   5. 详情页样式与交互 (Detail Page)
   ========================================= */
.detail-hero-title {
    font-size: 80px; font-weight: 700; color: #fff; cursor: default;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-hero-title:hover { transform: scale(1.15); } /* 标题悬停放大 */

.detail-hero-subtitle {
    font-size: 36px; font-weight: 400; color: #fff; cursor: default;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.works-section {
    padding: 100px 20px; max-width: 1200px; margin: 0 auto;
    background-color: var(--bg-color);
}
.section-header { text-align: center; font-size: 40px; font-weight: 600; margin-bottom: 60px; }

.works-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
}

/* 卡片样式 */
.work-card {
    background: #fff; border-radius: 20px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: var(--transition-smooth); cursor: pointer;
    display: flex; flex-direction: column;
}

/* 卡片交互: 放大 + 浮起 + 阴影加深 */
.work-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.work-card-img {
    width: 100%; height: 260px; /* 确保占位 */
    background-color: #f0f0f0; background-size: cover; background-position: center;
}
.work-card-text { padding: 24px; }
.work-card-title-bar { width: 60%; height: 24px; background: #e5e5e5; border-radius: 4px; margin-bottom: 10px; }
.work-card-desc-bar { width: 90%; height: 16px; background: #f5f5f5; border-radius: 4px; }

/* =========================================
   6. 动画系统 (Animations)
   ========================================= */
/* 页面加载初始淡入 */
.fade-in-init {
    opacity: 0; animation: fadeInMoveUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeInMoveUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 滚动触发淡入 (由 JS 添加 .active 类) */
.reveal-on-scroll {
    opacity: 0; transform: translateY(60px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-on-scroll.active {
    opacity: 1; transform: translateY(0);
}

/* =========================================
   7. 响应式与页脚
   ========================================= */
.footer { background: #1d1d1f; color: #86868b; padding: 50px 0; font-size: 12px; text-align: center; }
.footer a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 900px) {
    .works-grid { grid-template-columns: repeat(2, 1fr); }
    #hero-title { font-size: 48px; }
    .module-title { font-size: 40px; }
}
@media (max-width: 600px) {
    .works-grid { grid-template-columns: 1fr; }
    .detail-hero-title { font-size: 48px; }
}
