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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.3);
    --glow: rgba(102, 126, 234, 0.6);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== 背景系统 ========== */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.7);
    animation: bgZoom 20s ease-in-out infinite alternate;
}

@keyframes bgZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.3) 0%, 
        rgba(118, 75, 162, 0.3) 50%, 
        rgba(240, 147, 251, 0.3) 100%
    );
}

.mesh-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(240, 147, 251, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    animation: meshMove 15s ease-in-out infinite;
}

@keyframes meshMove {
    0%, 100% { opacity: 0.5; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.8; transform: scale(1.1) rotate(5deg); }
}

/* ========== 主容器 ========== */
.container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

/* ========== 桌面端布局 ========== */
@media (min-width: 769px) {
    .container {
        padding: 30px 20px 60px;
    }
    
    /* 社交栏固定在右侧 */
    .social-links {
        position: fixed;
        right: 30px;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        z-index: 100;
    }
}

/* ========== 头像区域 ========== */
.profile-section {
    text-align: center;
    animation: fadeInDown 1s ease-out 0.2s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar:hover {
    transform: scale(1.1) rotate(5deg);
}

.avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--glow), transparent 70%);
    border-radius: 50%;
    animation: glowPulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.3; }
}

.avatar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: ringRotate 8s linear infinite;
    z-index: 0;
}

@keyframes ringRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.name {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, var(--accent), #ffffff, var(--primary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    animation: nameGradient 3s ease infinite, nameShake 0.5s ease;
}

@keyframes nameGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes nameShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px) rotate(-0.5deg);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px) rotate(0.5deg);
    }
}

.bio {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========== 搜索框 ========== */
.search-container {
    width: 100%;
    max-width: 500px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-wrapper {
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 4px 4px 4px 8px;
    transition: all 0.4s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    height: 45px;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.search-engine-switch {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}

.engine-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.engine-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
    transition: transform 0.4s ease;
}

.engine-btn:hover::before {
    transform: translate(-50%, -50%) scale(1.5);
}

.engine-btn:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.engine-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-icon {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 10px;
    transition: color 0.3s ease;
}

.search-box:focus-within .search-icon {
    color: var(--primary);
}

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.95rem;
    padding: 0 10px;
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
}

.search-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* ========== 社交链接 ========== */
.social-links {
    display: flex;
    gap: 20px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.social-link {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    transition: transform 0.4s ease;
    z-index: -1;
}

.social-link:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.social-link:hover {
    transform: translateY(-10px) scale(1.15);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

/* ========== 图标网格 ========== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 18px;
    width: 100%;
    max-width: 700px;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.link-card {
    aspect-ratio: 1;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(240, 147, 251, 0.3));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.link-card:hover::before {
    opacity: 1;
}

.link-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
    transform: scale(0);
    transition: transform 0.6s ease;
}

.link-card:hover::after {
    transform: scale(1);
}

.link-card:hover {
    transform: translateY(-15px) scale(1.05);
    border-color: var(--primary);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(102, 126, 234, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.link-icon {
    font-size: 2.2rem;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.link-card:hover .link-icon {
    transform: scale(1.2) rotateY(360deg);
    filter: drop-shadow(0 0 20px var(--glow));
}

.link-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ========== 页脚 ========== */
.footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: fadeInUp 1s ease-out 1s both;
}

.footer p {
    margin: 5px 0;
}

.footer-link {
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-block;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: transform 0.3s ease;
}

.footer-link:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.footer-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    /* 移动端和平板恢复默认布局 */
    .social-links {
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        flex-direction: row !important;
    }
    
    .name {
        font-size: 2rem;
    }
    
    .bio {
        font-size: 1rem;
    }
    
    .avatar-wrapper {
        width: 140px;
        height: 140px;
    }
    
    .links-grid {
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
        gap: 12px;
    }
    
    .link-icon {
        font-size: 1.8rem;
    }
    
    .link-title {
        font-size: 0.75rem;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .search-box {
        height: 42px;
    }
    
    .engine-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .search-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    
    #searchInput {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 40px 15px;
        gap: 30px;
    }
    
    .links-grid {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
        gap: 10px;
    }
    
    .link-card {
        border-radius: 16px;
    }
    
    .link-icon {
        font-size: 1.6rem;
    }
    
    .link-title {
        font-size: 0.7rem;
    }
}
