/**
 * 公共样式 - 全局、布局、导航等
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 页面包裹器（用于移动端推动效果） */
.page-wrapper {
    position: relative;
    left: 0;
    min-height: 100vh;
    transition: left 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 移动端防止横向滚动 */
body {
    overflow-x: hidden;
}

/* 禁止滚动 */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* 页面加载时禁用过渡动画，防止闪烁 */
body.page-loading .sticky-post-title,
body.page-loading .top-nav-menu {
    transition: none !important;
}

/* 双栏布局 */
.two-column-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* 左侧栏 - 36% */
.column-left {
    width: 36%;
    background: #fff;
    border-right: 1px solid #eee;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 60px 40px 40px;
    text-align: center;
    position: relative;
}

/* 侧边栏顶部标题栏 */
.sidebar-header {
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 左侧网站标题 */
.sidebar-site-title {
    flex-shrink: 0;
}

.sidebar-site-title a {
    font-size: 30px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    letter-spacing: 1.5px;
    transition: color 0.3s;
}

.sidebar-site-title a:hover {
    color: #000;
}

/* 右侧统计信息 */
.sidebar-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-stat-item {
    display: flex;
    align-items: baseline;
    gap: 7px;
    cursor: help;
    transition: all 0.3s ease;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
}

.sidebar-stat-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
}

.sidebar-stat-item .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}

.sidebar-stat-item .stat-label {
    font-size: 15px;
    color: #888;
    font-weight: 500;
}

/* 个人信息区域 */
.profile-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-avatar {
    margin-bottom: 35px;
    position: relative;
    display: inline-block;
}

.profile-avatar a {
    display: inline-block;
}

.profile-avatar img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.profile-avatar a:hover img {
    opacity: 0.8;
}

/* 头像气泡样式 - 极简优雅设计 */
.avatar-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 22px;
    background: #ffffff;
    border-radius: 18px;
    padding: 0;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04);
    width: 460px;
    max-width: calc(100vw * 0.36 - 60px);
    z-index: 100;
    animation: bubbleAppear 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    overflow: visible;
}

.avatar-bubble:hover {
    box-shadow: 
        0 6px 28px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.05);
    transform: translateX(-50%) translateY(-2px);
}

@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.bubble-content {
    position: relative;
    padding: 20px 22px;
    border-radius: 18px;
    overflow: hidden;
}

/* 气泡左侧装饰条 */
.bubble-content::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    bottom: 20px;
    width: 3px;
    background: #000000;
    border-radius: 0 2px 2px 0;
    opacity: 1;
}

/* 气泡头部 - 时间和统计 */
.bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-left: 12px;
    padding-right: 12px;
}

.bubble-time {
    font-size: 11px;
    color: #999;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bubble-time::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #000000;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.85);
    }
}

/* 气泡统计信息 */
.bubble-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bubble-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.bubble-stat-item svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    opacity: 0.6;
}

.bubble-text {
    font-size: 14.5px;
    color: #2c2c2c;
    line-height: 1.7;
    word-wrap: break-word;
    word-break: break-all;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-left: 12px;
    padding-right: 12px;
    letter-spacing: 0.2px;
}

/* 气泡中的标签样式 - 精致简约 */
.avatar-bubble .talk-inline-tag {
    color: #333;
    font-weight: 500;
    text-decoration: none;
    padding: 2px 10px;
    border-radius: 8px;
    display: inline;
    background: rgba(0, 0, 0, 0.06);
    font-size: 13px;
    line-height: inherit;
    vertical-align: baseline;
    white-space: nowrap;
    transition: all 0.25s ease;
    border: none;
    margin: 0 2px;
}

.avatar-bubble .talk-inline-tag:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

.avatar-bubble .talk-inline-tag::before {
    content: '#';
    font-size: 0.9em;
    margin-right: 2px;
    opacity: 0.7;
}

.avatar-bubble .talk-inline-tag[data-has-emoji]::before {
    content: "";
    margin-right: 0;
}

.bubble-arrow {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px 14px 0 14px;
    border-color: rgba(0, 0, 0, 0.04) transparent transparent transparent;
    z-index: 98;
}

/* 倒三角主体 */
.bubble-arrow::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 13px 13px 0 13px;
    border-color: #ffffff transparent transparent transparent;
    z-index: 99;
}

.profile-info {
    margin-bottom: 30px;
}

.site-title {
    font-size: 42px;
    font-weight: 600;
    color: #000;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.site-description {
    font-size: 18px;
    color: #666;
    font-weight: 400;
    letter-spacing: 1px;
}

