* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #050505;
    --bg-secondary: #101010;
    --bg-tertiary: #181818;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #262626;
    --accent: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

html {
    scrollbar-gutter: stable; /* 始终预留滚动条空间，避免 Twikoo 等加载后出现滚动条导致整页右移 */
}

html,
body {
    overflow-x: clip; /* 防止横向溢出，同时不影响 sticky（比 hidden 更稳） */
    max-width: 100%; /* iPhone Safari：避免整页宽度超出视口出现横向滚动 */
}

.no-select,
body {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* 提示信息 */
.notification {
    position: fixed;
    top: 68px; /* 与首页第一张文章卡片顶部对齐：navbar 高度 60px + padding 8px = 68px */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99;
    max-width: 90%;
    text-align: center;
    font-size: 0.95rem;
    white-space: nowrap; /* 始终单行显示 */
    overflow: hidden;
    text-overflow: ellipsis; /* 小屏避免溢出 */
}

.notification.show {
    opacity: 1;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000; /* 高于主内容/侧栏即可；过大会导致侧栏 sticky 初始位置变成 65+顶栏高度 */
    padding-top: 4px;
    padding-bottom: 4px;
    margin-bottom: 0;
    touch-action: manipulation;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    width: 100%;
    gap: 20px;
    position: relative;
}

.logo {
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    touch-action: manipulation;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.logo-wrapper {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 4px 4px;
    height: 44px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo-wrapper:hover .logo {
    background-color: var(--accent);
    color: var(--bg-primary);
}

body.light-mode .logo-wrapper:hover .logo {
    background-color: #000000;
    color: #ffffff;
}

.nav-wrapper {
    display: flex;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 4px;
    height: 44px;
    align-items: center;
    width: auto;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-current-wrapper {
    display: flex;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 4px;
    height: 44px;
    align-items: center;
    width: auto;
    flex-shrink: 0;

    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translateY(6px);

    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.nav-current {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    height: 36px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-current {
    /* hover 样式见下方媒体查询：避免 iOS 首次触摸只触发 hover 而不触发 click */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 16px;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    display: block;
    padding: 8px 16px;
    border-radius: 20px;
    height: 36px;
    display: flex;
    align-items: center;
}

.nav-links a {
    /* hover 样式见下方媒体查询：避免 iOS 首次触摸只触发 hover 而不触发 click */
}

.nav-item--dropdown {
    position: relative;
}

.nav-item--dropdown {
    /* hover 展开见下方媒体查询：触屏设备不依赖 hover */
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    display: flex;
    gap: 16px;
    padding: 4px;
    height: 44px;
    align-items: center;
    list-style: none;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 50;
}

.nav-dropdown li {
    margin: 0;
}

.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    height: 36px;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-dropdown a {
    /* hover 样式见下方媒体查询：避免 iOS 首次触摸只触发 hover 而不触发 click */
}

.theme-toggle-wrapper {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--bg-secondary);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.menu-toggle-wrapper {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: none; /* 默认只在移动端显示 */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    pointer-events: auto !important;
    z-index: 1002 !important;
    position: relative;
}

.menu-toggle {
    /* hover 样式见下方媒体查询：避免 iOS 首次触摸只触发 hover 而不触发 click */
}

.menu-toggle svg {
    width: 18px;
    height: 18px;
}

/* 新：右上角动作容器（桌面保持圆形，移动端变成圆角矩形） */
.nav-actions-wrapper {
    width: auto;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 4px; /* 与移动端一致：圆角矩形内部留出内边距包裹圆形按钮 */
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
    pointer-events: auto !important;
    z-index: 1001 !important;
}

.nav-actions-wrapper .menu-toggle {
    display: none; /* 桌面隐藏菜单按钮 */
}

/* 旧结构仍可能存在于历史页面：隐藏以免双层出现 */
.theme-toggle-wrapper,
.menu-toggle-wrapper {
    display: none;
}

/* 移动端菜单（遮罩 + 抽屉） */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1100; /* 高于顶栏(1000)，打开时菜单与遮罩盖住整页、点击遮罩可关 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    z-index: 0;
}

.mobile-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(86vw, 320px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 18px 16px;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px; /* 与“关于”分组到按钮的网格间距保持一致 */
    z-index: 1;
    touch-action: manipulation; /* iOS：菜单内链接/按钮点击可靠 */
}

/* 移动端菜单顶部个人信息（头像 + 名字 + 三个图标） */
.mobile-menu__profile {
    padding: 8px 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* 间距交给头像/名字自己的 margin 控制，方便和侧边栏保持一致 */
}

.mobile-menu__profile-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px; /* 缩小与图标的垂直间距，在移动端更紧凑 */
}

.mobile-menu__profile .avatar {
    width: 72px;
    height: 72px;
    margin-bottom: 16px; /* 与首页头像到名字的竖向间距保持一致 */
}

.mobile-menu__title {
    /* 与“关于”分组标题同款样式 */
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    /* 直接在 panel 上，从左边缘算起 14px，与 ul(0 6px) + section(6px 8px) 的视觉起点对齐 */
    padding: 6px 14px;
    margin: 0;
}

.mobile-menu__links {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 6px;
    margin: 0;
    margin-top: 16px; /* 首页按钮上方空距 */
}

/* 移动端：首页、文章归档按钮单独一行撑满宽度 */
.mobile-menu__links li:first-child,
.mobile-menu__links li:has(a[href="/archive"]) {
    grid-column: 1 / -1;
}

.mobile-menu__links a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px; /* 按钮整体稍微缩小 */
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem; /* 字号略小一点 */
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    touch-action: manipulation; /* iOS：菜单链接点击可靠 */
}

.mobile-menu__links a:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

body.light-mode .mobile-menu__links a:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

body.mobile-menu-open .mobile-menu {
    opacity: 1;
    pointer-events: auto;
}

body.mobile-menu-open .mobile-menu__panel {
    transform: translateX(0);
}

.navbar--compact .nav-wrapper {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.navbar--compact .nav-current-wrapper {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

.nav-actions-wrapper:has(.theme-toggle:hover),
.nav-actions-wrapper:has(.menu-toggle:hover),
.nav-actions-wrapper:has(.progress-button:hover) {
    border-color: var(--border-color);
}

body:not(.light-mode) .nav-actions-wrapper:has(.theme-toggle:hover),
body:not(.light-mode) .nav-actions-wrapper:has(.menu-toggle:hover),
body:not(.light-mode) .nav-actions-wrapper:has(.progress-button:hover) {
    border-color: var(--border-color);
}

/* 滚动时的样式 */

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

/* 当前页面滚动进度按钮（数值百分比，不显示 %） */
.progress-button {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 36px;  /* 固定宽高，始终为圆形 */
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    pointer-events: auto !important;
    z-index: 1002 !important;
    position: relative;
}

.progress-button:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
}

body.light-mode .progress-button:hover {
    background-color: #000000;
    color: #ffffff;
}

.theme-toggle:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
}

body.light-mode .theme-toggle:hover {
    background-color: #000000;
    color: #ffffff;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

body.light-mode .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

body.light-mode .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.container {
    max-width: 1200px;
    width: 100%;
    /* 允许内部模块（如文章头图）横向溢出，以便实现真正的全宽效果；
       整体页面仍由 html, body 的 overflow-x: clip 控制不出现横向滚动条 */
    overflow-x: visible;
    margin: 0 auto;
    padding: 20px;
    padding-top: 0;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Bento布局：与主内容顶对齐，不留侧边栏上方空距 */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 12px;
    margin-bottom: 24px;
    margin-top: 0;
    padding-top: 0;
    align-items: start;
    min-width: 0;
}

/* 主要内容 */
.main-content {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* 特色文章（特殊布局：大图 + 底部叠字，不强制比例） */
.featured-post {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    min-height: 320px;
}

.featured-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.featured-post-label {
    font-size: 1.8rem;
    padding: 32px 32px 10px;
    position: relative;
    z-index: 1;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    margin-top: 260px;
    display: block;
    font-weight: 700;
}

.featured-post__category {
    display: none; /* 桌面不显示，一行一卡时显示 */
}
.featured-post h3 {
    margin: 0 32px 12px;
    padding: 0;
    position: relative;
    z-index: 1;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
}

.featured-post p {
    padding: 0 32px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.featured-post__meta {
    display: none;
}
.featured-post .date {
    display: none;
}

.featured-post .btn {
    display: inline-block;
    margin: 0 32px 32px;
    padding: 10px 20px;
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
}

.featured-post .btn:hover {
    background-color: #333333;
}

body.light-mode .featured-post .btn {
    background-color: #ffffff;
    color: #000000;
}

body.light-mode .featured-post .btn:hover {
    background-color: #f5f5f5;
}

.featured-post .btn {
    display: inline-block;
    margin: 0 32px 32px;
    padding: 10px 20px;
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
}

.featured-post .btn:hover {
    background-color: #333333;
}

body.light-mode .featured-post .btn {
    background-color: #ffffff;
    color: #000000;
}

body.light-mode .featured-post .btn:hover {
    background-color: #f5f5f5;
}

/* 文章网格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    min-width: 0;
}

.post-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.post-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
    min-width: 0;
}

.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.post-image img {
    width: 100%;
    height: auto;
    min-height: 100%;
    display: block;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.post-card:hover .post-image img {
    transform: scale(1.1);
}

/* 文章卡片分类小字（与关于页人格类型标签同款） */
.post-card__category {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0;
    padding: 24px 32px 0 32px; /* 图片下边距 24px */
}

.post-card h3 {
    font-size: 1.2rem;
    line-height: 1.35;
    margin-top: 0;
    margin-bottom: 10px;
    padding: 0 32px 0 32px;
    min-height: 2.7em; /* 预留两行高度 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-card > p {
    display: none; /* 去掉内容预览，仅最新文章保留 */
}

.post-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0 32px 24px 32px;
}
.post-card__meta .date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.post-card__meta .date::before,
.featured-post__meta .date::before {
    content: '';
    width: 14px;
    height: 14px;
    max-width: 14px;
    max-height: 14px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: currentColor;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

body:not(.light-mode) .post-card:hover {
    background-color: var(--bg-secondary);
}

/* 侧边栏：sticky 必须在内层，否则 grid 子元素会相对格子吸顶（随页面上移） */
.sidebar {
    margin-top: 0;
    align-self: stretch;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 侧栏内层撑满列高，目录 sticky 才有可吸顶的滚动区间 */
.sidebar__inner {
    position: static;
    padding-top: 0;
    padding-bottom: 0;
    align-self: stretch;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.sidebar__inner > div,
.sidebar__inner > .sidebar-toc {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
}

.sidebar__inner > .sidebar-toc {
    padding: 24px;
    position: sticky;
    top: 68px; /* 吸顶后目录顶边贴住 navbar 下沿（4+60+4 px） */
    align-self: stretch;
    width: 100%;
    box-sizing: border-box;
}

/* 侧边栏目录卡片 */
.sidebar-toc__title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 16px;
    color: var(--text-primary);
}

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

.sidebar-toc__list li {
    margin: 0;
}

/* 当前 h2 项下才显示其 h3 子列表 */
.sidebar-toc__sublist {
    display: none;
    list-style: none;
    margin: 4px 0 4px 0;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--border-color);
}
.sidebar-toc__list > li:has(.is-active) .sidebar-toc__sublist {
    display: block;
}
.sidebar-toc__sublist li {
    margin: 0;
}
.sidebar-toc__sublist a {
    font-size: 0.85rem;
    padding: 2px 0;
}
.sidebar-toc__sublist a.is-active {
    font-size: 0.9rem;
}

.sidebar-toc__list a {
    display: block;
    padding: 4px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.2s;
}

.sidebar-toc__list li:first-child a {
    padding-top: 0;
}

.sidebar-toc__list li:last-child a {
    padding-bottom: 0;
}

.sidebar-toc__list a:hover {
    color: var(--text-primary);
}

.sidebar-toc__list a.is-active {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

/* h2 目录项高亮时字号放大；子目录（h3）为当前项时父级 h2 也高亮并放大 */
.sidebar-toc__list > li > a.is-active,
.sidebar-toc__list > li:has(.sidebar-toc__sublist a.is-active) > a {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

body.light-mode .sidebar-toc__list a:hover {
    color: #000000;
}

body.light-mode .sidebar-toc__list a.is-active {
    color: #000000;
}

body.light-mode .sidebar-toc__list > li:has(.sidebar-toc__sublist a.is-active) > a {
    color: #000000;
}

/* 个人信息 */
.profile {
    text-align: center;
    padding: 24px;
}
.sidebar__inner > .profile {
    padding: 24px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 0;
    border: 2px solid var(--border-color);
}

.profile h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* 侧边栏：标签 / 分类 / 文章 统计（数字 + 文案，三列） */
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}
.profile-stats__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.profile-stats__item:hover {
    color: var(--accent);
}
.profile-stats__num {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.profile-stats__item:hover .profile-stats__num {
    color: var(--accent);
}
.profile-stats__label {
    font-size: 0.85rem;
    line-height: 1;
    color: var(--text-secondary);
    margin-top: 8px;
}
body.light-mode .profile-stats__item:hover .profile-stats__num {
    color: #000000;
}

.profile p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.sidebar-page-pv {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.profile .social-icons {
    margin-top: 0.75rem;
}
.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.icon-link {
    /* hover 样式见下方媒体查询：避免 iOS 首次触摸只触发 hover 而不触发 click */
}

.icon-link svg {
    width: 18px;
    height: 18px;
}

/* 标签 */
.tags h4,
.stats h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    background-color: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.tag:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.tag:active,
.tag:focus {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
    outline: none;
}

body.light-mode .tag:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

body.light-mode .tag:active,
body.light-mode .tag:focus {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
    outline: none;
}

/* 关于页头像区（无卡片） */
.about-header {
    text-align: center;
    margin-bottom: -4px; /* 与 bento-about gap 12px 叠加，实际名字到卡片距离 = 10px */
}

.about-header .avatar {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.about-header__name {
    margin-top: 12px;
    margin-bottom: 0.5em;
    font-size: 1.8rem; /* 与首页“最新文章”字号一致 */
    font-weight: 700;
}

.about-header__desc {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.stack-section-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}
.stack-section-title--spaced {
    margin-top: 1rem;
}

/* 标准：卡片与下方区块间距 24px。装备页「卡片—居家生活」= gap 12px + 此处标题上边距 */
.bento-row + .stack-section-title--spaced {
    margin-top: 4px;
}

/* 关于页 Bento 布局（无侧边栏）；与首页/文章页一致，主内容区下边距 24px */
.bento-about {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    margin-top: 4px;
}

.bento-row {
    display: grid;
    gap: 12px;
}

/* 一行一个卡片（全宽） */
.bento-row--single {
    grid-template-columns: 1fr;
}

/* 一行两个卡片（同宽） */
.bento-row--equal {
    grid-template-columns: 1fr 1fr;
}

.bento-row--four {
    grid-template-columns: repeat(4, 1fr);
}

/* 左宽右窄（比例柔和，避免悬殊） */
.bento-row--left-wide {
    grid-template-columns: 5fr 4fr;
}

/* 左窄右宽（比例柔和，避免悬殊） */
.bento-row--right-wide {
    grid-template-columns: 4fr 5fr;
}

/* 关于页卡片（与首页 sidebar 个人简介卡片完全一致） */
.about-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    min-width: 0; /* 防止被内部内容撑开，确保 grid 布局中等宽 */
    overflow: hidden; /* 确保内容不会撑开卡片 */
}

.about-card h3 {
    font-size: 1.8rem; /* 与首页“最新文章”字号一致 */
    font-weight: 700;
    margin-bottom: 12px;
    margin-top: -6px;
}

.about-card p {
    display: none; /* 去掉副标题 */
}

.about-card--intro p {
    display: block;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* 👋 招手动画 */
.wave-emoji {
    display: inline-block;
    transform-origin: 70% 70%; /* 以手心为中心旋转 */
    will-change: transform; /* 优化渲染性能 */
    -webkit-animation: wave 1.2s ease-out 1;
    animation: wave 1.2s ease-out 1;
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(25deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(25deg);
    }
}

/* 装备页列表 */
.stack-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.stack-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.stack-list li:last-child {
    border-bottom: none;
}
.stack-item__name {
    font-weight: 500;
    color: var(--text-primary);
}
.stack-item__spec {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 装备页产品卡片（上图 + 标题 + 副标题） */
.about-card--stack {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.about-card--stack .stack-card__img-wrap {
    padding: 24px 24px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px; /* 固定高度，宽度随卡片自适应 */
    background: transparent;
    overflow: hidden;
}
.about-card--stack .stack-card__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    aspect-ratio: 1; /* 图片 1:1 显示 */
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}
@media (hover: hover) {
    .about-card--stack:hover .stack-card__img {
        transform: scale(1.05);
    }
}
.about-card--stack .stack-card__title {
    margin: 0 24px 2px 24px;
    padding: 0;
    font-size: 1.2rem; /* 与首页文章卡片 .post-card h3 一致 */
    font-weight: 600;
    color: var(--text-primary);
}
.about-card--stack .stack-card__subtitle {
    margin: 0 24px 24px 24px;
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block !important; /* 覆盖 .about-card p { display: none } */
}

/* 关于页 技术栈卡片 */
.about-card--tech {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-card__tech-header h3 {
    margin-top: -6px; /* 与其他 about 卡片标题一致，避免额外上方空白 */
    margin-bottom: 12px;
}

.about-card__tech-header p {
    display: none; /* 去掉技术栈卡片的副标题 */
}

.tech-card__content {
    position: relative;
    margin-top: 4px;
    margin-left: -32px;
    margin-right: -32px;
    width: calc(100% + 64px);
    min-width: 0;
    background: var(--bg-secondary); /* 添加背景色，避免闪白 */
    overflow: hidden; /* 确保内容不会溢出 */
    contain: layout style paint; /* 隔离渲染 */
}

.tech-stack-scroller {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary); /* 添加背景色，避免闪白 */
    will-change: transform; /* 优化性能 */
    backface-visibility: hidden; /* 避免重绘 */
    contain: layout style paint; /* 隔离渲染，避免影响其他元素 */
    isolation: isolate; /* 创建新的层叠上下文 */
    /* 移除 transition，避免动画循环时的过渡效果导致闪白 */
}

/* 仅桌面端：技能卡片 hover 时展示概览、暂停滚动 */
@media (min-width: 769px) {
    .about-card--tech:hover .tech-card__content .tech-stack-scroller {
        opacity: 0;
        transition: opacity 0.35s ease; /* 只在 hover 时添加 transition */
    }

    .about-card--tech:hover .tech-row {
        animation-play-state: paused;
    }

    .about-card--tech:hover .tech-card__content .tech-overview {
        opacity: 1;
        pointer-events: auto;
        transition: opacity 0.35s ease; /* 只在 hover 时添加 transition */
    }
}

.tech-overview {
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    will-change: opacity; /* 优化性能 */
    backface-visibility: hidden; /* 避免重绘 */
    z-index: 1; /* 确保在 scroller 之上 */
    visibility: hidden; /* 默认隐藏，避免意外显示 */
    transition: none; /* 完全移除 transition，避免动画循环时的过渡效果 */
}

.about-card--tech:hover .tech-card__content .tech-overview,
.about-card--tech.is-expanded .tech-card__content .tech-overview {
    visibility: visible; /* hover 或展开时才显示 */
}

/* 移动端：无 hover，仅通过点击 .is-expanded 切换展开/收起 */
@media (max-width: 768px) {
    .about-card--tech.is-expanded .tech-card__content .tech-stack-scroller {
        opacity: 0;
        transition: opacity 0.35s ease; /* 只在展开时添加 transition */
    }

    .about-card--tech.is-expanded .tech-row {
        animation-play-state: paused;
    }

    .about-card--tech.is-expanded .tech-card__content .tech-overview {
        opacity: 1;
        pointer-events: auto;
        transition: opacity 0.35s ease; /* 只在展开时添加 transition */
    }
}

.tech-overview__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 12px;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.tech-tag img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.tech-stack-grid {
    display: flex;
    flex-direction: column;
    gap: 12px; /* 两行之间的间距 */
    width: max-content;
    background: var(--bg-secondary); /* 添加背景色，避免闪白 */
    contain: layout style paint; /* 隔离渲染 */
}

.tech-stack-scroller {
    /* 技能模块参数化：以后你增减图标/改尺寸，不用再动动画逻辑 */
    --tech-item-size: 96px;
    --tech-item-gap: 12px;
    --tech-step: calc(var(--tech-item-size) + var(--tech-item-gap));
    --tech-offset: calc(var(--tech-step) / 2); /* 用“半个步长”强制错开，和图标数量奇偶无关 */
}

.tech-row {
    display: flex;
    gap: 0; /* 统一使用子元素的 margin 控制间距，保证两组宽度严格相等，避免循环衔接时“弹动” */
    width: max-content;
    animation: tech-row-scroll 14s linear infinite;
    animation-play-state: running;
    will-change: transform; /* 优化动画性能，避免闪白 */
    backface-visibility: hidden; /* 避免重绘导致的闪白 */
    transform: translate3d(0, 0, 0); /* 使用 transform3d 启用硬件加速 */
    perspective: 1000px; /* 创建 3D 渲染上下文 */
}

/* 两行保持同向滚动，通过相位错开来“错位” */
.tech-row--bottom {
    animation-name: tech-row-scroll-bottom;
}

/* 不再 hover 才滚动；如需悬停暂停可再加回去 */

@keyframes tech-row-scroll {
    0% {
        transform: translate3d(0, 0, 0); /* 使用 transform3d 强制 GPU 加速 */
    }
    100% {
        transform: translate3d(-50%, 0, 0); /* 滚动到一半（第一组的宽度）无缝循环 */
    }
}

@keyframes tech-row-scroll-bottom {
    0% {
        transform: translate3d(calc(0px - var(--tech-offset)), 0, 0); /* 固定错开半个步长 */
    }
    100% {
        transform: translate3d(calc(-50% - var(--tech-offset)), 0, 0); /* 在同样路程上整体平移，保证无缝循环 */
    }
}

.tech-item {
    flex: 0 0 var(--tech-item-size); /* 预留固定宽度，避免图片加载后速度“变快” */
    width: var(--tech-item-size);
    height: var(--tech-item-size);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: var(--tech-item-gap); /* 横向间距由每个图标自己的外边距提供，配合无 gap 保证两组宽度为严格 1:1 */
    backface-visibility: hidden; /* 避免重绘 */
    transform: translateZ(0); /* 启用硬件加速 */
    will-change: transform; /* 优化性能 */
}

.tech-item img {
    display: block;
    height: var(--tech-item-size);
    width: var(--tech-item-size); /* 固定尺寸，避免加载前后布局变化 */
    filter: none; /* 去掉阴影 */
    backface-visibility: hidden; /* 避免图片重绘导致的闪白 */
    transform: translateZ(0); /* 启用硬件加速 */
}

.about-card a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.about-card a:hover {
    color: var(--text-primary);
}

/* 友链卡片：上地图 + 下位置条；地图区背景与其它 about 卡片一致，底行保持原样 */
.about-card--friendlink {
    padding: 0;
    overflow: hidden;
}

.friendlink-map {
    width: 100%;
    height: 200px;
    background: var(--bg-secondary);
}

/* MapLibre GL 地图容器：填满卡片上半部分 */
.friendlink-map canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}


/* 深色模式下署名控件保持浅底深字，避免白字/白 © 不可见、hover 白字看不见 */
body:not(.light-mode) .friendlink-map .maplibregl-ctrl-attrib {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
}
body:not(.light-mode) .friendlink-map .maplibregl-ctrl-attrib a {
    color: #1a73e8 !important;
}
body:not(.light-mode) .friendlink-map .maplibregl-ctrl-attrib a:hover {
    color: #0d47a1 !important;
}

.friendlink-location {
    background: var(--bg-tertiary);
    padding: 12px 12px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.friendlink-location p {
    display: block;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.friendlink-location strong {
    color: var(--text-primary);
}

/* 友链页卡片列表 */
.friendlink-list {
    margin-top: 0;
}
.friendlink-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}
@media (hover: hover) {
    .friendlink-card:hover {
        background-color: var(--bg-tertiary);
    }
}
.friendlink-card__name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}
.friendlink-card:hover .friendlink-card__name {
    color: var(--accent-color);
}
.friendlink-card__desc {
    display: block !important;
    font-size: 0.85rem; /* 与装备卡片副标题一致 */
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* 文章详情页：主内容 + 侧栏两列（与首页一致）；上边距只加在主内容，侧栏用自身 margin-top */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 270px;
    column-gap: 12px;
    row-gap: 0;
    margin-bottom: 24px;
    margin-top: 0;
    align-items: stretch;
    min-width: 0;
}

/* 主内容列撑满与侧栏同高，文章卡片填满主内容列 */
.post-layout .post-page {
    margin-top: 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.post-layout .post-page__article {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.post-layout .post-page__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 正文内容单独一层：块级流内 margin 折叠保持（多行行距 12 不变成 24） */
.post-layout .post-page__body .post-page__body-content {
    flex: 1;
    min-height: 0;
}

.post-layout .post-page__body .post-copyright-wrap {
    margin-top: auto;
}

/* 文章详情页头部模块 */
.post-header {
    position: relative;
    margin-top: 0;
    margin-bottom: 12px;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: transparent;
}

.post-header__background {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}

/* 浅色模式下的头部背景 */
body.light-mode .post-header__background {
    background: transparent;
}

/* 浅色模式下 post-header 文字改为黑色 */
body.light-mode .post-header__content {
    color: #000000;
}

body.light-mode .post-header__category {
    background: rgba(0, 0, 0, 0.1);
    color: #000000;
}

body.light-mode .post-header__category:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #000000;
}

body.light-mode .post-header__tag {
    color: #000000;
}

body.light-mode .post-header__tag:hover {
    color: #000000;
}

body.light-mode .post-header__star {
    color: rgba(0, 0, 0, 0.9);
}

body.light-mode .post-header__line {
    background: rgba(0, 0, 0, 0.5);
}

body.light-mode .post-header__avatar {
    border-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .post-header__action,
body.light-mode .post-header__nav {
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.1);
    color: #000000;
}

body.light-mode .post-header__action:hover,
body.light-mode .post-header__nav:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.5);
}

/* 雪花装饰 */
.post-header__decoration--snowflake {
    display: none;
}

.post-header__decoration--snowflake::before {
    content: none;
}

/* 树枝装饰 */
.post-header__decoration--branches {
    display: none;
}

/* 飘落的雪花 */
.post-header__snow {
    display: none;
}

@keyframes snow-fall {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 0% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 100%; }
}

.post-header__content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 12px 0;
    margin-top: 0;
    text-align: left;
    color: #ffffff;
    pointer-events: none;
}

.post-header__content > * {
    pointer-events: auto;
}

/* 头图标题上方：分类 + 标签（模仿参考图） */
.post-header__top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.post-header__category {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.25;
    opacity: 0.9;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.post-header__category:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #2a529e;
    opacity: 1;
}

/* 头图标签：字号与 post-header__meta 统一；圆角与卡片一致 8px，由文字+边距预设大小，hover 只改背景/文字色不位移 */
.post-header__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.post-header__tag {
    display: inline-block;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    text-decoration: none;
    font-size: inherit;
    line-height: 1.25;
    white-space: nowrap;
    opacity: 0.9;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.post-header__tag:hover {
    color: #ffffff;
    opacity: 1;
}

.post-header__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
    text-shadow: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.post-header__subtitle {
    font-size: 0.95rem;
    margin: 0 0 20px;
    opacity: 0.9;
}

.post-header__separator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 0 0 24px;
}

.post-header__star {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
}

.post-header__line {
    width: 60px;
    height: 1px;
    background: rgba(255,255,255,0.5);
}

.post-header__excerpt {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 32px;
    opacity: 0.95;
    max-width: 600px;
    margin-left: 0;
    margin-right: 0;
}

.post-header__meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    padding-top: 6px;
    padding-bottom: 6px;
}

.post-header__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.post-header__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
}

.post-header__icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.post-header__action,
.post-header__nav {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-header__action:hover,
.post-header__nav:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.post-header__action svg,
.post-header__nav svg {
    width: 18px;
    height: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-header {
        padding: 0 20px; /* 与 container 移动端 padding 一致 */
        border-radius: 0;
    }
    
    .post-header__content {
        padding: 12px 0;
    }
    
    .post-header__title {
        font-size: 1.875rem;
    }
    
    .post-header__meta {
        gap: 12px;
        font-size: 0.9rem;
    }

    .post-header__tags {
        font-size: 0.9rem;
    }
    
    .post-header__decoration--snowflake,
    .post-header__decoration--branches {
        opacity: 0.2;
    }
}

/* 文章详情页（单篇布局） */
.post-page {
    padding: 0; /* 上下无 padding，左右由 .container 控制 */
}
/* 文章标题+正文放在同一张卡片内（与侧栏卡片风格一致） */
.post-page__article {
    margin: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    box-sizing: border-box;
}
.post-page__category {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.post-page__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    line-height: 1.3;
}
.post-page__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 24px;
}
.post-page__body {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}
.post-page__body p {
    margin: 12px 0;
}
.post-page__body p:first-child {
    margin-top: 0;
}
.post-page__body p:last-child {
    margin-bottom: 0;
}

.post-page__body a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s, border-color 0.2s;
}
.post-page__body a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* 文章正文排版优化（margin 已去掉，由你自行设计） */
.post-page__body h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 24px 0 12px; /* 一级标题：段前 24px */
}
.post-page__body h2:first-child {
    margin-top: 12px;
}

.post-page__body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 12px 0;
}

.post-page__body h4 {
    margin: 12px 0;
}

/* 点击目录跳转时，目标上方留出 navbar 高度，避免被顶栏遮挡 */
.post-page__body h2,
.post-page__body h3,
.post-page__body h4 {
    scroll-margin-top: 68px;
}

.post-page__body ul,
.post-page__body ol {
    margin: 0;
    padding-left: 1.5em; /* 序号与项目符号缩进到正文区域内 */
}

.post-page__body li ul,
.post-page__body li ol {
    margin: 0.25em 0;
    padding-left: 1.5em;
}

.post-page__body li {
    margin: 0;
}

.post-page__body del {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.post-page__body code:not(pre code) {
    padding: 0.2em 0.4em;
    margin: 0 0.2em;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
}

.post-page__body img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.post-page__body figure {
    margin: 12px 0;
}

.post-page__body figure img {
    display: block;
    width: 100%;
    border-radius: 8px;
}

.post-page__body figcaption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.post-page__body .post-body-p--inline-img .post-body-text--middle,
.post-page__body .post-body-img--inline-wrap {
    display: inline;
    vertical-align: middle;
}

.post-page__body .post-body-img--inline-wrap {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.post-page__body .post-body-img--inline {
    height: 1.35em;
    width: auto;
    display: block;
    border-radius: 0;
}

.post-page__body .post-body-img--center {
    text-align: center;
}

.post-page__body .post-body-img--center img {
    display: inline-block;
    margin-top: 12px;
}

.post-page__body blockquote {
    margin: 0;
    padding: 0.5em 0 0.5em 1em;
    border-left: 4px solid var(--border-color);
    color: var(--text-secondary);
}

/* 代码块容器：表头 + 行号 + 复制按钮（由 JS 包裹） */
.post-page__body .code-block {
    margin: 12px 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.post-page__body .code-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.post-page__body .code-block__expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    margin-right: 8px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.post-page__body .code-block__expand:hover {
    color: var(--text-primary);
}
.post-page__body .code-block__expand .code-block__expand-icon {
    display: block;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}
.post-page__body .code-block--collapsed .code-block__expand .code-block__expand-icon {
    transform: rotate(-90deg); /* 收起时箭头朝右 */
}
.post-page__body .code-block--collapsed .code-block__body {
    display: none;
}
.post-page__body .code-block--collapsed .code-block__header {
    border-bottom: none;
}
.post-page__body .code-block__title {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.post-page__body .code-block__copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.post-page__body .code-block__copy:hover {
    color: var(--text-primary);
}
.post-page__body .code-block__copy:active {
    transform: scale(0.96);
}
.post-page__body .code-block__copy.copied {
    color: var(--accent);
}
.post-page__body .code-block__body {
    overflow-x: auto;
}
.post-page__body .code-block__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.6;
    font-family: ui-monospace, monospace;
}
.post-page__body .code-block__table td {
    vertical-align: top;
    padding: 0;
}
.post-page__body .code-block__table td.gutter {
    width: 1%;
    min-width: 2.5em;
    padding: 0 12px 0 1em;
    text-align: right;
    color: var(--text-tertiary, var(--text-secondary));
    user-select: none;
    border-right: 1px solid var(--border-color);
}
.post-page__body .code-block__table td.gutter .line {
    display: block;
}
.post-page__body .code-block__table td.code {
    padding: 0 1em 0 12px;
    min-width: 0;
}
.post-page__body .code-block__table tr:first-child td.gutter,
.post-page__body .code-block__table tr:first-child td.code {
    padding-top: 12px;
}
.post-page__body .code-block__table tr:last-child td.gutter,
.post-page__body .code-block__table tr:last-child td.code {
    padding-bottom: 12px;
}
/* 最后一个数据行（展开更多行的上一行）始终有下间距 */
.post-page__body .code-block__table .code-block__data-row:nth-last-child(2) td.gutter,
.post-page__body .code-block__table .code-block__data-row:nth-last-child(2) td.code {
    padding-bottom: 12px;
}
.post-page__body .code-block__table .code-line {
    white-space: pre;
    color: var(--text-primary);
}

/* 超过 12 行时默认截断，点击展开 */
.post-page__body .code-block--truncated .code-block__data-row:nth-child(n+13) {
    display: none;
}
/* 截断时第 12 行下方也要有 12px，与「展开更多」隔开 */
.post-page__body .code-block--truncated .code-block__data-row:nth-child(12) td.gutter,
.post-page__body .code-block--truncated .code-block__data-row:nth-child(12) td.code {
    padding-bottom: 12px;
}
.post-page__body .code-block__more-row {
    border-top: 1px solid var(--border-color);
}
.post-page__body .code-block__more-cell {
    padding: 10px;
    text-align: center;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: background-color 0.2s;
}
.post-page__body .code-block__more-cell:hover {
    background: color-mix(in srgb, var(--bg-tertiary) 70%, var(--border-color));
}
.post-page__body .code-block__more-cell:hover .code-block__more-btn {
    color: var(--text-primary);
}
.post-page__body .code-block__more-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}
.post-page__body .code-block__more-btn svg {
    display: block;
    transition: transform 0.2s;
}

.post-page__body pre:not(.code-block pre) {
    margin: 12px 0;
    padding: 1em;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
}

.post-page__body pre:not(.code-block pre) code {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.post-page__body hr {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* 文章底部版权声明（头像 + 圆角卡片） */
.post-copyright-wrap {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.post-copyright__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    margin-bottom: -28px;
    z-index: 1;
    display: block;
    object-fit: cover;
}

.post-copyright {
    margin-top: 0;
    padding: 36px 18px 14px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.post-copyright__text {
    display: inline;
    vertical-align: middle;
}

.post-copyright__cc-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 0;
}

.post-copyright__cc-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.post-copyright a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.post-copyright a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* 正文中的表格（排除代码块内的 .code-block__table） */
.post-page__body table:not(.code-block__table) {
    width: 100%;
    margin: 12px 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
}
.post-page__body table:not(.code-block__table) th,
.post-page__body table:not(.code-block__table) td {
    padding: 8px 12px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
.post-page__body table:not(.code-block__table) th:first-child,
.post-page__body table:not(.code-block__table) td:first-child {
    border-left: 1px solid var(--border-color);
}
.post-page__body table:not(.code-block__table) thead th {
    border-top: 1px solid var(--border-color);
}
.post-page__body table:not(.code-block__table) th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}
.post-page__body table:not(.code-block__table) th:first-child {
    border-top-left-radius: 8px;
}
.post-page__body table:not(.code-block__table) th:last-child {
    border-top-right-radius: 8px;
}
.post-page__body table:not(.code-block__table) tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}
.post-page__body table:not(.code-block__table) tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* Element Loading：去掉 spinner 占位高度（避免顶出布局） */
.el-loading-spinner {
    height: 0 !important;
    min-height: 0 !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* 文章归档页 */
.tags-page .tags-card {
    padding: 24px 32px;
}

/* 分类：一行四个卡片 */
.archive-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: 20px 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem; /* 与装备卡片标题一致 */
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.archive-category-card:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}
.archive-category-card[data-count]::after {
    content: attr(data-count) "篇";
    margin-top: 4px;
    font-size: 0.85rem; /* 与装备卡片副标题一致 */
    font-weight: 500;
    color: var(--text-secondary);
}

/* 标签：圆角矩形随文字长度变化 */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
}
.tags-page > .tags-list {
    margin-left: 0;
}
.tags-list .tag-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px; /* 圆润胶囊形，背景与分类卡片一致 */
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem; /* 与关于页正文字号一致 */
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.tags-list .tag-pill::before {
    content: '#';
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 0.35em; /* 井号与文字间距，不用空格 */
}
.tags-list .tag-pill[data-count]::after {
    content: attr(data-count);
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-secondary);
    vertical-align: super;
    line-height: 0;
    margin-left: 0.35em; /* 文字与上标间距，不用空格 */
}
.tags-list .tag-pill:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}
.tags-list .tag-pill:hover::before {
    color: var(--bg-primary);
}
.tags-list .tag-pill:hover::after {
    color: var(--bg-primary);
    opacity: 0.9;
}
body.light-mode .tags-list .tag-pill:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}
body.light-mode .tags-list .tag-pill:hover::before {
    color: #ffffff;
}
body.light-mode .tags-list .tag-pill:hover::after {
    color: #ffffff;
    opacity: 0.9;
}
.tags-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 人格类型卡片：固定两栏，左文右图 */
.about-card--personality {
    display: grid;
    grid-template-columns: 1fr 200px;
    padding: 0;
    align-items: stretch;
}

.personality-card__text {
    padding: 32px 12px 32px 28px; /* 右侧（图片左侧）空距小一点 */
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.personality-card__visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 20px 0; /* 上下留白，左右无 padding 以便 200px 图片完整显示 */
}

.personality-card__visual img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    object-position: center;
}

