/*
Theme Name: SafeJasmine
Theme URI: https://your-blog-url.com
Author: Gemini
Version: 1.0
Description: A safe and clean theme inspired by Jasmine's style.
*/

/* Font Definition */
body {
    /* Noto Sans SC for body text, with fallbacks */
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .post-title a {
    /* Montserrat for all titles */
    font-family: 'Montserrat', "Noto Sans SC", sans-serif;
    font-weight: 700; /* Use the bold version for titles */
}

/* Code Fonts */
code, pre {
    font-family: 'JetBrains Mono', "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color: #333;
}

.main-content-inner, .sidebar-inner {
    padding-top: 1rem; /* Space for sticky headers/sidebars */
}

/* Adjust sticky top for sidebars */
.sidebar-inner.sticky-top {
    top: 80px; /* Adjust based on your header height */
}

/* Post Cards */
.post-card, .card {
    border: 1px solid #f0f0f0; /* 更浅的边框 */
    border-radius: 8px; /* 更圆润的边角 */
    box-shadow: 0 2px 4px rgba(0,0,0,.05); /* 更柔和的阴影 */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.post-card:hover, .card:hover {
    transform: translateY(-5px); /* 鼠标悬停时轻微上浮 */
    box-shadow: 0 4px 12px rgba(0,0,0,.1); /* 更明显的阴影 */
}

.post-title a {
    text-decoration: none;
    color: #212529;
}

.post-title a:hover {
    color: #007bff;
}

.post-meta {
    font-size: 0.85rem;
}

.post-content p {
    line-height: 1.7;
}

/* Full Post */
.post-full .post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-full .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Code Blocks Styling */
pre {
    padding: 1rem;
    margin: 1rem 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.9em;
    overflow-x: auto;
}

code {
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #d63384;
    word-wrap: break-word;
}

pre code {
    color: inherit;
}


/* Comments Section */
#comments {
    margin-top: 2rem;
}

pre {
    position: relative; /* Required for button positioning */
}

.copy-code-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

pre:hover .copy-code-button {
    opacity: 1;
}

/* Dark Mode Styles */
[data-bs-theme="dark"] {
    background-color: #212529;
    color: #dee2e6;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #343a40 !important;
}

[data-bs-theme="dark"] .card {
    background-color: #343a40;
    border-color: #495057;
}

[data-bs-theme="dark"] .post-title a {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .post-title a:hover {
    color: #0d6efd;
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .border-top {
    border-color: #495057 !important;
}

[data-bs-theme="dark"] pre {
    background-color: #2b2b2b;
    border-color: #495057;
}

/* --- Dark Mode FIX --- */
[data-bs-theme="dark"] body.bg-light {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #343a40;
    border-color: #495057;
}

[data-bs-theme="dark"] .list-group-item a {
    color: #dee2e6;
}

[data-bs-theme="dark"] .list-group-item a:hover {
    color: #0d6efd;
}

[data-bs-theme="dark"] .form-control {
    background-color: #495057;
    border-color: #6c757d;
    color: #f8f9fa;
}

/* Comment Section Dark Mode */
[data-bs-theme="dark"] #comments .comment-list {
    background-color: transparent;
}

[data-bs-theme="dark"] #comments .comment-body {
    background: #343a40;
    border: 1px solid #495057;
}

[data-bs-theme="dark"] #comments cite, [data-bs-theme="dark"] #comments cite a {
    color: #f8f9fa;
    font-weight: bold;
}

[data-bs-theme="dark"] #comments .comment-meta {
    color: #adb5bd;
}

[data-bs-theme="dark"] #comment-form textarea,
[data-bs-theme="dark"] #comment-form input[type="text"] {
    background-color: #212529;
    color: #dee2e6;
    border-color: #495057;
}

[data-bs-theme="dark"] #comment-form label {
    color: #dee2e6;
}

/* 返回按钮 */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 99;
    width: 40px;
    height: 40px;
    line-height: 28px;
    font-size: 1.5rem;
}