:root {
    --bg: #ffffff;
    --text: #50616d;
    --text-sub: #9aa5b1;
    --accent: #42b983;
    --border: #f0f2f5;
    --menu-bg: rgba(255, 255, 255, 0.98);
    --tag-bg: #f8fafc;
    --float-btn-bg: #ffffff;
    --status-bg: #f7f9fa;

    ---theme-color: var(--accent) !important;
    ---active-color: #2c3e50 !important;
    ---bgcolor: #ffffff !important;
    ---bgcolor-light: #f8f9fa !important;
    ---border-color: #eee !important;
}

[data-theme="dark"] {
    --bg: #1a202c;
    --text: #e2e8f0;
    --text-sub: #a0aec0;
    --accent: #68d391;
    --border: #2d3748;
    --menu-bg: rgba(26, 32, 44, 0.98);
    --tag-bg: #2d3748;
    --float-btn-bg: #2d3748;
    --status-bg: #2d3748;

    ---theme-color: var(--accent) !important;
    ---active-color: #e2e8f0 !important;
    ---bgcolor: #1a202c !important;
    ---bgcolor-light: #2d3748 !important;
    ---border-color: #2d3748 !important;
}

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

html,
body {
    background: var(--bg);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.search-box, .tag-pill, .status-card, #sidebar, .markdown-body pre, .nsk-magic-tab-title, .nsk-magic-tab-body, .toolbar-btn, .float-btn, .admonition {
    transition: background-color 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), transform 0.2s, box-shadow 0.2s;
}

a {
    text-decoration: none;
    color: inherit;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 20px 20px 100px;
    min-height: 100vh;
}

body.menu-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border); /* 新增：顶部和下方内容的虚线分割 */
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    flex-shrink: 0; 
}

@keyframes rotate-infinite {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.avatar:hover {
    animation: rotate-infinite 0.8s linear infinite;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent); 
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.site-title:hover {
    color: var(--accent);
    opacity: 0.8; 
}

.theme-icon {
    font-size: 1.2rem;
    color: #f6ad55;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s ease;
}

.theme-icon:hover {
    transform: rotate(20deg) scale(1.15);
}

.pc-nav {
    display: none;
    gap: 20px; 
    font-size: 1.15rem; 
    font-weight: 800; 
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto; 
    overflow: hidden;
}

.pc-nav a {
    text-decoration: none;
    color: var(--text);
    position: relative;
    padding: 5px 0;
    transition: color 0.2s;
    white-space: nowrap;
    word-break: keep-all;
    line-break: strict;
    flex-shrink: 0;
}

.pc-nav a:hover {
    color: var(--accent);
}

.nav-divider {
    color: var(--border);
    font-weight: 300;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0 -2px; 
}

.mobile-menu-btn {
    font-size: 1.4rem;
    color: var(--accent);
    cursor: pointer;
    padding: 5px;
    display: block;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none !important;
    }

    .pc-nav {
        display: flex !important;
        align-items: center;
    }

    #sidebar,
    #overlay {
        display: none !important;
    }
}

#sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 240px;
    height: 100%;
    background: var(--menu-bg);
    z-index: 1000;
    padding: 25px 20px;
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.08);
    transform: translateX(110%);
    transition: transform 0.3s, background-color 0.4s;
    backdrop-filter: blur(10px);
}

#sidebar.active {
    transform: translateX(0);
}

#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    margin: 5px 0;
    border-radius: 12px;
    font-weight: 750;
    color: var(--text);
    transition: all 0.2s;
}

.menu-link:hover {
    background: var(--tag-bg);
    color: var(--accent);
    transform: translateX(-3px);
}

.menu-link i {
    width: 20px;
}

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

.cursor {
    display: inline-block;
    width: 10px;
    height: 2px;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    margin-left: 5px;
    vertical-align: middle;
}

.intro-text {
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: var(--text);
    font-weight: 800;
}

