/* OpenClaw教程网站 - 全局样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.9;
}

/* 导航栏样式 */
nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    position: relative;
}

nav a:hover {
    opacity: 0.8;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 20px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 主内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 20px;
}

/* 章节标题 */
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #667eea;
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* 教程网格 */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.tutorial-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e9ecef;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.tutorial-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.tutorial-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.tutorial-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.tutorial-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 文章头部 */
.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.article-meta {
    color: #999;
    font-size: 0.9rem;
}

/* 内容样式 */
article {
    font-size: 1.1rem;
}

article h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
    font-size: 1.8rem;
}

article h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.4rem;
}

article h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: #666;
    font-size: 1.2rem;
}

article p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

article ul, article ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
}

article li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* 代码块样式 */
pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

code {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.95rem;
}

.inline-code {
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9rem;
    color: #e74c3c;
}

/* 提示框样式 */
.note {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.note strong {
    color: #1976D2;
}

.warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.warning strong {
    color: #856404;
}

.success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.success strong {
    color: #155724;
}

.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.error strong {
    color: #721c24;
}

.info {
    background: #e2e3e5;
    border-left: 4px solid #6c757d;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.info strong {
    color: #495057;
}

/* 目录样式 */
.toc {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.toc h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.toc ul {
    list-style: none;
    margin-left: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.toc a:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* 特性网格 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.feature-item p {
    color: #666;
}

/* 最新教程列表 */
.tutorial-list {
    list-style: none;
}

.tutorial-list li {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.tutorial-list li:last-child {
    border-bottom: none;
}

.tutorial-list a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.3rem;
    transition: color 0.3s;
}

.tutorial-list a:hover {
    color: #667eea;
}

.tutorial-list span {
    color: #999;
    font-size: 0.9rem;
}

/* 页脚样式 */
footer {
    background: #2c3e50;
    color: #fff;
    padding: 3rem 20px;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .tutorial-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .hero {
        padding: 3rem 20px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    article {
        font-size: 1rem;
    }
    
    .tutorial-grid {
        grid-template-columns: 1fr;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    nav ul {
        gap: 0.8rem;
        font-size: 0.85rem;
    }
    
    main {
        padding: 2rem 15px;
    }
}

/* 打印样式 */
@media print {
    header, footer {
        display: none;
    }
    
    main {
        padding: 0;
    }
    
    .tutorial-card {
        page-break-inside: avoid;
    }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a2e;
        color: #eee;
    }
    
    .tutorial-card,
    .feature-item,
    .toc {
        background-color: #16213e;
        border-color: #0f3460;
    }
    
    pre {
        background-color: #0f0f0f;
    }
    
    .note {
        background-color: #1a237e;
        color: #e3f2fd;
    }
    
    .warning {
        background-color: #ff6f00;
        color: #fff3e0;
    }
    
    .success {
        background-color: #1b5e20;
        color: #e8f5e9;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.pt-1 { padding-top: 1rem; }
.pt-2 { padding-top: 2rem; }
.pt-3 { padding-top: 3rem; }
.pb-1 { padding-bottom: 1rem; }
.pb-2 { padding-bottom: 2rem; }
.pb-3 { padding-bottom: 3rem; }
