/* ==========================================================================
   博客主样式文件 - 转换自Jekyll SCSS
   ========================================================================== */

/* 变量定义 */
:root {
    /* Colors via Solarized */
    --c-base-03: #0D2B35;
    --c-base-02: #163541;
    --c-base-01: #5C6E74;
    --c-base-00: #697B82;
    --c-base-0: #869395;
    --c-base-1: #96A0A0;
    --c-base-2: #EDE7D6;
    --c-base-3: #FCF5E4;
    
    --c-accent-blue: #0067FB;
    --c-accent-green: #8BE367;
    
    /* Theme colors */
    --dark-theme-background: #1a1a1a;
    --dark-theme-text: #d8d8d8;
    --dark-theme-link: #58a6ff;
    --dark-theme-link-hover: #81a2ff;
    --dark-theme-button-bg: #4a4a4a;
    --dark-theme-button-border: #333;
    --dark-theme-code-bg: #282c34;
    --dark-theme-header-footer-bg: #111;
    
    /* Breakpoints */
    --bp-sm: 45rem; /* 450px */
    
    /* Spacing */
    --spacing-unit: 30px;
    
    /* Borders */
    --m-border: 1px solid var(--c-base-2);
    
    /* Transitions */
    --transition-time: 0.5s;
    --transition-effect: linear;
}

/* ==========================================================================
   Reset和基础样式
   ========================================================================== */

/* Reset */
body, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
dl, dd, ol, ul, figure {
    margin: 0;
    padding: 0;
}

/* 基础样式 */
html {
    font-size: 57%; /* 使1rem = 5.7px，与原版Jekyll一致 */
    min-height: 100%;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inconsolata', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'STHeiti', 'WenQuanYi Micro Hei', 'Droid Sans Fallback', 'SimSun', monospace;
    font-size: 1.8rem; /* 18px */
    line-height: 1.55;
    font-weight: 350; /* 统一修改为350 */
    color: #333333;
    background-color: #f5f5f5;
    -webkit-text-size-adjust: 100%;
    transition: background-color 0.3s linear, color 0.3s linear;
    -webkit-font-smoothing: antialiased;
}

/* 中文字符优化 */
body, p, h1, h2, h3, h4, h5, h6, li, td, th {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 垂直间距 - 与原版Jekyll一致 */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure {
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
}

/* 图片 */
img {
    max-width: 100%;
    vertical-align: middle;
}

.img-responsive {
    clear: both;
    margin: 0 auto;
    display: block;
    box-shadow: 0px 1px 4px rgba(0,0,0,0.3), 0 0 40px rgba(0,0,0,0.1) inset;
}

figure > img {
    display: block;
}

figcaption {
    font-size: 1.6rem;
}

/* 列表 */
ul, ol {
    margin-left: var(--spacing-unit);
}

li > ul,
li > ol {
    margin-bottom: 0;
}

/* 标题 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 350; /* 统一修改为350 */
}

/* 链接 */
a {
    color: var(--c-accent-blue);
    text-decoration: none;
}

a:visited {
    color: var(--c-accent-blue); /* 访问过的链接保持与普通链接相同的颜色 */
}

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

/* 引用块 */
blockquote {
    color: var(--c-base-01);
    border-left: 4px solid var(--c-base-2);
    padding-left: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
    font-size: 1.8rem;
    letter-spacing: -1px;
    font-style: italic;
    margin-left: 0;
    margin-right: 0;
}

blockquote > :last-child {
    margin-bottom: 0;
}

/* 代码格式 - GitHub风格 */
pre, code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
    font-size: 1.4rem;
    border-radius: 6px;
}

code {
    padding: 2px 6px;
    background-color: rgba(175, 184, 193, 0.2);
    border: 1px solid rgba(175, 184, 193, 0.4);
    font-size: 1.3rem;
}

pre {
    padding: 16px;
    overflow-x: auto;
    font-size: 1.4rem;
    line-height: 1.45;
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
}

pre > code {
    border: 0;
    padding: 0;
    background-color: transparent;
    font-size: inherit;
}

/* MathJax数学公式样式 */
.MathJax {
    font-size: 1.1em !important;
}

/* 行间公式居中显示 */
.MathJax_Display {
    text-align: center !important;
    margin: 1em 0 !important;
}

/* 确保数学公式不会被截断 */
.MathJax_Display,
.MathJax {
    overflow-x: auto;
    overflow-y: hidden;
}

/* 彩虹色标题样式 - 静态红到紫色均布 */
/* 已废弃，现在使用金色下划线样式 */

/* 深色主题下的彩虹色标题 */
/* 已废弃，现在使用金色下划线样式 */

/* 登录后的金色下划线标题样式 */
.logged-in-title {
    position: relative;
    display: inline-block;
}

.logged-in-title::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700); /* 金色渐变下划线 */
    border-radius: 2px;
}

/* 深色主题下的登录标题样式 */
html.dark-theme .logged-in-title::after {
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700); /* 深色主题下也使用金色 */
}

/* ==========================================================================
   文章页面布局
   ========================================================================== */

/* 文章容器 */
.post-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 左侧目录 */
.post-toc {
    display: none; /* 隐藏目录 */
    flex: 0 0 180px; /* 减小宽度为180px，避免过宽 */
    background: #f8f9fa;
    border-radius: 5px;
    padding: 1rem;
    align-self: flex-start;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto; /* 独立滚动 */
    border: 1px solid #e1e4e8;
}

/* 深色主题下的目录 */
html.dark-theme .post-toc {
    background: #2d2d2d;
    border: 1px solid #515862;
}