.social-contact {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.4rem;
    color: var(--text);
    margin-top: 18px;
}

.social-label {
    font-weight: 800;
    margin-right: 5px;
    font-size: 1rem;
    color: var(--text);
}

.social-icon-link {
    color: var(--text-sub);
    transition: all 0.3s;
}

.social-icon-link:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.section-header {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    margin: 45px 0 24px 0;
}

.list-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 10px 0 26px;
}

.search-box {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--tag-bg);
}

.search-box i {
    color: var(--text-sub);
    font-size: 0.95rem;
}

.search-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.search-input::placeholder {
    color: var(--text-sub);
    font-weight: 700;
}

.search-clear {
    cursor: pointer;
    color: var(--text-sub);
    font-weight: 900;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 6px;
    border-radius: 10px;
    user-select: none;
}

.search-clear:hover {
    color: var(--accent);
}

.pager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.pager-info {
    color: var(--text-sub);
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
}

.pager-btn {
    user-select: none;
    cursor: pointer;
}

.pager-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
/* ==========================================
   1. 动态网站大背景 (纯色/网格/点阵)
   ========================================== */
/* 默认纯色：无缝的白/黑 */
html, body { background-color: #ffffff !important; }
html[data-theme="dark"], html[data-theme="dark"] body { background-color: #1a202c !important; } /* 高级黑青色 */

/* 开启网格/点阵：变更为带质感的灰 */
body[data-bg="grid"], body[data-bg="dots"] { background-color: #f2f3f5 !important; }
html[data-theme="dark"] body[data-bg="grid"], html[data-theme="dark"] body[data-bg="dots"] { background-color: #111827 !important; } /* 网格底色稍微加深，突出卡片 */

body[data-bg="grid"] {
    background-image: 
        linear-gradient(rgba(128, 128, 128, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 128, 128, 0.08) 1px, transparent 1px) !important;
    background-size: 24px 24px !important;
}
body[data-bg="dots"] {
    background-image: radial-gradient(rgba(128, 128, 128, 0.15) 1px, transparent 1px) !important;
    background-size: 20px 20px !important;
}

/* ==========================================
   2. 所有内容页的动态“容器” (恢复独立卡片布局)
   ========================================== */
.post-list, #article-view, #archive-view, #status-view {
    background: transparent; 
    padding: 20px 30px; 
    border-left: 1px solid var(--border); 
    border-right: 1px solid var(--border); 
    border-radius: 0;
    box-shadow: none;
    margin: 20px 0; 
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    transition: all 0.4s ease; 
}

/* 开启网格/点阵时：恢复单独卡片，去掉整页大白纸 */
body[data-bg="grid"] .post-list, body[data-bg="dots"] .post-list,
body[data-bg="grid"] #article-view, body[data-bg="dots"] #article-view,
body[data-bg="grid"] #archive-view, body[data-bg="dots"] #archive-view,
body[data-bg="grid"] #status-view, body[data-bg="dots"] #status-view {
    background: #ffffff;
    border-left: none;
    border-right: none;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.03), 0 0 2px rgba(0, 0, 0, 0.02);
}

/* 暗黑模式 */
html[data-theme="dark"] body[data-bg="grid"] .post-list,
html[data-theme="dark"] body[data-bg="dots"] .post-list,
html[data-theme="dark"] body[data-bg="grid"] #article-view,
html[data-theme="dark"] body[data-bg="dots"] #article-view,
html[data-theme="dark"] body[data-bg="grid"] #archive-view,
html[data-theme="dark"] body[data-bg="dots"] #archive-view,
html[data-theme="dark"] body[data-bg="grid"] #status-view,
html[data-theme="dark"] body[data-bg="dots"] #status-view {
    background: #1a202c; 
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
    .post-list, #article-view, #archive-view, #status-view { padding: 10px 16px; margin: 15px 0; }
    body[data-bg="grid"] .post-list, body[data-bg="dots"] .post-list,
    body[data-bg="grid"] #article-view, body[data-bg="dots"] #article-view,
    body[data-bg="grid"] #archive-view, body[data-bg="dots"] #archive-view,
    body[data-bg="grid"] #status-view, body[data-bg="dots"] #status-view {
        padding: 15px 16px;
        border-radius: 12px;
    }
}

