/* =========================================================
   个人主页 - 前台样式
   简约 · 现代 · 玻璃拟态
   ========================================================= */

:root {
    --bg: #0b0d13;
    --bg-soft: #12151f;
    --card: rgba(255, 255, 255, 0.045);
    --card-border: rgba(255, 255, 255, 0.09);
    --text: #e8eaf2;
    --text-dim: #9aa3b8;
    --text-faint: #6b7387;
    --primary: #6366f1;
    --primary-2: #a855f7;
    --accent: #22d3ee;
    --radius: 18px;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

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

/* ---------- 背景光晕 ---------- */
.background {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(99, 102, 241, 0.16), transparent 60%),
        radial-gradient(800px 480px at 85% 110%, rgba(168, 85, 247, 0.14), transparent 60%),
        radial-gradient(600px 400px at 70% 20%, rgba(34, 211, 238, 0.08), transparent 55%);
}
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1080px, 92%); margin: 0 auto; }

/* ---------- 导航 ---------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 16px 0;
    transition: all 0.3s ease;
}
.navbar.scrolled {
    background: rgba(11, 13, 19, 0.72);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 10px 0;
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}
.brand .dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    margin-right: 8px;
    box-shadow: 0 0 14px rgba(99,102,241,0.8);
}
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
    color: var(--text-dim);
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    transition: all 0.2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-admin {
    color: var(--text-dim);
    font-size: 14px;
    padding: 8px 14px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    margin-left: 8px;
    transition: all 0.2s;
}
.nav-admin:hover { color: var(--text); border-color: var(--primary); }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 0 80px;
    position: relative;
}
.hero-avatar {
    width: 132px; height: 132px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 26px;
    border: 3px solid rgba(255,255,255,0.12);
    box-shadow: 0 0 0 8px rgba(99,102,241,0.12), 0 24px 60px rgba(0,0,0,0.5);
    background: linear-gradient(135deg, #1e2130, #262a3d);
}
.hero h1 {
    font-size: clamp(34px, 6vw, 58px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.hero h1 .grad {
    background: linear-gradient(120deg, var(--primary), var(--primary-2) 50%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.hero-typing {
    margin-top: 18px;
    font-family: var(--mono);
    font-size: clamp(16px, 2.6vw, 21px);
    color: var(--text-dim);
    min-height: 34px;
}
.hero-typing .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--primary);
    vertical-align: -2px;
    margin-left: 3px;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-tags {
    margin-top: 26px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    transition: all 0.25s;
}
.chip:hover { border-color: var(--primary); color: var(--text); transform: translateY(-2px); }

.hero-cta {
    margin-top: 36px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(99,102,241,0.5); }
.btn-ghost {
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text);
    backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

.hero-scroll {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-faint);
    font-size: 12px;
    letter-spacing: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.hero-scroll .line {
    width: 1px; height: 42px;
    background: linear-gradient(to bottom, var(--text-faint), transparent);
    animation: scrollHint 2s ease-in-out infinite;
}
@keyframes scrollHint { 0%,100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- 区块 ---------- */
.section { padding: 96px 0; position: relative; }
.section-head { text-align: center; margin-bottom: 52px; }
.section-eyebrow {
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
}
.section-head h2 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.4px;
}
.section-head p { color: var(--text-dim); margin-top: 12px; font-size: 15px; }

/* ---------- 关于 ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
}
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 34px;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,0.35); }
.card h3 {
    font-size: 19px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card h3 .icon {
    width: 34px; height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(168,85,247,0.18));
    color: var(--primary-2);
    font-size: 17px;
}
.about-text { color: var(--text-dim); font-size: 15.5px; }
.about-text p + p { margin-top: 14px; }
.highlight-box {
    margin-top: 22px;
    padding: 16px 20px;
    border-left: 3px solid var(--primary);
    background: linear-gradient(90deg, rgba(99,102,241,0.1), transparent);
    border-radius: 0 12px 12px 0;
    color: var(--text);
    font-size: 15px;
}

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
    text-align: center;
    padding: 18px 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    border-radius: 14px;
}
.stat b { display: block; font-size: 24px; font-weight: 800; background: linear-gradient(120deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.stat span { font-size: 12.5px; color: var(--text-faint); }

/* 社交链接 */
.social-list { display: flex; flex-direction: column; gap: 12px; }
.social-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    transition: all 0.25s;
    color: var(--text-dim);
}
.social-item:hover { border-color: var(--primary); color: var(--text); transform: translateX(4px); }
.social-item .ico {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: rgba(99,102,241,0.14);
    color: var(--primary-2);
    flex-shrink: 0;
}
.social-item .txt { flex: 1; font-size: 14.5px; }
.social-item .tag { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }

