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

:root {
    --primary-color: #1e40af;
    --secondary-color: #7c3aed;
    --accent-color: #ec4899;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

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

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 50%, #0c4a6e 100%);
    color: white;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar .toc {
    list-style: none;
}

.sidebar .toc li {
    margin-bottom: 0.5rem;
}

.sidebar .toc a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.sidebar .toc a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar .toc ul {
    list-style: none;
    margin-left: 1rem;
    margin-top: 0.25rem;
}

.sidebar .toc ul li {
    margin-bottom: 0.25rem;
}

.sidebar .toc ul a {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

/* 主内容区 */
.content {
    margin-left: 280px;
    padding: 2rem;
    flex: 1;
    max-width: 1200px;
}

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

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.update-time {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 章节 */
.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.section h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.section h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* 结论框 */
.conclusion-box {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(124, 58, 237, 0.1));
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.conclusion-box p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.conclusion-box ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* 模型文章 */
.model-article {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.model-article:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-color);
}

.model-info {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.badge-oxford {
    background-color: #3b82f6;
}

.badge-salesforce {
    background-color: #8b5cf6;
}

.badge-princeton {
    background-color: #ec4899;
}

.badge-google {
    background-color: #f59e0b;
}

.badge-tsinghua {
    background-color: #10b981;
}

.badge-umich {
    background-color: #06b6d4;
}

.badge-aws {
    background-color: #f97316;
}

.badge-year {
    background-color: #64748b;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border: none;
}

table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background-color: rgba(30, 64, 175, 0.05);
}

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

/* 列表 */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* 术语表 */
.glossary {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.glossary dt {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.glossary dt:first-child {
    margin-top: 0;
}

.glossary dd {
    color: var(--text-light);
    margin-left: 1rem;
    margin-bottom: 0.75rem;
}

/* 介绍文本 */
.intro-text {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-style: italic;
}

/* 页脚 */
.footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

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

.footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .section h2 {
        font-size: 1.4rem;
    }

    .sidebar .toc {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar .toc li {
        margin-bottom: 0;
    }

    .sidebar .toc ul {
        display: none;
    }

    table {
        font-size: 0.9rem;
    }

    table th, table td {
        padding: 0.5rem;
    }
}

/* 打印样式 */
@media print {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
    }

    .model-article {
        page-break-inside: avoid;
    }

    table {
        page-break-inside: avoid;
    }
}

/* 代码块 */
code {
    background-color: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

/* 强调 */
strong {
    color: var(--primary-color);
    font-weight: 600;
}

em {
    color: var(--text-light);
    font-style: italic;
}

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

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

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

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

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

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

/* 页面目录样式 */
.page-toc {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(124, 58, 237, 0.05));
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-toc h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1rem;
}

.page-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-toc li {
    margin-bottom: 8px;
}

.page-toc a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.page-toc a:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

.page-toc li:has(> a[href*="#"]:not([href*="一"]):not([href*="二"]):not([href*="三"])) a {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.95rem;
}
