/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --accent: #00cec9;
    --dark: #2d3436;
    --gray: #636e72;
    --light: #f5f6fa;
    --card: #ffffff;
    --radius: 16px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    color: var(--dark);
    background: var(--light);
    scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; }

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}
.nav-logo span { color: var(--accent); }
.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
}
.nav-link {
    font-weight: 500;
    color: var(--gray);
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.menu-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.menu-toggle span { width: 24px; height: 2px; background: var(--dark); border-radius: 2px; }

/* ===== 主视觉 ===== */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #00cec9 100%);
}
.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.25), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.2), transparent 40%);
    animation: float 8s ease-in-out infinite;
}
@keyframes float {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-20px); }
}
.hero-content { position: relative; padding: 0 20px; }
.avatar-wrap { position: relative; display: inline-block; }
.avatar {
    width: 130px; height: 130px; line-height: 130px;
    font-size: 70px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    margin-bottom: 20px;
}
.status-dot {
    position: absolute; bottom: 8px; right: 8px;
    width: 22px; height: 22px; background: #00b894;
    border-radius: 50%; border: 3px solid #fff;
}
.greeting { font-size: 1.2rem; opacity: 0.95; }
.hero h1 { font-size: 3rem; margin: 10px 0; }
.highlight { color: #ffeaa7; font-weight: 800; }
.subtitle { font-size: 1.15rem; opacity: 0.9; }
.motto { margin-top: 12px; font-style: italic; opacity: 0.85; }
.hero-tags { margin: 22px 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-tag {
    background: rgba(255,255,255,0.2);
    padding: 6px 16px; border-radius: 30px;
    font-size: 0.9rem; border: 1px solid rgba(255,255,255,0.3);
}
.hero-btns { display: flex; gap: 14px; justify-content: center; margin-top: 10px; }
.btn {
    padding: 12px 30px; border-radius: 30px;
    font-weight: 600; font-size: 0.95rem;
    transition: 0.3s; cursor: pointer; border: none; display: inline-block;
}
.btn-primary { background: #fff; color: var(--primary); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.7); }
.btn-ghost:hover { background: rgba(255,255,255,0.2); }
.scroll-hint {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    font-size: 0.85rem; opacity: 0.7; animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100%{bottom:24px} 50%{bottom:34px} }

/* ===== 主体 ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 36px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}
.card:hover { transform: translateY(-4px); }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.section-num {
    font-size: 1.4rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    width: 44px; height: 44px; line-height: 44px;
    text-align: center; border-radius: 12px;
}
.section-head h2 { font-size: 1.5rem; color: var(--dark); }
.card-desc { color: var(--gray); margin-bottom: 20px; }

/* ===== 关于我 ===== */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; }
.about-text p { margin-bottom: 14px; color: #555; }
.about-text strong { color: var(--primary); }
.about-text em { color: var(--accent); font-style: normal; font-weight: 600; }
.info-list { list-style: none; }
.info-list li {
    display: flex; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px dashed #eee;
}
.info-list span { color: var(--gray); }
.info-list b { color: var(--dark); }

/* ===== 技能 ===== */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-item {
    background: var(--light); padding: 22px; border-radius: 14px;
    transition: 0.3s; text-align: center;
}
.skill-item:hover { background: var(--primary); color: #fff; transform: scale(1.03); }
.skill-item:hover small { color: rgba(255,255,255,0.8); }
.skill-icon { font-size: 2rem; margin-bottom: 8px; }
.skill-item h4 { margin-bottom: 10px; }
.bar { height: 8px; background: rgba(108,92,231,0.2); border-radius: 8px; overflow: hidden; }
.skill-item:hover .bar { background: rgba(255,255,255,0.3); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 8px; }
.skill-item small { color: var(--gray); font-size: 0.8rem; }

/* ===== 项目 ===== */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project {
    border-radius: 14px; overflow: hidden; border: 1px solid #f0f0f0;
    transition: 0.3s;
}
.project:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project-cover {
    height: 120px; display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: #fff;
}
.p1 { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.p2 { background: linear-gradient(135deg, #00cec9, #55efc4); }
.p3 { background: linear-gradient(135deg, #fd79a8, #fdcb6e); }
.project-body { padding: 18px; }
.project-body h4 { margin-bottom: 8px; }
.project-body p { color: var(--gray); font-size: 0.9rem; margin-bottom: 12px; }

/* ===== 经历时间线 ===== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
    content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
    width: 2px; background: linear-gradient(var(--primary), var(--accent));
}
.tl-item { position: relative; margin-bottom: 26px; }
.tl-dot {
    position: absolute; left: -29px; top: 6px;
    width: 16px; height: 16px; background: #fff;
    border: 4px solid var(--primary); border-radius: 50%;
}
.tl-time { font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.tl-content h4 { margin: 4px 0; }
.tl-content p { color: var(--gray); font-size: 0.92rem; }

/* ===== 联系方式 ===== */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.contact-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--light); padding: 16px 20px;
    border-radius: 12px; font-size: 0.95rem;
    transition: 0.3s;
}
.contact-item:hover { background: var(--primary); color: #fff; transform: translateX(6px); }

/* ===== 标签 ===== */
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span {
    background: var(--primary); color: #fff; padding: 4px 12px;
    border-radius: 20px; font-size: 0.78rem;
}

/* ===== 留言板 ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; position: relative; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--dark); }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px 14px; border: 2px solid #eee;
    border-radius: 10px; font-family: inherit; font-size: 0.95rem;
    transition: 0.3s; resize: vertical;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
}
.count { position: absolute; right: 2px; bottom: -18px; color: #bbb; font-size: 0.8rem; }
.mood-pick { display: flex; gap: 8px; }
.mood-btn {
    font-size: 1.4rem; width: 44px; height: 44px; border-radius: 10px;
    border: 2px solid #eee; background: #fff; cursor: pointer; transition: 0.2s;
}
.mood-btn.active, .mood-btn:hover { border-color: var(--primary); background: var(--light); transform: scale(1.1); }
.form-actions { display: flex; gap: 14px; }

.msg {
    border: 1px solid #f0f0f0; border-radius: 12px;
    padding: 18px; margin-bottom: 14px; background: var(--light);
    animation: slideIn 0.4s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.msg-mood { font-size: 1.3rem; }
.msg-head strong { color: var(--primary); }
.msg-time { margin-left: auto; font-size: 0.78rem; color: #bbb; }
.msg-body { color: #444; line-height: 1.6; }
.msg-email { margin-top: 8px; font-size: 0.85rem; color: var(--gray); }
.empty-tip { color: #bbb; font-style: italic; text-align: center; padding: 20px 0; }
.msg-count { margin-left: auto; font-size: 0.85rem; color: var(--gray); font-weight: normal; }

/* ===== 页脚 ===== */
footer { text-align: center; padding: 30px; color: var(--gray); font-size: 0.9rem; background: #fff; }

/* ===== 动画 ===== */
.fade-in { opacity: 0; transform: translateY(30px); transition: 0.6s; }
.fade-in.show { opacity: 1; transform: none; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .nav-menu {
        position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; gap: 0; background: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        max-height: 0; overflow: hidden; transition: 0.4s;
    }
    .nav-menu.show { max-height: 400px; }
    .nav-menu li { padding: 14px 24px; border-top: 1px solid #f5f5f5; }
    .hero h1 { font-size: 2rem; }
    .about-grid, .skills-grid, .projects, .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .card { padding: 24px; }
}
