/* Custom CSS for Personal Website */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: 40px; /* 再缩小12px */
}

/* 面包屑导航样式 */
.breadcrumb {
    margin-bottom: 2rem !important; /* 增加面包屑的下边距 */
    background-color: transparent; /* 移除灰色背景 */
    padding: 0.75rem 0; /* 调整内边距 */
}

/* 项目主题面包屑导航颜色 */
.project-theme-warning .breadcrumb-item.active {
    color: #ffc107 !important; /* 黄色主题 */
}

.project-theme-info .breadcrumb-item.active {
    color: #17a2b8 !important; /* 蓝色主题 */
}

.project-theme-success .breadcrumb-item.active {
    color: #28a745 !important; /* 绿色主题 */
}

.project-theme-primary .breadcrumb-item.active {
    color: #0d6efd !important; /* 蓝色主题 */
}

.project-theme-danger .breadcrumb-item.active {
    color: #dc3545 !important; /* 红色主题 */
}

/* 🎨 超美 Markdown 样式 */
.markdown-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 标题样式 - 统一蓝色 */
.markdown-content h1 {
    color: #0d6efd; /* Bootstrap primary blue */
    font-size: 2.8rem;
    font-weight: 800;
    margin: 4rem 0 2rem 0; /* 进一步增加上边距，确保与面包屑有足够间距 */
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.markdown-content h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #0d6efd; /* Bootstrap primary blue */
    border-radius: 2px;
}

.markdown-content h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem 0;
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid #0d6efd; /* Bootstrap primary blue */
    background: linear-gradient(90deg, rgba(13, 110, 253, 0.1) 0%, transparent 100%);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.markdown-content h3 {
    color: #34495e;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem 0;
    position: relative;
    padding-left: 0.5rem;
}

.markdown-content h3::before {
    content: '';
    color: #3498db;
    margin-right: 0.5rem;
    font-size: 0.8em;
}

.markdown-content h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border-left: 3px solid #0d6efd; /* Bootstrap primary blue */
}

/* 段落样式 */
.markdown-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    color: #495057;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* 列表样式 - 超漂亮 */
.markdown-content ul {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;  /* 减少行间距 */
    column-gap: 1.5rem;  /* 减少列间距 */
}

.markdown-content ul li {
    margin: 0.4rem 0;  /* 减少外边距 */
    padding: 0.6rem 0.8rem;  /* 减少内边距 */
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 6px;  /* 稍微减小圆角 */
    border-left: 4px solid #0d6efd; /* Bootstrap primary blue */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.markdown-content ul li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.markdown-content ul li::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #3498db;
}

/* 响应式设计 - 小屏幕时单栏 */
@media (max-width: 768px) {
    .markdown-content ul,
    .markdown-content ol {
        grid-template-columns: 1fr;
        gap: 0.3rem;  /* 移动端更紧凑 */
        column-gap: 0;
    }
}

/* 项目主题颜色样式 */
.project-theme-warning h1 {
    color: #ffc107 !important; /* Bootstrap warning color */
}

.project-theme-warning h1::after {
    background: #ffc107 !important;
}

.project-theme-warning h2 {
    border-left-color: #ffc107 !important;
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%) !important;
}

.project-theme-warning h3 {
    border-left-color: #ffc107 !important;
}

.project-theme-warning ul li {
    border-left-color: #ffc107 !important;
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%) !important;
}

.project-theme-warning ol li {
    border-left-color: #ffc107 !important;
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%) !important;
}

.project-theme-warning ol li::before {
    background: #ffc107 !important;
}