.personality-card__label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* 移动端菜单：分组标题（同“人格类型”样式） */
.mobile-menu__section {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    /* 与“菜单”标题左侧空白保持一致：ul 左内边距 6px + 自身 8px = 14px */
    padding: 6px 8px; /* 缩小“关于”上下空距并减小左侧空白 */
    margin: 0;
    grid-column: 1 / -1; /* 两列按钮时占满整行 */
}

.about-card--personality .personality-card__desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

.personality-card__code {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2dd4bf;
    margin: 0 0 14px 0;
}

.personality-card__link {
    /* 只让文字成为可点击区域（不再是一整块矩形） */
    display: inline;
    font-size: 0.9rem;
    color: var(--text-secondary) !important;
    /* 用 auto 把链接推到底部，再用 padding-top 控制与正文之间的空距 */
    margin-top: auto;
    padding-top: 0.6em;
    /* 移动端长按时去掉系统默认的深色点击高亮背景 */
    -webkit-tap-highlight-color: transparent;
    background-color: transparent !important;
}

.personality-card__link:hover {
    color: #2dd4bf !important;
}

body.light-mode .personality-card__code {
    color: #0d9488;
}

body.light-mode .personality-card__link:hover {
    color: #0d9488 !important;
}

/* 移动端人格类型卡片不显示图片 */
@media (max-width: 768px) {
    .about-card--personality {
        grid-template-columns: 1fr;
    }

    .about-card--personality .personality-card__visual {
        display: none;
    }
}

