/* AI-Digest 技术文档样式 */

:root {
    --primary-color: #2563eb;
    --secondary-color: #0ea5e9;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --sidebar-width: 280px;
    --header-height: 80px;
    --code-bg: #f3f4f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-secondary);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-color);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.logo {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.version {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.nav-menu {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
}

.nav-section ul {
    list-style: none;
}

.nav-section ul li a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-section ul li a:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-section ul li a.active {
    background-color: #eff6ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* 主内容区样式 */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
}

.content-wrapper {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1.5rem 0 1rem;
}

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

.section ul, .section ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.section li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

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

.feature-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 架构图 SVG */
.arch-svg-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    overflow-x: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.arch-svg-container svg {
    width: 100%;
    height: auto;
    max-width: 900px;
    margin: 0 auto;
    display: block;
}

.arch-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* 数据流图 */
.dataflow-diagram {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.dataflow-diagram svg {
    width: 100%;
    height: auto;
    max-width: 900px;
    margin: 0 auto;
    display: block;
}

/* 架构图 */
.architecture-diagram {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.arch-layer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 2rem;
}

.arch-layer:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.arch-layer:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.arch-layer h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.arch-layer p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.arch-layer ul {
    list-style: none;
    margin-left: 0;
}

.arch-layer li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.arch-layer li:before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 技术栈 */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-category {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
}

.tech-category h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tech-category ul {
    list-style: none;
    margin-left: 0;
}

.tech-category li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tech-category li:last-child {
    border-bottom: none;
}

.tech-category strong {
    color: var(--text-color);
}

/* 特性详解 */
.feature-detail {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.feature-detail h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* 代码块 */
code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    padding: 0;
}

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

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

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

tr:hover {
    background-color: var(--bg-secondary);
}

/* 警告框 */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.alert-info {
    background-color: #eff6ff;
    border-color: var(--primary-color);
    color: #1e40af;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: var(--success-color);
    color: #166534;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: var(--danger-color);
    color: #991b1b;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-stack {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .content-wrapper {
        padding: 1.5rem;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}