/* ===== Variables ===== */
:root {
    --bg-primary: linear-gradient(90deg, #ffd7e4 0%, #c8f1ff 100%);
    --bg-secondary: rgba(255, 255, 255, 0.6);
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-secondary: #ec4899;
    --accent-green: #10b981;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --border: rgba(203, 213, 224, 0.6);
    --border-accent: rgba(99, 102, 241, 0.3);
    --glow: rgba(99, 102, 241, 0.15);
    --radius: 12px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ===== Particles ===== */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ===== Glow Orbs ===== */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: 0;
    animation: float 25s ease-in-out infinite;
    pointer-events: none;
}
.orb-1 { width: 500px; height: 500px; background: rgba(99, 102, 241, 0.12); top: -150px; right: -150px; }
.orb-2 { width: 400px; height: 400px; background: rgba(236, 72, 153, 0.1); bottom: 10%; left: -100px; animation-delay: -10s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ===== App ===== */
#app { position: relative; z-index: 1; }

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(203, 213, 224, 0.4);
    z-index: 100;
}
.nav-brand { font-weight: 600; font-size: 1rem; color: var(--accent); font-family: 'SF Mono', monospace; }
.nav-links { display: flex; gap: 1.8rem; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5rem 1.5rem 2rem;
}
.hero-content { animation: fadeUp 0.8s ease-out; width: 100%; max-width: 640px; margin: 0 auto; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(25px); } to { opacity: 1; transform: translateY(0); } }

.avatar-container { position: relative; width: 110px; height: 110px; margin: 0 auto 1.5rem; }
.avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--accent-gradient);
    animation: spin 12s linear infinite;
    opacity: 0.5;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-ring::before { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); }
.avatar { position: relative; width: 102px; height: 102px; border-radius: 50%; object-fit: cover; z-index: 1; }

.title { font-size: 2rem; font-weight: 600; margin-bottom: 0.5rem; min-height: 2.5rem; white-space: nowrap; display: flex; justify-content: center; align-items: center; }
.title-text { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cursor { -webkit-text-fill-color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.subtitle { color: var(--text-secondary); font-size: 1rem; margin-bottom: 0.6rem; letter-spacing: 0.5px; }
.bio { color: var(--text-muted); font-size: 0.9rem; margin: 0 auto 1.5rem; max-width: 480px; line-height: 1.7; }

/* ===== Social Links 居中 ===== */
.social-links { display: flex; justify-content: center; gap: 0.85rem; }
.social-link {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(203, 213, 224, 0.5);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.25s;
}
.social-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.social-logo { width: 18px; height: 18px; object-fit: contain; }
.footer-logo { width: 14px; height: 14px; object-fit: contain; margin-right: 0.2rem; }

/* ===== Main ===== */
.main-content { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

/* ===== Section ===== */
.section { margin-bottom: 3rem; opacity: 0; transform: translateY(20px); transition: all 0.6s ease-out; scroll-margin-top: 72px; }
.section.visible { opacity: 1; transform: translateY(0); }
.section-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.25rem; }
.section-header i { color: var(--accent); font-size: 1.2rem; }
.section-header h2 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); }
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-accent), transparent); }

/* ===== About ===== */
.about-intro { margin-bottom: 1.25rem; }
.about-intro p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.8; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-bottom: 1.25rem; }
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all 0.25s;
}
.about-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15); }
.about-icon { color: var(--accent); font-size: 1.35rem; margin-bottom: 0.5rem; }
.about-card h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.35rem; }
.about-card p { color: var(--text-muted); font-size: 0.82rem; line-height: 1.6; }

