/* ========================================
   AI成长知识库 - 专业设计系统 v3.1
   设计理念：简洁、专业、易读、科技感
   避免：AI味、千篇一律、过度装饰
   现代设计原则：层次感、呼吸感、微交互、避免死板
   ======================================== */

/* ========== 1. CSS变量系统 ========== */
:root {
    /* 主色调 - 专业蓝 */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    
    /* 强调色 - 活力橙 */
    --accent: #ea580c;
    --accent-light: #f97316;
    
    /* 功能色 */
    --success: #16a34a;
    --warning: #ca8a04;
    --error: #dc2626;
    
    /* 中性色 - 温暖灰 */
    --bg-primary: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-tertiary: #e7e5e4;
    --bg-card: #ffffff;
    
    /* 文字色 */
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #a8a29e;
    
    /* 边框和阴影 - 多层次阴影系统 */
    --border: #d6d3d1;
    --border-light: #e7e5e4;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    
    /* 玻璃态效果 */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    
    /* 字体系统 */
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    /* 间距系统 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* 圆角 - 多层次 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    
    /* 过渡动画 */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== 2. 基础重置 ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 预渲染背景色，避免闪烁 */
    background-color: #fafaf9;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
}

/* ========== 3. 背景纹理与装饰 ========== */
/* 移除body::before以避免页面加载闪烁 */
/* body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(30, 64, 175, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(234, 88, 12, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
} */

/* 粒子背景效果 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particles::before,
.particles::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.particles::before {
    top: 20%;
    left: 10%;
}

.particles::after {
    bottom: 20%;
    right: 10%;
    animation-delay: -10s;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.06) 0%, transparent 70%);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -30px) scale(1.1); }
    50% { transform: translate(20px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -10px) scale(1.05); }
}

/* ========== 4. 布局容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ========== 5. 导航栏 ========== */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow var(--transition-base), background var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: transform var(--transition-fast);
}

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

.nav a.active {
    color: var(--primary);
    background: rgba(30, 64, 175, 0.08);
}

.nav a.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: rotate(15deg);
}

/* ========== 7. 面包屑导航 ========== */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-md) 0;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.breadcrumb-separator {
    color: var(--text-muted);
    margin: 0 var(--space-sm);
}

.breadcrumb-current {
    color: var(--text-muted);
}

/* ========== 8. Hero区域 ========== */
.hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
    text-align: center;
    position: relative;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-xl);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.back-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(30, 64, 175, 0.04);
    transform: translateX(-4px);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
    line-height: 1.7;
}

/* ========== 9. 搜索框 ========== */
.search-box {
    max-width: 520px;
    margin: var(--space-xl) auto 0;
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-left: 48px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-box::before {
    content: '⌕';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ========== 10. 统计数据 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card-link {
    text-decoration: none;
    display: block;
}

.stat-card-link:hover .stat-card {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.stat-card-link:hover .stat-card::before {
    opacity: 1;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== 11. CTA按钮 ========== */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ========== 12. 内容区域 ========== */
.section {
    padding: var(--space-2xl) 0;
    position: relative;
    z-index: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: var(--space-sm);
}

.section-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: gap var(--transition-fast);
}

.section-link:hover {
    gap: var(--space-sm);
    text-decoration: underline;
}

/* ========== 13. 卡片网格 ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.category-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.category-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-2xl);
    transform: translateY(-6px);
}

.category-card:hover::before {
    opacity: 1;
}

.category-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: var(--space-lg);
    transition: transform var(--transition-bounce);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(-5deg);
}

.category-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.category-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.category-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* ========== 14. 笔记卡片 ========== */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.note-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.note-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.note-card:hover {
    border-color: var(--primary-light);
    box-shadow: 
        0 8px 16px -4px rgba(30, 64, 175, 0.08),
        0 4px 8px -2px rgba(30, 64, 175, 0.04);
    transform: translateX(4px);
}

.note-card:hover::before {
    opacity: 1;
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    transition: height var(--transition-base);
}

.note-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.note-card:hover::before {
    height: 100%;
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.note-card-title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.note-card-tag {
    font-size: 0.6875rem;
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 9999px;
    white-space: nowrap;
    font-weight: 500;
}

.note-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 笔记卡片的标题样式 */
.note-title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.note-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 15. 文章页面样式 ========== */
.article-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* ========== 16. 表格 ========== */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    margin: var(--space-xl) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

th, td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.6;
}

th {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    font-weight: 600;
    color: var(--primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--primary-light);
}

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

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

tr:hover td {
    background: #f8fafc;
}

/* ========== 17. 代码块 ========== */
pre, code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

:not(pre) > code {
    background: var(--bg-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.85em;
}

pre {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: 1.7;
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-lg);
}

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

/* ========== 18. 文章内容区域 ========== */
.article-content {
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content h1 {
    display: none; /* 隐藏文章内的重复标题 */
}

.article-content h2 {
    margin-top: 48px;
    margin-bottom: 24px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-light);
}

.article-content h3 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.article-content p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-xl);
}

.article-content li {
    margin-bottom: var(--space-sm);
    line-height: 1.7;
}

.article-content pre {
    margin: var(--space-xl) 0;
    overflow-x: auto;
    max-width: 100%;
}

.article-content table {
    margin: var(--space-xl) 0;
}

.article-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, var(--border-light), var(--border), var(--border-light));
    margin: var(--space-2xl) 0;
    border-radius: 1px;
}