@media (max-width: 380px) {
    .about-card--personality {
        grid-template-rows: auto auto;
    }
}

/* 关于页响应式 */
@media (max-width: 1024px) {
    .bento-row--left-wide,
    .bento-row--right-wide {
        grid-template-columns: 1fr;
    }
}

/* 首页 / 关于页：在中等宽度以上展示两列卡片 */
@media (max-width: 1024px) {
    /* 首页：中等宽度时收起侧边栏，只保留内容一列（但文章列表仍可两列） */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    /* 首页：当文章卡片进入 2 列/1 列断点时，不展示侧边栏卡片 */
    .sidebar {
        display: none;
    }

    /* 文章详情页：窄屏单列 */
    .post-layout {
        grid-template-columns: 1fr;
    }
}

/* 再窄一点时（如手机），首页和关于页的等宽行都缩成一列 */
@media (max-width: 1024px) {
    /* 关于页：所有等宽行改为单列 */
    .bento-row--equal {
        grid-template-columns: 1fr;
    }
}

/* 装备页四列卡片：大屏 4 列 → 中屏 3 列 → 小屏 2 列 → 窄屏 1 列 */
@media (max-width: 1200px) {
    .bento-row--four {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 900px) {
    .bento-row--four {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* 装备页 / 友链页：一行两卡 → 一行一卡断点与友链一致（600px 两列，420px 一列） */
@media (max-width: 600px) {
    .bento-row--four {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 420px) {
    .bento-row--four {
        grid-template-columns: 1fr;
    }
}

/* 文章归档页分类：与友链同一断点 */
@media (max-width: 600px) {
    .tags-page .archive-categories.bento-row--four {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 420px) {
    .tags-page .archive-categories.bento-row--four {
        grid-template-columns: 1fr;
    }
}

/* 统计 */
.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.stat-item .number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-item .label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.about-card--intro .stats--about {
    margin-top: 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 社交链接 */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    display: block;
    padding: 10px;
    text-align: center;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.social-link:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}
.footer {
    padding: 20px 4px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 页脚：移动优先，默认窄屏布局，避免最后才应用媒体查询导致闪烁 */
.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    row-gap: 8px;
    column-gap: 4px;
    flex-wrap: wrap;
    text-align: center;
}

.footer-content > p,
.footer-content > .footer-links {
    width: 100%;
    flex-basis: 100%;
}

.footer-content p {
    margin: 0;
    flex-shrink: 0;
}

.footer-content p a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-content p a {
    /* hover 样式见下方媒体查询：避免触屏设备首点只触发 hover */
}

.footer-links {
    font-size: 0.85rem;
    display: block;
}

/* 默认（窄屏）：两行备案 萌|茶 / 幸|雾，每行居中 */
.footer-links--single {
    display: none;
}

.footer-links--double {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.footer-links--double .footer-links-line {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

/* 中屏 768px+：只显示单行四链接，居中；彻底隐藏两行备案避免同时出现 */
@media (min-width: 768px) {
    .footer-links--single {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        align-items: center;
    }
    .footer-links--double {
        display: none !important;
    }
}

/* 宽屏 1024px+：版权居左、备案居右；再次确保不显示两行备案 */
@media (min-width: 1024px) {
    .footer-content {
        justify-content: space-between;
        text-align: left;
    }
    .footer-content > p,
    .footer-content > .footer-links {
        width: auto;
        flex-basis: auto;
    }
    .footer-links--single {
        justify-content: flex-end;
    }
    .footer-links--double {
        display: none !important;
    }
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.footer-links a {
    /* hover 样式见下方媒体查询：避免触屏设备首点只触发 hover */
}

/* 仅在支持 hover 的设备（鼠标/触控板）上启用 hover 视觉反馈。
   触屏设备（如 iPhone）不启用 hover，避免“第一次 tap 只触发 hover、不触发 click”。 */
@media (hover: hover) and (pointer: fine) {
    .nav-current:hover {
        background-color: var(--accent);
        color: var(--bg-primary);
    }

    body.light-mode .nav-current:hover {
        background-color: #000000;
        color: #ffffff;
    }

    .nav-links a:hover {
        background-color: var(--accent);
        color: var(--bg-primary);
    }

    body.light-mode .nav-links a:hover {
        background-color: #000000;
        color: #ffffff;
    }

    .nav-item--dropdown:hover .nav-dropdown {
        opacity: 1;
        visibility: visible;
    }

    .nav-dropdown a:hover {
        background-color: var(--accent);
        color: var(--bg-primary);
    }

    body.light-mode .nav-dropdown a:hover {
        background-color: #000000;
        color: #ffffff;
    }

    .menu-toggle:hover {
        background-color: var(--accent);
        color: var(--bg-primary);
    }

    body.light-mode .menu-toggle:hover {
        background-color: #000000;
        color: #ffffff;
    }

    .icon-link:hover {
        background-color: var(--accent);
        color: var(--bg-primary);
        border-color: var(--accent);
    }

    body.light-mode .icon-link:hover {
        background-color: #000000;
        color: #ffffff;
        border-color: #000000;
    }

    .footer-content p a:hover {
        color: var(--text-primary);
    }

    .footer-links a:hover {
        color: var(--text-primary);
    }
}

.footer-links .separator {
    color: var(--border-color);
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding-left: 20px; /* 与顶栏 nav-container 左右边距一致 */
        padding-right: 20px;
    }

    /* 移动端：顶栏不显示任何导航（默认导航/当前页按钮） */
    .nav-wrapper,
    .nav-current-wrapper {
        display: none !important;
    }

    /* 移动端：两个按钮在同一个大圆角矩形里 */
    .theme-toggle-wrapper,
    .menu-toggle-wrapper {
        display: none !important;
    }

    .nav-actions-wrapper {
        width: auto;
        border-radius: 24px;
        padding: 4px;
        gap: 4px;
        justify-content: flex-end;
    }

    .nav-actions-wrapper .menu-toggle {
        display: flex;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .header h1 {
        font-size: 2rem;
    }

    .featured-post {
        position: static;
        min-height: auto;
        display: flex;
        flex-direction: column;
    }

    .featured-post img {
        position: static;
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

    .featured-post h2 {
        display: none;
    }

    .featured-post-label {
        display: none;
    }

    .featured-post__category {
        display: block;
        font-size: 0.75rem;
        letter-spacing: 0.06em;
        color: var(--text-secondary);
        margin-bottom: 0;
        padding: 24px 32px 0 32px; /* 图片下边距 24px */
    }

    .featured-post h3 {
        display: -webkit-box;
        font-size: 1.2rem;
        line-height: 1.35;
        padding: 0 32px 0 32px;
        margin: 0;
        margin-bottom: 10px;
        min-height: 2.7em; /* 预留两行高度 */
        color: var(--text-primary);
        text-shadow: none;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .featured-post p {
        display: none; /* 一行一卡时最新文章也不显示内容预览 */
    }

    .featured-post__meta {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 14px 20px;
        padding: 0 32px;
        color: var(--text-secondary);
        text-shadow: none;
        font-size: 0.85rem;
        margin-bottom: 24px;
    }
    .featured-post__meta .date {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .featured-post .btn {
        display: none;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}
