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

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a8e8;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

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

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

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

.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(--primary-color);
}

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

/* 英雄区 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 0;
    text-align: center;
    margin-bottom: 60px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

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

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

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

.btn-secondary:hover {
    background: transparent;
    color: white;
}

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

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

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

/* 文章卡片 */
.recent-posts {
    padding: 60px 0;
    background: var(--light-bg);
}

.recent-posts h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

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

.post-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.post-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.post-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.post-card h3 a:hover {
    color: var(--primary-color);
}

.meta {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-card p {
    color: #666;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--secondary-color);
}

.view-all {
    text-align: center;
}

/* 功能介绍 */
.features {
    padding: 60px 0;
}

.features h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
    border-radius: 8px;
    transition: var(--transition);
}

.feature:hover {
    background: var(--light-bg);
}

.feature .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.feature p {
    color: #666;
}

/* 号召行动 */
.cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
    margin: 60px 0;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* 页脚 */
footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

/* 文章页面 */
article.post {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

article.post h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

article.post .meta {
    color: #999;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

article.post .content {
    line-height: 1.8;
    color: #444;
}

article.post .content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
}

article.post .content h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.5rem;
}

article.post .content p {
    margin-bottom: 1rem;
}

article.post .content code {
    background: var(--light-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d73a49;
}

article.post .content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

article.post .content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* 聊天页面 */
.chat-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 20px;
}

.chat-box {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--light-bg);
}

.message {
    margin-bottom: 1rem;
    display: flex;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    justify-content: flex-end;
}

.message.ai {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.message.ai .message-content {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.chat-input-area {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.chat-input-area button {
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.chat-input-area button:hover {
    background: #0052a3;
}

.chat-input-area button:active {
    transform: scale(0.98);
}

.loading {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: loading 1.4s infinite;
}

@keyframes loading {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .features-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .message-content {
        max-width: 90%;
    }

    .chat-box {
        height: auto;
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.4rem;
    }
}
