/* 全局变量定义 */
:root {
    --primary-color: #254665;
    --secondary-color: #3498db;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

.dark-mode {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #f0f0f0;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --border-color: #2c3e50;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 基础样式 */
* {
    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(--bg-color);
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 8px;
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--secondary-color);
}

/* 英雄区域样式 */
.hero {
    padding: 150px 0 100px;
    text-align: center;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255,255,255,0.1) 100%);
    border-radius: 0 0 20px 20px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 800;
}

.hero p {
    font-size: 1.4rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: var(--text-color);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.4);
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateY(-3px);
}

/* 卡片样式 */
.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 25px 25px 10px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.card-header p {
    color: var(--secondary-color);
    font-weight: 500;
}

.card-body {
    padding: 25px;
}

/* 项目展示 */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.project-img {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.project-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.project-description {
    flex-grow: 1;
    margin-bottom: 15px;
}

.project-link {
    display: block;
    text-align: center;
    padding: 10px;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: var(--transition);
    margin-top: auto;
}

.project-link:hover {
    background-color: #2980b9;
}

/* 联系表单 */
.contact-section {
    margin-top: 100px;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 50px;
    box-shadow: var(--shadow);
    margin-bottom: 60px;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / span 2;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.form-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

.form-message.success {
    background-color: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #27ae60;
    display: block;
}

.form-message.error {
    background-color: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #c0392b;
    display: block;
}

/* 页脚样式 */
footer {
    background-color: var(--card-bg);
    padding: 50px 0 30px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: inline-block;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
}

.footer-heading {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
}

.footer-heading::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: var(--secondary-color);
    bottom: -8px;
    left: 0;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

.footer-links i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 15px;
    }
    
    .nav-links {
        margin-top: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0 10px 10px;
    }
    
    .hero {
        padding: 180px 0 80px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .contact-form {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: 1;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}