@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; /* 深灰色，确保在白色背景下可读 */
}

/* 留言板表单输入框 - 白天模式优化 */
body.light-mode #留言板 input,
body.light-mode #留言板 textarea {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: #d1d5db !important;
}

body.light-mode #留言板 input::placeholder,
body.light-mode #留言板 textarea::placeholder {
    color: #9ca3af !important;
}

body.light-mode #留言板 input:focus,
body.light-mode #留言板 textarea:focus {
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
}

/* 提交成功/失败提示框样式 */
#submit-success {
    animation: slideDown 0.3s ease-out;
}

#submit-error {
    animation: slideDown 0.3s ease-out;
}

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

/* 字符计数器样式 */
#char-counter {
    transition: color 0.3s ease;
}

/* 表单提交按钮加载状态 */
#submit-btn:disabled {
    cursor: not-allowed !important;
}

/* 白天模式下的成功提示 */
body.light-mode #submit-success {
    background-color: rgba(34, 197, 94, 0.15) !important;
    border-color: #22c55e !important;
}

body.light-mode #submit-success p {
    color: #16a34a !important;
}

/* 白天模式下的错误提示 */
body.light-mode #submit-error {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
}

body.light-mode #submit-error p {
    color: #dc2626 !important;
}

/* 项目链接气泡样式 */
.project-link-bubble {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 50px;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.project-link-bubble:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
    border-color: rgba(59, 130, 246, 0.8);
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

body.light-mode .project-link-bubble {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
    border-color: rgba(59, 130, 246, 0.4);
    color: #2563eb;
}

body.light-mode .project-link-bubble:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
    border-color: rgba(59, 130, 246, 0.6);
    color: #1d4ed8;
}

/* 保研重点科研项目 */
.featured-research {
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(139, 92, 246, 0.08));
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.45);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.project-with-code {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 2rem;
    align-items: start;
}

.achievement-banner {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.38);
    font-weight: 600;
}

.miniprogram-code-card {
    margin: 0;
    padding: 0.8rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.miniprogram-code-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.miniprogram-code-card figcaption {
    margin-top: 0.65rem;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

body.light-mode .featured-research {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(139, 92, 246, 0.06));
}

body.light-mode .status-badge {
    color: #1d4ed8;
}

body.light-mode .achievement-banner {
    color: #92400e;
}

/* 直接访问页面锚点时跳过欢迎遮罩，保证分享链接可直达内容 */
body:has(section:target) #welcome-screen {
    display: none !important;
}

/* 荣誉证书图集 */
.honor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.honor-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 1rem;
    color: inherit;
    background: rgba(15, 23, 42, 0.34);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.honor-card:hover {
    transform: translateY(-4px);
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
}

.honor-image-frame {
    display: flex;
    height: 185px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.65rem;
    background: rgba(241, 245, 249, 0.97);
}

.honor-image-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.honor-image-rotated img {
    width: 150px;
    height: 240px;
    transform: rotate(-90deg);
}

.honor-card:hover .honor-image-frame:not(.honor-image-rotated) img {
    transform: scale(1.025);
}

.honor-card-body {
    display: flex;
    flex: 1;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem;
}

.honor-card-body strong {
    line-height: 1.45;
}

.honor-card-body small {
    color: #94a3b8;
}

.honor-level {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #bfdbfe;
}

.honor-level.national,
.honor-level.international {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(251, 191, 36, 0.42);
    color: #fde68a;
}

.honor-level.provincial,
.honor-level.competition {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(167, 139, 250, 0.4);
    color: #ddd6fe;
}

.honor-view {
    margin-top: auto;
    padding-top: 0.35rem;
    color: #60a5fa;
    font-size: 0.82rem;
    font-weight: 600;
}

body.light-mode .honor-card {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(100, 116, 139, 0.22);
}

body.light-mode .honor-card-body small {
    color: #64748b;
}

body.light-mode .honor-level {
    color: #1d4ed8;
}

body.light-mode .honor-level.national,
body.light-mode .honor-level.international {
    color: #92400e;
}

body.light-mode .honor-level.provincial,
body.light-mode .honor-level.competition {
    color: #6d28d9;
}

@media (max-width: 768px) {
    .honor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-with-code {
        grid-template-columns: 1fr;
    }

    .miniprogram-code-card {
        width: min(100%, 260px);
        margin: 0 auto;
    }

    .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) {
    .honor-grid {
        grid-template-columns: 1fr;
    }

    .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;
    }
}

/* 技能清单部分样式 */
.skill-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;
}

.skill-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);
}

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

.skill-category-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.32);
    transition: all 0.25s ease;
}

.skill-tag:hover {
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(96, 165, 250, 0.6);
    transform: translateY(-2px);
}

.skill-tag.skill-core {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(251, 191, 36, 0.42);
    font-weight: 600;
}

body.light-mode .skill-card {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

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

body.light-mode .skill-category-title {
    color: #2563eb !important;
}

body.light-mode .skill-tag {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

body.light-mode .skill-tag.skill-core {
    color: #92400e;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.4);
}