/* 目录头部 */
.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e1e4e8;
}

/* 深色主题下的目录头部 */
html.dark-theme .toc-header {
    border-bottom-color: #515862;
}

.toc-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--c-base-01);
}

/* 深色主题下的目录标题 */
html.dark-theme .toc-header h3 {
    color: #d8d8d8;
}

/* 目录切换按钮 */
.toc-toggle {
    background: none;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--c-base-01);
}

/* 深色主题下的目录切换按钮 */
html.dark-theme .toc-toggle {
    border-color: #30363d;
    color: #d8d8d8;
}

.toc-toggle:hover {
    background-color: #eaecef;
}

/* 深色主题下的目录切换按钮悬停 */
html.dark-theme .toc-toggle:hover {
    background-color: #30363d;
}

/* 目录列表 */
.toc-list {
    font-size: 1.2rem; /* 减小字体大小 */
}

/* 目录列表样式 */
.toc-list ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.toc-list li {
    margin: 0.1rem 0; /* 进一步减小行间距 */
    padding: 0;
}

.toc-list a {
    display: block;
    padding: 0.1rem 0.3rem; /* 进一步减小内边距 */
    color: var(--c-base-01);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2; /* 减小行高 */
}

/* 深色主题下的目录链接 */
html.dark-theme .toc-list a {
    color: #d8d8d8;
}

.toc-list a:hover {
    background-color: #e1e4e8;
    color: var(--c-accent-blue);
    text-decoration: none;
}

/* 深色主题下的目录链接悬停 */
html.dark-theme .toc-list a:hover {
    background-color: #30363d;
    color: #58a6ff;
}

/* 不同级别的目录项 */
.toc-list li.level-1 > a {
    font-weight: bold;
    padding-left: 0.5rem;
}

.toc-list li.level-2 > a {
    padding-left: 1rem;
}

.toc-list li.level-3 > a {
    padding-left: 1.5rem;
}

.toc-list li.level-4 > a {
    padding-left: 2rem;
}

.toc-list li.level-5 > a {
    padding-left: 2.5rem;
}

.toc-list li.level-6 > a {
    padding-left: 3rem;
}

/* 主文章内容 */
.c-article {
    flex: 1;
    min-width: 0; /* 允许内容区域收缩 */
}

/* 响应式设计 - 小屏幕设备 */
@media screen and (max-width: 768px) {
    .post-container {
        flex-direction: column;
    }
    
    .post-toc {
        display: none; /* 隐藏目录 */
        flex: 0 0 auto;
        position: relative;
        top: 0;
        max-height: none;
        order: 2; /* 目录放在文章内容之后 */
        width: 100%;
    }
    
    .c-article {
        order: 1; /* 文章内容放在前面 */
    }
}

/* ==========================================================================
   编辑器样式
   ========================================================================== */

/* 编辑器容器 */
.editor-container {
    /* 置顶布局，占满整个视口 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5 !important; /* 与博客整体风格一致的浅色背景 */
}

/* 深色主题下的编辑器容器 */
/* 深色主题下的编辑器容器 */
html.dark-theme .editor-container {
    background-color: #1a1a1a !important; /* 与博客整体风格一致的深色背景 */
}

/* 工具栏 */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--c-base-2);
    border-bottom: var(--m-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toolbar-left .editor-title {
    margin: 0;
    font-size: 2rem;
    color: var(--c-base-01);
}

.toolbar-right {
    display: flex;
    gap: 1rem;
}

/* 编辑器主体 */
.editor-main {
    display: flex;
    flex: 1;
    /* 回到固定高度，只显示一屏 */
    height: 0; /* 让flex生效 */
    /* 左右留出间距 */
    padding: 0 1rem;
    gap: 1rem; /* 中间间距 */
}

/* 编辑窗格和预览窗格 */
.editor-pane {
    flex: 1; /* 各占半屏 */
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden; /* 防止内容溢出 */
}

.preview-pane {
    flex: 1; /* 各占半屏 */
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden; /* 防止内容溢出 */
}

/* 窗格标题栏 */
.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--c-base-2);
    border-bottom: var(--m-border);
}

.pane-header h3 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--c-base-01);
}

.pane-tools {
    display: flex;
    gap: 0.5rem;
}

/* 工具按钮 */
.tool-btn {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--c-base-1);
    background-color: white;
    color: var(--c-base-01);
    cursor: pointer;
    border-radius: 3px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background-color: var(--c-base-2);
    color: var(--c-base-00);
}

/* 编辑器区域（包含目录和编辑器） */
.editor-with-toc {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 目录容器 */
.toc-container {
    display: none; /* 隐藏目录 */
    width: 180px; /* 减小宽度为180px */
    min-width: 150px;
    max-width: 180px; /* 限制最大宽度 */
    border-right: 1px solid #e1e4e8;
    background-color: #f6f8fa;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto; /* 独立滚动 */
}

/* 深色主题下的目录容器 */
html.dark-theme .toc-container {
    background-color: #161b22;
    border-right-color: #30363d;
}

/* 目录头部 */
.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e1e4e8;
    background-color: #f6f8fa;
}

/* 深色主题下的目录头部 */
html.dark-theme .toc-header {
    background-color: #161b22;
    border-bottom-color: #30363d;
}

.toc-header h4 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--c-base-01);
}

/* 深色主题下的目录标题 */
html.dark-theme .toc-header h4 {
    color: #d8d8d8;
}

/* 目录切换按钮 */
.toc-toggle {
    background: none;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--c-base-01);
}