.article-content blockquote {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    padding-left: var(--space-xl);
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ========== 19. 相关笔记区域 ========== */
.related-section {
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-light);
}

.related-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

/* ========== 20. Skill来源卡片 ========== */
.skill-source {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin: var(--space-3xl) 0;
    border: 1px solid var(--border-light);
}

.skill-source-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: var(--space-lg);
    font-size: 1.125rem;
    font-weight: 600;
}

.skill-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.skill-source-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--transition-base);
}

.skill-source-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.skill-source-card-icon {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.skill-source-card h4 {
    color: var(--primary);
    margin: 0 0 var(--space-xs) 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.skill-source-card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* ========== 21. API文档 ========== */
.api-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-2xl);
    min-height: calc(100vh - 200px);
}

.api-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.api-nav {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-md);
}

.api-nav-title {
    font-weight: 600;
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.api-nav a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.api-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.api-nav a.active {
    color: var(--primary);
    background: rgba(30, 64, 175, 0.08);
}

.api-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
}

.api-section {
    margin-bottom: var(--space-2xl);
}

.api-section:last-child {
    margin-bottom: 0;
}

.api-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.endpoint {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-secondary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.method {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
}

.method.post {
    background: var(--success);
}

.method.get {
    background: var(--primary-light);
}

.method.delete {
    background: var(--error);
}

.endpoint-path {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.endpoint-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ========== 22. 评论区样式 ========== */
.comment-section {
    max-width: 800px;
    margin: var(--space-3xl) auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.comment-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.comment-form-row {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

.comment-form input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.comment-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.rating-select {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.rating-select select {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    background: var(--bg-card);
    cursor: pointer;
}

.comment-form .btn {
    align-self: flex-start;
}

/* ========== 23. 页脚 ========== */
.footer {
    margin-top: var(--space-3xl);
    padding: var(--space-2xl) 0;
    background: var(--bg-card);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

/* AI API Section */
.footer-api-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

.footer-api-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.footer-api-content {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.footer-api-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

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

.footer-api-link {
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.footer-api-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Footer Main */
.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-xl);
}

.footer-brand {
    flex: 1;
    min-width: 200px;
}

.footer-brand-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

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

.footer-links-group {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.footer-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: var(--space-xs) 0;
    border-bottom: 2px solid transparent;
}

.footer-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-version {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.version-badge {
    background: var(--primary);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.version-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.version-link {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.version-link:hover {
    text-decoration: underline;
}

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* 滚动动画触发 */
.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 25. 响应式设计 ========== */
@media (max-width: 1024px) {
    .api-layout {
        grid-template-columns: 1fr;
    }
    
    .api-sidebar {
        position: static;
    }
    
    .api-nav {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-xs);
    }
    
    .api-nav-title {
        width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 20px;
        --space-xl: 24px;
        --space-2xl: 32px;
        --space-3xl: 48px;
    }
    
    .container, .container-narrow {
        padding: 0 var(--space-md);
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: var(--space-sm);
        padding-top: var(--space-sm);
        border-top: 1px solid var(--border-light);
    }
    
    .nav a {
        padding: var(--space-sm) var(--space-sm);
        font-size: 0.875rem;
    }
    
    .hero {
        padding: var(--space-2xl) 0 var(--space-xl);
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .ai-notice-content {
        flex-direction: column;
        text-align: center;
    }
    
    .api-content {
        padding: var(--space-lg);
    }
    
    .endpoint {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .endpoint-desc {
        margin-left: 0;
    }
    
    /* 移动端表格 */
    .table-wrapper {
        margin: var(--space-lg) -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    th, td {
        padding: var(--space-md);
        font-size: 0.875rem;
    }
    
    /* 移动端文章内容 */
    .article-content h2 {
        font-size: 1.25rem;
        margin-top: 32px;
    }
    
    .article-content h3 {
        font-size: 1.125rem;
        margin-top: 24px;
    }
    
    /* 移动端评论 */
    .comment-section {
        padding: var(--space-lg);
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-title {
        font-size: 1.125rem;
    }
    
    .comment-form textarea {
        min-height: 100px;
        font-size: 16px;
    }
    
    .comment-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }
    
    .comment-form input[type="text"] {
        width: 100%;
        font-size: 16px;
    }
    
    .rating-select {
        justify-content: space-between;
    }
    
    .rating-select select {
        flex: 1;
    }
    
    .comment-form .btn {
        width: 100%;
        padding: var(--space-md);
    }
    
    /* 移动端Skill来源卡片 */
    .skill-source {
        padding: var(--space-lg);
        margin: var(--space-2xl) 0;
        border-radius: var(--radius-lg);
    }
    
    .skill-source-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: var(--space-lg);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-section {
        padding: var(--space-md);
        margin-left: calc(-1 * var(--space-md));
        margin-right: calc(-1 * var(--space-md));
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .comment-form textarea {
        min-height: 80px;
    }
    
    .comment-form input[type="text"] {
        min-width: unset;
    }
}

