/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --bg-lighter: #fafbfc;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    overflow-x: hidden;
    background-color: var(--bg-color);
}

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

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-color);
}

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

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    letter-spacing: -0.5px;
}

.nav-logo a:hover {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    margin: 4px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* 主页样式 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding-top: 70px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(44,62,80,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -1px;
}

.highlight {
    color: var(--accent-color);
    position: relative;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-weight: 400;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

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

.btn-secondary:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: var(--accent-color);
    color: white;
}

.hero-image {
    display: flex;
    justify-content: center;
    animation: fadeInRight 1s ease 0.3s both;
}

.profile-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
}

.profile-img img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-light);
    box-shadow: var(--shadow);
}

/* 博客部分样式 */
.blog {
    padding: 100px 0;
    background: var(--bg-color);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: var(--primary-color);
    font-weight: 700;
    position: relative;
    letter-spacing: -0.5px;
}

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

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.blog-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.blog-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 3rem;
    background: var(--bg-lighter);
}

.blog-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-category {
    background: var(--bg-light);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 500;
}

.blog-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.4;
}

.blog-excerpt {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    flex: 1;
}

.blog-read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: auto;
}

.blog-read-more:hover {
    gap: 1rem;
    color: #2980b9;
}

.blog-more {
    text-align: center;
    margin-top: 3rem;
}

/* 关于我样式 */
.about {
    padding: 100px 0;
    background: var(--bg-light);
}

.about-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: var(--shadow);
}

.about-intro {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.about-intro h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.about-intro p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.about-details {
    display: grid;
    gap: 2rem;
}

.detail-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.detail-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-top: 0.3rem;
    min-width: 24px;
}

.detail-item h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.detail-item p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 0.3rem;
}

.detail-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
}

/* 项目样式 */
.projects {
    padding: 100px 0;
    background: var(--bg-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 4rem;
}

.project-content {
    padding: 2rem;
}

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

.project-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: var(--bg-light);
    color: var(--accent-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.project-links {
    display: flex;
    gap: 1.5rem;
}

.project-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link:hover {
    color: #2980b9;
    gap: 0.8rem;
}

/* 联系样式 */
.contact {
    padding: 100px 0;
    background: var(--bg-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-details h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact-details p {
    color: var(--text-light);
}

.contact-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.contact-form {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--bg-lighter);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 页脚样式 */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 2.5rem 0;
    text-align: center;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: white;
    transform: translateY(-3px);
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 2rem 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-text {
        padding: 2rem;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form {
        padding: 2rem;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .about-text {
        padding: 1.5rem;
    }
    
    .blog-content,
    .project-content {
        padding: 1.5rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
}

/* 博客管理样式 */
.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.write-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.write-link {
    color: var(--accent-color) !important;
}

.write-link:hover {
    color: #2980b9 !important;
}

/* 写文章部分 */
.write-section {
    padding: 100px 0;
    background: var(--bg-light);
    min-height: calc(100vh - 70px);
}

.write-form-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: var(--shadow);
}

.article-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--bg-lighter);
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: auto;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-close-btn {
    margin-left: auto;
}

/* 文章查看样式 */
.article-view {
    padding: 3rem;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.article-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.article-category {
    background: var(--bg-light);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
}

.article-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-body h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

.article-body pre {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: var(--text-color);
}

.article-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.article-body a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.article-body a:hover {
    border-bottom-color: var(--accent-color);
}

.article-actions {
    display: flex;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.preview-header {
    padding: 2rem 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.preview-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* 响应式设计 - 模态框和编辑页面 */
@media (max-width: 768px) {
    .blog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .write-form-container {
        padding: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .article-view {
        padding: 2rem 1.5rem;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    .article-actions {
        flex-direction: column;
    }
    
    .article-actions .btn {
        width: 100%;
    }
}
