:root {
    --bg: #f8f9fa; /* 极淡的灰白色，比纯白更有质感 */
    --card-bg: #ffffff;
    --border: rgba(0, 0, 0, 0.05);
    --text: #050505;
    --text-dim: #71717a;
    --primary: #000000;
    --accent: #3b82f6;
    --font-main: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
    --radius-lg: 32px;
    --radius-md: 20px;
    --grid-line: rgba(0, 0, 0, 0.03);
    --accent-line: rgba(59, 130, 246, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a;
        --card-bg: #121212;
        --border: rgba(255, 255, 255, 0.06);
        --text: #f8f9fa;
        --text-dim: #a1a1aa;
        --primary: #ffffff;
        --accent: #60a5fa;
        --grid-line: rgba(255, 255, 255, 0.02);
        --accent-line: rgba(96, 165, 250, 0.05);
    }
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

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

/* 现代设计感背景装饰 */
.grid-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; /* 提升到 0，确保在 body 背景之上 */
    background-image: 
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 100px 100px;
    pointer-events: none;
}

/* 添加点状装饰层 */
.grid-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 侧边装饰线 */
.grid-overlay::after {
    content: '';
    position: absolute;
    top: 0; left: 280px; /* 对应侧边栏宽度 */
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.2), transparent);
}

.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    opacity: 0.02;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography Enhancements */
.gradient-text {
    background: linear-gradient(to right, var(--text) 30%, var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-outline {
    -webkit-text-stroke: 1px var(--text-dim);
    color: transparent;
    opacity: 0.3;
}

/* Layout Structure */
.app-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10; /* 确保内容在背景装饰之上 */
}

.side-nav {
    position: fixed;
    width: 280px;
    height: 100vh;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
}

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

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
    padding-left: 0;
}

.nav-item:hover, .nav-item.active {
    color: var(--text);
    padding-left: 12px;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 0; height: 1px;
    background: var(--text);
    transition: 0.3s;
}

.nav-item.active::before {
    width: 8px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-icon-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    transition: 0.3s cubic-bezier(0.2, 0, 0, 1);
    width: fit-content;
}

.social-icon-btn:hover {
    color: var(--text);
    background: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 100px 80px;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-heading {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 40px;
}

/* Hero Section */
.hero-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    line-height: 0.9;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 32px;
}

.hero-sub {
    font-size: 1.25rem;
    color: var(--text-dim);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.primary-btn {
    padding: 16px 32px;
    background: var(--primary);
    color: var(--bg);
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
}

.primary-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px var(--accent);
}

.secondary-btn {
    padding: 16px 32px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
}

.secondary-btn:hover {
    background: var(--bg);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
    gap: 24px;
}

.bento-item {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.05);
    transition: 0.3s ease;
}

.bento-item:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.bento-large { grid-column: span 2; grid-row: span 2; }
.bento-medium { grid-column: span 2; }

.bento-item h3 { font-size: 1.5rem; margin-bottom: 12px; font-weight: 700; }
.bento-item p { color: var(--text-dim); font-size: 0.95rem; }

.tech-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.chip {
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

.bento-bg-icon {
    position: absolute;
    right: -20px; bottom: -20px;
    width: 150px; height: 150px;
    opacity: 0.03;
    transform: rotate(-15deg);
}

/* Project Cards */
.project-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.work-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: 0 10px 40px -20px rgba(0,0,0,0.05);
    transition: 0.4s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
}

.work-card:hover {
    border-color: var(--accent);
    transform: scale(1.01) translateY(-4px);
    box-shadow: 0 20px 60px -20px rgba(0,0,0,0.1);
}

.work-meta {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.work-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.work-description {
    color: var(--text-dim);
    max-width: 500px;
    font-size: 1rem;
    margin-bottom: 20px;
}

.work-tags {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.6;
}

.work-arrow {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: 0.3s;
}

.work-card:hover .work-arrow {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    transform: rotate(45deg);
}

.work-link-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

/* About / Education */
.about-bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.about-card {
    padding: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.05);
}

.about-heading { font-size: 1.5rem; margin-bottom: 24px; font-weight: 800; }

.edu-item { margin-bottom: 20px; }
.edu-main { display: flex; justify-content: space-between; margin-bottom: 4px; }
.quote { font-size: 1.25rem; font-style: italic; color: var(--text-dim); margin-bottom: 30px; }
.brand-signature { font-weight: 800; font-size: 1.1rem; }

/* Footer */
.main-footer { padding-top: 100px; }
.footer-line { height: 1px; background: var(--border); margin-bottom: 40px; }
.footer-content { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 0.9rem; align-items: center; }
.footer-links { display: flex; gap: 12px; }

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Responsive */
@media (max-width: 1024px) {
    .side-nav { display: none; }
    .main-content { margin-left: 0; padding: 60px 24px; }
    .hero-title { font-size: 4rem; }
    .bento-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .bento-large, .bento-medium { grid-column: span 1; }
    .about-bento { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 3rem; }
    .work-card { flex-direction: column; align-items: flex-start; gap: 30px; }
    .work-arrow { align-self: flex-end; }
}