/* ========================================
   OpenClaw 文档 - 独立样式
   ======================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent-orange: #f97316;
    --accent-cyan: #06b6d4;
    
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16162a;
    --bg-hover: #252545;
    --bg-code: #0d0d14;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(99, 102, 241, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-dark: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
    
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon { font-size: 1.5rem; }

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active { color: var(--text-primary); }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s;
}

.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* 项目头部 */
.project-header {
    padding: 120px 0 60px;
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
}

.project-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
}

.project-header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.project-icon {
    font-size: 6rem;
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.5));
}

.project-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.tag {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-links { display: flex; gap: 1rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

/* 主内容区 */
.main-content { padding: 3rem 0; }

.content-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

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

.sidebar-nav a, .sidebar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s;
}

.sidebar-nav a:hover, .sidebar-links a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

/* 内容区 */
.content { min-height: 500px; }

.content-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-light);
}

.content-section:last-child { border-bottom: none; }

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

.content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--primary);
}

.content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.content ul, .content ol {
    margin: 1rem 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.content li { margin-bottom: 0.5rem; }

.content strong { color: var(--text-primary); }

.content code {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-cyan);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* 高亮框 */
.highlight-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.highlight-box h4 {
    margin-top: 0;
    color: var(--primary);
}

.highlight-box ul { margin-bottom: 0; }

/* 特性网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

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

.feature-card h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.feature-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* 代码块 */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 1.5rem 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-light);
}

.code-lang {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.code-block pre {
    padding: 1.5rem;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 架构图 */
.architecture-diagram {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 2rem;
    margin: 1.5rem 0;
}

.arch-layer {
    text-align: center;
    padding: 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.arch-layer h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
}

.arch-items {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.arch-item {
    background: var(--bg-hover);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.arch-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    padding: 0.5rem;
}

/* API 表格 */
.api-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.api-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
}

.api-table th,
.api-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.api-table th {
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
    color: var(--text-primary);
}

.api-table td { color: var(--text-secondary); }

.api-table tr:last-child td { border-bottom: none; }

.api-table code {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

/* 页脚 */
.footer {
    background: var(--bg-secondary);
    padding: 3rem 0 1.5rem;
    border-top: 1px solid var(--border-light);
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

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

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.beian { font-size: 0.75rem !important; }

/* 响应式 */
@media (max-width: 768px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        order: 2;
    }
    
    .project-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .project-title { font-size: 2rem; }
    
    .project-tags { justify-content: center; }
    
    .project-links { justify-content: center; }
    
    .nav-menu { display: none; }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .features-grid { grid-template-columns: 1fr; }
    
    .arch-items { flex-direction: column; }
    
    .api-table { font-size: 0.875rem; }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track { background: var(--bg-secondary); }

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}