.profile-bio {
    margin-bottom: 35px;
}

.profile-bio p {
    font-size: 18px;
    line-height: 1.8;
    color: #666;
    letter-spacing: 1px;
}

/* 打字机效果 */
.typewriter-text.typing::after {
    content: '|';
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

.typewriter-text.typed::after {
    content: '';
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* 社交媒体按钮 */
.social-links {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #333;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s;
}

.social-links a:hover {
    color: #000;
    border-color: #333;
}

/* 导航菜单 */
.profile-nav {
    margin-top: 25px;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-menu li {
    margin: 8px 0;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.nav-menu a:hover {
    color: #000;
}

/* 版权区域 */
.copyright-section {
    margin-top: auto;
    padding-top: 30px;
    font-size: 14px;
    color: #999;
    letter-spacing: 0.8px;
}

.copyright-section p {
    margin: 5px 0;
}

/* 右侧栏 - 64% */
.column-right {
    width: 64%;
    margin-left: 36%;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* 顶部菜单 */
.top-menu {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1000;
}

.top-menu-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 60px;
    position: relative;
    height: 80px;
}

/* 中间内容区域容器 */
.nav-menu-container {
    flex: 1;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    min-width: 0;
}

.top-menu-buttons {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
}

/* 站点名称容器 - 桌面端隐藏 */
.site-name-container {
    display: none;
}

/* 导航条中的文章标题 */
.sticky-post-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    position: absolute;
    left: 60px;
    max-width: calc(100% - 240px);
}

.sticky-post-title span {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.sticky-post-title.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 当文章标题显示时，隐藏站点名称 */
.sticky-post-title.show ~ .site-name-container {
    opacity: 0;
    visibility: hidden;
}

/* 当文章标题显示时，隐藏菜单 */
.sticky-post-title.show ~ .nav-menu-container {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 返回上一页按钮 */
.back-page-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: 8px;
}

.back-page-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.back-page-btn:active {
    transform: scale(0.95);
}

.back-page-btn svg {
    transition: transform 0.2s ease;
}

.back-page-btn:hover svg {
    transform: translateX(-2px);
}

/* 复制链接按钮 */
.copy-link-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.copy-link-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.copy-link-btn:active {
    transform: scale(0.95);
}

.copy-link-btn .link-icon,
.copy-link-btn .check-icon {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-link-btn .check-icon {
    display: none;
    color: #000;
}

.copy-link-btn.copied .link-icon {
    display: none;
}

.copy-link-btn.copied .check-icon {
    display: block;
    animation: checkBounce 0.4s ease;
}

@keyframes checkBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.top-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    flex: 1;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.top-nav-menu > li {
    position: relative;
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
}

.top-nav-menu > li > a {
    display: flex;
    align-items: center;
    height: 80px;
    padding: 0 15px;
    color: #333;
    text-decoration: none;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-nav-menu > li > a:hover {
    color: #000;
}

/* 当前菜单项下划线 */
.top-nav-menu > li.current-menu-item > a,
.top-nav-menu > li.current_page_item > a,
.top-nav-menu > li.current-menu-ancestor > a,
.top-nav-menu > li.current-page-ancestor > a {
    color: #000;
    border-bottom: 2px solid #000;
}

/* 有子菜单的一级菜单项显示向下箭头 */
.top-nav-menu > li.menu-item-has-children > a::after {
    content: '▾';
    margin-left: 8px;
    font-size: 16px;
    opacity: 0.6;
}

/* 多级菜单 */
.top-nav-menu > li {
    position: relative;
}

.top-nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1001;
    white-space: normal;
}

.top-nav-menu li:hover > .sub-menu {
    display: block;
}

.top-nav-menu .sub-menu li {
    margin: 0;
}

.top-nav-menu .sub-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid #f5f5f5;
}

.top-nav-menu .sub-menu a:hover {
    color: #000;
    background: #f9f9f9;
}

.top-nav-menu .sub-menu li:last-child a {
    border-bottom: none;
}

/* 有子菜单的二级菜单项显示向右箭头 */
.top-nav-menu .sub-menu li.menu-item-has-children > a::after {
    content: '▸';
    float: right;
    margin-left: 10px;
    font-size: 15px;
    opacity: 0.6;
}

/* 三级菜单 */
.top-nav-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

/* 目录按钮 */
.toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.toc-toggle:hover {
    transform: scale(1.05);
}

.toc-toggle:active {
    transform: scale(0.95);
}

/* 搜索框容器 */
.search-box-container {
    margin-left: 20px;
    flex-shrink: 0;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 200px;
    height: 40px;
    padding: 0 40px 0 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.search-input:focus {
    width: 280px;
    background: rgba(0, 0, 0, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-input::placeholder {
    color: #999;
}

.search-button {
    position: absolute;
    right: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    padding: 0;
}

.search-button:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    transform: scale(1.05);
}

.search-button:active {
    transform: scale(0.95);
}

/* 夜间模式切换按钮 */
/* 购物车图标 */
.cart-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.cart-icon-btn:hover {
    transform: scale(1.05);
}

.cart-icon-btn:active {
    transform: scale(0.95);
}

.cart-icon-btn .cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.cart-icon-btn .cart-count:empty,
.cart-icon-btn .cart-count[style*="display: none"] {
    display: none !important;
}

body.dark-mode .cart-icon-btn {
    color: #ccc;
}

body.dark-mode .back-page-btn {
    color: #aaa;
}

body.dark-mode .back-page-btn:hover {
    background: #2a2a2a;
    color: #fff;
}

.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.dark-mode-toggle:hover {
    transform: scale(1.05);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

.dark-mode-toggle .moon-icon {
    display: none;
}

body.dark-mode .dark-mode-toggle .sun-icon {
    display: none;
}

body.dark-mode .dark-mode-toggle .moon-icon {
    display: block;
}

/* 文章目录树 */
.toc-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.toc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toc-container.active .toc-overlay {
    opacity: 1;
}

.toc-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toc-container.active .toc-sidebar {
    transform: translateX(0);
}


.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.toc-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.toc-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.toc-close:hover {
    background: #f5f5f5;
    color: #333;
}

.toc-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: block;
    padding: 8px 0;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
    transition: color 0.2s;
    border-left: 2px solid transparent;
    padding-left: 12px;
}

.toc-list a:hover {
    color: #000;
    border-left-color: #000;
}

.toc-list a.active {
    color: #000;
    font-weight: 500;
    border-left-color: #000;
}

/* 多级目录缩进 */
.toc-list .toc-h3 a {
    padding-left: 24px;
}

.toc-list .toc-h4 a {
    padding-left: 36px;
}

.toc-list .toc-h5 a {
    padding-left: 48px;
}

.toc-list .toc-h6 a {
    padding-left: 60px;
}

/* 内容区域内边距 */
.column-content {
    padding: 10px 120px 10px 70px;
    flex: 1;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 移动端汉堡菜单按钮 */
.mobile-menu-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.hamburger-line {
    display: block;
    height: 2.5px;
    background: #555;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-line:nth-child(1) {
    width: 20px;
}

.hamburger-line:nth-child(2) {
    width: 16px;
}

.hamburger-line:nth-child(3) {
    width: 12px;
}

.mobile-menu-toggle.active {
    background: none;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    width: 20px;
    transform: translateY(6.5px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    width: 20px;
    transform: translateY(-6.5px) rotate(-45deg);
}

/* 移动端侧边栏菜单 - 推动式效果 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                visibility 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1998;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -320px;
    width: 80%;
    max-width: 320px;
    background: #fff;
    z-index: 1999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transition: left 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu-sidebar.active {
    left: 0;
}

/* 横屏时优化侧边栏宽度 */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-menu-sidebar {
        width: 60%;
        max-width: 280px;
        left: -280px;
    }
    
    .page-wrapper.pushed {
        left: min(60vw, 280px) !important;
    }
    
    .page-wrapper.pushed .top-menu {
        left: min(60vw, 280px) !important;
    }
}

/* 移动端推动效果 */
@media (max-width: 768px) {
    .page-wrapper.pushed {
        left: min(80vw, 320px);
    }
    
    /* 导航条也跟随页面推动 */
    .page-wrapper.pushed .top-menu {
        left: min(80vw, 320px);
    }
}

.mobile-menu-header {
    padding: 15px 24px;
    position: relative;
    overflow: visible; /* 允许内容正常显示 */
    flex-shrink: 0; /* 防止在滚动时被压缩 */
}

.mobile-menu-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.mobile-menu-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu-title.hide {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

.mobile-menu-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-menu-left-btn,
.mobile-menu-right-btn {
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.mobile-menu-left-btn {
    margin-right: 8px;
    z-index: 5;
}

.mobile-menu-right-btn {
    z-index: 5;
}

.mobile-menu-left-btn:hover,
.mobile-menu-right-btn:hover {
    color: #333;
    transform: scale(1.05);
}

.mobile-menu-left-btn:active,
.mobile-menu-right-btn:active {
    transform: scale(0.95);
}

.mobile-menu-stats {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: flex-start;
    margin-top: 15px;
    gap: 10px;
}

.mobile-menu-stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.mobile-menu-stat-item:nth-child(2) {
    justify-self: center;
}

.mobile-menu-stat-item:nth-child(3) {
    justify-self: end;
}

.mobile-menu-stat-item .stat-number {
    font-size: 28px;
    font-weight: 600;
    color: #555;
    line-height: 1;
}

.mobile-menu-stat-item .stat-label {
    font-size: 14px;
    color: #999;
}

.mobile-menu-contribution {
    margin-top: 15px;
}

.mobile-contribution-grid {
    display: flex;
    gap: 6px;
    width: 100%;
}

.mobile-contribution-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.mobile-contribution-day {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 3px;
    background: #eee;
    transition: all 0.2s;
    display: block;
    text-decoration: none;
}

a.mobile-contribution-day {
    cursor: pointer;
}

a.mobile-contribution-day:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mobile-contribution-day.mobile-level-0 {
    background: #ebedf0;
}

.mobile-contribution-day.mobile-level-1 {
    background: #9be9a8;
}

.mobile-contribution-day.mobile-level-2 {
    background: #40c463;
}

.mobile-contribution-day.mobile-level-3 {
    background: #30a14e;
}

.mobile-contribution-day.mobile-level-4 {
    background: #216e39;
}

.mobile-contribution-months {
    margin-top: 8px;
    height: 16px;
    position: relative;
}

.mobile-contribution-months-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.mobile-contribution-month-label {
    position: absolute;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.mobile-menu-content {
    padding: 20px;
    flex-shrink: 0; /* 防止在滚动时被压缩 */
    /* 移除独立滚动，让整个侧边栏统一滚动 */
}

/* 移动端搜索框 */
.mobile-search-form {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
}

.mobile-search-form.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

.mobile-search-input {
    width: 100%;
    height: 40px;
    padding: 0 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

.mobile-search-input:focus {
    background: rgba(0, 0, 0, 0.08);
}

.mobile-search-input::placeholder {
    color: #999;
}

/* 隐藏浏览器默认的清除按钮 */
.mobile-search-input::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
}

.mobile-search-input::-webkit-search-decoration {
    display: none;
    -webkit-appearance: none;
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-menu li {
    margin: 0;
}

.mobile-nav-menu > li {
    border-bottom: 1px solid #f5f5f5;
}

.mobile-nav-menu > li:last-child {
    border-bottom: none;
}

.mobile-nav-menu a {
    display: block;
    padding: 14px 0;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s, padding-left 0.2s;
}

.mobile-nav-menu a:hover {
    color: #000;
    padding-left: 8px;
}

.mobile-nav-menu .current-menu-item > a,
.mobile-nav-menu .current_page_item > a {
    color: #000;
    font-weight: 500;
}

/* 移动端菜单子菜单 */
.mobile-nav-menu .sub-menu {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
    display: none;
}

.mobile-nav-menu li.menu-item-has-children.active > .sub-menu {
    display: block;
}

.mobile-nav-menu .sub-menu a {
    padding: 10px 0;
    font-size: 15px;
    color: #666;
}

.mobile-nav-menu .sub-menu a:hover {
    color: #333;
}

.mobile-nav-menu li.menu-item-has-children > a {
    position: relative;
    padding-right: 30px;
}

.mobile-nav-menu li.menu-item-has-children > a::after {
    content: '›';
    position: absolute;
    right: 0;
    font-size: 20px;
    transition: transform 0.3s;
}

.mobile-nav-menu li.menu-item-has-children.active > a::after {
    transform: rotate(90deg);
}

/* 气泡高度不足时隐藏 */
@media (max-height: 960px) {
    .avatar-bubble {
        display: none;
    }
}

/* 响应式设计 - 平板 */
@media (max-width: 1240px) {
    /* 平板端隐藏左侧个人信息栏 */
    .column-left {
        display: none;
    }
    
    .column-right {
        width: 100%;
        margin-left: 0;
    }                                                               
    
    .column-content {
        padding: 30px 60px 30px 30px;
    }
    
    .top-menu-wrapper {
        padding: 0 30px;
    }
}

/* 移动端版权信息 */
.mobile-footer-copyright {
    display: none;
}

/* 响应式设计 - 手机 */
@media (max-width: 768px) {
    /* 防止移动端按钮双击缩放 */
    button,
    .mobile-menu-toggle,
    .toc-toggle,
    .dark-mode-toggle,
    .mobile-menu-close,
    .toc-close,
    .back-to-top,
    a {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 移动端版权信息样式 */
    .mobile-footer-copyright {
        display: block;
        text-align: center;
        padding: 40px 20px 30px;
        margin-top: 0;
        background: transparent;
    }
    
    .mobile-footer-copyright p {
        margin: 0;
        font-size: 14px;
        color: #888;
        line-height: 1.8;
        letter-spacing: 0.5px;
    }
    
    .two-column-layout {
        flex-direction: column;
        max-width: 100vw;
    }
    
    /* 移动端隐藏左侧个人信息栏 */
    .column-left {
        display: none;
    }
    
    /* 移动端隐藏返回上一页按钮 */
    .back-page-btn {
        display: none;
    }
    
    .column-right {
        width: 100%;
        margin-left: 0;
        border-right: none;
    }
    
    /* 为主内容区域添加顶部边距和内边距 */
    .column-content {
        padding: 20px;
        margin-top: 60px;
    }
    
    /* 移动端导航栏 - 固定在顶部 */
    .top-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        z-index: 999;
        background: #fff;
        transition: left 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .top-menu-wrapper {
        padding: 0 20px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        position: relative;
        width: 100%;
    }
    
    /* 显示汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* 移动端显示站点名称 */
    .site-name-container {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        transition: none !important; /* 移除过渡，跟随父元素一起移动 */
        opacity: 1;
        visibility: visible;
        z-index: 1;
    }
    
    .site-name {
        font-size: 18px;
        font-weight: 600;
        color: #333;
        text-decoration: none;
        white-space: nowrap;
    }
    
    /* 当文章标题显示时，隐藏站点名称 */
    .sticky-post-title.show ~ .site-name-container {
        opacity: 0;
        visibility: hidden;
    }
    
    /* 移动端导航栏简化 - 文章标题居中 */
    .sticky-post-title {
        left: 50%;
        transform: translateX(-50%);
        font-size: 16px;
        max-width: calc(100% - 120px);
        z-index: 2;
        flex: none;
        transition: none !important; /* 移除过渡，跟随父元素一起移动 */
    }
    
    /* 确保标题文字省略号显示 */
    .sticky-post-title span {
        display: inline-block;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    
    .nav-menu-container,
    .top-nav-menu {
        display: none !important;
    }
    
    /* 移动端隐藏搜索框 */
    .search-box-container {
        display: none;
    }
    
    /* 按钮排列 */
    .toc-toggle,
    .cart-icon-btn,
    .dark-mode-toggle {
        margin-left: 8px;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        border-radius: 6px;
    }
    
    /* 购物车图标计数标签 */
    .cart-icon-btn .cart-count {
        font-size: 9px;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        padding: 0 4px;
    }
    
    .copy-link-btn {
        display: none;
    }
    
    /* 目录侧边栏宽度调整 */
    .toc-sidebar {
        width: 85%;
        max-width: 360px;
    }
    
    /* 返回顶部按钮位置调整 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ==================== 分类密码保护全屏弹窗 ==================== */

.category-password-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fafafa;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.password-close-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10001;
}

.password-close-btn svg {
    width: 24px;
    height: 24px;
}

.password-close-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.password-close-btn:active {
    transform: scale(0.95);
}

.category-password-content {
    text-align: center;
    max-width: 420px;
    width: 100%;
    padding: 0 30px;
    animation: slideUpFadeIn 0.8s ease-out;
}

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

.lock-icon-wrapper {
    margin-bottom: 30px;
}

.lock-icon {
    width: 64px;
    height: 64px;
    color: #999;
    stroke-width: 1.5;
}

.password-error-msg {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.password-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.password-input-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.password-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.password-input:focus {
    border-color: #e0e0e0;
    box-shadow: none;
}

.password-submit {
    padding: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.password-submit:hover {
    background: #000;
}

.password-submit:active {
    transform: scale(0.98);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .password-close-btn {
        top: 20px;
        right: 20px;
        width: 36px;
        height: 36px;
    }
    
    .password-close-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .category-password-content {
        padding: 0 20px;
    }
    
    .lock-icon {
        width: 56px;
        height: 56px;
    }
    
    .password-title {
        font-size: 20px;
        margin-bottom: 30px;
    }
    
    .password-input {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .password-submit {
        font-size: 15px;
        padding: 14px;
    }
    
    /* 移动端隐藏头像气泡，避免布局问题 */
    .avatar-bubble {
        display: none;
    }
}

