/* 自定义GitBook样式 */

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: #2196F3;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 1em;
    border-bottom: 2px solid #e1e4e8;
    padding-bottom: 0.3em;
}

h1 {
    font-size: 2.2em;
    color: #1976D2;
    border-bottom: 3px solid #2196F3;
}

h2 {
    font-size: 1.8em;
    color: #2196F3;
}

h3 {
    font-size: 1.4em;
    color: #42A5F5;
}

/* 代码块样式 */
pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.45;
    margin: 1em 0;
}

code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    color: #d73a49;
}

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

/* 链接样式 */
a {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1976D2;
    text-decoration: underline;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e4e8;
}

th {
    background: #f6f8fa;
    font-weight: 600;
    color: #24292e;
}

tr:hover {
    background: #f8f9fa;
}

/* 引用块样式 */
blockquote {
    border-left: 4px solid #2196F3;
    margin: 1em 0;
    padding: 0 1em;
    color: #6a737d;
    background: #f8f9fa;
    border-radius: 0 6px 6px 0;
}

/* 列表样式 */
ul, ol {
    padding-left: 2em;
}

li {
    margin: 0.5em 0;
}

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 1em 0;
}

/* 侧边栏样式 */
.book-summary {
    background: #f8f9fa;
    border-right: 1px solid #e1e4e8;
}

.book-summary ul.summary li a {
    color: #586069;
    padding: 8px 16px;
    border-radius: 4px;
    margin: 2px 8px;
    transition: all 0.2s ease;
}

.book-summary ul.summary li a:hover {
    background: #e1e4e8;
    color: #2196F3;
}

.book-summary ul.summary li.active > a {
    background: #2196F3;
    color: white;
    font-weight: 600;
}

/* 导航栏样式 */
.book-header {
    background: #2196F3;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.book-header h1 {
    color: white;
    border: none;
    margin: 0;
}

/* 搜索框样式 */
#book-search-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 4px;
}

#book-search-input:focus {
    background: white;
    color: #333;
}

/* 按钮样式 */
.btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #1976D2;
}

/* 返回顶部按钮 */
.back-to-top {
    background: #2196F3 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3) !important;
}

.back-to-top:hover {
    background: #1976D2 !important;
    transform: translateY(-2px);
}

/* 代码复制按钮 */
.copy-code-button {
    background: #2196F3 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease !important;
}

.copy-code-button:hover {
    opacity: 1 !important;
}

/* 分享按钮样式 */
.sharing {
    margin: 2em 0;
    padding: 1em;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #2196F3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .book-summary {
        width: 100%;
        position: relative;
    }
    
    .book-body {
        margin-left: 0;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    h3 {
        font-size: 1.2em;
    }
}

/* 特殊效果 */
.highlight {
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    padding: 1em;
    border-radius: 0 6px 6px 0;
    margin: 1em 0;
}

.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    padding: 1em;
    border-radius: 0 6px 6px 0;
    margin: 1em 0;
}

.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    padding: 1em;
    border-radius: 0 6px 6px 0;
    margin: 1em 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-body .page-wrapper .page-inner section {
    animation: fadeIn 0.6s ease-out;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #2196F3;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1976D2;
} 