/* 深色主题下的目录切换按钮 */
html.dark-theme .toc-toggle {
    border-color: #30363d;
    color: #d8d8d8;
}

.toc-toggle:hover {
    background-color: #eaecef;
}

/* 深色主题下的目录切换按钮悬停 */
html.dark-theme .toc-toggle:hover {
    background-color: #30363d;
}

/* 目录列表 */
.toc-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    font-size: 1.2rem; /* 减小字体大小 */
}

/* 目录折叠状态 */
.toc-list.collapsed {
    display: none;
}

/* 目录列表样式 */
.toc-list ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.toc-list li {
    margin: 0.1rem 0; /* 进一步减小行间距 */
    padding: 0;
}

.toc-list a {
    display: block;
    padding: 0.1rem 0.3rem; /* 进一步减小内边距 */
    color: var(--c-base-01);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2; /* 减小行高 */
}

/* 深色主题下的目录链接 */
html.dark-theme .toc-list a {
    color: #d8d8d8;
}

.toc-list a:hover {
    background-color: #e1e4e8;
    color: var(--c-accent-blue);
    text-decoration: none;
}

/* 深色主题下的目录链接悬停 */
html.dark-theme .toc-list a:hover {
    background-color: #30363d;
    color: #58a6ff;
}

/* 不同级别的目录项 */
.toc-list li.level-1 > a {
    font-weight: bold;
    padding-left: 0.5rem;
}

.toc-list li.level-2 > a {
    padding-left: 1rem;
}

.toc-list li.level-3 > a {
    padding-left: 1.5rem;
}

.toc-list li.level-4 > a {
    padding-left: 2rem;
}

.toc-list li.level-5 > a {
    padding-left: 2.5rem;
}

.toc-list li.level-6 > a {
    padding-left: 3rem;
}

/* 编辑器分隔线 */
.editor-separator {
    width: 1px;
    background-color: #e1e4e8;
}

/* 深色主题下的分隔线 */
html.dark-theme .editor-separator {
    background-color: #30363d;
}

/* Markdown编辑器 */
.markdown-textarea {
    flex: 1;
    padding: 2rem;
    border: none;
    resize: none;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
    font-size: 1.4rem;
    line-height: 1.6;
    background-color: white;
    outline: none;
    /* 恢复滚动条，只显示一屏 */
    overflow-y: auto;
}

/* 预览内容 */
.preview-content {
    flex: 1;
    padding: 2rem;
    background-color: white;
    /* 恢复滚动条，只显示一屏 */
    overflow-y: auto;
}

.preview-loading,
.preview-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--c-base-01);
    font-style: italic;
}

.preview-error {
    color: #d73a49;
}

/* 状态栏 */
.editor-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background-color: var(--c-base-2);
    border-top: var(--m-border);
    font-size: 1.3rem;
    color: var(--c-base-01);
}

.status-left {
    display: flex;
    gap: 2rem;
}

.status-right {
    font-weight: 500;
}

/* 保存状态样式 */
.status-dirty {
    color: #d73a49;
}

.status-saving {
    color: #fd7e14;
}

.status-clean {
    color: #28a745;
}

.status-error {
    color: #d73a49;
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--c-base-1);
    background-color: white;
    color: var(--c-base-01);
    text-decoration: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.4rem;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--c-base-2);
    color: var(--c-base-00);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-save {
    background-color: #28a745; /* 绿色，表示保存操作 */
    color: white;
    border-color: #28a745;
    font-weight: 500;
}

.btn-save:hover:not(:disabled) {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-cancel {
    background-color: #6c757d; /* 灰色，表示取消操作 */
    color: white !important; /* 强制白色文字 */
    border-color: #6c757d;
    font-weight: 500;
}

.btn-cancel:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: white !important; /* 悬停时保持白色文字 */
}

/* 关闭按钮特殊样式 */
.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d; /* 灰色，与取消按钮保持一致 */
    cursor: pointer;
    z-index: 1001;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background-color: rgba(108, 117, 125, 0.1); /* 灰色背景 */
    color: #495057; /* 深灰色文字 */
}

.btn-edit {
    background-color: #007bff; /* 使用更专业的蓝色 */
    color: white !important; /* 强制白色文字 */
    border-color: #007bff;
    font-size: 1.4rem; /* 增大字体 */
    padding: 0.6rem 1.2rem; /* 增加内边距 */
    border-radius: 6px; /* 更圆润的边角 */
    font-weight: 500; /* 稍微加粗 */
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2); /* 添加阴影效果 */
    transition: all 0.3s ease; /* 平滑过渡效果 */
}

.btn-edit:hover {
    background-color: #0069d9; /* 悬停时更深的蓝色 */
    border-color: #0062cc;
    color: white !important; /* 悬停时保持白色文字 */
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3); /* 悬停时增强阴影 */
    transform: translateY(-2px); /* 轻微上移效果 */
}

/* 编辑按钮在文章标题旁的样式 */
.c-article__actions {
    margin-top: 1rem;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: white;
    font-size: 1.4rem;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background-color: #28a745;
}

.notification-error {
    background-color: #dc3545;
}

.notification-info {
    background-color: #17a2b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .editor-main {
        flex-direction: column;
        padding: 0 0.5rem;
        gap: 0.5rem;
    }
    
    .editor-pane,
    .preview-pane {
        flex: 1;
        min-height: 45vh; /* 移动设备上各占一半高度 */
    }
    
    .toolbar-left .editor-title {
        font-size: 1.6rem;
    }
    
    .toolbar-right {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 1.2rem;
    }
    
    .markdown-textarea,
    .preview-content {
        padding: 1rem;
    }
    
    /* 移动端隐藏目录 */
    .toc-container {
        display: none;
    }
    
    .editor-with-toc {
        flex-direction: column;
    }
    
    .editor-separator {
        width: 100%;
        height: 1px;
    }
}

