﻿/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --max-width: 1100px;
    --nav-height: 64px;
}
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px; border-radius: var(--radius-sm); font-size: .95rem;
    font-weight: 500; border: 2px solid transparent; cursor: pointer;
    transition: all .25s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: 6px 16px; font-size: .85rem; }
.btn-block { width: 100%; }

/* ===== Navbar ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height);
    background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); z-index: 1000;
}
.nav-container {
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: -.5px;
}
.nav-menu { display: flex; list-style: none; gap: 32px; align-items: center; }
.nav-menu a {
    font-size: .9rem; font-weight: 500; color: var(--text-secondary);
    padding: 4px 0; position: relative; transition: color .2s;
}
.nav-menu a::after {
    content: ""; position: absolute; bottom: -2px; left: 0; right: 0;
    height: 2px; background: var(--primary); border-radius: 2px;
    transform: scaleX(0); transition: transform .25s;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--text); }
.nav-menu a.active::after, .nav-menu a:hover::after { transform: scaleX(1); }
.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 32px; height: 32px; background: none; border: none; cursor: pointer;
    padding: 4px; z-index: 1001;
}
.nav-toggle span {
    display: block; width: 100%; height: 2px; background: var(--text);
    border-radius: 2px; transition: all .3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    padding-top: var(--nav-height); position: relative; overflow: hidden;
}
.hero-bg {
    position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(79,70,229,.08) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none;
}
.hero-content { text-align: center; position: relative; z-index: 1; padding: 60px 0; }
.hero-avatar { margin-bottom: 24px; }
.avatar-placeholder {
    width: 120px; height: 120px; margin: 0 auto; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700; color: var(--white);
    box-shadow: 0 8px 32px rgba(79,70,229,.3);
}
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -1px; }
.hero-title {
    font-size: 1.2rem; color: var(--primary); font-weight: 600; margin-bottom: 16px;
}
.hero-desc {
    max-width: 520px; margin: 0 auto 32px; color: var(--text-secondary); font-size: 1.05rem;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats {
    display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
    display: block; font-size: 1.8rem; font-weight: 800; color: var(--primary);
}
.stat-label { font-size: .85rem; color: var(--text-muted); }

/* ===== Page Header ===== */
.page-header {
    padding: calc(var(--nav-height) + 60px) 0 40px; text-align: center;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}
.page-header h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -1px; }
.page-header p { color: var(--text-secondary); font-size: 1.05rem; }

/* ===== Sections ===== */
.section { padding: 60px 0; }
.section-title {
    font-size: 1.6rem; font-weight: 700; margin-bottom: 32px;
    letter-spacing: -.5px;
}

/* ===== About Grid ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 60px; }
.about-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; box-shadow: var(--shadow);
}
.about-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 16px; }
.bio p { color: var(--text-secondary); margin-bottom: 12px; line-height: 1.8; }
.personal-info { margin-top: 20px; }
.personal-info div {
    display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.personal-info div:last-child { border-bottom: none; }
.personal-info span { color: var(--text-muted); min-width: 64px; font-weight: 500; }
.skill-group { margin-bottom: 20px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group h3 { font-size: .85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags span {
    background: var(--primary-light); color: var(--primary); padding: 4px 12px;
    border-radius: 20px; font-size: .85rem; font-weight: 500;
}

/* ===== Timeline ===== */
.timeline-section { margin-bottom: 60px; }
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
    content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-dot {
    position: absolute; left: -27px; top: 6px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--primary); border: 3px solid var(--primary-light);
}
.timeline-content {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.timeline-date {
    display: inline-block; background: var(--primary-light); color: var(--primary);
    padding: 2px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600;
    margin-bottom: 8px;
}
.timeline-content h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.timeline-company { color: var(--text-secondary); font-size: .9rem; margin-bottom: 8px; }
.timeline-content p:last-child { color: var(--text-secondary); font-size: .9rem; line-height: 1.7; }

.edu-card {
    display: flex; gap: 20px; align-items: flex-start;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.edu-icon {
    flex-shrink: 0; width: 56px; height: 56px;
    background: var(--primary-light); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.edu-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.edu-card p { font-size: .9rem; color: var(--text-secondary); }
.text-muted { color: var(--text-muted) !important; font-size: .85rem !important; margin-top: 4px; }

/* ===== Projects Grid ===== */
.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}
.project-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform .25s, box-shadow .25s; box-shadow: var(--shadow);
}
.project-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.project-thumb {
    height: 180px; display: flex; align-items: center; justify-content: center;
}
.project-body { padding: 24px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.project-tags span {
    font-size: .75rem; padding: 2px 10px; border-radius: 20px;
    background: var(--primary-light); color: var(--primary); font-weight: 500;
}
.project-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.project-body p { color: var(--text-secondary); font-size: .9rem; line-height: 1.7; margin-bottom: 16px; }
.project-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Contact ===== */
.contact-grid {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start;
}
.contact-info { display: flex; flex-direction: column; gap: 20px; }
.contact-item {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.contact-icon {
    flex-shrink: 0; width: 48px; height: 48px;
    background: var(--primary-light); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.contact-item h3 { font-size: .9rem; font-weight: 600; margin-bottom: 2px; }
.contact-item p { color: var(--text-secondary); font-size: .9rem; }
.contact-form-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.contact-form-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group textarea {
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .9rem; font-family: inherit; transition: border-color .2s;
    outline: none; background: var(--bg);
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-note { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.form-note.success { color: #059669; }
.form-note.error { color: #dc2626; }

/* ===== Footer ===== */
.footer {
    text-align: center; padding: 24px; border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: .85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 260px; height: 100vh;
        background: var(--white); flex-direction: column; padding: 80px 32px 32px;
        gap: 24px; transition: right .3s; box-shadow: var(--shadow-lg);
    }
    .nav-menu.open { right: 0; }
    .nav-toggle { display: flex; }
    .hero h1 { font-size: 2.2rem; }
    .hero-stats { gap: 32px; }
    .about-grid { grid-template-columns: 1fr; }
    .about-card { padding: 24px; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-thumb { height: 140px; }
    .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 2rem; }
    .section-title { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero h1 { font-size: 1.8rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-stats { gap: 24px; }
    .stat-num { font-size: 1.4rem; }
    .projects-grid { grid-template-columns: 1fr; }
}
