@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary: #3b82f6;
    --primary-light: #93c5fd;
    --dark: #1e293b;
    --light: #f8fafc;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    transition: all 0.3s ease;
    line-height: 1.6;
}

body.light-mode {
    background-color: var(--light);
    color: var(--dark);
    --glass-bg: rgba(248, 250, 252, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
}

.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.glassmorphism:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.3);
}

/* 担任职务部分样式 */
.position-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.position-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.position-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* 白色模式下担任职务部分的文字颜色修复 */
body.light-mode .position-card {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .position-card:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .position-card p {
    color: #374151 !important; /* 深灰色，确保在白色背景下可读 */
}

body.light-mode .position-card h3 {
    color: #111827 !important; /* 更深的颜色用于标题 */
}

/* 兴趣爱好部分样式 */
.hobby-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hobby-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.hobby-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* 白色模式下兴趣爱好部分的文字颜色修复 */
body.light-mode .hobby-card {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .hobby-card:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .hobby-card p {
    color: #374151 !important; /* 深灰色，确保在白色背景下可读 */
}

body.light-mode .hobby-card h3 {
    color: #111827 !important; /* 更深的颜色用于标题 */
}

/* 教育经历部分样式 */
.education-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.education-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* 白色模式下教育经历部分的文字颜色修复 */
body.light-mode .education-card {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .education-card:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .education-card li {
    color: #374151 !important; /* 深灰色，确保在白色背景下可读 */
}

body.light-mode .education-card h3 {
    color: #111827 !important; /* 更深的颜色用于标题 */
}

/* 链接样式优化 */
.link-elegant {
    color: #60a5fa;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.link-elegant:hover {
    color: #3b82f6;
}

.link-elegant::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

.link-elegant:hover::after {
    width: 100%;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.section-title {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.card, .glassmorphism {
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: var(--primary);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #2563eb;
}

.progress-bar {
    height: 6px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.heart-animation {
    position: fixed;
    pointer-events: none;
    animation: float 4s ease-out forwards;
    font-size: 24px;
    z-index: 9999;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(0);
        opacity: 0;
    }
}

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.active {
    max-height: 500px;
}

.link {
    color: var(--primary-light);
    transition: all 0.2s ease;
    position: relative;
}

.link:hover {
    color: var(--primary);
}

.link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.link:hover::after {
    width: 100%;
}

.ai-chat-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.ai-chat-iframe {
    width: 100%;
    height: 600px;
    min-height: 500px;
    border: none;
    border-radius: 0.75rem;
}

/* 搜索相关样式 */
.search-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.search-container {
    width: 90%;
    max-width: 800px;
    background-color: var(--dark);
    border-radius: 1rem;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.light-mode .search-container {
    background-color: var(--light);
}

.search-modal.active .search-container {
    transform: scale(1);
}

.search-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .search-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--light);
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

.light-mode .search-input {
    color: var(--dark);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.light-mode .search-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-results {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.search-result-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.light-mode .search-result-item {
    background-color: rgba(0, 0, 0, 0.05);
}

.search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.light-mode .search-result-item:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.search-result-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.search-result-content {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.light-mode .search-result-content {
    color: rgba(0, 0, 0, 0.8);
}

.search-no-results {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.light-mode .search-no-results {
    color: rgba(0, 0, 0, 0.5);
}

.search-highlight {
    background-color: yellow;
    color: black;
    font-weight: bold;
}

/* 白色模式下联系方式部分的文字颜色修复 */
body.light-mode #联系方式 .position-card span {
    color: #374151 !important; /* 深灰色，确保在白色背景下可读 */
}

body.light-mode #联系方式 .position-card h3 {
    color: #111827 !important; /* 更深的颜色用于标题 */
}

/* 白色模式下留言板部分的文字颜色修复 */
body.light-mode #留言板 p {
    color: #374151 !important; /* 深灰色，确保在白色背景下可读 */
}

body.light-mode #留言板 label {
    color: #374151 !important; /* 深灰色，确保在白色背景下可读 */
}

@media (max-width: 768px) {
    .ai-chat-iframe {
        height: 400px;
        min-height: 350px;
    }

    .search-results {
        max-height: 50vh;
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* 添加的导航栏调整样式 */
    header {
        padding-top: 0.3rem; /* 更小的内边距 */
        padding-bottom: 0.3rem;
    }
    header h1 {
        font-size: 0.9rem; /* 更小的字体 */
    }
    #mobile-menu {
        margin-top: 0.3rem; /* 更小的间距 */
    }
    main {
        padding-top: 4.5rem; /* 更小的顶部间距 */
    }

    .hobby-card, .position-card, .education-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .glassmorphism {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* 在480px以下进一步调整导航栏 */
    header {
        padding-top: 0.3rem; /* 更小的内边距 */
        padding-bottom: 0.3rem;
    }
    header h1 {
        font-size: 0.9rem; /* 更小的字体 */
    }
    #mobile-menu {
        margin-top: 0.3rem; /* 更小的间距 */
    }
    main {
        padding-top: 4.5rem; /* 更小的顶部间距 */
    }

    .hobby-card, .position-card, .education-card {
        padding: 1rem;
    }
}
