/**
 * 版权信息
 * 开发作者：程序员海阔
 * QQ：726177359
 */

/* ============================================================
   个人主页 · 前端样式
   风格：唯美 / 留白 / 玻璃拟态 / 渐变 / 平滑动效
   ============================================================ */

:root {
    --bg: #f6f8fc;
    --bg-soft: #eef2fb;
    --text: #233044;
    --text-soft: #5b6b82;
    --primary: #5b6cff;
    --primary-2: #9b6bff;
    --accent: #ff8fb1;
    --card: rgba(255, 255, 255, 0.72);
    --card-border: rgba(255, 255, 255, 0.6);
    --shadow: 0 12px 40px rgba(91, 108, 255, 0.12);
    --radius: 20px;
    --maxw: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
}

/* 背景装饰光斑 */
body::before, body::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 520px; height: 520px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    pointer-events: none;
}
body::before { top: -160px; left: -120px; background: radial-gradient(circle, #9b6bff, transparent 70%); }
body::after  { bottom: -180px; right: -140px; background: radial-gradient(circle, #5b6cff, transparent 70%); }

a { color: var(--primary); text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- 导航 ---------------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}
.nav .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .5px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav .links { display: flex; gap: 26px; }
.nav .links a { color: var(--text-soft); font-weight: 600; font-size: 15px; transition: color .2s; }
.nav .links a:hover { color: var(--primary); }
.nav .toggle { display: none; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--text); }

/* ---------------- 通用区块 ---------------- */
section { padding: 96px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 {
    font-size: 34px; margin: 0 0 10px; font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-title p { color: var(--text-soft); margin: 0; }

/* ---------------- Hero ---------------- */
.hero {
    min-height: 92vh; display: flex; align-items: center; justify-content: center; text-align: center;
    position: relative; padding: 120px 24px 80px;
}
.hero .avatar {
    width: 132px; height: 132px; border-radius: 50%; object-fit: cover;
    border: 4px solid #fff; box-shadow: var(--shadow); margin-bottom: 26px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}
.hero h1 { font-size: 52px; margin: 0 0 14px; font-weight: 800; letter-spacing: 1px; }
.hero .slogan { font-size: 20px; color: var(--text-soft); margin: 0 0 12px; }
.hero .status {
    display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
    background: rgba(91, 108, 255, 0.12); color: var(--primary); margin-bottom: 28px;
}
.hero .socials { display: flex; gap: 14px; justify-content: center; margin-bottom: 34px; flex-wrap: wrap; }
.hero .socials a {
    padding: 9px 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border);
    color: var(--text); font-weight: 600; box-shadow: var(--shadow); transition: transform .2s;
}
.hero .socials a:hover { transform: translateY(-3px); }
.hero .cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
    display: inline-block; padding: 13px 28px; border-radius: 14px; font-weight: 700; cursor: pointer; border: 0;
    transition: transform .2s, box-shadow .2s;
}
.btn-primary { background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--card-border); }
.btn:hover { transform: translateY(-3px); }

/* ---------------- About ---------------- */
.about-card {
    background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 44px; box-shadow: var(--shadow); font-size: 17px; color: var(--text-soft);
    max-width: 760px; margin: 0 auto; text-align: center;
}
.about-card .city { color: var(--primary); font-weight: 700; }

/* ---------------- Skills ---------------- */
.skill-group { margin-bottom: 36px; }
.skill-group h3 { font-size: 20px; margin: 0 0 18px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.skill {
    background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow);
}
.skill .top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 10px; }
.skill .bar { height: 9px; border-radius: 999px; background: rgba(91, 108, 255, 0.14); overflow: hidden; }
.skill .bar > span {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0; transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}

/* ---------------- Portfolio ---------------- */
.filters { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.filters button {
    border: 1px solid var(--card-border); background: var(--card); color: var(--text-soft);
    padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; transition: all .2s;
}
.filters button.active, .filters button:hover { background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.project {
    background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.project:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(91,108,255,.22); }
.project .cover { height: 180px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 40px; font-weight: 800; }
.project .cover img { width: 100%; height: 100%; object-fit: cover; }
.project .body { padding: 20px 22px; }
.project .body h3 { margin: 0 0 8px; font-size: 19px; }
.project .body p { margin: 0 0 12px; color: var(--text-soft); font-size: 14px; }
.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(91,108,255,.12); color: var(--primary); margin-right: 6px; }
.top-badge { position: absolute; top: 12px; left: 12px; background: var(--accent); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.project { position: relative; }

/* ---------------- 弹窗 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,28,48,.5); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%; max-height: 86vh; overflow: auto; padding: 32px; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal .close { position: absolute; top: 16px; right: 20px; font-size: 26px; cursor: pointer; color: var(--text-soft); border: 0; background: none; }
.modal h2 { margin: 0 0 6px; }
.modal .meta { color: var(--text-soft); font-size: 14px; margin-bottom: 16px; }
.modal .content { color: var(--text-soft); }

/* ---------------- Contact ---------------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.contact-info { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.contact-info .row { display: flex; gap: 12px; margin-bottom: 16px; }
.contact-info .row b { min-width: 64px; color: var(--text); }
.form-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; }
.field input, .field textarea {
    width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid #dfe5f3; background: #fff; font-size: 15px; font-family: inherit; color: var(--text);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,108,255,.15); }
.field textarea { resize: vertical; min-height: 110px; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.alert-success { background: rgba(46,155,91,.12); color: #2e9b5b; }
.alert-error { background: rgba(225,73,62,.12); color: #e1493e; }

/* ---------------- Footer ---------------- */
.footer { text-align: center; padding: 40px 24px; color: var(--text-soft); font-size: 14px; }

/* ---------------- 滚动揭示动画 ---------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.show { opacity: 1; transform: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 820px) {
    .nav .links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
        background: rgba(255,255,255,.96); padding: 10px 24px; border-bottom: 1px solid #eee; }
    .nav .links.open { display: flex; }
    .nav .toggle { display: block; }
    .hero h1 { font-size: 38px; }
    section { padding: 64px 0; }
    .contact-wrap { grid-template-columns: 1fr; }
}

/* ===================== 炫酷增强动效 ===================== */

/* 全屏粒子画布 */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }

/* 顶部滚动进度条 */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 999;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-2)); box-shadow: 0 0 12px var(--primary); }