/* ==========================================
   新增：顶部导航栏 - 悬浮胶囊岛屿
   ========================================== */
.nav-menu-island {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 8px 0; /* 纯色模式下无内边距，与背景融为一体 */
    background: transparent;
    border-radius: 50px; /* 极致圆润的胶囊两端 */
    transition: all 0.4s ease;
}

/* 网格/点阵模式下，菜单变成带阴影的悬浮胶囊 */
body[data-bg="grid"] .nav-menu-island, 
body[data-bg="dots"] .nav-menu-island {
    background: #ffffff;
    padding: 8px 24px; /* 撑开左右内边距，完美包裹文字 */
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.03), 0 0 2px rgba(0, 0, 0, 0.02);
}

/* 暗黑模式下，胶囊自动切换为高级黑青色 */
html[data-theme="dark"] body[data-bg="grid"] .nav-menu-island,
html[data-theme="dark"] body[data-bg="dots"] .nav-menu-island {
    background: #1a202c; 
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
    .nav-menu-island { gap: 12px; }
    body[data-bg="grid"] .nav-menu-island, 
    body[data-bg="dots"] .nav-menu-island { padding: 8px 16px; }
}

/* 手机端进一步缩减留白，省出屏幕空间 */
@media (max-width: 600px) {
    .post-list, #article-view, #archive-view, #status-view { padding: 10px 16px; margin: 15px 0; }
    body[data-bg="grid"] .post-list, body[data-bg="dots"] .post-list,
    body[data-bg="grid"] #article-view, body[data-bg="dots"] #article-view,
    body[data-bg="grid"] #archive-view, body[data-bg="dots"] #archive-view,
    body[data-bg="grid"] #status-view, body[data-bg="dots"] #status-view {
        padding: 15px 16px;
        border-radius: 12px;
    }
}

/* ==========================================
   3. 首页文章列表内部样式 (保持极简文本)
   ========================================== */
.post-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 25px 0;
    border-bottom: 1px dashed var(--border); 
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    transform: none !important; 
}

/* 👇 核心魔法：直接干掉第一篇文章头顶的多余留白，让它极限靠上！ */
.post-item:first-child { 
    padding-top: 5px; 
}

/* 最后一篇文章干掉底线和底部多余留白 */
.post-item:last-child { 
    border-bottom: none; 
    padding-bottom: 5px; 
}

.post-item:hover { transform: none; background: transparent; box-shadow: none; }
.post-item:hover .post-title-link { color: var(--accent); }

/* ==========================================
   4. 右侧悬浮功能岛 (贴近主容器)
   ========================================== */
#float-btn-group {
    position: fixed;
    bottom: 40px;
    /* 核心魔法：居中后向右偏移430px，刚好贴近你820px文章容器的右侧 */
    left: calc(50% + 430px);
    right: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
    align-items: center;
}

/* 向下按钮默认隐藏逻辑 */
#float-bottom-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
}
#float-bottom-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

/* 切背景小图标样式 */
.bg-switch-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.bg-switch-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.bg-switch-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--menu-bg);
}

/* 小屏幕自动回退到传统的右下角 */
@media (max-width: 1050px) {
    #float-btn-group { left: auto; right: 20px; }
}

.tag-pill {
    font-size: 0.8rem;
    color: var(--text-sub);
    background: var(--tag-bg);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
}

.tag-pill:hover {
    background: var(--accent);
    color: #ffffff;
}

.status-item {
    display: flex;
    gap: 15px;
    margin-bottom: 26px;
    align-items: flex-start;
}

