/* 全局样式 */
:root {
    --primary-color: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #6366f1;
    --text-color: #1f2937;
    --light-text: #6b7280;
    --bg-color: #ffffff;
    --light-bg: #f9fafb;
    --dark-bg: #111827;
    --border-color: #e5e7eb;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
    min-height: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1, h2, h3 {
    margin-bottom: 0.5em;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    min-height: 4.2rem; /* 保留空间防止打字效果导致布局跳动 */
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    min-height: 3rem; /* 保留空间防止打字效果导致布局跳动 */
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--secondary-color);
}

section {
    min-height: 100vh;
    padding: 80px 0;
    display: flex;
    align-items: center;
    position: relative;
}

/* 导航栏 */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    padding-left: 20px;
    padding-right: 20px;
}

nav.scrolled {
    background-color: var(--bg-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 15px 20px;
}

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

.logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center; /* 确保导航链接垂直居中 */
    height: 100%; /* 确保高度与导航栏一致 */
}

.nav-links li {
    margin-left: 30px;
    display: flex; /* 使链接项也使用flex布局 */
    align-items: center; /* 链接项内容垂直居中 */
    height: 100%; /* 链接项高度100% */
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    display: flex; /* 使链接也使用flex布局 */
    align-items: center; /* 链接内容垂直居中 */
    height: 100%; /* 链接高度100% */
}

.nav-links a:hover {
    color: var(--primary-color);
}

.github-btn {
    display: flex;
    align-items: center;
    background-color: var(--dark-bg);
    color: white !important;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

/* 英雄区域 */
.hero {
    background: var(--light-bg);
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 10%, rgba(79, 70, 229, 0.15) 0%, rgba(0, 0, 0, 0) 50%);
}

.hero .container {
    padding-top: 70px; /* 为固定导航栏留出空间，与导航栏高度一致 */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.hero-content {
    max-width: 600px;
    margin-top: 40px;
    flex: 1;
}

.hero-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--light-text);
}

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

.hero-image {
    flex: 1;
    max-width: 50%;
    margin-left: 40px;
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

/* 打字光标效果 */
.typing::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.cta-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

.btn-clicked::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

.btn.primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

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

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* 演示部分 */
.demo {
    background-color: var(--bg-color);
    text-align: center;
}

.demo-img {
    margin-top: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.demo-img img {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* 特点部分 */
.features {
    background-color: var(--light-bg);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-card.animate {
    opacity: 1;
    transform: translateY(0);
}

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

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon i {
    font-size: 24px;
    color: white;
}

/* 安装部分 */
.setup {
    background-color: var(--bg-color);
}

.setup-steps {
    margin-top: 40px;
}

.step {
    display: flex;
    margin-bottom: 40px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 20px;
    flex-shrink: 0;
}

.step-content {
    flex-grow: 1;
    max-width: 100%; /* 确保不超出父容器宽度 */
    overflow: hidden; /* 防止内容溢出 */
}

.code-block {
    position: relative;
    background-color: var(--dark-bg);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 10px;
    max-width: 100%; /* 确保不超出父容器宽度 */
    word-break: break-word; /* 允许长单词在必要时断行 */
}

.code-block code {
    color: #f8f8f2;
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap; /* 保持代码格式但允许换行 */
    display: block; /* 确保代码块占据整个宽度 */
    width: 100%; /* 设置宽度为100% */
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 语音功能部分 */
.voice {
    background-color: var(--light-bg);
}

.voice-features {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.voice-feature {
    flex: 1;
    min-width: 300px;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.voice-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.voice-icon i {
    font-size: 30px;
    color: white;
}

.voice-steps {
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.voice-steps ol {
    margin-top: 15px;
    padding-left: 20px;
}

.voice-steps li {
    margin-bottom: 10px;
}

/* 多用户部分 */
.users {
    background-color: var(--bg-color);
    text-align: center;
}

.user-steps {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background-color: var(--light-bg);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    text-align: left;
}

.user-steps ol {
    padding-left: 20px;
}

.user-steps li {
    margin-bottom: 10px;
}

/* 页脚 */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.footer-logo i {
    margin-right: 10px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #d1d5db;
}

.footer-links a:hover {
    color: white;
}

.footer-social a {
    color: white;
    font-size: 1.5rem;
    margin-left: 15px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #9ca3af;
}

.footer-bottom a {
    color: #d1d5db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    nav {
        height: 60px; /* 移动设备上导航栏高度略小 */
    }
    
    .nav-links {
        display: none;
    }
    
    .hero {
        padding: 0;
    }
    
    .hero .container {
        padding-top: 60px; /* 适应移动设备上的导航栏高度 */
        flex-direction: column;
    }
    
    .hero-content {
        max-width: 100%;
        text-align: center;
    }
    
    .hero-image {
        max-width: 90%;
        margin: 40px auto 0;
        order: 2;
    }
    
    .cta-buttons {
        justify-content: center;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .voice-features {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .code-block {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .step-content {
        width: 100%;
    }
}

/* 部分高亮效果 */
.highlight-section {
    animation: highlight-pulse 1s ease-in-out;
}

@keyframes highlight-pulse {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(79, 70, 229, 0.05);
    }
    100% {
        background-color: transparent;
    }
} 