/* Letta 文档中文站 - 自定义样式 */

/* 基础样式 */
:root {
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-bg-light: #ffffff;
  --color-bg-dark: #0f172a;
  --color-text-light: #1e293b;
  --color-text-dark: #e2e8f0;
  --color-border-light: #e2e8f0;
  --color-border-dark: #334155;
  --color-code-bg-light: #f8fafc;
  --color-code-bg-dark: #1e293b;
}

/* 暗色主题 */
.dark {
  --color-bg: var(--color-bg-dark);
  --color-text: var(--color-text-dark);
  --color-border: var(--color-border-dark);
  --color-code-bg: var(--color-code-bg-dark);
}

/* 亮色主题 */
.light {
  --color-bg: var(--color-bg-light);
  --color-text: var(--color-text-light);
  --color-border: var(--color-border-light);
  --color-code-bg: var(--color-code-bg-light);
}

/* 代码块样式 */
pre {
  background-color: var(--color-code-bg);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.875rem;
}

/* 行内代码 */
p code, li code {
  background-color: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  border: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  text-align: left;
}

th {
  background-color: var(--color-code-bg);
  font-weight: 600;
}

/* 链接样式 */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* 导航高亮 */
.nav-active {
  font-weight: 600;
  color: var(--color-primary);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

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

/* 搜索框样式 */
.search-input {
  background-color: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--color-primary);
}

/* 响应式侧边栏 */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: left 0.3s;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
  }

  .sidebar-overlay.open {
    display: block;
  }
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Hero 区域 */
.hero-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

/* 卡片悬停效果 */
.card-hover {
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px rgba(99, 102, 241, 0.3);
}

/* 代码复制按钮 */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--color-border);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

pre:hover .copy-btn {
  opacity: 1;
}

/* 文档内容区 */
.doc-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.doc-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.doc-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.doc-content p {
  margin-bottom: 1rem;
  line-height: 1.75;
}

.doc-content ul, .doc-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

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

.doc-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: #64748b;
}