/* 暗色主题下的编辑器样式 */
[data-theme="dark"] .editor-container {
    background-color: #1a1a1a !important;
}

[data-theme="dark"] .editor-toolbar,
[data-theme="dark"] .pane-header,
[data-theme="dark"] .editor-status {
    background-color: var(--dark-theme-header-footer-bg);
    border-color: #333;
}

[data-theme="dark"] .toolbar-left .editor-title,
[data-theme="dark"] .pane-header h3,
[data-theme="dark"] .editor-status {
    color: var(--dark-theme-text);
}

[data-theme="dark"] .editor-pane,
[data-theme="dark"] .preview-pane {
    background-color: var(--dark-theme-background);
    border-color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .markdown-textarea,
[data-theme="dark"] .preview-content {
    background-color: var(--dark-theme-background);
    color: var(--dark-theme-text);
}

[data-theme="dark"] .tool-btn,
[data-theme="dark"] .btn:not(.btn-edit) {
    background-color: var(--dark-theme-button-bg);
    border-color: var(--dark-theme-button-border);
    color: var(--dark-theme-text);
}

[data-theme="dark"] .btn:hover:not(.btn-save):not(.btn-cancel):not(.btn-edit) {
    background-color: #555;
}

/* 暗色主题下的关闭按钮 */
[data-theme="dark"] .btn-close {
    color: #adb5bd; /* 暗色主题下的灰色 */
}

[data-theme="dark"] .btn-close:hover {
    background-color: rgba(108, 117, 125, 0.2); /* 暗色主题下的灰色背景 */
    color: #f8f9fa; /* 暗色主题下的白色文字 */
}

/* 光标同步高亮样式 */
.cursor-highlight {
    background-color: rgba(0, 103, 251, 0.15);
    border-left: 4px solid var(--c-accent-blue);
    transition: all 0.3s ease;
    animation: highlightFadeOut 1s ease-out forwards;
}

@keyframes highlightFadeOut {
    0% {
        background-color: rgba(0, 103, 251, 0.25);
        border-left-color: var(--c-accent-blue);
    }
    100% {
        background-color: transparent;
        border-left-color: transparent;
    }
}

/* 暗色主题下的高亮样式 */
[data-theme="dark"] .cursor-highlight {
    background-color: rgba(88, 166, 255, 0.15);
    border-left-color: var(--dark-theme-link);
}

/* 深色主题下的数学公式样式 */
body.dark-theme .MathJax {
    color: #d8d8d8 !important;
}

body.dark-theme .MathJax_Display {
    color: #d8d8d8 !important;
}

/* ==========================================================================
   布局组件
   ========================================================================== */

/* 容器 */
.u-container {
    max-width: calc(800px - (var(--spacing-unit) * 2));
    margin-right: auto;
    margin-left: auto;
    margin-top: calc(var(--spacing-unit) * 2); /* 60px - 页面上边距设置为2倍 */
    padding-right: var(--spacing-unit);
    padding-left: var(--spacing-unit);
    /* 移除额外的内边距，与Jekyll版本保持一致 */
}

@media screen and (max-width: 800px) {
    .u-container {
        max-width: calc(800px - var(--spacing-unit));
        margin-top: calc(var(--spacing-unit) * 2); /* 60px - 响应式设计下保持相同的上边距 */
        padding-right: calc(var(--spacing-unit) / 2);
        padding-left: calc(var(--spacing-unit) / 2);
    }
}

/* 清除浮动 */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   页面组件
   ========================================================================== */

/* 文章归档 - 调整间距与Jekyll保持一致 */
.c-archives {
    margin-bottom: calc(var(--spacing-unit) * 2); /* 60px - 与Jekyll保持一致 */
}

.c-archives__year {
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
    line-height: 1.2; /* 调整行高以与头部保持一致 */
    font-size: 3.2rem; /* 32px */
    font-weight: 350; /* 统一修改为350 */
    color: var(--c-base-02);
}

.c-archives__list {
    margin-bottom: var(--spacing-unit); /* 30px - 增加列表与下一年份的间距 */
    list-style: none;
    margin-left: 0;
}

.c-archives__item {
    padding-top: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
    padding-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
    border-top: 1px solid #DADDE1;
    margin-bottom: 0; /* 移除多余的底部外边距 */
}

@media screen and (min-width: 45rem) {
    .c-archives__item {
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-box-pack: justify;
        -webkit-justify-content: space-between;
        -ms-flex-pack: justify;
        justify-content: space-between;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
    }
}

.c-archives__item h3 a {
    color: var(--c-accent-blue); /* 保持蓝色 */
    text-decoration: none;
}

.c-archives__item h3 a:hover {
    color: var(--c-accent-blue); /* 鼠标悬停时保持蓝色不变 */
    text-decoration: none; /* 鼠标悬停时不加下划线 */
}

.c-archives__item h3 a:visited {
    color: var(--c-accent-blue); /* 访问过的链接保持蓝色 */
}

.c-archives__item h3 {
    line-height: 1.5; /* 恢复标准行高 */
    font-size: 1.8rem;
    margin-bottom: 0;
    font-weight: 350; /* 统一修改为350 */
}

.c-archives__item p {
    line-height: 1.5; /* 恢复标准行高 */
    font-size: 1.8rem;
    color: #515862;
    margin-bottom: 0;
}

/* 文章样式 */
.c-article {
    margin-bottom: 10rem;
}

.c-article__header {
    margin-bottom: var(--spacing-unit); /* 30px - 与Jekyll标准一致 */
}

@media screen and (min-width: 45rem) {
    .c-article__header {
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-box-pack: justify;
        -webkit-justify-content: space-between;
        -ms-flex-pack: justify;
        justify-content: space-between;
        -webkit-box-align: baseline;
        -webkit-align-items: baseline;
        -ms-flex-align: baseline;
        align-items: baseline;
    }
}

.c-article__title {
    line-height: 1.5;
    font-size: 3.2rem;
    color: var(--c-base-02);
}

.c-article__title a {
    color: var(--c-accent-blue); /* 保持蓝色 */
    text-decoration: none;
}

.c-article__title a:hover {
    color: var(--c-accent-blue); /* 文章标题鼠标悬停时保持蓝色不变 */
    text-decoration: none; /* 不加下划线 */
}

.c-article__title a:visited {
    color: var(--c-accent-blue); /* 访问过的文章标题保持蓝色 */
}

.c-article__time {
    line-height: 1.55;
    font-size: 1.8rem;
    color: var(--c-base-01);
}

.c-article__main {
    margin-bottom: var(--spacing-unit); /* 30px - 与Jekyll标准一致 */
    line-height: 1.55;
    font-size: 1.8rem;
    color: var(--c-base-01);
}

.c-article__main > * {
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
}

.c-article__main h2 {
    line-height: 1.5;
    font-size: 2.4rem;
}

.c-article__main h3 {
    line-height: 1.5;
    font-size: 2rem;
}

.c-article__main h4 {
    line-height: 1.6;
    font-size: 1.8rem;
}

.c-article__main h5 {
    line-height: 1.55;
    font-size: 1.8rem;
}

.c-article__main strong {
    color: var(--c-base-02);
    font-weight: 350; /* 统一修改为350 */
}

.c-article__main blockquote {
    border-left: 1px solid #DADDE1;
}

.c-article__main ul,
.c-article__main ol {
    margin-left: 2.1rem;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 0.5rem;
    border: 1px solid #DADDE1;
    text-align: left;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 350; /* 统一修改为350 */
}

/* 语法高亮 - GitHub风格支持行号 */
.highlight {
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
    overflow-x: auto;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    position: relative;
}

.highlight pre {
    background-color: transparent;
    border: none;
    margin: 0;
    padding: 16px;
    font-size: 1.4rem;
    line-height: 1.45;
    overflow-x: visible; /* 允许行号区域可见 */
}

.highlight code {
    background-color: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
}

/* 行号表格样式调整 */
.highlight table {
    margin: 0;
    border: none;
}

/* ==========================================================================
   深色主题
   ========================================================================== */

/* 支持HTML根元素和body元素的主题类 */
html.dark-theme,
body.dark-theme {
    background-color: var(--dark-theme-background);
    color: var(--dark-theme-text);
}

/* 为HTML根元素添加过渡效果 */
html {
    transition: background-color 0.3s linear, color 0.3s linear;
}

html.dark-theme .c-article__main,
body.dark-theme .c-article__main {
    color: #999999;
    opacity: 0.9;
}

html.dark-theme h1,
html.dark-theme h2,
html.dark-theme h3,
html.dark-theme h4,
html.dark-theme h5,
html.dark-theme h6,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
    color: #fff;
    opacity: 0.9;
}

