/* ================================================================
   个人主页样式表
   修改颜色：只改 :root 里的变量，全站自动换色
   ================================================================ */

/* ── 全局 CSS 变量 ─────────────────────────────────────────────── */
:root {
    --bg:            #050b18;       /* 页面底色：深夜蓝黑 */
    --bg-card:       #0c1626;       /* 卡片底色 */
    --accent:        #00d4ff;       /* 主色调：科技青 */
    --accent-dim:    rgba(0, 212, 255, 0.08);
    --accent-border: rgba(0, 212, 255, 0.22);
    --purple:        #7c3aed;       /* 紫色：用于徽章 */
    --purple-dim:    rgba(124, 58, 237, 0.18);
    --purple-border: rgba(124, 58, 237, 0.4);
    --text:          #e2e8f0;       /* 主文字 */
    --text-muted:    #94a3b8;       /* 次级文字 */
    --text-dim:      #475569;       /* 暗淡文字（占位、注释）*/
    --border:        rgba(255, 255, 255, 0.07);
    --radius:        12px;
    --ease:          cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 基础重置 ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
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.75;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; border-radius: 8px; }
button { font-family: inherit; cursor: pointer; }

/* ================================================================
   导航栏（滚动到首屏底部后滑入）
   ================================================================ */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.4s var(--ease);
    background: rgba(5, 11, 24, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
#navbar.visible { transform: translateY(0); }

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.06em;
    font-size: 1rem;
}
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ================================================================
   首屏 Hero
   ================================================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* 细网格背景：透过 canvas 透明像素透出来，营造科技感 */
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    background-color: var(--bg);
}

/* 粒子画布：绝对覆盖全屏，canvas 本身透明，网格透过来 */
#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* 中央内容区 */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 1.5rem;
    max-width: 720px;
}

/* 顶部小标签 */
.hero-tag {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--accent);
    margin-bottom: 1.25rem;
    opacity: 0;
    animation: fadeUp 0.6s var(--ease) 0.2s forwards;
}

/* 主标题：延迟淡入上移 */
.hero-title {
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease) 0.5s forwards;
}
/* 渐变文字：淡青 → 近白，比纯色更精致 */
.accent {
    background: linear-gradient(120deg, #00d4ff 0%, #7de8ff 55%, #dff7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 描述文字：逐行出现（每行延迟 0.3s） */
.hero-desc {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: clamp(0.92rem, 2vw, 1.05rem);
    color: var(--text-muted);
}
.hero-desc p { opacity: 0; transform: translateY(12px); }
.hero-desc p:nth-child(1) { animation: fadeUp 0.6s var(--ease) 1.0s forwards; }
.hero-desc p:nth-child(2) { animation: fadeUp 0.6s var(--ease) 1.3s forwards; }
.hero-desc p:nth-child(3) { animation: fadeUp 0.6s var(--ease) 1.6s forwards; }
.hero-desc p:nth-child(4) { animation: fadeUp 0.6s var(--ease) 1.9s forwards; }

/* 向下滚动箭头 */
.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    opacity: 0;
    animation: fadeUp 0.6s var(--ease) 2.4s forwards;
}
.scroll-text {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}
.scroll-arrow {
    width: 34px; height: 34px;
    border: 1.5px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    animation: bounce 2.2s ease-in-out 2.8s infinite;
    transition: border-color 0.2s, background 0.2s;
}
.scroll-hint:hover .scroll-arrow {
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* ================================================================
   通用 Section
   ================================================================ */
.section {
    padding: 4rem 1.5rem;
    /* scroll-margin-top：修复导航栏遮挡标题的问题
       值 = 导航栏高度(54px) + 少量缓冲(16px) */
    scroll-margin-top: 70px;
}

.container { max-width: 1100px; margin: 0 auto; }

.section-title {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
    /* 为左侧小点腾出空间 */
    padding-left: 1rem;
    position: relative;
    display: block; /* block 使 padding-left 生效 */
}
/* 标题左侧小装饰点（替换原来的下划线横条） */
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.85;
}

/* ================================================================
   关于我
   ================================================================ */
.about-content { max-width: 680px; }
.about-content p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

/* ================================================================
   作品区
   ================================================================ */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.work-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
    /* box-shadow 也加入过渡，让光晕出现/消失平滑 */
    transition: border-color 0.3s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.work-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-5px);
    box-shadow: 0 8px 28px rgba(0, 212, 255, 0.13), 0 2px 14px rgba(0, 0, 0, 0.4);
}
.work-badge {
    display: inline-block;
    background: var(--purple-dim);
    border: 1px solid var(--purple-border);
    color: #a78bfa;
    font-size: 0.72rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}
.work-card h3 { font-size: 1.08rem; margin-bottom: 0.35rem; }
.work-meta    { font-size: 0.83rem; color: var(--text-dim); margin-bottom: 1rem; }
.work-desc {
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}
.work-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.work-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tag {
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-size: 0.72rem;
    padding: 0.18rem 0.6rem;
    border-radius: 4px;
}
