body {
    background-color: #e0f7fa; /* 设置背景颜色为浅蓝色 */
}

.code-runner {
    padding: 20px;
    margin: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.code-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#code-input {
    width: 100%;
    height: 300px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #2d2d2d;
    color: #fff;
    resize: vertical;
}

.code-editor button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.code-editor button:hover {
    background: #0056b3;
}

.code-editor button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#code-output {
    min-height: 100px;
    padding: 15px;
    background: #2d2d2d;
    color: #fff;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
}

.code-snippets {
    padding: 20px;
    margin: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.snippet-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.snippet {
    background: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.snippet pre {
    background: #2d2d2d;
    color: #fff;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

.learning-resources, .projects {
    padding: 20px;
    margin: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.resource-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.resource-links a {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.resource-links a:hover {
    background: #0056b3;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.project-link {
    display: inline-block;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
}

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

.online-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.platform-link {
    display: block;
    padding: 20px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.platform-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.platform-link h3 {
    color: #007bff;
    margin: 0 0 10px 0;
}

.platform-link p {
    margin: 0;
    color: #666;
}

/* 代码块基本样式 */
pre {
    position: relative;
    padding-top: 35px;
    padding-bottom: 35px;
    margin-bottom: 20px;
    background: #2d2d2d;
    border-radius: 4px;
    overflow: hidden;
}

pre code {
    display: block;
    overflow-x: auto;
    color: #fff;
    font-family: 'Consolas', monospace;
    line-height: 1.5;
}

/* 短代码块样式 */
pre.short-code {
    max-height: none;
    display: inline-block;
    margin-right: 15px;
}

/* 按钮样式 */
.copy-button, .toggle-button {
    position: absolute;
    padding: 3px 8px;
    font-size: 12px;
    background-color: #4ca3e0;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    z-index: 10;
}

.copy-button {
    top: 5px;
    right: 5px;
}

.toggle-button {
    bottom: 5px;
    right: 5px;
}

.copy-button:hover, .toggle-button:hover {
    background-color: #3a8cc1;
}

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

pre::-webkit-scrollbar-track {
    background: #3a3a3a;
}

pre::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* 时间线样式 */
.history-section {
    padding: 30px;
    margin: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: #4ca3e0;
    top: 0;
    bottom: 0;
    left: 30px;
    margin-left: -3px;
    border-radius: 3px;
}

.timeline-item {
    padding: 10px 40px 10px 60px;
    position: relative;
    background-color: inherit;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 30px;
    background-color: white;
    border: 4px solid #4ca3e0;
    top: 50%;
    border-radius: 50%;
    z-index: 1;
    margin-left: -14px;
    margin-top: -10px;
    transform: translateY(-50%);
}

.timeline-date {
    font-weight: bold;
    color: #4ca3e0;
    margin-bottom: 5px;
    font-size: 18px;
    margin-left: -10px;
    padding-top: 10px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: white;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-left: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.timeline-content:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.timeline-content h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
}

.timeline-content p {
    margin-bottom: 0;
    line-height: 1.6;
    color: #666;
}

/* 响应式设计 */
@media screen and (max-width: 600px) {
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        padding-left: 70px;
    }
    
    .timeline-item::after {
        left: 30px;
    }
}

/* C++函数讲解卡片样式 */
.cpp-functions {
    padding: 40px 0;
    background-color: #f9f9f9;
}

.section-desc {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.function-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
    gap: 10px;
}

.category-btn {
    padding: 8px 16px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background-color: #e0e0e0;
}

.category-btn.active {
    background-color: #0077cc;
    color: white;
}

.functions-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 35px;
    padding: 0 20px;
}

.function-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 450px; /* 设置最小高度，保持卡片高度一致 */
}

.function-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.function-header {
    background-color: #0077cc;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.function-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.function-tag {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.function-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.function-desc {
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

.function-syntax {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.function-syntax code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
    white-space: pre-wrap;
}

.function-example {
    margin-bottom: 20px;
}

.function-example pre {
    background-color: #282a36;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0;
}

.function-example code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.function-notes {
    background-color: #fffde7;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #ffd600;
    margin-top: 10px;
}

.function-notes p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
}

.function-library {
    background-color: #e3f2fd;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: 500;
    color: #0d47a1;
    border-left: 4px solid #2196f3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .functions-container {
        grid-template-columns: 1fr;
    }
    
    .function-categories {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .category-btn {
        flex-shrink: 0;
    }
} 