body.dark-theme .c-archives__list .c-archives__item {
    border-top: 1px solid #515862;
}

body.dark-theme img {
    filter: brightness(0.8) saturate(1.25);
}

body.dark-theme a {
    color: var(--dark-theme-link);
}

body.dark-theme a:hover {
    color: var(--dark-theme-link-hover);
}

body.dark-theme code,
body.dark-theme pre {
    background-color: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}

body.dark-theme code {
    background-color: rgba(110, 118, 129, 0.4); /* 文章正文中的行内代码保持背景色 */
    border-color: rgba(110, 118, 129, 0.4);
}

/* 代码块内的代码元素应该是透明背景 */
body.dark-theme .highlight code,
body.dark-theme pre code {
    background-color: transparent !important;
    border: none !important;
    color: inherit;
}

body.dark-theme .highlight {
    background-color: #161b22;
    border-color: #30363d;
}

body.dark-theme .table th {
    background-color: #2d2d2d;
    border-color: #444C56;
}

body.dark-theme .table td {
    border-color: #444C56;
}

body.dark-theme blockquote {
    border-left-color: #515862;
    color: #999;
}

/* 深色主题下的标签样式 */
body.dark-theme .tag-cloud-link {
    color: var(--dark-theme-link);
}

body.dark-theme .tag-cloud-link:hover {
    color: var(--dark-theme-link-hover);
}

body.dark-theme .listing-item time {
    color: #999999;
}

body.dark-theme .listing-item a {
    color: var(--dark-theme-link);
}

body.dark-theme .listing-item a:hover {
    color: var(--dark-theme-link-hover);
}

body.dark-theme hr {
    border-color: #515862;
}

/* 深色主题下的文章标题链接样式 */
body.dark-theme .c-archives__item h3 a,
body.dark-theme .c-article__title a {
    color: var(--dark-theme-link); /* 深色主题下保持蓝色 */
}