/* ---------- 技能 ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.skill-cat h4 {
    font-size: 15px;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.skill-row { margin-bottom: 16px; }
.skill-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.skill-top .pct { color: var(--primary); font-family: var(--mono); font-size: 13px; }
.bar {
    height: 7px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 12px rgba(99,102,241,0.5);
    transition: width 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- 项目 ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.project {
    display: flex;
    flex-direction: column;
    padding: 26px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.project::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}
.project:hover::before { opacity: 1; }
.project:hover { transform: translateY(-6px); border-color: rgba(99,102,241,0.4); box-shadow: var(--shadow); }
.project h3 { font-size: 17px; margin-bottom: 10px; }
.project p { color: var(--text-dim); font-size: 14px; flex: 1; }
.project-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.project-tags span {
    font-size: 11.5px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(99,102,241,0.12);
    color: var(--accent);
    font-family: var(--mono);
}
.project-link {
    margin-top: 18px;
    font-size: 13.5px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.project-link:hover { gap: 10px; color: var(--accent); }

/* ---------- 文章 ---------- */
.post-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.post-item {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 28px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    transition: all 0.25s;
}
.post-item:hover { border-color: rgba(99,102,241,0.4); transform: translateX(6px); }
.post-date {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-faint);
    background: rgba(255,255,255,0.04);
    padding: 6px 14px;
    border-radius: 999px;
    white-space: nowrap;
}
.post-body { flex: 1; }
.post-body h3 { font-size: 16.5px; margin-bottom: 4px; }
.post-body h3 a:hover { color: var(--primary); }
.post-body p { color: var(--text-dim); font-size: 13.5px; }

/* ---------- 留言板 ---------- */
.comment-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 28px;
}
.form-card .form-group { margin-bottom: 16px; }
.form-card label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; }
.form-card input,
.form-card textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14.5px;
    font-family: var(--font);
    transition: all 0.2s;
    resize: vertical;
}
.form-card input:focus,
.form-card textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.14);
    background: rgba(99,102,241,0.05);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item {
    padding: 20px 24px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
}
.comment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.comment-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    flex-shrink: 0;
}
.comment-head b { font-size: 14.5px; }
.comment-head time { font-size: 12px; color: var(--text-faint); }
.comment-body { color: var(--text-dim); font-size: 14.5px; }
.comment-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-faint);
    font-size: 14px;
    border: 1px dashed var(--card-border);
    border-radius: var(--radius);
}

/* ---------- 联系 ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.contact-card {
    text-align: center;
    padding: 38px 24px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    transition: all 0.3s;
}
.contact-card:hover { transform: translateY(-6px); border-color: rgba(34,211,238,0.4); }
.contact-card .ico {
    width: 58px; height: 58px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(34,211,238,0.16));
}
.contact-card h3 { font-size: 16px; margin-bottom: 6px; }
.contact-card p { color: var(--text-dim); font-size: 14px; word-break: break-all; }

/* ---------- 页脚 ---------- */
.footer {
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    color: var(--text-faint);
    font-size: 13.5px;
}
.footer .footer-icp {
    display: inline-block;
    margin-top: 8px;
    color: var(--text-faint);
    transition: color 0.2s;
}
.footer .footer-icp:hover { color: var(--text); }

/* ---------- 动画 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translate(-50%, -80px);
    background: rgba(20, 23, 34, 0.92);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text);
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 14px;
    z-index: 999;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show { transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.toast.err { border-color: rgba(248, 113, 113, 0.5); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .about-grid, .skills-grid, .comment-layout { grid-template-columns: 1fr; }
    .project-grid, .contact-grid { grid-template-columns: 1fr; }
    .post-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .nav-links { display: none; }
    .section { padding: 72px 0; }
    .stats-row { grid-template-columns: repeat(3, 1fr); }
}
