/* 全局样式和变量 */
:root {
  --color-primary: #4B5563; /* 浅灰色主色调 */
  --color-secondary: #1F2937;
  --color-accent: #6B7280;
  --color-light: #F9FAFB;
  --color-bg: #F3F4F6;
  --text-color: #1F2937;
  --white: #FFFFFF;
  --dark-gray: #111827;
  --transition: all 0.3s ease;
}

/* 确保图片容器是相对定位 */
.about-image {
  position: relative;
  display: inline-block;
}

/* 经验徽章样式 - 绝对定位在右下角 */
.experience-badge {
  position: absolute;
  bottom: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  background-color: #D4AF37; /* 金色背景 */
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(7, 7, 7, 0.1);
  z-index: 10;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

/* 悬停效果也修改为更深的金色 */
.experience-badge:hover {
  transform: scale(1.05);
  background-color: #B8860B; /* 深金色 */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.experience-badge i {
  margin-right: 8px;
}

.experience-badge:hover {
  transform: scale(1.05);
  background-color: var(--color-secondary);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn.primary {
    background-color: var(--color-secondary);
    color: var(--white);
}

.btn.primary:hover {
    background-color: var(--dark-gray);
}

.btn.secondary {
    background-color: transparent;
    color: var(--color-secondary);
    border: 2px solid var(--color-secondary);
}

.btn.secondary:hover {
    background-color: var(--color-secondary);
    color: var(--white);
}

/* 导航栏样式 - 确保水平布局 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.navbar-brand a {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-secondary);
    text-decoration: none;
}

/* 桌面导航菜单 - 确保水平布局 */
.nav-menu {
    display: block;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu ul li {
    margin-left: 30px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-secondary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-secondary);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-secondary);
    cursor: pointer;
}

/* 移动端菜单 */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transform: translateY(-150%);
    transition: var(--transition);
    display: none;
}

.mobile-menu.active {
    transform: translateY(0);
    display: block;
}

.mobile-menu ul {
    list-style: none;
    padding: 20px;
    margin: 0;
}

.mobile-menu ul li {
    margin-bottom: 15px;
}

.mobile-nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: block;
    padding: 10px 0;
}

.mobile-nav-link:hover {
    color: var(--color-secondary);
}

/* 英雄区域 */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--color-bg);
    padding: 0 20px;
    margin-top: 70px;
    height: calc(100vh - 70px);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--color-secondary);
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 通用区域样式 */
section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-secondary);
}

.section-description {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
    font-size: 1.1rem;
}

/* 作品网格 */
.projects {
    background-color: var(--white);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    background-color: var(--white);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* 修改作品卡片，添加查看详情按钮 */
.project-info {
    position: relative;
}

/* 统一的浅色详情按钮样式 */
.project-details-btn {
    background-color: var(--color-light); /* 使用浅色背景 */
    color: var(--color-secondary); /* 使用深色文字 */
    border: 1px solid var(--color-accent); /* 添加边框 */
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 15px;
    transition: var(--transition);
    display: inline-flex; /* 使用flex布局 */
    align-items: center;
    gap: 8px; /* 文字和图标间距 */
    text-decoration: none; /* 确保链接样式正常 */
}
.project-details-btn:hover {
    background-color: var(--color-bg); /* 悬停时稍微深一点 */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary); /* 悬停时边框颜色变化 */
}

.project-details-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.project-details-btn:hover i {
    transform: translateX(3px); /* 图标移动效果 */
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .project-details-btn {
        padding: 10px 20px;
        width: 100%; /* 小屏幕上按钮全宽 */
        justify-content: center;
    }
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--color-secondary);
}

.project-info p {
    color: var(--color-accent);
}

