/* 重置和基础样式 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #505965;
    --text-light: #8895a7;
    --accent-color: #3498db;
    --accent-light: #5dade2;
    --background-color: #f4f4f2;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--primary-color);
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(52, 152, 219, 0.04), transparent),
        linear-gradient(180deg, #f9f9f7 0%, var(--background-color) 35%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* 页面容器 */
.page-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 4rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 8rem;
}

/* 左侧栏样式 */
.left-column {
    position: sticky;
    top: 3rem;
    height: fit-content;
    align-self: start;
}

/* 右侧栏样式 */
.right-column {
    min-width: 0;
}

/* 个人信息样式 */
.avatar {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.16);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-content h1 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.subtitle {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* 个人网站链接样式 */
.subtitle a {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.subtitle a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-light);
}

.intro {
    font-size: 1rem;
    color: var(--secondary-color);
    line-height: 1.75;
    margin-bottom: 2rem;
}

/* 联系方式样式 */
#contact {
    margin-top: 3rem;
    position: relative;
}

#contact h2 {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.contact-icons {
    display: flex;
    gap: 1.5rem;
}

.contact-icon {
    color: var(--primary-color);
    text-decoration: none;
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.contact-icon:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.contact-icon i {
    font-size: 24px;
}

.qr-code {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    background-color: white;
    padding: 8px;
    pointer-events: none;
    animation: qr-fade-in 0.2s ease;
}

@keyframes qr-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.contact-icon span {
    display: none;
}

/* 右侧内容样式 */
.right-column h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 2.5rem;
}

/* 社交媒体图标 */
.social-grid {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
}

.social-card {
    display: flex;
    text-decoration: none;
    color: var(--primary-color);
}

.social-icon {
    width: 48px;
    height: 48px;
    font-size: 36px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.social-icon i {
    font-size: 36px;
}

.social-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.social-card:hover .social-icon {
    transform: translateY(-2px);
    color: var(--accent-color);
}

/* 各平台品牌色 */
.social-card:hover .social-icon.github {
    color: #171515;
}

.social-card:hover .social-icon.zhihu {
    color: #056de8;
}

.social-card:hover .social-icon img {
    transform: scale(1.1);
}

/* 图片基础样式 */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* 作品展示 */
.project-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
    margin-bottom: 60px;
}

.project {
    position: relative;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.project:hover {
    transform: translateY(-3px);
}

.project img {
    width: 100%;
    aspect-ratio: 16 / 10;
    height: auto;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    background-color: #ececea;
    display: block;
    transition: transform 0.3s ease;
}

.project:hover img {
    transform: scale(1.03);
}

.project h3 {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.project:hover h3 {
    color: var(--accent-color);
}

.project-desc {
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

/* tooltip 使用原生 title 属性，避免溢出容器 */

/* 中英文标题样式 */
.right-column h2,
#contact h2 {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.title-cn {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.title-en {
    font-size: 1rem;
    font-weight: normal;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#contact h2 .title-cn {
    font-size: 1rem;
    color: var(--primary-color);
}

#contact h2 .title-en {
    font-size: 0.85rem;
}

/* 入场动画 */
section {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    section {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .page-container {
        max-width: 1200px;
        gap: 6rem;
    }
}

@media (max-width: 968px) {
    .page-container {
        padding: 3rem 2rem;
        grid-template-columns: 1fr;
        gap: 4rem;
    }
}

@media (max-width: 768px) {
    .page-container {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
    }

    .left-column {
        position: relative;
        top: 0;
    }

    .project-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .project-container {
        grid-template-columns: 1fr;
    }
}
