:root {
    --bg-color: #080808;      /* 极深的背景色，比纯黑更有质感 */
    --text-main: #f0f0f0;     /* 主色文字（偏白） */
    --text-muted: #666666;    /* 次级文字（灰度） */
    --accent: #ffffff;        /* 强调色 */
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Noto Serif SC', serif; /* 衬线体用于主标题和高光文字 */
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: default;
}

/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--text-muted), var(--accent));
    z-index: 10000;
    transform-origin: left;
    transition: transform 0.1s ease-out;
}

/* 网格粒子背景 */
.grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.4;
    pointer-events: none;
}

/* 滚动切换背景图层 */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    transition: opacity 1s ease;
    opacity: 0;
}

.bg-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 8, 0.82);
}

.bg-layer.active {
    opacity: 1;
}

/* Mac 浏览器 z-index 修正：Mac 上负 z-index 的 fixed 元素会被 body 背景遮挡 */
.is-mac .grid-canvas {
    z-index: 0;
}
.is-mac .bg-layer {
    z-index: 1;
}
.is-mac main,
.is-mac .post-container,
.is-mac footer {
    position: relative;
    z-index: 2;
}

::selection {
    background: var(--text-main);
    color: var(--bg-color);
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference; /* 使导航栏在白色背景图片上也能反色显示 */
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 3rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.4s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--text-muted);
}

/* 语言切换按钮 */
.lang-toggle {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    border-radius: 2px;
}
.lang-toggle:hover {
    background: var(--text-main);
    color: var(--bg-color);
}

/* 布局区块 */
.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.fullscreen-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 首屏布局 */
.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-avatar {
    flex-shrink: 0;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 55% 90%;
    filter: contrast(1.05);
}

.nickname {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.nickname span {
    color: var(--text-main);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 3px;
}

@media (max-width: 768px) {
    .hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }
    .hero-avatar {
        width: 180px;
        height: 180px;
    }
}

.section {
    padding: 8rem 0;
}

/* 文字与排版 */
.title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #f5f5f5 0%, #c0c0c0 40%, #e8e8e8 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-shimmer 10s ease-in-out infinite;
}

@keyframes title-shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: var(--font-serif);
    font-weight: 300;
}

.subtitle span {
    color: var(--accent);
}

.description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.8;
}

.section-title {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 4rem;
    transition: text-shadow 0.6s ease, color 0.6s ease;
}

.section-title.glow {
    color: var(--accent);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.text-block p {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-family: var(--font-serif);
    font-weight: 300;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    line-height: 1.4;
}

/* 作品集图片网格 */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 4rem;
}

.gallery-item {
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #121212;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-family: var(--font-serif);
    margin-bottom: 1.5rem;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.6s ease,
                box-shadow 0.5s ease;
}

.gallery-item:hover .image-placeholder {
    transform: scale(0.97);
    background-color: #1a1a1a;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.project-name {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* 项目与教育排版 */
.education-item {
    margin-bottom: 2rem;
}
.edu-degree {
    font-size: 1.5rem;
    font-family: var(--font-serif);
    color: var(--accent);
}
.edu-time {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.edu-desc {
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* 技能网格 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
.skill-item {
    padding: 2rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}
.skill-item:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255,255,255,0.04);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
}
.skill-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.skill-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* 经历与论文 */
.work-item {
    margin-bottom: 4rem;
}
.work-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--text-main);
}
.work-meta {
    font-size: 0.9rem;
    color: var(--accent);
    margin: 0.8rem 0 1.5rem 0;
}
.work-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 800px;
}

.pub-list {
    list-style: none;
    margin-top: -1rem;
}
.pub-list li {
    padding: 1.5rem 0;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.pub-list li strong {
    color: var(--text-main);
    font-weight: 400;
}
.pub-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.1);
    color: var(--accent);
    border-radius: 2px;
    margin-right: 0.8rem;
    vertical-align: middle;
}

/* 图片适配 */
.image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #121212;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}
.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item:hover .image-placeholder img {
    transform: scale(1.05);
}

.project-name {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.project-name strong {
    color: var(--text-main);
    font-size: 1.05rem;
}

/* 联系方式 */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-links .link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.2rem;
    letter-spacing: 1px;
    padding: 1rem 0;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.contact-links .link:hover {
    color: var(--text-muted);
    padding-left: 0.5rem;
}

footer {
    text-align: center;
    padding: 4rem;
    color: #444;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

/* 博客列表 */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.blog-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.3s ease,
                background 0.3s ease;
}

.blog-card:hover {
    transform: translateX(12px) translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.blog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2rem;
    flex-wrap: wrap;
}

.blog-card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-main);
}

.blog-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.blog-card-tags {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.15em 0.6em;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* 动画特效 */
.fade-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 交错动画延迟（仅对 .fade-up 生效，保证依次淡入） */
.fade-up.stagger-1 { transition-delay: 0.08s; }
.fade-up.stagger-2 { transition-delay: 0.16s; }
.fade-up.stagger-3 { transition-delay: 0.24s; }
.fade-up.stagger-4 { transition-delay: 0.32s; }
.fade-up.stagger-5 { transition-delay: 0.4s; }
.fade-up.stagger-6 { transition-delay: 0.48s; }
.fade-up.stagger-7 { transition-delay: 0.56s; }
.fade-up.stagger-8 { transition-delay: 0.64s; }

/* 鼠标跟随特效（宽屏设备显示） */
.cursor {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    display: none;
}

@media (min-width: 768px) {
    .cursor {
        display: block;
    }
}
