* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
html {
    scroll-padding-top: 80px;
    scroll-behavior: smooth;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(108,99,255,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(108,99,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 1;
}
body {
    padding-top: 80px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 10% 20%, #0a0f1c, #03050b);
    color: #eef4ff;
    min-height: 100vh;
    overflow-x: hidden;
    font-weight: 400;
    line-height: 1.6;
}
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0f1c;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(108,99,255,0.3);
    border-top: 5px solid #6c63ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
    animation: rationalFadeIn 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1) both;
}
@keyframes rationalFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 头像区域 */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeUp 0.8s ease-out;
    transform: translateZ(0);
    will-change: transform;
}
.avatar-wrapper {
    display: inline-block;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c63ff, #3f3d9e);
    padding: 4px;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.4);
    transition: transform 0.3s ease;
}
.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.glow-text {
    background: linear-gradient(135deg, #fff, #a78bfa);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(167, 139, 250, 0.3);
}
.wave {
    display: inline-block;
    animation: wave 1.2s infinite;
}
.tagline {
    font-size: 1.2rem;
    color: #b9c3e6;
    margin-bottom: 1.5rem;
}
.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.social-icon {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    padding: 0.6rem 1.5rem;
    border-radius: 40px;
    text-decoration: none;
    color: #eef4ff;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}
.social-icon:hover {
    background: rgba(108, 99, 255, 0.7);
    transform: translateY(-3px);
    border-color: #6c63ff;
}
/* 三列卡片网格 —— 桌面端横向排列，移动端纵向堆叠 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 三等分，自适应宽度 */
    gap: 1.5rem;                            /* 卡片之间的间距 */
    margin: 3rem 0;
}
/* 卡片基础样式（玻璃态、圆角、内边距） */
.card {
    background: rgba(20, 25, 45, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    padding: 1.8rem;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    backface-visibility: hidden;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1),
                box-shadow 0.3s ease,
                opacity 0.6s ease;
    width: 100%;
    max-width: none;  /* 由 grid 列宽决定，不再限制固定宽度 */
    margin: 0;
}
/* 滚动进入可见区域时只改变透明度 */
.card.visible {
    opacity: 1;
}
/* 悬浮效果 —— 卡片轻微上浮 + 放大 */
.card:hover {
    transform: translateY(-6px) scale(1.02);
    z-index: 10;
}
/* 点击时的瞬时效果 */
.card.clicked {
    transform: scale(1.05);
    z-index: 20;
    box-shadow: 0 25px 35px -12px rgba(0,0,0,0.5);
}
/* 光晕扫光 */
.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(108,99,255,0.08) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.card:hover::after {
    opacity: 1;
}
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.card p {
    color: rgba(238, 244, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.5;
}
.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}
.skills span {
    background: rgba(108, 99, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(108, 99, 255, 0.3);
}
.quote {
    text-align: center;
    margin-top: 4rem;
    padding: 1rem;
    font-size: 1.2rem;
    font-style: italic;
    color: #9aa9d9;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
}
/* 动画 */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-10deg); }
}
/* 响应式 */
@media (max-width: 640px) {
    h1 { font-size: 2.5rem; }
    .container { padding: 1rem; }
    /* 移动端卡片纵向堆叠，恢复最大宽度限制 */
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .card {
        max-width: 320px;
        margin: 0 auto;
    }
}
/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-sizing: border-box;
}
.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a78bfa);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.nav-menu li a {
    color: #eef4ff;
    text-decoration: none;
    transition: 0.3s;
}
.nav-menu li a:hover {
    color: #a78bfa;
}
.nav-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #eef4ff;
}
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 60%;
        height: calc(100vh - 70px);
        background: rgba(10, 15, 28, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: start;
        padding-top: 2rem;
        transition: 0.3s;
        gap: 1.5rem;
    }
    .nav-menu.active {
        right: 0;
    }
}
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #6c63ff;
    color: white;
    border: none;
    border-radius: 50px;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: #8a82ff;
    transform: translateY(-3px);
}
.guestbook-list {
    margin-top: 3rem;
}
.message-item {
    background: rgba(20, 25, 45, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #6c63ff;
}
.message-item strong {
    color: #a78bfa;
}
.message-item small {
    color: #9aa9d9;
    font-size: 0.8rem;
    margin-left: 1rem;
}
.message-item p {
    margin-top: 0.5rem;
    color: #cdd9ff;
}
/* 联系表单等已有样式 */
.contact-section {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    background: rgba(20, 25, 45, 0.5);
    border-radius: 2rem;
    backdrop-filter: blur(8px);
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    margin: 2rem auto;
}
.contact-form input, .contact-form textarea {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.8rem;
    border-radius: 1rem;
    color: #fff;
    font-family: inherit;
}
.contact-form button {
    background: #6c63ff;
    border: none;
    padding: 0.8rem;
    border-radius: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.contact-form button:hover {
    background: #8a82ff;
    transform: scale(1.02);
}
#formStatus {
    margin-top: 1rem;
    font-size: 0.9rem;
}
/* 详情提示条 */
.card-detail-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 25, 45, 0.85);
    backdrop-filter: blur(12px);
    color: #cdd9ff;
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    border: 1px solid rgba(108, 99, 255, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    z-index: 100;
}
.card-detail-toast.show {
    opacity: 1;
}