:root {
    --bg-color: #05050a; /* Extreme deep space black */
    --text-color: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-color: #a855f7; /* Electric Purple */
    --grad-color-1: #a855f7;
    --grad-color-2: #3b82f6; /* Deep Blue */
    --light-bg: #0a0a10;
    --glass-bg: rgba(10, 10, 15, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --white: #ffffff;
    --border-color: rgba(255,255,255,0.05);
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-color: #ffffff;
    --text-color: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #ff6b6b;
    --grad-color-1: #ff6b6b;
    --grad-color-2: #f59e0b;
    --light-bg: #f5f5f7;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* 防止光晕引起横向滚动 */
    transition: background-color 0.8s ease, color 0.8s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography 排版基础 */
h1, h2, h3, h4 {
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

h1 { 
    font-size: clamp(2.5rem, 5vw, 4rem); 
    font-weight: 800; 
    letter-spacing: -1px; 
}

h2 { 
    font-size: clamp(2rem, 3vw, 2.5rem); 
    letter-spacing: -0.5px; 
}

h3 { 
    font-size: 1.2rem; 
    color: var(--text-secondary); 
    margin-bottom: var(--spacing-md); 
    text-transform: uppercase;
    letter-spacing: 1px;
}

h4 { 
    font-size: 1.2rem; 
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.highlight {
    color: var(--accent-color);
}

/* Navigation 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: var(--spacing-md) 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 10, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.8s ease, border-color 0.8s ease;
}

body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

/* Buttons 按钮 */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    margin-top: var(--spacing-md);
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--grad-color-1) 0%, var(--grad-color-2) 100%);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--grad-color-2) 0%, var(--grad-color-1) 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
}

/* Layout 通用布局 */
.section {
    padding: var(--spacing-xl) 10%;
    position: relative;
}

.section-header {
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
}

.bg-light {
    background-color: var(--light-bg);
}

/* Hero Section 第一屏 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 10%;
    padding-top: 80px; /* offset navbar */
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Hero Typography Focus */
.hero-container.typography-focus {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: var(--spacing-xl);
}

.typography-focus .hero-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.typography-focus .hero-title {
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: -3px;
}

.typography-focus .hero-desc {
    max-width: 600px;
}

/* Canvas Background */
#antigravity-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 氛围光晕 (Antigravity Spatial Dark version) */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}

.glow-1 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(168,85,247,0.4) 0%, rgba(168,85,247,0) 70%); /* Purple */
    top: -20vw;
    right: -20vw;
    animation: pulse 15s ease-in-out infinite alternate;
}

.glow-2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(59,130,246,0) 70%); /* Blue */
    bottom: -10vw;
    left: -10vw;
    animation: pulse 18s ease-in-out infinite alternate-reverse;
}

.glow-3 {
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(236,72,153,0.15) 0%, rgba(236,72,153,0) 70%); /* Pink */
    top: 20%;
    left: 10%;
}

/* Light Mode Ambient Glow Updates */
body.light-mode .ambient-glow {
    mix-blend-mode: multiply;
    opacity: 0.6;
}
body.light-mode .glow-1 {
    background: radial-gradient(circle, rgba(255,107,107,0.3) 0%, rgba(255,107,107,0) 70%); /* Pastel Red */
}
body.light-mode .glow-2 {
    background: radial-gradient(circle, rgba(65,105,225,0.2) 0%, rgba(65,105,225,0) 70%); /* Pastel Blue */
}
body.light-mode .glow-3 {
    background: radial-gradient(circle, rgba(255,140,0,0.15) 0%, rgba(255,140,0,0) 70%); /* Pastel Orange */
}

.glow-4 {
    width: 45vw;
    height: 45vw;
    background: var(--grad-color-2);
    bottom: 10%;
    left: -20vw;
    opacity: 0.15;
}