/* ===== Honors ===== */
.honors-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
.honor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 0.9rem;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.honor-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15); }
.honor-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-size: 1.1rem;
}
.honor-card h3 { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.honor-card p { color: var(--text-muted); font-size: 0.78rem; line-height: 1.55; margin: 0; }

.honors-footer {
    margin-top: 1.5rem; text-align: center; color: var(--text-muted);
    font-size: 0.85rem; display: flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.honors-footer i { color: var(--accent-secondary); font-size: 1.1rem; }
.honors-footer strong { color: var(--accent); font-weight: 600; }

.quote-box {
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1.1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.quote-box i { color: var(--accent); opacity: 0.4; font-size: 1.1rem; flex-shrink: 0; }

/* ===== Tech Stack ===== */
.tech-categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.tech-category h3 { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.tech-category h3 i { color: var(--accent-secondary); font-size: 1rem; }
.tech-items { display: flex; flex-direction: column; gap: 0.6rem; }
.tech-item { display: grid; grid-template-columns: 130px 1fr 45px; align-items: center; gap: 0.8rem; }
.tech-name { font-size: 0.88rem; color: var(--text-primary); }
.tech-bar { height: 5px; background: rgba(99, 102, 241, 0.1); border-radius: 3px; overflow: hidden; }
.tech-progress { height: 100%; width: 0; background: var(--accent-gradient); border-radius: 3px; transition: width 0.8s ease-out; }
.tech-level { font-size: 0.75rem; color: var(--accent-green); text-align: right; font-weight: 500; }

/* ===== Projects ===== */
.projects-subsection { margin-bottom: 1.6rem; }
.projects-subsection:last-child { margin-bottom: 0; }
.projects-subsection-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.4rem 0 0.9rem;
}
.projects-subsection-header i { color: var(--accent-secondary); font-size: 1.05rem; }
.projects-subsection-header h3 { font-size: 0.98rem; font-weight: 600; color: var(--text-primary); }
.projects-subsection-line { flex: 1; height: 1px; background: var(--border); }
.projects-subsection-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.15rem 0.55rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 999px;
}
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    transition: all 0.25s;
    position: relative;
}
.project-card.is-featured { border-color: rgba(99, 102, 241, 0.5); }
.project-card.is-featured::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: var(--radius) var(--radius) 0 0;
}
.project-badge {
    font-size: 0.62rem;
    padding: 0.12rem 0.42rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-left: auto;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(99, 102, 241, 0.18); }
