/* --- 全局样式与变量 --- */
:root {
    --bg-color: #121212;
    --card-bg-color: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --accent-color-1: #8a2be2; /* 蓝紫色 */
    --accent-color-2: #4169e1; /* 宝蓝色 */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    line-height: 1.6;
    overflow-x: hidden; /* 防止背景形状溢出 */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- 背景动效 --- */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-shapes::before,
.background-shapes::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-color-1), var(--accent-color-2));
    filter: blur(150px);
    opacity: 0.2;
}

.background-shapes::before {
    width: 400px;
    height: 400px;
    top: 10vh;
    left: 10vw;
    animation: move-shape 20s infinite alternate;
}

.background-shapes::after {
    width: 300px;
    height: 300px;
    bottom: 10vh;
    right: 15vw;
    animation: move-shape 25s infinite alternate-reverse;
}

@keyframes move-shape {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(100px, 50px) rotate(180deg); }
}

/* --- 头部英雄区 --- */
.hero {
    text-align: center;
    padding: 4rem 0;
    animation: fadeIn 1.5s ease-in-out;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-pic:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(138, 43, 226, 0.5);
}

.name {
    margin: 1rem 0 0.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-color-1), var(--accent-color-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    min-height: 1.5em; /* 防止打字时页面跳动 */
}

/* 打字机光标 */
#typewriter::after {
    content: '|';
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* --- 社交链接 --- */
.social-links {
    margin-top: 1.5rem;
}

.social-links a {
    color: var(--secondary-text-color);
    font-size: 1.5rem;
    margin: 0 1rem;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-text-color);
    transform: translateY(-3px);
}

/* --- 毛玻璃卡片样式 --- */
.content-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* 兼容 Safari */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFadeIn 1s forwards;
}

/* 为不同的卡片设置动画延迟 */
#about { animation-delay: 0.2s; }
#portfolio { animation-delay: 0.4s; }

.content-card:hover {
    transform: translateY(-5px);
}

.content-card h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color-1);
    padding-left: 1rem;
}

/* --- 作品集网格 --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.portfolio-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
}

.portfolio-item h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.2rem;
}

.portfolio-item p {
    padding: 0 1rem 1rem;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

/* --- 页脚 --- */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

/* --- 新增的署名样式 --- */
footer .credit {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* --- 动画 --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* --- 响应式设计 --- */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .name {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .social-links a {
        margin: 0 0.5rem;
    }
}