.project-theme-warning a:hover {
    background: linear-gradient(90deg, #ffc107 0%, #ffecb3 100%) !important;
}

.project-theme-warning pre::before {
    background: linear-gradient(90deg, #ffc107 0%, #ffecb3 100%) !important;
}

.project-theme-warning th {
    background: linear-gradient(135deg, #ffc107 0%, #ffecb3 100%) !important;
}

.project-theme-warning hr {
    background: linear-gradient(90deg, #ffc107 0%, #ffecb3 100%) !important;
}

/* 有限体积法 - 蓝色主题 */
.project-theme-info h1 {
    color: #17a2b8 !important; /* Bootstrap info color */
}

.project-theme-info h1::after {
    background: #17a2b8 !important;
}

.project-theme-info h2 {
    border-left-color: #17a2b8 !important;
    background: linear-gradient(90deg, rgba(23, 162, 184, 0.1) 0%, transparent 100%) !important;
}

.project-theme-info h3 {
    border-left-color: #17a2b8 !important;
}

.project-theme-info ul li {
    border-left-color: #17a2b8 !important;
    background: linear-gradient(135deg, #e1f7fa 0%, #ffffff 100%) !important;
}

.project-theme-info ol li {
    border-left-color: #17a2b8 !important;
    background: linear-gradient(135deg, #e1f7fa 0%, #ffffff 100%) !important;
}

.project-theme-info ol li::before {
    background: #17a2b8 !important;
}

.project-theme-info a:hover {
    background: linear-gradient(90deg, #17a2b8 0%, #a3d5db 100%) !important;
}

.project-theme-info pre::before {
    background: linear-gradient(90deg, #17a2b8 0%, #a3d5db 100%) !important;
}

.project-theme-info th {
    background: linear-gradient(135deg, #17a2b8 0%, #a3d5db 100%) !important;
}

.project-theme-info hr {
    background: linear-gradient(90deg, #17a2b8 0%, #a3d5db 100%) !important;
}

/* 数值线性代数 - 绿色主题 */
.project-theme-success h1 {
    color: #28a745 !important; /* Bootstrap success color */
}

.project-theme-success h1::after {
    background: #28a745 !important;
}

.project-theme-success h2 {
    border-left-color: #28a745 !important;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.1) 0%, transparent 100%) !important;
}

.project-theme-success h3 {
    border-left-color: #28a745 !important;
}

.project-theme-success ul li {
    border-left-color: #28a745 !important;
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%) !important;
}

.project-theme-success ol li {
    border-left-color: #28a745 !important;
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%) !important;
}

.project-theme-success ol li::before {
    background: #28a745 !important;
}

.project-theme-success a:hover {
    background: linear-gradient(90deg, #28a745 0%, #b8e6b8 100%) !important;
}

.project-theme-success pre::before {
    background: linear-gradient(90deg, #28a745 0%, #b8e6b8 100%) !important;
}

.project-theme-success th {
    background: linear-gradient(135deg, #28a745 0%, #b8e6b8 100%) !important;
}

.project-theme-success hr {
    background: linear-gradient(90deg, #28a745 0%, #b8e6b8 100%) !important;
}

.markdown-content ol {
    margin: 1.5rem 0;
    padding-left: 0;
    counter-reset: custom-counter;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;  /* 与ul保持一致 */
    column-gap: 1.5rem;
}

.markdown-content ol li {
    margin: 0.4rem 0;  /* 与ul保持一致 */
    padding: 0.6rem 0.8rem 0.6rem 2.5rem;  /* 减少内边距 */
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border-radius: 6px;  /* 与ul保持一致 */
    border-left: 4px solid #0d6efd; /* Bootstrap primary blue */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    counter-increment: custom-counter;
    list-style: none; /* 隐藏默认的数字编号 */
    transition: all 0.3s ease;  /* 添加过渡效果 */
}

.markdown-content ol li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.markdown-content ol li::before {
    content: counter(custom-counter);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: #0d6efd; /* Bootstrap primary blue */
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* 强调文本 */
.markdown-content strong {
    color: #2c3e50;
    font-weight: 700;
    background: #f8f9fa;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.markdown-content em {
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* 链接样式 - 超炫 */
.markdown-content a {
    color: #3498db;
    text-decoration: none;
    position: relative;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, transparent 100%);
}

.markdown-content a:hover {
    color: #ffffff;
    background: #0d6efd; /* Bootstrap primary blue */
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 引用块 - 超美 */
.markdown-content blockquote {
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #3498db;
}

.markdown-content blockquote::before {
    content: '"';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-size: 4rem;
    color: #3498db;
    opacity: 0.3;
    font-family: serif;
}

/* 代码样式 - 超酷 */
.markdown-content code {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 代码块高亮样式 - Atom One Dark风格 */
.markdown-content .codehilite {
    background: #282c34;
    border: 1px solid #3e4451;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.markdown-content .codehilite pre {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    color: #d4d4d4;
}

.markdown-content .codehilite code {
    background: none;
    color: #d4d4d4;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 0.9rem;
    line-height: 1.6;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Courier New', monospace;
}

/* Atom One Dark主题的语法高亮颜色 */
.markdown-content .codehilite .c1 { color: #98c379; } /* 注释 - 绿色 */
.markdown-content .codehilite .k { color: #c678dd; } /* 关键字 - 紫色 */
.markdown-content .codehilite .nc { color: #e06c75; } /* 类名 - 红色 */
.markdown-content .codehilite .n { color: #e06c75; } /* 变量名 - 红色 */
.markdown-content .codehilite .o { color: #56b6c2; } /* 操作符 - 青色 */
.markdown-content .codehilite .kt { color: #c678dd; } /* 类型 - 紫色 */
.markdown-content .codehilite .w { color: #abb2bf; } /* 空白 - 浅灰色 */
.markdown-content .codehilite .p { color: #abb2bf; } /* 标点 - 浅灰色 */
.markdown-content .codehilite .s { color: #98c379; } /* 字符串 - 绿色 */
.markdown-content .codehilite .s2 { color: #98c379; } /* 字符串 - 绿色 */
.markdown-content .codehilite .nb { color: #e5c07b; } /* 内置函数 - 黄色 */
.markdown-content .codehilite .mi { color: #d19a66; } /* 数字 - 橙色 */
.markdown-content .codehilite .mf { color: #d19a66; } /* 浮点数 - 橙色 */
.markdown-content .codehilite .mh { color: #d19a66; } /* 十六进制 - 橙色 */
.markdown-content .codehilite .mo { color: #d19a66; } /* 八进制 - 橙色 */
.markdown-content .codehilite .na { color: #61afef; } /* 属性 - 蓝色 */
.markdown-content .codehilite .nf { color: #61afef; } /* 函数 - 蓝色 */
.markdown-content .codehilite .no { color: #c678dd; } /* 常量 - 紫色 */
.markdown-content .codehilite .nl { color: #e06c75; } /* 标签 - 红色 */
.markdown-content .codehilite .nn { color: #e06c75; } /* 命名空间 - 红色 */
.markdown-content .codehilite .nt { color: #e06c75; } /* 标签名 - 红色 */
.markdown-content .codehilite .nv { color: #e06c75; } /* 变量 - 红色 */
.markdown-content .codehilite .ow { color: #56b6c2; } /* 操作符 - 青色 */
.markdown-content .codehilite .bp { color: #e06c75; } /* 内置常量 - 红色 */
.markdown-content .codehilite .vc { color: #e06c75; } /* 变量类 - 红色 */
.markdown-content .codehilite .vg { color: #e06c75; } /* 变量全局 - 红色 */
.markdown-content .codehilite .vi { color: #e06c75; } /* 变量实例 - 红色 */
.markdown-content .codehilite .vm { color: #e06c75; } /* 变量模块 - 红色 */

/* 代码块标题 */
.markdown-content pre::before {
    content: attr(data-lang);
    display: block;
    background: #6c757d;
    color: white;
    padding: 0.5rem 1rem;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    border-radius: 8px 8px 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 行内代码 */
.markdown-content p code {
    background: #f1f3f4;
    color: #d73a49;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid #e1e4e8;
}

/* 移除重复的pre样式，使用上面的新样式 */

.markdown-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #0d6efd; /* Bootstrap primary blue */
    border-radius: 12px 12px 0 0;
}

.markdown-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* 表格样式 - 超专业 */
.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.markdown-content th {
    background: #0d6efd; /* Bootstrap primary blue */
    color: white;
    font-weight: 600;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.markdown-content td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.markdown-content tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

/* 分割线 - 简洁蓝白 */
.markdown-content hr {
    border: none;
    height: 2px;
    background: #0d6efd; /* Bootstrap primary blue */
    margin: 2rem 0;
    border-radius: 1px;
    position: relative;
}

.markdown-content hr::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 1rem;
    color: #3498db;
    font-size: 1.2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .markdown-content {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .markdown-content h1 {
        font-size: 2.2rem;
    }
    
    .markdown-content h2 {
        font-size: 1.6rem;
    }
    
    .markdown-content pre {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #007bff !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.profile-image {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Skills */
.skill-item {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef !important;
}

.skill-item:hover {
    border-color: #007bff !important;
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Badges */
.badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    border-radius: 15px;
}

/* Footer */
footer {
    margin-top: auto;
}

.social-links a {
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: #007bff !important;
    transform: scale(1.2);
}

/* Contact Form */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Resume Styles */
.border-dashed {
    border: 2px dashed #dee2e6 !important;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .profile-image i {
        font-size: 5rem !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Loading Animation */
.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); }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Contact Form Enhancements */
.contact-form {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 2rem;
}

/* Project Cards */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.project-card:hover::before {
    left: 100%;
}