/* 关于我 */
.about {
    background-color: var(--color-bg);
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.about-image {
    flex: 1;
    min-width: 300px;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text h3 {
    margin: 30px 0 20px;
    font-size: 1.5rem;
    color: var(--color-secondary);
}

/* 技能条 */
.skills {
    margin-top: 20px;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--color-secondary);
}

.skill-bar {
    height: 8px;
    background-color: var(--color-light);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: var(--color-secondary);
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* 联系我部分 - 美化和统一对齐 */
.contact {
    background-color: var(--white);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    clip-path: polygon(0 15%, 100% 0, 100% 85%, 0 100%);
    z-index: 0;
    opacity: 0.5;
}

.contact .container {
    position: relative;
    z-index: 1;
}

.contact-content {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto;
}

/* 统一联系方式的对齐方式 */
.contact-info {
    flex: 1;
    min-width: 300px;
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* 修改联系方式信息项间距 */
.contact-info .info-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px; /* 从25px减小到10px，消除明显空行 */
    justify-content: center;
    padding: 12px; /* 略微减小内边距 */
    background-color: var(--color-bg);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.contact-info .info-item:hover {
    background-color: var(--color-light);
}

.contact-info .info-item i {
    margin-right: 15px;
    font-size: 22px;
    color: var(--color-primary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-info .info-item a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.contact-info .info-item a:hover {
color: var(--color-primary);
}

/* 社交链接美化 */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--color-bg);
    color: var(--color-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.social-links a:hover {
    background-color: var(--color-primary);
    color: var(--white);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 表单美化 */
.contact-form {
    flex: 1;
    min-width: 300px;
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--color-light);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--color-light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.1);
    transform: translateY(-2px);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 提交按钮美化 */
.contact-form button[type="submit"] {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--color-primary);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.2);
}

.contact-form button[type="submit"]:hover {
    background-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 85, 99, 0.3);
}

.contact-form button[type="submit"]:disabled {
    background-color: var(--color-accent);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 页脚 */
.footer {
    background-color: var(--color-secondary);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
}

/* 返回顶部按钮 */
/* 固定返回按钮 - 调整位置并确保始终显示 */
.fixed-back-button-container {
    position: fixed;
    bottom: 30px;
    right: 30px; /* 保持在右侧 */
    z-index: 1000;
}

.fixed-back-button {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    opacity: 1; /* 确保始终显示 */
    visibility: visible; /* 确保始终显示 */
}

/* 返回顶部按钮 - 调整位置在右侧但错开 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 180px; /* 调整位置到固定返回按钮的左侧，避免重叠 */
    width: 50px;
    height: 50px;
    background-color: var(--color-secondary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    /* 固定返回按钮的响应式样式 */
    .fixed-back-button-container {
        bottom: 20px;
        right: 20px;
    }
    
    .fixed-back-button {
        padding: 10px 16px;
        font-size: 0.8rem;
        opacity: 1; /* 移动端也确保始终显示 */
        visibility: visible; /* 移动端也确保始终显示 */
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        bottom: 20px;
        right: 140px; /* 移动端也调整位置 */
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--dark-gray);
    transform: translateY(-5px);
}

/* 浮动联系按钮 */
.contact-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.contact-btn i {
    font-size: 20px;
    transition: all 0.3s ease;
}

.contact-btn span {
    position: absolute;
    right: -100px;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.contact-btn:hover span {
    right: 15px;
    opacity: 1;
}

/* 不同按钮的颜色区分 */
.email-btn {
    background-color: #FF6B6B;
}

.call-btn {
    background-color: #4ECDC4;
}

.message-btn {
    background-color: #45B7D1;
}

.email-btn:hover {
    background-color: #FF5252;
}

.call-btn:hover {
    background-color: #26C6DA;
}

.message-btn:hover {
    background-color: #2196F3;
}

/* 社交媒体图标的微信和QQ样式 */
.wechat-icon {
    color: #07C160;
}

.qq-icon {
    color: #12B7F5;
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    /* 导航菜单 */
    .nav-menu {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .mobile-menu {
        display: block;
    }
    
    /* 英雄区域 */
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* 通用样式 */
    section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* 项目网格 */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    /* 联系部分 */
    .contact-content {
        gap: 30px;
    }
    
    .contact-info,
    .contact-form {
        padding: 25px;
    }
    
    .social-links {
        margin-top: 30px;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* 经验徽章 */
    .experience-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
        bottom: 10px;
        right: 10px;
    }
    
    /* 浮动联系按钮 */
    .floating-contact {
        right: 15px;
        bottom: 15px;
    }
    
    .contact-btn {
        width: 40px;
        height: 40px;
    }
    
    .contact-btn:hover {
        width: 120px;
    }
    
    .contact-btn i {
        font-size: 16px;
    }
    
    .contact-btn span {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    /* 英雄区域 */
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    /* 联系信息 */
    .contact-info .info-item {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .contact-info .info-item i {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .social-links {
        gap: 10px;
    }
    
    .social-links a {
        width: 40px;
        height: 40px;
    }
}