@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap');

:root {
    --bg-color: #F7FBF2;
    --primary-color: #39693B;
    --secondary-color: #D0EDA1;
    --text-color: #39693B;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.navbar {
    position: relative;
    width: 100%;
    background-color: var(--primary-color);
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: var(--bg-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    height: 100%;
}

.nav-links li {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a,
.nav-select,
.language-switcher select {
    color: var(--bg-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
    font-size: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a:hover,
.nav-select:hover,
.language-switcher select:hover {
    opacity: 0.8;
}

.nav-select::-ms-expand {
    display: none;
}

.nav-select:focus {
    outline: none;
}

.nav-select option {
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 8px;
}

.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(0.8);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--bg-color);
    max-width: 800px;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.work-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.work-item:hover {
    transform: translateY(-5px);
}

.work-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.work-info {
    padding: 1.5rem;
}

.contact-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(57, 105, 59, 0.1);
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1.5rem;
    background: var(--secondary-color);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

.contact-item i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.contact-item span {
    color: var(--primary-color);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .contact-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .contact-item {
        justify-content: center;
    }
}

.about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}

.profile-image {
    flex: 0 0 300px;
}

.profile-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--secondary-color);
}

.about-text {
    flex: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--secondary-color);
    margin-top: 1.2rem;
}

.tech-tag {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

footer {
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    width: 100%;
}

footer p {
    opacity: 0.9;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-image {
        flex: 0 0 200px;
    }
    
    .profile-image img {
        height: 200px;
    }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.language-switcher select {
    background-color: transparent;
    border: none;
    color: var(--bg-color);
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.language-switcher select:focus {
    outline: none;
}

.language-switcher select option {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.contact {
    padding: 5rem 2rem;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .nav-right {
        gap: 1rem;
    }
    
    .language-switcher {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contact-item {
        width: 100%;
        justify-content: center;
    }
}

.skills-container {
    margin-top: 2rem;
}

.skill-category {
    margin-bottom: 1.5rem;
}

.skill-category h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1rem;
}

.skill-category h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1rem;
    background-color: var(--secondary-color);
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(57, 105, 59, 0.15);
}

.skill-item i {
    font-size: 1.2rem;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.keyword {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb {
    background: var(--bg-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--secondary-color);
    margin-top: 0;
}

.breadcrumb-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    color: var(--text-color);
    opacity: 0.5;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: var(--bg-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0.8;
}

.back-to-top i {
    font-size: 1.2rem;
}

.back-to-top:hover {
    transform: translateY(-3px);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(57, 105, 59, 0.2);
}

.back-to-top.visible {
    display: flex;
}

.nav-select {
    background: transparent;
    border: none;
    color: var(--bg-color);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.nav-select option {
    background: var(--primary-color);
    color: var(--bg-color);
}

.language-switcher {
    display: flex;
    align-items: center;
    height: 100%;
}

.language-switcher select {
    color: var(--bg-color);
    cursor: pointer;
    font-size: 1rem;
    height: 100%;
    padding: 0;
    display: flex;
    align-items: center;
}

/* 目录卡片样式 */
.toc-card {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    height: fit-content;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    width: 100%;
}

.toc-card h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.8rem;
}

.toc-list li:last-child {
    margin-bottom: 0;
}

.toc-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    opacity: 0.8;
}

.toc-list a:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    opacity: 1;
}

.toc-list a.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 500;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(57, 105, 59, 0.1);
    transform: translateX(5px);
}

/* 博客列表页面布局 */
.blog-list {
    max-width: 1200px;
    margin: var(--header-height) auto 0;
    padding: 3rem 2rem;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

.blog-list-header {
    text-align: center;
    margin-bottom: 4rem;
}

.blog-list-header h1 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.blog-list-header p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-bottom: auto;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    display: block;
    position: relative;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    color: white;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    font-size: 0.9rem;
}

.blog-card-title {
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.4;
    color: white;
}

/* 面包屑导航 */
.breadcrumb {
    background: var(--bg-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--secondary-color);
    margin-top: 0;
}

/* 相关文章卡片 */
.related-posts .blog-card {
    height: 240px;
}

.related-posts .blog-card-image {
    height: 100%;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card-image {
        height: 200px;
    }
    
    .related-posts .blog-card {
        height: 200px;
    }
}

/* 自定义滚动条 */
.toc-card::-webkit-scrollbar {
    width: 4px;
}

.toc-card::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.toc-card::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 2px;
}

.toc-card::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 博客文章图片 */
.blog-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.section-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* 相关文章 */
.related-posts {
    background: var(--bg-color);
    padding: 4rem 0;
    margin-top: 4rem;
}

.related-posts .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.related-posts h2 {
    text-align: left;
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.related-posts .blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.related-posts .blog-card {
    height: auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.related-posts .blog-card:hover {
    transform: translateY(-5px);
}

.related-posts .blog-card-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    display: block;
    position: relative;
}

.related-posts .blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-posts .blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.related-posts .blog-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    color: white;
}

.related-posts .blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    font-size: 0.9rem;
}

.related-posts .blog-card-title {
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.4;
    color: white;
}

@media (max-width: 768px) {
    .related-posts {
        padding: 3rem 1rem;
    }
    
    .related-posts .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .related-posts .blog-card-image {
        height: 200px;
    }
}

/* 博客内容页面布局 */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    min-height: calc(100vh - var(--header-height));
}

.blog-content {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
}

.blog-header {
    margin-bottom: 2rem;
    text-align: center;
}

.blog-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.blog-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.blog-body {
    line-height: 1.8;
}

.blog-body section {
    margin-bottom: 3rem;
}

.blog-body h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.blog-body p {
    margin-bottom: 1.5rem;
    color: #333;
}

/* 移动端响应式布局 */
@media (max-width: 768px) {
    .blog-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .toc-card {
        position: relative;
        top: 0;
        margin-bottom: 1rem;
    }

    .blog-header h1 {
        font-size: 2rem;
    }

    .blog-content {
        padding: 1.5rem;
    }
} 