/* =========================================
   1. 变量与主题 (引入更丰富的色彩)
========================================= */
:root {
    --primary-color: #4f46e5; /* 靛蓝 */
    --primary-accent: #818cf8;
    --secondary-color: #0ea5e9; /* 天蓝 */
    
    /* 亮色模式 */
    --bg-body: #f3f4f6;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --nav-bg: rgba(255, 255, 255, 0.85);
    
    /* 社交媒体品牌色 */
    --color-wechat: #07c160;
    --color-weibo: #e6162d;
    --color-rednote: #ff2442;
    --color-douyin: #111;
    --color-official: #576b95;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

/* 暗色模式 */
body.dark-mode {
    --bg-body: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(15, 23, 42, 0.85);
    --color-douyin: #fff; /* 暗色模式下抖音图标变白 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* =========================================
   2. 背景氛围光 (Ambient Light)
   让背景不单调，有流动感
========================================= */
.ambient-light {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: -1;
    animation: float 10s ease-in-out infinite alternate;
}
.light-1 { top: -100px; left: -100px; background: var(--primary-color); }
.light-2 { bottom: -100px; right: -100px; background: var(--secondary-color); animation-delay: -5s; }

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* =========================================
   3. 通用样式 & 毛玻璃卡片
========================================= */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; position: relative; }

.section-title {
    font-size: 2.5rem; font-weight: 800; text-align: center; margin-bottom: 60px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* 毛玻璃通用类 - 核心视觉风格 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    transition: var(--transition);
}
.glass-card:hover { transform: translateY(-5px); border-color: var(--primary-color); }

/* =========================================
   4. 导航栏
========================================= */
.navbar {
    position: fixed; top: 0; width: 100%; height: 70px;
    background: var(--nav-bg); backdrop-filter: blur(10px);
    z-index: 1000; border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center;
}
.nav-container { display: flex; justify-content: space-between; width: 100%; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-main); text-decoration: none;}
.logo span { color: var(--primary-color); }
.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links a { color: var(--text-main); font-weight: 500; text-decoration: none; position: relative; font-size: 0.95rem; }
.nav-links a.active, .nav-links a:hover { color: var(--primary-color); }
.nav-controls { display: flex; align-items: center; gap: 15px; }
#theme-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-main); transition: transform 0.3s; }
#theme-toggle:hover { transform: rotate(15deg); color: var(--primary-color); }
.menu-toggle { display: none; cursor: pointer; font-size: 1.5rem; color: var(--text-main); }

/* =========================================
   5. 首屏优化 (Hero Section)
========================================= */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 80px; }
.hero-content { display: flex; align-items: center; justify-content: space-between; gap: 60px; width: 100%; }

.badge {
    display: inline-block; padding: 6px 16px; background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color); border-radius: 50px; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 20px; border: 1px solid rgba(79, 70, 229, 0.2);
}

.hero-text h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 15px; font-weight: 800; letter-spacing: -1px; }
.hero-text h2 { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 25px; font-weight: 400; }
.hero-text .bio { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; max-width: 500px; }

/* 联系信息栏 */
.contact-bar {
    display: flex; gap: 30px; padding: 20px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 16px; width: fit-content;
}
.contact-item { display: flex; align-items: center; gap: 15px; }
.icon-box {
    width: 45px; height: 45px; background: var(--primary-color); color: #fff;
    border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.contact-item div { display: flex; flex-direction: column; }
.contact-item .label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.contact-item .value { font-weight: 600; font-size: 0.95rem; color: var(--text-main); }

.img-wrapper {
    width: 400px; height: 500px; border-radius: 20px; overflow: hidden;
    position: relative; box-shadow: 20px 20px 60px rgba(0,0,0,0.1);
    transform: rotate(3deg); transition: var(--transition);
}
.img-wrapper:hover { transform: rotate(0); }
.img-wrapper img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================
   6. 教育 (Timeline)
========================================= */
.timeline { position: relative; max-width: 700px; margin: 0 auto; padding-left: 30px; border-left: 2px solid var(--glass-border); }
.timeline-item { margin-bottom: 50px; position: relative; padding-left: 30px; }
.timeline-dot {
    position: absolute; left: -39px; top: 0; width: 16px; height: 16px;
    background: var(--primary-color); border-radius: 50%; border: 4px solid var(--bg-body);
}
.timeline-date { font-weight: 700; color: var(--primary-color); margin-bottom: 10px; font-size: 0.9rem; }
.timeline-content { padding: 30px; }
.timeline-content h3 { margin-bottom: 5px; }
.timeline-content h4 { color: var(--text-muted); margin-bottom: 15px; font-weight: 500; font-size: 0.95rem; }

/* =========================================
   7. 工作经历 (Grid Cards - 全新设计)
========================================= */
.work-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }

.work-card {
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 5px solid var(--primary-color); /* 左侧强调色 */
}

.work-header { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; flex-wrap: wrap; }
.company-logo {
    width: 60px; height: 60px; background: var(--primary-color); color: #fff;
    border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.work-title h3 { font-size: 1.3rem; color: var(--text-main); }
.work-title h4 { color: var(--text-muted); font-weight: 500; }
.work-year {
    margin-left: auto; background: rgba(0,0,0,0.05); padding: 5px 15px;
    border-radius: 20px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
}
body.dark-mode .work-year { background: rgba(255,255,255,0.1); }

.work-list { list-style: none; }
.work-list li {
    margin-bottom: 12px; padding-left: 25px; position: relative; color: var(--text-main);
}
.work-list li::before {
    content: '→'; position: absolute; left: 0; color: var(--primary-color);
}

/* =========================================
   8. 技能 & 作品
========================================= */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
@media(min-width: 992px) { .balanced-grid { grid-template-columns: repeat(3, 1fr); } }

.skill-card { padding: 30px; text-align: center; }
.skill-card i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; }

.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.project-card { overflow: hidden; }
.card-image { height: 200px; background-size: cover; background-position: center; }
.card-info { padding: 25px; }
.link-text { color: var(--primary-color); font-weight: 700; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;}

/* =========================================
   9. 页脚 (社交媒体矩阵)
========================================= */
.footer-section { background: var(--glass-bg); padding: 60px 0 30px; border-top: 1px solid var(--glass-border); margin-top: 80px; }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 30px; }

.footer-brand h3 { font-size: 2rem; font-weight: 800; margin-bottom: 5px; text-align: center;}
.footer-brand p { color: var(--text-muted); text-align: center;}

.social-matrix { display: flex; gap: 40px; flex-wrap: wrap; justify-content: center; }
.social-item {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text-muted); transition: var(--transition);
}
.social-item .icon {
    width: 50px; height: 50px; background: rgba(0,0,0,0.05); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
    transition: var(--transition);
}
body.dark-mode .social-item .icon { background: rgba(255,255,255,0.1); }

/* 社交图标悬停色 */
.social-item:hover { transform: translateY(-5px); }
.social-item.wechat:hover .icon { background: var(--color-wechat); color: #fff; }
.social-item.weibo:hover .icon { background: var(--color-weibo); color: #fff; }
.social-item.rednote:hover .icon { background: var(--color-rednote); color: #fff; }
.social-item.douyin:hover .icon { background: var(--color-douyin); color: #fff; }
body.dark-mode .social-item.douyin:hover .icon { color: #000; } /* 暗黑模式抖音图标字变黑 */
.social-item.official:hover .icon { background: var(--color-official); color: #fff; }

.social-item span { font-size: 0.8rem; font-weight: 500; opacity: 0; transform: translateY(10px); transition: var(--transition); }
.social-item:hover span { opacity: 1; transform: translateY(0); }

.copyright { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-top: 40px; opacity: 0.6; }

/* =========================================
   10. 响应式与动画类
========================================= */
.fade-in-up { opacity: 0; transform: translateY(30px); animation: fadeInUp 0.8s forwards; }
.scroll-reveal { opacity: 0; transform: translateY(30px); transition: 0.6s cubic-bezier(0.5, 0, 0, 1); }
.scroll-reveal.active { opacity: 1; transform: translateY(0); }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
.delay-100 { animation-delay: 0.1s; transition-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; transition-delay: 0.2s; }

@media (max-width: 900px) {
    .hero-content { flex-direction: column-reverse; text-align: center; padding-top: 20px;}
    .hero-text h1 { font-size: 2.8rem; }
    .contact-bar { margin: 0 auto; width: 100%; flex-direction: column; gap: 15px; align-items: flex-start; }
    .contact-item { width: 100%; }
    .img-wrapper { width: 100%; height: 400px; transform: rotate(0); }
    .work-header { flex-direction: column; align-items: flex-start; }
    .work-year { margin-left: 0; margin-top: 10px; }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 70px; left: 0; width: 100%;
        background: var(--nav-bg); padding: 20px; flex-direction: column;
        border-bottom: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
    }
    .nav-links.active { display: flex; animation: slideDown 0.3s forwards; }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
    
    .social-matrix { gap: 20px; }
    .social-item span { opacity: 1; transform: translateY(0); } /* 手机端始终显示文字 */
}