/* Hexo 风格个人博客系统样式文件 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 14px;
}

/* 代码字体 */
code,
pre {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 - Hexo 风格 */
.header {
    background: #fff;
    border-bottom: 1px solid #e1e8ed;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #3498db;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: #7f8c8d;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #2c3e50;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 主要内容区域 - Hexo 布局 */
.main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 文章列表 - Hexo 卡片风格 */
.post-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.post-item {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.post-item:hover {
    background-color: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-item:last-child {
    border-bottom: none;
}

.post-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #3498db;
}

.post-meta {
    color: #95a5a6;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta .meta-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.post-excerpt {
    color: #7f8c8d;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 15px;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tag {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e1e8ed;
}

.tag:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-1px);
}

.post-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 5px;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #ecf0f1;
    color: #7f8c8d;
    border: 1px solid #e1e8ed;
}

.btn-secondary:hover {
    background: #d5dbdb;
    color: #2c3e50;
}

/* 侧边栏 - Hexo 风格 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    border: 1px solid #e1e8ed;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    position: relative;
    padding-bottom: 10px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #3498db;
}

/* 搜索框 */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form .form-control {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-form .form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-form .btn {
    padding: 10px 20px;
    white-space: nowrap;
}

/* 分类和标签列表 */
.category-list,
.tag-list {
    list-style: none;
}

.category-list li,
.tag-list li {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-list li:last-child,
.tag-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.category-list a,
.tag-list a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.category-list a:hover,
.tag-list a:hover {
    color: #3498db;
}

.category-count,
.tag-count {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag {
    font-size: 12px;
    padding: 6px 12px;
    margin: 2px;
}

/* 热门文章 */
.popular-posts {
    list-style: none;
}

.popular-posts li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.popular-posts li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-posts a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 5px;
}

.popular-posts a:hover {
    color: #3498db;
}

.view-count {
    color: #95a5a6;
    font-size: 12px;
}

/* 分页 - Hexo 风格 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    padding: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #e1e8ed;
    color: #7f8c8d;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-1px);
}

.pagination .current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination .disabled {
    color: #bdc3c7;
    background: #f8f9fa;
    border-color: #e9ecef;
    cursor: not-allowed;
}

/* 文章详情页 */
.post-detail {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid #e1e8ed;
}

.post-header {
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.post-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #2c3e50;
    line-height: 1.3;
}

.post-detail-meta {
    color: #95a5a6;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.post-content {
    line-height: 1.8;
    color: #2c3e50;
    font-size: 16px;
}

.post-content a {
    color: #3498db;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: #2980b9;
    text-decoration: none;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 30px 0 15px 0;
    color: #2c3e50;
    font-weight: 600;
}

.post-content h1 {
    font-size: 28px;
}

.post-content h2 {
    font-size: 24px;
}

.post-content h3 {
    font-size: 20px;
}

.post-content h4 {
    font-size: 18px;
}

.post-content h5 {
    font-size: 16px;
}

.post-content h6 {
    font-size: 14px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content blockquote {
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin: 20px 0;
    background: #f8f9fa;
    color: #7f8c8d;
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.post-content code {
    background: #f1f2f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 14px;
    color: #b42318;
}

.post-content pre {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    overflow-x: auto;
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.code-block {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(180deg, #2a3240 0%, #232a36 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.code-block-dots {
    display: flex;
    gap: 8px;
}

.code-block-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.code-block-dot.red {
    background: #ff5f56;
}

.code-block-dot.yellow {
    background: #ffbd2e;
}

.code-block-dot.green {
    background: #27c93f;
}

.code-copy-btn {
    border: 1px solid #3b475a;
    background: #2b3442;
    color: #f1f5f9;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-copy-btn:hover {
    background: #374151;
    border-color: #4b5563;
    color: #ffffff;
}

.code-copy-btn.copied {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
}

.code-block-body {
    padding: 16px 18px 20px;
    overflow-x: auto;
    background: #0f172a;
}

.code-block pre code,
.code-block .hljs {
    color: #e6edf3;
    background: transparent;
}

.code-block .hljs-comment,
.code-block .hljs-quote {
    color: #94a3b8;
}

.code-block .hljs-keyword,
.code-block .hljs-selector-tag,
.code-block .hljs-literal,
.code-block .hljs-name,
.code-block .hljs-strong {
    color: #7dd3fc;
}

.code-block .hljs-string,
.code-block .hljs-title,
.code-block .hljs-section,
.code-block .hljs-attribute {
    color: #fca5a5;
}

.code-block .hljs-number,
.code-block .hljs-symbol,
.code-block .hljs-bullet,
.code-block .hljs-link {
    color: #f9a8d4;
}

.code-block .hljs-params,
.code-block .hljs-variable,
.code-block .hljs-template-variable {
    color: #fde68a;
}

.post-content>ul {
    list-style-type: disc;
}

.post-content ul ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content ul,
.post-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 8px;
}

/* 多级列表（可选但推荐） */
.post-content ul ul {
    list-style-type: circle;
}

.post-content ul ul ul {
    list-style-type: square;
}


.post-content li {
    margin-bottom: 8px;
}

.post-content img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.post-content th,
.post-content td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f2f5;
    border-right: 1px solid #f0f2f5;
    font-size: 14px;
}

.post-content th:last-child,
.post-content td:last-child {
    border-right: none;
}

.post-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
}

.post-content tr:last-child td {
    border-bottom: none;
}

.post-content tr:nth-child(even) {
    background-color: #fafbfc;
}

.post-content tr:hover {
    background-color: #f1f5f9;
    transition: background-color 0.2s ease;
}

/* 评论区域 */
.comments {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 30px;
    border: 1px solid #e1e8ed;
}

.comments h3 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.comment {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-meta {
    color: #95a5a6;
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.comment-content {
    color: #2c3e50;
    line-height: 1.6;
    font-size: 14px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 评论区域特殊样式 */
.comments textarea:focus,
.comments input:focus {
    outline: none !important;
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

/* 移除所有元素的默认outline */
*:focus {
    outline: none;
}

/* 为可访问性保留键盘导航的视觉指示 */
*:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.footer-content p {
    margin-bottom: 10px;
    font-size: 14px;
}

.footer-content a {
    color: #3498db;
    text-decoration: none;
}

.footer-content a:hover {
    color: #5dade2;
}

/* 回到顶部按钮 */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* 移动端菜单样式 */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.mobile-menu {
    display: none;
    background: #fff;
    border-top: 1px solid #e1e8ed;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.active {
    display: block;
    max-height: 300px;
}

.mobile-menu .nav-menu {
    flex-direction: column;
    padding: 20px;
    gap: 15px;
}

.mobile-menu .nav-menu a {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu .nav-menu a:last-child {
    border-bottom: none;
}

/* 代码高亮样式 */
.code-wrapper {
    display: flex;
    background: #2c3e50;
    border-radius: 8px;
    overflow: hidden;
}

.line-numbers {
    background: #34495e;
    color: #95a5a6;
    padding: 20px 15px;
    font-size: 12px;
    line-height: 1.5;
    user-select: none;
    border-right: 1px solid #4a5f7a;
}

.code-content {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
}

/* 图片懒加载样式 */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-in {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }

    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .post-detail-title {
        font-size: 24px;
    }

    .post-detail {
        padding: 20px;
    }

    .post-item {
        padding: 20px;
    }

    .widget {
        padding: 20px;
    }

    .container {
        padding: 0 15px;
    }

    .search-form {
        flex-direction: column;
    }

    .post-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .post-detail-title {
        font-size: 20px;
    }

    .post-title {
        font-size: 20px;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 3rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #95a5a6;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== 左侧悬浮 TOC ===== */
.floating-toc {
    position: fixed;
    top: 100px;
    /* 避开 header */
    left: 36px;
    width: 280px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px 16px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    z-index: 999;
    font-size: 14px;
}

.floating-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.floating-toc-title {
    font-weight: 600;
    color: #2c3e50;
}

.floating-toc-toggle {
    border: 1px solid #e1e8ed;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-toc-toggle:hover {
    background: #eef2f7;
    color: #1e293b;
}

.floating-toc ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.floating-toc li {
    position: relative;
    padding-left: 20px;
    margin: 10px 0;
}

.floating-toc li::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c7d2fe;
    box-shadow: 0 0 0 2px #eef2ff;
}

.floating-toc li::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 18px;
    width: 1px;
    height: calc(100% - 10px);
    background: linear-gradient(180deg, #dbe4ff 0%, #e2e8f0 100%);
}

.floating-toc li:last-child::after {
    display: none;
}

.floating-toc ul ul {
    margin-top: 6px;
    padding-left: 14px;
    border-left: 1px solid #e2e8f0;
}

.floating-toc a {
    color: #3498db;
    text-decoration: none;
    line-height: 1.4;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.floating-toc a:hover {
    background: #eef2ff;
    color: #1d4ed8;
    text-decoration: none;
}

.floating-toc a.active {
    color: #1d4ed8;
    font-weight: 600;
    background: #e0e7ff;
}

.floating-toc li:has(a.active)::before {
    background: #4f46e5;
    box-shadow: 0 0 0 3px #e0e7ff;
}

.floating-toc li:has(a.active)::after {
    background: linear-gradient(180deg, #a5b4fc 0%, #c7d2fe 100%);
}



.floating-toc.is-collapsed ul {
    display: none;
}

.floating-toc.is-collapsed {
    max-height: none;
    overflow: hidden;
}

/* 小屏隐藏 */
@media (max-width: 1024px) {
    .floating-toc {
        display: none;
    }
}

/* ===== 标题锚点（¶）默认隐藏，hover 时显示 ===== */
.headerlink,
a[title="Permanent link"] {
    opacity: 0;
    margin-left: 6px;
    font-size: 0.9em;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

h1:hover .headerlink,
h2:hover .headerlink,
h3:hover .headerlink,
h4:hover .headerlink,
h5:hover .headerlink,
h6:hover .headerlink,
h1:hover a[title="Permanent link"],
h2:hover a[title="Permanent link"],
h3:hover a[title="Permanent link"],
h4:hover a[title="Permanent link"],
h5:hover a[title="Permanent link"],
h6:hover a[title="Permanent link"] {
    opacity: 1;
}

/* ===== Tailwind 预编译遗漏的工具类补充 ===== */
/* 以下类名在 Tailwind CSS 预编译（tree-shaking）时被移除，需手动补充 */

/* 渐变文字效果 */
.bg-clip-text {
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

.text-transparent {
    color: transparent !important;
}

/* 等宽字体 */
.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

/* 防止 flex 子元素被缩小 */
.flex-shrink-0 {
    flex-shrink: 0 !important;
}