/* main.css - 主样式表 */

/* 基础样式和重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4e54c8;
    --secondary-color: #8f94fb;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --light-text: #f4f4f4;
    --background-color: #f9f9f9;
    --card-bg: #ffffff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
    border: none;
}

.primary-btn:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    color: var(--light-text);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
}

.outline-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.outline-btn:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
}

.small-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.center-button {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

section {
    padding: 5rem 10%;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

.highlight {
    color: var(--accent-color);
}

.highlight-btn {
    background-color: var(--accent-color);
    color: var(--light-text);
    padding: 8px 16px;
    border-radius: var(--border-radius);
}

.highlight-btn:hover {
    background-color: #ff5252;
    color: var(--light-text);
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 600;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 首页英雄区样式 */
.hero {
    display: flex;
    align-items: center;
    min-height: 80vh;
    padding: 5rem 10%;
    background-color: var(--background-color);
    overflow: hidden;
}

.hero-content {
    flex: 1;
    padding-right: 3rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    overflow: hidden;
    border: 8px solid var(--secondary-color);
    box-shadow: var(--shadow);
    animation: float 6s ease-in-out infinite;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 技能预览区域 */
.skills-preview {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 4rem;
    margin: 2rem 10%;
}

.skills-preview h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.skills-preview h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.skill-card {
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.skill-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 1.5s ease-in-out;
}

/* 项目展示区域 */
.featured-projects {
    padding: 5rem 10%;
}

.featured-projects h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.featured-projects h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    margin: 1rem 0;
    gap: 0.5rem;
}

.project-tags span {
    background-color: #e9ecef;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* PDF模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    width: 85%;
    max-width: 900px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-color);
}

/* 装饰性简历查看器 */
.pdf-container {
    width: 100%;
    height: 70vh;
    margin: 1.5rem 0;
    position: relative;
}

.resume-wrapper {
    width: 100%;
    height: 100%;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    background-color: #f9f9f9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 四角装饰 */
.corner-decoration {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 2;
}

.top-left {
    top: 0;
    left: 0;
    border-top: 4px solid var(--primary-color);
    border-left: 4px solid var(--primary-color);
    border-top-left-radius: var(--border-radius);
}

.top-right {
    top: 0;
    right: 0;
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-color);
    border-top-right-radius: var(--border-radius);
}

.bottom-left {
    bottom: 0;
    left: 0;
    border-bottom: 4px solid var(--primary-color);
    border-left: 4px solid var(--primary-color);
    border-bottom-left-radius: var(--border-radius);
}

.bottom-right {
    bottom: 0;
    right: 0;
    border-bottom: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-color);
    border-bottom-right-radius: var(--border-radius);
}

/* PDF iframe */
.resume-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 1;
}

/* 加载指示器 */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 下载通知样式 */
.download-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    transition: opacity 0.5s ease;
}

.download-notification.fade-out {
    opacity: 0;
}

/* 模态框按钮 */
.modal-buttons {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 10% auto;
    }
    
    .pdf-container {
        height: 60vh;
    }
    
    .corner-decoration {
        width: 30px;
        height: 30px;
    }
}

@media screen and (max-width: 480px) {
    .pdf-container {
        height: 50vh;
    }
}

/* 简历模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    width: 80%;
    max-width: 900px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
}

.pdf-container {
    width: 100%;
    height: 500px;
    margin: 2rem 0;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
}

#pdf-viewer {
    width: 100%;
    height: 100%;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: var(--light-text);
    padding: 4rem 10% 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-logo h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.footer-logo span {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--light-text);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 背景动画 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}