/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    color: #333;
}

/* 导航栏 */
.navbar {
    background: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.navbar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

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

.nav-menu a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #34495e;
    color: #fff;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 首页样式 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

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

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

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #fff;
    color: #667eea;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    font-weight: 600;
}

.btn-outline:hover {
    background: #fff;
    color: #667eea;
}

/* 功能卡片 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.feature-card p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.feature-card .btn {
    width: 100%;
    justify-content: center;
}

/* 教程页面 */
.tutorial-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.sidebar {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: #34495e;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #667eea;
    color: white;
}

.content-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.content-section h3 {
    color: #34495e;
    margin: 1.5rem 0 1rem;
}

.content-section p {
    margin-bottom: 1rem;
    color: #555;
}

.content-section ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    color: #555;
}

.code-block {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
}

/* 命令参考页面 */
.search-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.category-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background: #667eea;
    color: white;
}

.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.command-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.command-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.command-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

.command-category {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
}

.command-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.command-syntax {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
}

.command-example {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
}

/* 交互式演示页面 */
.playground-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.terminal {
    background: #2c3e50;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.terminal-header {
    background: #34495e;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: #ecf0f1;
    font-weight: bold;
}

.terminal-badge {
    background: #27ae60;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
}

.terminal-clear {
    background: transparent;
    color: #ecf0f1;
    border: 1px solid #ecf0f1;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.terminal-clear:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.terminal-output {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-input {
    padding: 1rem;
    border-top: 2px solid #34495e;
}

.terminal-input input {
    width: 100%;
    background: #2c3e50;
    color: #ecf0f1;
    border: none;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    outline: none;
}

.terminal-prompt {
    color: #2ecc71;
    margin-right: 0.5rem;
}

.quick-commands {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.quick-commands h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.quick-commands-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-command-btn {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-command-btn:hover {
    background: #5568d3;
}

/* 页脚 */
footer {
    background: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer small {
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

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

    .tutorial-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}