/* 自定义样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    font-size: 0.9rem; /* 全局缩小字体 */
}

/* 全局字体大小调整 */
h1, .h1 { font-size: 1.4rem !important; }
h2, .h2 { font-size: 1.2rem !important; }
h3, .h3 { font-size: 1.1rem !important; }
h4, .h4 { font-size: 1rem !important; }
h5, .h5 { font-size: 0.9rem !important; }
h6, .h6 { font-size: 0.8rem !important; }

/* 卡片标题字体调整 */
.card-title { font-size: 0.9rem !important; }
.card-text { font-size: 0.85rem !important; }

/* 按钮字体调整 */
.btn { font-size: 0.85rem !important; }

/* 导航链接字体调整 */
.nav-link { font-size: 0.9rem !important; }

/* 表单元素字体调整 */
.form-control, .form-select { font-size: 0.85rem !important; }
.form-label { font-size: 0.85rem !important; }

/* 表格字体调整 */
.table { font-size: 0.85rem !important; }

/* 列表字体调整 */
.list-group-item { font-size: 0.85rem !important; }

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.2rem;
}

/* 卡片样式 */
.pattern-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 10px;
}

.pattern-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border: none;
}

/* 渐变背景 */
.jumbotron {
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 2rem 1.5rem !important; /* 减少内边距，缩小高度 */
}

/* 英雄页面标题样式 */
.jumbotron h1 {
    font-size: 1.6rem !important; /* 进一步缩小标题字体 */
    color: #2c3e50 !important; /* 深色字体 */
    font-weight: 600;
}

/* 英雄页面副标题样式 */
.jumbotron .lead {
    font-size: 0.9rem !important; /* 进一步缩小副标题字体 */
    color: #34495e !important; /* 深色字体 */
    font-weight: 500;
}

/* 英雄页面描述文字样式 */
.jumbotron p:not(.lead) {
    font-size: 0.8rem !important; /* 进一步缩小描述文字字体 */
    color: #5d6d7e !important; /* 深色字体 */
    margin-bottom: 0.5rem;
}

/* 设计模式详情页面样式 */
.pattern-detail-page {
    font-size: 0.8rem; /* 进一步缩小整体字体大小 */
    
}

/* 设计模式详情页面英雄标题样式 */
.pattern-detail-page .card-header h1 {
    font-size: 1.3rem !important; /* 进一步缩小英雄标题字体 */
    font-weight: 600;
}

/* 设计模式详情页面副标题样式 */
.pattern-detail-page .card-header p {
    font-size: 0.8rem !important; /* 进一步缩小副标题字体 */
}

/* 设计模式详情页面描述文字样式 */
.pattern-detail-page .lead {
    font-size: 0.9rem !important; /* 进一步缩小描述文字字体 */
}

/* 设计模式详情页面卡片标题样式 */
.pattern-detail-page .card-header h5 {
    font-size: 0.9rem !important; /* 进一步缩小卡片标题字体 */
    font-weight: 600;
}

/* 设计模式详情页面代码块样式 */
.pattern-detail-page pre {
    font-size: 0.7rem !important; /* 进一步缩小代码字体 */
    line-height: 1.4;
}

/* 设计模式详情页面段落文字样式 */
.pattern-detail-page .card-body p {
    font-size: 0.8rem !important; /* 进一步缩小段落文字字体 */
    line-height: 1.5;
}

/* 源代码标签页样式 */
.pattern-detail-page .nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 0;
}

.pattern-detail-page .nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.pattern-detail-page .nav-tabs .nav-link:hover {
    border-color: transparent;
    border-bottom-color: #007bff;
    color: #007bff;
}

.pattern-detail-page .nav-tabs .nav-link.active {
    color: #007bff;
    background-color: transparent;
    border-color: transparent;
    border-bottom-color: #007bff;
    font-weight: 600;
}

/* 代码块样式 */
.pattern-detail-page pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
    font-size: 0.7rem !important;
    line-height: 1.4;
}

.pattern-detail-page code {
    background-color: transparent;
    color: #212529;
    font-family: 'Courier New', Courier, monospace;
}

/* 语言图标样式 */
.pattern-detail-page .fab {
    font-size: 0.9rem;
}

.pattern-detail-page .fa-java {
    color: #ed8b00;
}

.pattern-detail-page .fa-python {
    color: #3776ab;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 代码块样式 */
pre {
    background-color: #2d3748;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 练习卡片样式 */
.exercise-card {
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.exercise-card:hover {
    box-shadow: 0 4px 15px rgba(0,123,255,0.1);
}

/* 答案解释样式 */
.answer-explanation {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单样式 */
.form-check {
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-check:hover {
    background-color: #f8f9fa;
}

.form-check-input:checked + .form-check-label {
    color: #007bff;
    font-weight: 600;
}

/* 面包屑导航样式 */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    font-weight: bold;
}

/* 页脚样式 */
footer {
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .jumbotron h1 {
        font-size: 1.4rem !important; /* 移动端进一步缩小 */
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        border-radius: 8px !important;
    }
    
    /* 移动端全局字体调整 */
    body { font-size: 0.85rem !important; }
    .card-title { font-size: 0.85rem !important; }
    .card-text { font-size: 0.8rem !important; }
    .btn { font-size: 0.8rem !important; }
}

/* 打印样式 */
@media print {
    .navbar, .btn, footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    pre {
        background-color: #f8f9fa !important;
        color: #212529 !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 10px 10px 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 10px 10px;
}