body.dark-theme .c-archives__item h3 a:hover,
body.dark-theme .c-article__title a:hover {
    color: var(--dark-theme-link); /* 深色主题下文章标题鼠标悬停时保持蓝色不变 */
    text-decoration: none;
}

body.dark-theme .c-archives__item h3 a:visited,
body.dark-theme .c-article__title a:visited {
    color: var(--dark-theme-link); /* 深色主题下访问过的文章标题保持蓝色 */
}

/* 浅色主题 */
html.light-theme,
body.light-theme {
    background-color: #f5f5f5;
    color: #333333;
}

html.light-theme h1,
html.light-theme h2,
html.light-theme h3,
html.light-theme h4,
html.light-theme h5,
html.light-theme h6,
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
    color: #333333;
}

/* ==========================================================================
   主题切换按钮 - 与原版Jekyll一致
   ========================================================================== */

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.5s;
}

.theme-switch .icon {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.5s;
    font-size: 24px; /* 与原版一致 */
}

.container1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   导航和页眉页脚
   ========================================================================== */

/* 页面头部 - 主要导航区域 */
.c-page__header {
    margin-bottom: calc(var(--spacing-unit) * 2); /* 60px - 导航链接与下面元素的间距调整为2倍 */
}

.c-page__header h1 {
    font-size: 2.6rem;
    line-height: 1.2;
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 标题下方间距 */
    color: var(--c-base-02);
    font-weight: 350; /* 统一修改为350 */
}

.c-page__header p {
    line-height: 1.5;
    font-size: 1.8rem;
    margin-bottom: 0;
}

.c-page__header a {
    color: var(--c-accent-blue);
    text-decoration: none;
}

.c-page__header a:hover {
    color: #0050C7;
    text-decoration: underline;
}

/* 统一所有页面的字体粗细 */
.tags-cloud,
.tag-section,
.listing-item,
.c-article__main,
.c-archives {
    font-weight: 350; /* 统一修改为350 */
}

.tags-cloud a,
.tag-section h3,
.listing-item a,
.listing-item time {
    font-weight: 350; /* 统一修改为350 */
}

.site-header {
    border-top: 5px solid var(--c-base-01);
    border-bottom: 1px solid var(--c-base-2);
    min-height: 56px;
    position: relative;
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
}

.site-title {
    font-size: 2.6rem;
    line-height: 56px;
    letter-spacing: -1px;
    margin-bottom: 0;
    float: left;
    color: var(--c-base-02);
}

.site-title:visited {
    color: var(--c-base-02);
}

.site-nav {
    float: right;
    line-height: 56px;
}

.site-nav .page-link {
    color: #333333;
    line-height: 1.55;
    margin-left: 20px;
}

.site-nav .page-link:first-child {
    margin-left: 0;
}

.site-footer {
    border-top: 1px solid var(--c-base-2);
    padding: var(--spacing-unit) 0;
    margin-top: var(--spacing-unit); /* 增加上方间距以与内容分开 */
}

.site-footer p {
    margin-bottom: calc(var(--spacing-unit) / 6); /* 5px - 页脚元素间紧密间距 */
    font-size: 1.8rem; /* 1em 等价于基础字号 */
}

.site-footer a {
    color: var(--c-accent-blue);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

#fortune-text {
    min-height: 2em;
    font-size: 0.9em !important; /* 设置为0.9em并确保优先级 */
}

/* 深色主题下的页脚样式 */
body.dark-theme .site-footer {
    border-top-color: #515862;
}

body.dark-theme .site-footer a {
    color: var(--dark-theme-link);
}

body.dark-theme .site-footer a:hover {
    color: var(--dark-theme-link-hover);
}

/* ==========================================================================
   卍助功能样式
   ========================================================================== */

/* 代码复制按钮 */
.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #238636;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

pre:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background: #2ea043;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* 深色主题下的复制按钮 */
body.dark-theme .copy-button {
    background: #238636;
    color: #ffffff;
}

body.dark-theme .copy-button:hover {
    background: #2ea043;
}

/* 目录样式 */
.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
}

