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

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

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

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: background-color 0.3s ease;
}

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

.nav-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #000;
}

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

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #0071e3;
}

.download-btn {
    background-color: #0071e3;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #0056b3;
}

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

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero 区域 */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    z-index: -1;
}

.hero-content {
    text-align: center;
    margin-bottom: 2rem;
    z-index: 2;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    color: #000;
}

.hero h2 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #888;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.cta-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-btn.primary {
    background-color: #0071e3;
    color: white;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.4);
}

.cta-btn.primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.5);
}

.cta-btn.secondary {
    background-color: transparent;
    color: #0071e3;
    border: 2px solid #0071e3;
}

.cta-btn.secondary:hover {
    background-color: rgba(0, 113, 227, 0.1);
    transform: translateY(-2px);
}

.hero-image {
    width: 100%;
    max-width: 300px;
    margin-top: 2rem;
    z-index: 2;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* 功能区域 */
.features {
    padding: 8rem 0;
    background-color: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: #000;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #000;
}

.feature-card p {
    color: #666;
    font-size: 1rem;
}

/* 截图区域 */
.screenshots {
    padding: 6rem 0;
    background-color: #f5f7fa;
}

.screenshots h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #000;
}

.screenshot-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.screenshot-container img {
    width: 200px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

.screenshot-container img:hover {
    transform: scale(1.05);
}

/* 关于区域 */
.about {
    padding: 8rem 0;
    background-color: white;
}

.about h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #000;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
    line-height: 1.8;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 2.5rem;
    color: #0071e3;
    margin-bottom: 0.5rem;
}

.stat p {
    font-size: 1rem;
    color: #666;
}

/* 下载区域 */
.download {
    padding: 6rem 0;
    background: linear-gradient(135deg, #0071e3 0%, #1d4fd8 100%);
    color: white;
    text-align: center;
}

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

.download p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.appstore-btn {
    display: inline-block;
    background-color: white;
    color: #0071e3;
    width: 200px;
    height: 60px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.appstore-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.btn-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.btn-text p {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.btn-text h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.btn-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

/* 页脚 */
.footer {
    padding: 3rem 0;
    background-color: #f5f7fa;
    text-align: center;
}

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #0071e3;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.95);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        backdrop-filter: blur(10px);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1rem 0;
    }

    .hamburger {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

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

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .features, .about {
        padding: 4rem 0;
    }

    .features h2, .about h2 {
        font-size: 2rem;
    }

    .screenshot-container {
        flex-direction: column;
        align-items: center;
    }

    .stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .download {
        padding: 4rem 0;
    }
}

@media screen and (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

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

    .features h2, .about h2, .screenshots h2, .download h2 {
        font-size: 1.8rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* AI助手样式 */
.ai-assistant-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.ai-assistant-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ai-assistant-icon {
    font-size: 24px;
}

.ai-assistant-panel {
    position: fixed;
    top: 80px; /* 避开navbar高度 */
    right: -100%; /* 完全隐藏到屏幕外 */
    width: 33vw; /* 宽度为视窗宽度的1/3 */
    max-width: 33vw; /* 确保不超过1/3屏幕宽度 */
    min-width: 300px; /* 最小宽度 */
    height: calc(100vh - 160px); /* 高度避开navbar和底部空间，不超过navbar */
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.ai-assistant-panel.show {
    right: 0;
}

.ai-assistant-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-assistant-header h3 {
    margin: 0;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.bot-message {
    background: #e9ecef;
    color: #333;
    margin-right: auto;
}

/* 机器人消息中的格式化样式 - Markdown 渲染 */
.bot-message p {
    line-height: 1.6;
    white-space: pre-wrap; /* 保留换行符 */
    margin: 0.5em 0;
}

/* 粗体样式 - 重点优化 */
.bot-message strong {
    font-weight: bold !important;
    color: #667eea !important;
    display: inline-block;
}

.bot-message em {
    font-style: italic;
    color: #764ba2;
}

.bot-message a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid #667eea;
    transition: all 0.2s ease;
}

.bot-message a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* Markdown 列表样式 */
.bot-message ul,
.bot-message ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.bot-message li {
    margin: 0.3em 0;
}

/* Markdown 代码块样式 */
.bot-message code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.bot-message pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0.5em 0;
}

.bot-message pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Markdown 引用样式 */
.bot-message blockquote {
    border-left: 4px solid #667eea;
    margin: 0.5em 0;
    padding-left: 1em;
    color: #666;
    font-style: italic;
}

/* Markdown 标题样式 */
.bot-message h1,
.bot-message h2,
.bot-message h3,
.bot-message h4,
.bot-message h5,
.bot-message h6 {
    margin: 0.8em 0 0.5em;
    font-weight: bold;
    color: #333;
}

.bot-message h1 { font-size: 1.5em; }
.bot-message h2 { font-size: 1.3em; }
.bot-message h3 { font-size: 1.1em; }

/* Markdown 表格样式 */
.bot-message table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5em 0;
}

.bot-message th,
.bot-message td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.bot-message th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.chat-input-area {
    padding: 15px;
    display: flex;
    background: white;
    border-top: 1px solid #eee;
}

#userInput {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

#sendBtn {
    margin-left: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

#sendBtn:hover {
    opacity: 0.9;
}