.hero-content {
    max-width: 600px;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.floating-3d {
    width: 130%;
    max-width: 800px;
    mix-blend-mode: multiply; 
    transform-origin: center center;
    -webkit-mask-image: radial-gradient(circle closest-side, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 95%);
    mask-image: radial-gradient(circle closest-side, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 95%);
    filter: contrast(1.15) brightness(0.9);
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.hero-title {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}

.gradient-text {
    background: linear-gradient(135deg, var(--grad-color-1) 0%, var(--grad-color-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: var(--spacing-md);
}

/* Works Section 作品区 */
/* Antigravity Sticky Scroll Works Section */
.works-antigravity {
    position: relative;
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.sticky-layout {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xl);
    position: relative;
}

.sticky-sidebar {
    position: sticky;
    top: 20vh;
    width: 40%;
    flex-shrink: 0;
}

.huge-title {
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    letter-spacing: -1px;
}

.sidebar-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 400px;
}

.scrolling-cards {
    width: 60%;
    display: flex;
    flex-direction: column;
    gap: 30vh; /* Massive gap to force scrolling and stacking effect */
    padding-bottom: 20vh;
}

/* Glassmorphism Card (Antigravity Spatial Dark) */
.ag-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: var(--spacing-md);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease, border-color 0.4s ease;
    will-change: transform, opacity;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.ag-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.5);
}

body.light-mode .ag-card {
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}
body.light-mode .ag-card:hover {
    box-shadow: 0 30px 60px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
}

.ag-card-image {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 12px;
    background-color: #000000;
    margin-bottom: var(--spacing-md);
    overflow: hidden;
}
body.light-mode .ag-card-image {
    background-color: #eaeaea;
}

/* 占位图样式 */
.placeholder-img {
    background: linear-gradient(135deg, #101015, #05050A);
    display: flex;
    align-items: center;
    justify-content: center;
}
body.light-mode .placeholder-img {
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

.placeholder-img::after {
    content: 'Image Placeholder';
    color: #444;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
}
body.light-mode .placeholder-img::after {
    color: #999;
}

.ag-card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.ag-card-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.ag-link {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.ag-card:hover .ag-link {
    transform: translateX(5px);
}

/* Scroll Animation Classes */
.reveal-up {
    opacity: 0;
    transform: translateY(100px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Timeline 履历区 */
.timeline {
    border-left: 2px solid var(--light-bg);
    padding-left: var(--spacing-md);
    margin-left: 5px;
}

.timeline-item {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(var(--spacing-md) * -1 - 6px);
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 3px solid var(--light-bg);
    box-sizing: content-box;
}

.timeline-date {
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* About 关于我 */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.about-image {
    width: 100%;
    aspect-ratio: 3/4;
    background-color: var(--light-bg);
    border-radius: 8px;
}

.skills {
    margin-top: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    border-color: var(--accent-color);
    color: var(--text-color);
}

/* Footer 底部 */
.footer {
    padding: var(--spacing-xl) 10% var(--spacing-md);
    background-color: var(--light-bg);
    color: var(--text-color);
    text-align: center;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.8s ease, color 0.8s ease;
}

.footer h2, .footer p {
    color: var(--text-color);
}

.footer p {
    opacity: 0.7;
    margin-bottom: 0;
}

.social-links {
    margin-top: var(--spacing-lg);
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.social-links a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    font-weight: 600;
}

.social-links a:hover {
    opacity: 1;
}

.footer-bottom {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Animations 动画 */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive 移动端适配 */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .about-container { grid-template-columns: 1fr; }
    .section { padding: var(--spacing-lg) 5%; }
    .hero { padding: 0 5%; padding-top: 120px; padding-bottom: 60px; height: auto; min-height: 100vh; }
    .hero-container { grid-template-columns: 1fr; gap: var(--spacing-lg); text-align: left; }
    .hero-content { max-width: 100%; }
    .floating-3d { width: 100%; max-width: 400px; }
    
    .sticky-layout { flex-direction: column; gap: var(--spacing-lg); }
    .sticky-sidebar { position: relative; top: 0; width: 100%; margin-bottom: var(--spacing-md); }
    .scrolling-cards { width: 100%; gap: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
    .reveal-up { transform: translateY(40px); }
}