.table-of-contents h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.table-of-contents ul {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.table-of-contents ul ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.table-of-contents a {
    color: var(--c-base-01);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}

.table-of-contents a:hover {
    color: var(--c-accent-blue);
}

/* 标签样式 */
.tag-link {
    display: inline;
    background: none;
    color: var(--c-accent-blue);
    padding: 0;
    border-radius: 0;
    font-size: 1.8rem; /* 与原版c-tag一致 */
    text-decoration: none;
    margin-right: 5px;
    transition: none;
}

.tag-link:hover {
    background: none;
    color: var(--c-accent-blue);
    text-decoration: none;
}

.tag-link:visited {
    background: none;
    color: var(--c-accent-blue);
}

/* 标签云样式 - 仿照原版Jekyll */
.tags-cloud {
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px */
    line-height: 1.8;
}

.tag-cloud-link {
    color: var(--c-accent-blue);
    text-decoration: none;
    font-size: 1.8rem;
    margin-right: 8px;
    transition: color 0.2s ease;
}

.tag-cloud-link:hover {
    color: #0050C7;
    text-decoration: underline;
}

/* 标签详细列表样式 */
.listing-item {
    margin-bottom: calc(var(--spacing-unit) / 4); /* 7.5px */
}

.listing-item time {
    color: var(--c-base-01);
    font-size: 1.6rem;
    margin-right: 10px;
}

.listing-item a {
    color: var(--c-accent-blue);
    text-decoration: none;
    font-size: 1.8rem;
}

.listing-item a:hover {
    color: #0050C7;
    text-decoration: underline;
}

.c-article__tags {
    margin-top: calc(var(--spacing-unit) / 2); /* 15px - 与Jekyll标准一致 */
    padding-top: calc(var(--spacing-unit) / 3); /* 10px - 边框间距 */
    border-top: 1px solid #e9ecef;
    font-size: 1.8rem; /* 与原版fs--body一致 */
}

.c-article__tags p {
    font-size: 1.8rem; /* 确保"Tags:"文字也是正确大小 */
    margin-bottom: 0;
}

.tag-section {
    margin-bottom: var(--spacing-unit); /* 30px - 与Jekyll标准一致 */
}

/* 返回顶部按钮 */
.back-to-top {
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.back-to-top:hover {
    background: #0050C7;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 分隔符 */
.u-separate {
    color: #999;
    margin: 0 0.5rem;
}

/* 深色主题下的目录样式 */
body.dark-theme .table-of-contents {
    background: #2d2d2d;
    border-color: #515862;
}

body.dark-theme .table-of-contents a {
    color: #ccc;
}

body.dark-theme .table-of-contents a:hover {
    color: var(--dark-theme-link);
}

body.dark-theme .c-article__tags {
    border-top-color: #515862;
}

/* 深色主题下的标签样式 */
body.dark-theme .tag-link {
    background: none;
    color: var(--dark-theme-link);
}

body.dark-theme .tag-link:hover {
    background: none;
    color: var(--dark-theme-link);
    text-decoration: none;
}

body.dark-theme .tag-link:visited {
    background: none;
    color: var(--dark-theme-link);
}

/* ==========================================================================
   Note标签样式
   ========================================================================== */

.note-tag {
    display: inline-block;
    background-color: #007bff;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
}

/* 深色主题下的note标签样式 */
body.dark-theme .note-tag {
    background-color: #007bff;
    color: white;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */

@media screen and (max-width: 600px) {
    html {
        font-size: 9px;
    }
    
    .c-article__title {
        font-size: 2.8rem;
    }
    
    .c-archives__year {
        font-size: 2.8rem;
    }
    
    .site-title {
        font-size: 2.2rem;
    }
    
    .site-nav {
        float: none;
        margin-top: 1rem;
    }
    
    .site-nav .page-link {
        margin-left: 15px;
    }
}

/* ==========================================================================
   书签页面样式
   ========================================================================== */

/* 书签页面描述 */

/* 操作工具栏 */
.bookmark-toolbar {
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px */
    padding: calc(var(--spacing-unit) / 3) 0; /* 10px */
}

.bookmark-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.admin-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 1.4rem;
    font-weight: 350;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--c-accent-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #0050C7;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.form-input,
.form-select,
.form-textarea {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.4rem;
    font-family: inherit;
    font-weight: 350;
    background-color: white;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--c-accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 103, 251, 0.2);
}

.form-input {
    flex: 1;
    min-width: 200px;
}

/* 书签容器 */
.bookmark-container {
    margin-top: calc(var(--spacing-unit) / 2); /* 15px */
    /* 移除最大宽度限制，让其与父容器保持一致 */
    margin-left: auto;
    margin-right: auto;
}

/* 书签网格 */
.bookmark-grid {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) / 6); /* 5px */
}

/* 书签项目 */
.bookmark-item {
    background: white;
    border: 1px solid #DADDE1;
    border-radius: 6px;
    padding: calc(var(--spacing-unit) / 3); /* 10px */
    transition: all 0.2s ease;
    position: relative;
}

.bookmark-item:hover {
    border-color: var(--c-accent-blue);
    box-shadow: 0 2px 8px rgba(0, 103, 251, 0.1);
    transform: translateY(-1px);
}

/* 删除动画 */
.bookmark-item.deleting {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
}

/* 书签项目 */
.bookmark-item {
    background: white;
    border: 1px solid #DADDE1;
    border-radius: 6px;
    padding: 8px 16px; /* 减少上下内边距 */
    transition: all 0.2s ease;
    position: relative;
    width: 100%; /* 使用100%宽度，与容器保持一致 */
    margin: 0 auto; /* 居中显示 */
    box-sizing: border-box; /* 确保padding计算在内 */
}

.bookmark-item:hover {
    border-color: var(--c-accent-blue);
    box-shadow: 0 2px 8px rgba(0, 103, 251, 0.1);
    transform: translateY(-1px);
}

.bookmark-content {
    display: flex;
    justify-content: space-between; /* 恢复左右分布 */
    align-items: center; /* 垂直居中 */
    gap: 15px;
    line-height: 1; /* 减少行高 */
    min-height: 36px; /* 减小最小高度 */
}

.bookmark-main-info {
    display: flex;
    align-items: center; /* 垂直居中 */
    flex: 1;
    gap: 12px;
    min-width: 0;
}

/* 书签标题样式 */
.bookmark-title {
    margin: 0;
    flex-shrink: 0; /* 防止标题被压缩 */
}

.bookmark-title a {
    color: var(--c-accent-blue);
    text-decoration: none;
    font-size: 1.8rem; /* 与正文字号一致 */
    font-weight: 350;
    line-height: 1; /* 减少行高 */
}

.bookmark-title a:hover {
    color: var(--c-accent-blue);
    text-decoration: none;
}

.bookmark-title a:visited {
    color: var(--c-accent-blue);
}

/* 标签样式 */
.bookmark-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-shrink: 0;
}

.bookmark-meta {
    display: flex;
    align-items: center; /* 垂直居中 */
    gap: 8px;
    flex-shrink: 0;
}