.status-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
}

.status-main {
    flex: 1;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.status-name {
    font-weight: 800;
    color: var(--text);
}

.status-time {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 700;
}

.status-card {
    background: var(--status-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    position: relative;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.6;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--status-bg);
}

.status-actions {
    margin-top: 10px;
    display: flex;
    gap: 20px;
}

.status-btn {
    font-size: 0.9rem;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.status-btn:hover {
    color: var(--accent);
}

.back-btn {
    display: none; 
}

.archive-year {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 30px 0 18px;
    color: var(--text);
}

.archive-item {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    align-items: baseline;
}

.archive-date {
    color: var(--text-sub);
    font-weight: 800;
    font-size: 0.9rem;
    min-width: 45px;
}

.archive-link {
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px dashed var(--border);
    font-weight: 600;
}

.archive-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.article-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--accent);
}

.article-meta {
    color: var(--text-sub);
    font-weight: 800;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.markdown-body {
    background: transparent !important;
    color: var(--text) !important;
    font-family: inherit !important; /* 直接继承刚刚设置好的高级字体 */
    font-size: 1.02rem;
    line-height: 1.95;
    word-break: break-word;
}

.markdown-body > *:first-child {
    margin-top: 0;
}

.markdown-body > *:last-child {
    margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body table,
.markdown-body pre,
.markdown-body .admonition,
.markdown-body .nsk-magic-tabs {
    margin: 1.15em 0;
}

.markdown-body p,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table,
.markdown-body .admonition {
    display: block;
}

.markdown-body p {
    text-align: left;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin: 1.8em 0 0.8em;
    line-height: 1.4;
    font-weight: 900;
    color: var(--text);
}

.markdown-body h1 {
    font-size: 2rem;
}

.markdown-body h2 {
    font-size: 1.8rem;
    padding-bottom: 0.38rem;
    border-bottom: 1px solid var(--border);
}

.markdown-body h3 {
    font-size: 1.45rem;
}

.markdown-body h4 {
    font-size: 1.18rem;
}

.markdown-body a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.markdown-body a:hover {
    text-decoration-color: var(--accent);
}

.markdown-body strong {
    font-weight: 900;
    color: var(--text);
}

.markdown-body em {
    font-style: italic;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5rem;
}

.markdown-body li {
    margin: 0.42rem 0;
}

.markdown-body li > ul,
.markdown-body li > ol {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

.markdown-body code {
    background: var(--tag-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.18em 0.42em;
    font-size: 0.92em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.markdown-body pre {
    background: #f6f8fa;
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow-x: auto;
    padding: 16px 18px;
    position: relative; /* 复制按钮的定位基准 */
}

[data-theme="dark"] .markdown-body pre {
    background: #222b36;
}

.markdown-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
}

.markdown-body blockquote {
    margin-left: 0;
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--accent);
    background: color-mix(in srgb, var(--tag-bg) 82%, transparent);
    border-radius: 0 12px 12px 0;
}

.markdown-body hr {
    border: none;
    border-top: 4px solid var(--border);
    margin: 2rem 0;
}

.markdown-body img {
    max-width: 100%;
    display: block;
    margin: 1.25rem auto;
    border-radius: 14px;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    display: table;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.markdown-body th,
.markdown-body td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.markdown-body th {
    background: var(--tag-bg);
    font-weight: 800;
}

.markdown-body tr:last-child td {
    border-bottom: none;
}

.markdown-body .admonition {
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    background: var(--tag-bg);
    border-radius: 12px;
    padding: 14px 16px;
}

.markdown-body .admonition-title {
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--accent);
}

.nsk-magic-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0;
    width: 100%;
}

.nsk-magic-tab-title {
    order: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7dbe2;
    border-bottom: none;
    background: #eef1f5;
    color: #5f6b7a;
    font: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1;
    padding: 12px 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    border-radius: 10px 10px 0 0;
    margin-right: 2px;
    margin-bottom: -1px;
    user-select: none;
}

.nsk-magic-tab-title .emoji {
    margin-right: 6px;
}

[data-theme="dark"] .nsk-magic-tab-title {
    background: #273140;
    border-color: #334155;
    color: #a7b3c3;
}

.nsk-magic-tab-title:hover {
    color: var(--accent);
}

.nsk-magic-tab-title.is-active {
    color: var(--text);
    background: #f6f7f9;
    border-color: #d7dbe2;
}

[data-theme="dark"] .nsk-magic-tab-title.is-active {
    background: #1f2937;
    border-color: #334155;
    color: #e5edf7;
}

.nsk-magic-tab-body {
    order: 1;
    width: 100%;
    display: none;
    border: 1px solid #d7dbe2;
    border-radius: 0 14px 14px 14px;
    background: #f5f6f8;
    padding: 18px 22px 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.nsk-magic-tab-body.is-active {
    display: block;
}

[data-theme="dark"] .nsk-magic-tab-body {
    background: #111827;
    border-color: #334155;
    box-shadow: none;
}

.nsk-magic-tab-body > *:first-child {
    margin-top: 0;
}

.nsk-magic-tab-body > *:last-child {
    margin-bottom: 0;
}

.terminal-container.embedMode {
    margin: 0;
}

.terminal-padding {
    padding: 0;
}

.xterm-wrapper {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.xterm-wrapper::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.nsk-terminal.terminal.xterm {
    background: #191b20;
    color: #eeeeec;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.nsk-terminal .xterm-viewport,
.nsk-terminal .invisible.scrollbar {
    display: none !important;
}

.nsk-terminal .xterm-scrollable-element {
    position: relative;
    background: #191b20;
    overflow: visible;
}

.nsk-terminal .xterm-screen {
    display: inline-block;
    min-width: 100%;
    width: max-content;
    padding: 22px 36px 22px 34px;
}

.nsk-terminal .xterm-rows {
    white-space: pre;
    color: #eeeeec;
    font-family: Consolas, "xyBarMono", "Courier New", monospace;
    font-size: 13.5px;
    line-height: 1.38;
    font-kerning: none;
}

.nsk-terminal .xterm-rows > div {
    min-height: 1.38em;
}

.nsk-terminal .xterm-bold {
    font-weight: 700;
}

.nsk-terminal .xterm-italic {
    font-style: italic;
}

.nsk-terminal .xterm-underline-1 {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nsk-terminal .xterm-fg-0 { color: #2e3436; }
.nsk-terminal .xterm-fg-1 { color: #cc0000; }
.nsk-terminal .xterm-fg-2 { color: #61d011; }
.nsk-terminal .xterm-fg-3 { color: #d5b216; }
.nsk-terminal .xterm-fg-4 { color: #4f88d9; }
.nsk-terminal .xterm-fg-5 { color: #8d63b8; }
.nsk-terminal .xterm-fg-6 { color: #08d2e3; }
.nsk-terminal .xterm-fg-7 { color: #d3d7cf; }
.nsk-terminal .xterm-fg-8 { color: #6b7280; }
.nsk-terminal .xterm-fg-9 { color: #ff4b4b; }
.nsk-terminal .xterm-fg-10 { color: #77e114; }
.nsk-terminal .xterm-fg-11 { color: #f4df4d; }
.nsk-terminal .xterm-fg-12 { color: #7bb8ff; }
.nsk-terminal .xterm-fg-13 { color: #be8fff; }
.nsk-terminal .xterm-fg-14 { color: #20d7ff; }
.nsk-terminal .xterm-fg-15 { color: #eeeeec; }

.nsk-terminal .xterm-bg-0 { background-color: #2e3436; }
.nsk-terminal .xterm-bg-1 { background-color: #cc0000; }
.nsk-terminal .xterm-bg-2 { background-color: #4e9a06; }
.nsk-terminal .xterm-bg-3 { background-color: #c4a000; }
.nsk-terminal .xterm-bg-4 { background-color: #3465a4; }
.nsk-terminal .xterm-bg-5 { background-color: #75507b; }
.nsk-terminal .xterm-bg-6 { background-color: #06989a; }
.nsk-terminal .xterm-bg-7 { background-color: #d3d7cf; }
.nsk-terminal .xterm-bg-8 { background-color: #555753; }
.nsk-terminal .xterm-bg-9 { background-color: #ef2929; }
.nsk-terminal .xterm-bg-10 { background-color: #8ae234; }
.nsk-terminal .xterm-bg-11 { background-color: #fce94f; }
.nsk-terminal .xterm-bg-12 { background-color: #729fcf; }
.nsk-terminal .xterm-bg-13 { background-color: #ad7fa8; }
.nsk-terminal .xterm-bg-14 { background-color: #34e2e2; }
.nsk-terminal .xterm-bg-15 { background-color: #eeeeec; }

footer {
    margin-top: 100px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-sub);
    border-top: 1px dashed var(--border);
    padding-top: 40px;
    font-weight: 600;
}

#custom-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: var(--tag-bg);
    border: none;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: bold;
}

.toolbar-btn:hover {
    background: var(--accent);
    color: #ffffff;
}

#float-btn-group {
    position: fixed;
    bottom: 40px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 900;
}

.float-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--float-btn-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-sub);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.float-btn:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

#float-top-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}
#float-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.changelog-link {
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.changelog-link:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

/* --- 友链区域布局 --- */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 强制两列绝对平分 */
    gap: 20px;
    margin-top: 20px;
    width: 100%; /* 强制整个网格区占满 100% 宽度 */
}

@media (max-width: 768px) {
    .friends-grid {
        grid-template-columns: 1fr;
    }
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    text-decoration: none !important;
    width: 100%; /* 强制卡片撑满整列 */
    box-sizing: border-box;
}

.friend-card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
    background: var(--menu-bg) !important;
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: transform 0.5s ease-in-out;
}

.friend-card:hover .friend-avatar {
    transform: rotate(360deg);
}

.friend-info {
    flex: 1;
    min-width: 0; 
}

.friend-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .nsk-magic-tab-title {
        padding: 11px 14px;
        font-size: 0.94rem;
    }

    .nsk-magic-tab-body {
        padding: 12px;
    }

    .nsk-terminal .xterm-screen {
        padding: 16px 14px;
    }

    .nsk-terminal .xterm-rows {
        font-size: 12.5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 24px 16px 70px;
    }

    .site-title {
        font-size: 1.35rem;
    }

    .section-header {
        font-size: 1.6rem;
    }

    .post-title-link {
        font-size: 1.2rem;
    }
}

html:not(.theme-ready) *,
html:not(.theme-ready) {
    transition: none !important;
}

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

#home-view,
#status-view,
#archive-view,
#article-view,
#changelog-view,
#friends-view {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.article-title {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}

.article-meta {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards;
}

.markdown-body {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
}

/* 代码块复制按钮样式优化 */
.md-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--menu-bg);
    color: var(--text-sub);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    opacity: 0; 
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.markdown-body pre:hover .md-copy-btn {
    opacity: 1; 
}

.md-copy-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.05);
}

.md-copy-btn.copied {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* --- 文章右侧浮动目录 (TOC) --- */
.toc-container {
    position: fixed;
    top: 100px;
    left: 50%;
    /* 容器居中宽度 820px 的一半 (410) + 30px 间距 = 440px */
    margin-left: 440px; 
    width: 250px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-left: 16px;
    border-left: 2px solid var(--border);
    scrollbar-width: none; /* 隐藏滚动条 */
    opacity: 0;
    /* 复用你已有的渐显动画 */
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards; 
    z-index: 100;
}

.toc-container::-webkit-scrollbar {
    display: none;
}

.toc-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-title i {
    color: var(--accent); /* 图标使用你的主题色 */
}

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

.toc-item {
    margin: 8px 0;
    line-height: 1.4;
}

.toc-link {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid transparent;
    margin-left: -18px; /* 抵消外层 padding，用于实现左侧边框的高亮效果 */
    padding-left: 16px;
}

.toc-link:hover, .toc-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

/* 根据标题层级控制缩进 */
.toc-level-1 { font-weight: 800; }
.toc-level-2 { margin-left: 12px; font-weight: 700; }
.toc-level-3 { margin-left: 24px; font-size: 0.85rem; }
.toc-level-4 { margin-left: 36px; font-size: 0.8rem; }

/* 屏幕不够宽（小屏/平板）时自动隐藏目录，保持极简 */
@media (max-width: 1380px) {
    .toc-container {
        display: none !important;
    }
}

/* --- 顶部阅读进度条 --- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px; /* 稍微加粗一点 */
    background: var(--accent);
    box-shadow: 0 1px 5px var(--accent); /* 加个发光特效，绝对显眼 */
    z-index: 999999; /* 层级拉到最高 */
    transition: width 0.1s ease-out;
    display: none;
    pointer-events: none;
}

/* --- 文章底部 上/下一篇 导航 --- */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 50px 0 20px 0;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.post-navigation .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    text-decoration: none !important;
    transition: all 0.3s ease;
    min-width: 0; /* 防止标题过长撑爆 Flex 布局 */
}

.post-navigation .nav-item.empty {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

.post-navigation .nav-item:not(.empty):hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.post-navigation .nav-hint {
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-bottom: 8px;
    font-weight: 800;
}

.post-navigation .nav-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.post-navigation .nav-item:not(.empty):hover .nav-title {
    color: var(--accent);
}

.post-navigation .nav-next {
    text-align: right;
}

/* 手机端改成上下排列 */
@media (max-width: 600px) {
    .post-navigation {
        flex-direction: column;
        gap: 12px;
    }
    .post-navigation .nav-next {
        text-align: left;
    }
}

/* ==========================================
   补回的文章列表内部排版样式
   ========================================== */
.post-title-link {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    margin: 8px 0;
    display: block;
    transition: color 0.2s;
}
.post-title-link:hover {
    color: var(--accent);
}
.post-date {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 700;
    margin-bottom: 4px;
}
.post-tags {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ==========================================
   外链跳转安全提醒弹窗 (GPU 硬件加速版)
   ========================================== */
.ext-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    will-change: opacity;
    animation: extFadeIn 0.2s ease-out forwards;
}

.ext-modal-box {
    background: var(--bg);
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    opacity: 0;
    will-change: transform, opacity;
    animation: extScaleUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.ext-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.ext-modal-content {
    color: var(--text-sub);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.ext-modal-url {
    background: var(--tag-bg);
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 12px;
    word-break: break-all;
    font-family: monospace;
    color: var(--accent);
    border: 1px dashed var(--border);
    max-height: 80px;
    overflow-y: auto;
}

.ext-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ext-btn {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    outline: none;
}

.ext-btn-cancel {
    background: transparent;
    color: var(--text-sub);
}

.ext-btn-cancel:hover {
    background: var(--tag-bg);
    color: var(--text);
}

.ext-btn-continue {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2);
}

.ext-btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 184, 148, 0.4);
}

@keyframes extFadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}
@keyframes extScaleUp { 
    from { transform: scale(0.95) translateZ(0); opacity: 0; } 
    to { transform: scale(1) translateZ(0); opacity: 1; } 
}

/* ==========================================
   新增：首页置顶 / HOT 徽章
   ========================================== */
.top-badge {
    font-size: 0.75rem;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.08);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 10px;
    font-weight: 800;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 71, 87, 0.2);
}