.project-header { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.4rem; }
.project-header i { color: var(--accent-secondary); font-size: 1.1rem; }
.project-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.project-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 1.65rem;
    font-family: 'SF Mono', Consolas, monospace;
    letter-spacing: 0.2px;
}
.project-desc { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.7rem; line-height: 1.65; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.7rem; }
.project-tags span {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
}
.project-metrics { display: flex; gap: 1rem; padding-top: 0.6rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.metric { display: flex; flex-direction: column; }
.metric-value { font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.metric-label { font-size: 0.68rem; color: var(--text-muted); }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    transition: all 0.25s;
}
.timeline-content:hover { border-color: var(--border-accent); }
.timeline-date { font-size: 0.78rem; color: var(--accent); margin-bottom: 0.25rem; font-weight: 500; }
.timeline-content h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.2rem; }
.timeline-company { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.4rem; }
.timeline-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* ===== Stats ===== */
.section-stats { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; text-align: center; }
.stat-item { padding: 0.6rem; }
.stat-number { font-size: 1.6rem; font-weight: 600; background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ===== Poetry ===== */
.section-poetry { text-align: center; }
.poetry-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.poetry-box i { color: var(--accent-secondary); font-size: 1.1rem; opacity: 0.5; flex-shrink: 0; }
.poetry-box p { font-size: 0.92rem; color: var(--text-secondary); font-style: italic; }

/* ===== Links ===== */
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.25s;
    text-align: center;
}
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.link-card i { color: var(--accent); font-size: 1.2rem; margin-bottom: 0.35rem; }
.link-card span { font-size: 0.88rem; color: var(--text-primary); font-weight: 500; }
.link-card p { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ===== Footer ===== */
.footer { border-top: 1px solid rgba(203, 213, 224, 0.4); margin-top: 2.5rem; padding: 2rem 1.5rem 1.5rem; }
.footer-content { display: flex; justify-content: space-between; max-width: 960px; margin: 0 auto 1.5rem; }
.footer-info h3 { font-size: 1rem; color: var(--accent); margin-bottom: 0.3rem; }
.footer-info p { font-size: 0.82rem; color: var(--text-muted); }
.footer-contact h4 { font-size: 0.88rem; margin-bottom: 0.5rem; color: var(--text-secondary); }
.contact-items { display: flex; gap: 1.2rem; }
.contact-items a { color: var(--text-muted); text-decoration: none; font-size: 0.82rem; display: flex; align-items: center; gap: 0.35rem; transition: color 0.2s; }
.contact-items a:hover { color: var(--accent); }
.footer-bottom { text-align: center; padding-top: 1rem; border-top: 1px solid rgba(203, 213, 224, 0.4); }
.copyright-main { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.4rem; }
.copyright-sub { font-size: 0.72rem; color: var(--text-muted); display: flex; justify-content: center; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.copyright-sub .divider { opacity: 0.3; }
.copyright-sub a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.copyright-sub a:hover { color: var(--accent); }
.copyright-sub i { color: #ec4899; font-size: 0.7rem; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: repeat(2, 1fr); }
    .honors-grid { grid-template-columns: repeat(2, 1fr); }
    .tech-categories { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    .navbar { padding: 0.7rem 1.2rem; }
    .nav-links { display: none; }
    .hero { padding-top: 4rem; }
    .title { font-size: 1.6rem; }
    .main-content { padding: 1.2rem; }
    .about-grid { grid-template-columns: 1fr; }
    .honors-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .links-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
    .contact-items { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 480px) {
    html { font-size: 13px; }
    .avatar-container { width: 90px; height: 90px; }
    .avatar { width: 82px; height: 82px; }
    .links-grid { grid-template-columns: 1fr; }
    .tech-item { grid-template-columns: 110px 1fr 40px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; -ms-overflow-style: none; }

/* ===== Selection ===== */
::selection { background: var(--accent); color: var(--bg-primary); }

/* ===== Focus ===== */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== 微信悬浮操作区 ===== */
.float-actions {
    position: fixed;
    right: 1.5rem;
    bottom: 2.5rem;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.7rem;
}

.float-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.float-btn {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}
.float-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: pulse-ring 2.2s ease-out infinite;
    z-index: -1;
}
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.5; }
    70% { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}
.float-btn:hover { transform: scale(1.08) rotate(-6deg); }

/* 微信小程序：白底绿边，与公众号一致 */
.float-btn--mini {
    background: #fff;
    border: 1.5px solid #07C160;
    box-shadow: 0 5px 16px rgba(7, 193, 96, 0.22);
}
.float-btn--mini::before { background: #07C160; }
.float-btn--mini:hover { box-shadow: 0 7px 22px rgba(7, 193, 96, 0.35); }

/* 微信公众号：白底绿边，区分明显 */
.float-btn--official {
    background: #fff;
    border: 1.5px solid #07C160;
    box-shadow: 0 5px 16px rgba(7, 193, 96, 0.22);
}
.float-btn--official::before { background: #07C160; }
.float-btn--official:hover { box-shadow: 0 7px 22px rgba(7, 193, 96, 0.35); }

.float-icon { width: 24px; height: 24px; }
.float-btn--mini .float-icon { width: 44px; height: 44px; }

.float-popup {
    position: absolute;
    bottom: calc(100% + 0.7rem);
    right: 0;
    width: 168px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(7, 193, 96, 0.18);
    border-radius: 16px;
    padding: 1rem 0.9rem 0.85rem;
    box-shadow: 0 14px 40px rgba(7, 193, 96, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.float-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.popup-arrow {
    position: absolute;
    right: 23px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid rgba(7, 193, 96, 0.18);
    border-bottom: 1px solid rgba(7, 193, 96, 0.18);
    transform: rotate(45deg);
    box-shadow: 3px 3px 8px rgba(7, 193, 96, 0.1);
}

.popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.popup-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
}
.popup-sub {
    font-size: 0.75rem;
    color: #07C160;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.qr-code {
    width: 128px;
    height: 128px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
    padding: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.qr-text {
    font-size: 0.8rem;
    color: #07C160;
    margin: 0;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    .float-actions {
        right: 1rem;
        bottom: 1rem;
        gap: 0.6rem;
    }
    .float-btn {
        width: 42px;
        height: 42px;
    }
    .float-icon {
        width: 20px;
        height: 20px;
    }
    .float-popup {
        width: 150px;
        padding: 0.85rem 0.8rem 0.75rem;
    }
    .popup-arrow { right: 21px; }
    .qr-code {
        width: 112px;
        height: 112px;
    }
    .qr-text { font-size: 0.76rem; }
}