.bookmark-date {
    font-size: 1.6rem; /* 比标题小一号 */
    color: var(--c-base-01);
}

.bookmark-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.tag {
    background-color: #f1f3f4;
    color: #5f6368;
    padding: 1px 5px; /* 减少标签内边距 */
    border-radius: 10px; /* 稍微减小圆角 */
    font-size: 1.4rem; /* 减小标签字号，比日期更小 */
    font-weight: 350;
    border: 1px solid #e8eaed;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: var(--spacing-unit); /* 30px */
    color: var(--c-base-01);
    font-size: 1.6rem;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 450px; /* 稍微减小最大宽度 */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin: 0 20px; /* 增加左右边距 */
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: calc(var(--spacing-unit) * 2 / 3) calc(var(--spacing-unit) * 2 / 3); /* 进一步增加内边距 20px -> 24px */
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 350;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2.4rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    padding: calc(var(--spacing-unit) / 3) calc(var(--spacing-unit) * 2 / 3) calc(var(--spacing-unit) / 3) calc(var(--spacing-unit) * 2 / 3); /* 进一步增加左右内边距 */
}

/* 修复书签表单内边距，确保输入框不会紧贴边界 */
.modal-content form {
    padding: 0 calc(var(--spacing-unit) * 2 / 3) calc(var(--spacing-unit) / 3); /* 20px 左右内边距，10px 底部内边距 */
}

/* 表单样式 */
.form-group {
    margin-bottom: calc(var(--spacing-unit) / 3); /* 10px */
}

/* 弹窗内的表单组 - 确保输入框有足够边距 */
.modal-content .form-group {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: calc(var(--spacing-unit) / 2); /* 15px 底部间距 */
}

.modal-content .form-group input,
.modal-content .form-group textarea {
    margin: 0;
    width: calc(100% - 4px); /* 减去边框宽度，避免溢出 */
    max-width: calc(100% - 4px); /* 限制最大宽度 */
    box-sizing: border-box;
}

/* 针对弹窗内的输入框的特殊样式 */
.modal-content .form-input,
.modal-content .form-select,
.modal-content .form-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.4rem;
    font-family: inherit;
    font-weight: 350;
    background-color: white;
    transition: border-color 0.2s ease;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) / 3); /* 10px */
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 1.4rem;
    font-weight: 350;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* 防止内容溢出 */
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    padding: calc(var(--spacing-unit) / 3) calc(var(--spacing-unit) * 2 / 3); /* 进一步增加左右内边距 */
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-actions {
    padding: calc(var(--spacing-unit) / 3) calc(var(--spacing-unit) * 2 / 3); /* 进一步增加左右内边距 */
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

body.dark-theme .bookmark-item {
    background: #2d2d2d;
    border-color: #444C56;
    color: var(--dark-theme-text);
}

body.dark-theme .bookmark-item:hover {
    border-color: var(--dark-theme-link);
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.1);
}

body.dark-theme .bookmark-title a {
    color: var(--dark-theme-link);
}

body.dark-theme .bookmark-title a:hover {
    color: var(--dark-theme-link);
}

body.dark-theme .bookmark-title a:visited {
    color: var(--dark-theme-link);
}

body.dark-theme .btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .form-input,
body.dark-theme .form-select,
body.dark-theme .form-textarea {
    background-color: #333;
    border-color: #555;
    color: var(--dark-theme-text);
}

body.dark-theme .form-input:focus,
body.dark-theme .form-select:focus,
body.dark-theme .form-textarea:focus {
    border-color: var(--dark-theme-link);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

body.dark-theme .tag {
    background-color: #444;
    color: #ccc;
    border-color: #555;
}

body.dark-theme .modal-content {
    background: #2d2d2d;
    color: var(--dark-theme-text);
}

body.dark-theme .modal-header {
    border-bottom-color: #444;
}

body.dark-theme .form-actions {
    border-top-color: #444;
}

body.dark-theme .modal-actions {
    border-top-color: #444;
}

body.dark-theme .form-group label {
    color: var(--dark-theme-text);
}

body.dark-theme .btn-close {
    color: #adb5bd; /* 暗色主题下的灰色 */
}

body.dark-theme .btn-close:hover {
    background-color: rgba(108, 117, 125, 0.2); /* 暗色主题下的灰色背景 */
    color: #f8f9fa; /* 暗色主题下的白色文字 */
}

/* 移动端适配 */
@media screen and (max-width: 600px) {
    .bookmark-grid {
        grid-template-columns: 1fr;
    }
    
    .bookmark-container {
        max-width: 100%; /* 移动端占满宽度 */
        margin: calc(var(--spacing-unit) / 2) 10px 0; /* 移动端边距 */
    }
    
    .bookmark-item {
        width: 100%; /* 移动端保持占满容器宽度 */
        margin: 0; /* 移动端不需要额外边距 */
    }
    
    .bookmark-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 90%;
        max-width: 350px; /* 移动端进一步减小宽度 */
        margin: 15px; /* 增加移动端边距 */
    }
    
    .modal-header,
    .modal-body,
    .form-actions,
    .modal-actions {
        padding-left: calc(var(--spacing-unit) / 2); /* 移动端适度减少内边距 */
        padding-right: calc(var(--spacing-unit) / 2);
    }
    
    .bookmark-content {
        flex-direction: column; /* 移动端改为垂直布局 */
        align-items: stretch;
        gap: 8px;
    }
    
    .bookmark-main-info {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .bookmark-meta {
        justify-content: space-between; /* 移动端两端对齐 */
    }
}