/* 跟随鼠标的光晕 */
.cursor-glow { position: fixed; width: 360px; height: 360px; border-radius: 50%; pointer-events: none; z-index: -1;
    background: radial-gradient(circle, rgba(155,107,255,.20), transparent 65%);
    transform: translate(-50%, -50%); opacity: 0; transition: opacity .35s; mix-blend-mode: screen; }

/* 名字渐变流动 */
.hero h1 { background: linear-gradient(270deg, #5b6cff, #9b6bff, #ff8fb1, #5b6cff);
    background-size: 300% 300%; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: hueShift 8s ease infinite; }
@keyframes hueShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

/* 打字光标 */
.caret { display: inline-block; width: 2px; margin-left: 2px; color: var(--primary); font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 按钮流光 */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.5), transparent); transform: skewX(-20deg);
    animation: shine 3.5s infinite; }
@keyframes shine { 0%{left:-120%} 55%{left:160%} 100%{left:160%} }

/* 作品卡片 3D 悬浮 */
.project { transform: perspective(900px) rotateX(0) rotateY(0); transition: transform .15s ease, box-shadow .25s; will-change: transform; }

/* 区块标题下划线动画 */
.section-title h2 { position: relative; display: inline-block; }
.section-title h2::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 0; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent)); transform: translateX(-50%); transition: width .6s ease; }
.section-title.show h2::after { width: 64px; }

/* 滚动揭示：子元素错落出现 */
.stagger { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.show .stagger, .stagger.show { opacity: 1; transform: none; }

/* 英雄区进入动画 */
.hero > div { animation: heroIn 1s ease both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .hero h1, .btn-primary::after, .caret, .hero > div { animation: none; }
    .stagger, .reveal { opacity: 1 !important; transform: none !important; }
}
