/* ---------- 标签云动效 ---------- */
.tag-cloud {
    gap: 9px;
}

.tag-cloud-item {
    /* 文章越多字号略大，1 篇最小、5 篇以上最大 */
    font-size: calc(0.75rem + min(var(--w, 1), 5) * 0.045rem);
    padding: calc(4px + min(var(--w, 1), 5) * 0.6px) 11px;
    transition: transform 0.14s ease-out, box-shadow 0.14s ease-out, filter 0.14s ease-out;
    animation: tag-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    animation-delay: calc(var(--i, 0) * 35ms);
    will-change: transform;
}

@keyframes tag-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.86);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 悬停：抬起 + 放大 + 彩色光晕 */
.tag-cloud-item:hover,
.tag-cloud-item:focus-visible {
    transform: translateY(0) scale(1.5);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
    filter: brightness(1.05) saturate(1.2);
    z-index: 90;
    position: relative;
}

.tag-cloud-item:active {
    transform: translateY(0) scale(1.6);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.26);
    z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
    .tag-cloud-item,
    .tag-cloud-item:nth-child(3n) {
        animation: none;
        transition: none;
    }

    .tag-cloud-item:hover { transform: none; }
}


/* ---------- 手机端：点按标签放大 ---------- */
.tag-cloud-item {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.tag-cloud-item.is-zoomed {
    animation: none;
    transform: translateY(0) scale(1.5);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
    filter: brightness(1.05) saturate(1.2);
    z-index: 90;
    position: relative;
}


/* ---------- 标签云：像云一样缓慢飘动 ---------- */
.tag-cloud-item {
    /* translate / rotate 与 hover 的 transform 互不干扰，可以同时生效 */
    animation:
        tag-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards,
        cloud-a 8s ease-in-out infinite alternate;
    animation-delay:
        calc(var(--i, 0) * 35ms),
        calc(var(--i, 0) * -0.85s);
}

/* 三条路线，按位置轮换，避免整片同步移动 */
@keyframes cloud-a {
    0%   { translate: 0 0;       rotate: 0deg; }
    33%  { translate: 5px -4px;  rotate: 0.8deg; }
    66%  { translate: -3px 3px;  rotate: -0.6deg; }
    100% { translate: 4px 2px;   rotate: 0.4deg; }
}

@keyframes cloud-b {
    0%   { translate: 0 0;       rotate: 0deg; }
    40%  { translate: -6px -3px; rotate: -0.9deg; }
    75%  { translate: 3px 4px;   rotate: 0.7deg; }
    100% { translate: -4px 1px;  rotate: -0.3deg; }
}

@keyframes cloud-c {
    0%   { translate: 0 0;       rotate: 0deg; }
    30%  { translate: 3px 5px;   rotate: 0.6deg; }
    65%  { translate: 6px -2px;  rotate: -0.8deg; }
    100% { translate: -2px -4px; rotate: 0.5deg; }
}

.tag-cloud-item:nth-child(3n+1) {
    animation-name: tag-pop, cloud-a;
    animation-duration: 0.4s, 8s;
}

.tag-cloud-item:nth-child(3n+2) {
    animation-name: tag-pop, cloud-b;
    animation-duration: 0.4s, 10.5s;
    animation-delay: calc(var(--i, 0) * 35ms), calc(var(--i, 0) * -1.15s);
}

.tag-cloud-item:nth-child(3n) {
    animation-name: tag-pop, cloud-c;
    animation-duration: 0.4s, 9s;
    animation-delay: calc(var(--i, 0) * 35ms), calc(var(--i, 0) * -0.55s);
}

/* 系统要求减少动效时停止飘动 */
@media (prefers-reduced-motion: reduce) {
    .tag-cloud-item,
    .tag-cloud-item:nth-child(3n+1),
    .tag-cloud-item:nth-child(3n+2),
    .tag-cloud-item:nth-child(3n) {
        animation: none;
    }
}


/* ---------- 标签页：标签云尺寸放大一倍 ---------- */
/* 密集排布 + 大小错落，看起来更像一团云 */
.tag-cloud.tag-cloud-lg {
    gap: 5px 8px;
    align-items: center;
    line-height: 1.4;
}

.tag-cloud-lg .tag-cloud-item {
    font-size: calc(0.8rem + min(var(--w, 1), 10) * 0.16rem);
}

/* 用相对定位上下错开，形成云一样的参差感（不影响飘动动画） */
.tag-cloud-lg .tag-cloud-item:nth-child(3n+1) { position: relative; top: 3px; }
.tag-cloud-lg .tag-cloud-item:nth-child(3n+2) { position: relative; top: -2px; }
.tag-cloud-lg .tag-cloud-item:nth-child(4n)   { position: relative; top: 1px; }
.tag-cloud-lg .tag-cloud-item:nth-child(5n)   { position: relative; top: -4px; }


/* ---------- 标签页：标签不加粗 ---------- */
.tag-cloud .tag-cloud-item {
    font-weight: 400;
    letter-spacing: 0;
    color: inherit;
}

.tag-cloud .tag-cloud-item:nth-child(6n+1) { color: #4338ca; }
.tag-cloud .tag-cloud-item:nth-child(6n+2) { color: #047857; }
.tag-cloud .tag-cloud-item:nth-child(6n+3) { color: #b45309; }
.tag-cloud .tag-cloud-item:nth-child(6n+4) { color: #be123c; }
.tag-cloud .tag-cloud-item:nth-child(6n+5) { color: #0369a1; }
.tag-cloud .tag-cloud-item:nth-child(6n+6) { color: #7e22ce; }




/* ---------- 标签页：经典词云 ---------- */
.tag-cloud-sky {
    position: relative;
    max-width: 900px;
    margin: 8px auto 0;
    min-height: 470px;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: hidden;
}

.tag-cloud-sky .tag-cloud {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    padding: 0;
}

/* 纯文字标签：无背景、无边框，靠字号和颜色形成层次 */
.tag-cloud-sky .tag-cloud-item {
    background: none !important;
    border-radius: 0;
    padding: 2px 6px;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
    box-shadow: none;
    animation: none;
    transition: transform 0.15s ease, color 0.15s ease;
}

.tag-cloud-sky .tag-cloud-item:hover,
.tag-cloud-sky .tag-cloud-item:focus-visible {
    transform: scale(1.15);
    filter: saturate(1.3);
    z-index: 999 !important;
}

@media (max-width: 640px) {
    .tag-cloud-sky {
        min-height: 52vh;
        display: flex;
        background: none;
        border: 0;
        margin-top: 4px;
    }

    /* 稍作散开：行列均匀铺满，四周留白 */
    .tag-cloud-sky .tag-cloud {
        position: static;
        flex: 1;
        display: flex;
        flex-wrap: wrap;
        align-content: space-evenly;
        justify-content: center;
        gap: 9px 14px;
        padding: 6px 2px;
    }

    .tag-cloud-sky .tag-cloud-item {
        padding: 2px 3px;
        transform: none !important;
    }
}


/* ---------- 词云：缓慢飘动 ---------- */
.tag-cloud-sky .tag-cloud-item {
    animation: wc-drift-a 12s ease-in-out infinite alternate;
    animation-delay: calc(var(--i, 0) * -0.9s);
    will-change: translate;
}

@keyframes wc-drift-a {
    0%   { translate: 0 0; }
    50%  { translate: 6px -5px; }
    100% { translate: -5px 4px; }
}

@keyframes wc-drift-b {
    0%   { translate: 0 0; }
    45%  { translate: -7px -4px; }
    100% { translate: 5px 6px; }
}

@keyframes wc-drift-c {
    0%   { translate: 0 0; }
    40%  { translate: 4px 6px; }
    100% { translate: -6px -3px; }
}

.tag-cloud-sky .tag-cloud-item:nth-child(3n+1) {
    animation-name: wc-drift-a;
    animation-duration: 12s;
}

.tag-cloud-sky .tag-cloud-item:nth-child(3n+2) {
    animation-name: wc-drift-b;
    animation-duration: 15s;
    animation-delay: calc(var(--i, 0) * -1.3s);
}

.tag-cloud-sky .tag-cloud-item:nth-child(3n) {
    animation-name: wc-drift-c;
    animation-duration: 13.5s;
    animation-delay: calc(var(--i, 0) * -1.7s);
}

@media (prefers-reduced-motion: reduce) {
    .tag-cloud-sky .tag-cloud-item { animation: none; }
}

@media (max-width: 640px) {
    .tag-cloud-sky .tag-cloud-item { animation: none; }
}


/* ---------- 顶部菜单统一成「测试中心」的样式 ---------- */
.site-header nav a,
.site-header nav a.nav-strong {
    color: #000;
    font-weight: 700;
    font-size: 0.9375rem;
}

.site-header nav a:hover {
    color: #2563eb;
}

@media (max-width: 900px) {
    .site-header nav a {
        font-weight: 700;
        font-size: 0.875rem;
    }
}


/* ---------- 关于页：手机端不溢出 ---------- */
.about-body {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.about-body p,
.about-body li,
.about-body h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.about-body a {
    overflow-wrap: anywhere;
    word-break: break-all;
}

.post-content {
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .about-body {
        font-size: 0.9375rem;
        line-height: 1.8;
    }

    .about-body h2 {
        font-size: 1.0625rem;
        margin: 20px 0 8px;
    }

    .about-body ul {
        padding-left: 18px;
    }

    .about-body li {
        margin-bottom: 6px;
    }
}


/* ---------- 卡片原地编辑 ---------- */
.lab-card.card-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: default;
}

.lab-card.card-edit input,
.lab-card.card-edit textarea {
    padding: 6px 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
}

.lab-card.card-edit input:focus,
.lab-card.card-edit textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}


/* ---------- 卡片表单字段标签 ---------- */
.card-label {
    font-size: 0.75rem;
    color: var(--c-muted);
    margin-bottom: -4px;
}


/* ---------- 测试中心功能卡片里的补充文字 ---------- */
.lab-nav-more {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--c-muted);
}


/* ---------- 测试中心页头入口卡 ---------- */
.lab-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.lab-nav-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    padding: 14px 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    color: var(--c-heading);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.lab-nav-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.lab-nav-title {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.lab-nav-desc {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--c-muted);
}

.lab-nav-item.is-current {
    cursor: default;
    background: var(--c-bg);
    border-style: dashed;
    border-color: #cbd5e1;
}

.lab-nav-item.is-current .lab-nav-title {
    color: #334155;
}

.lab-nav-item.is-current .lab-nav-desc {
    color: var(--c-faint);
}

@media (max-width: 640px) {
    .lab-nav {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .lab-nav-item {
        padding: 12px 14px;
    }

    .lab-nav-title {
        font-size: 1.0625rem;
    }

    .lab-nav-desc {
        font-size: 0.75rem;
    }
}


/* 入口卡及其内部文字一律不可选中 */
.lab-nav,
.lab-nav *,
.lab-nav-item,
.lab-nav-item *,
.lab-nav-title,
.lab-nav-desc,
.lab-nav-more {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none;
}


/* 入口卡：悬停只让标题变蓝，不加下划线、不选中文字 */
.lab-nav-item,
.lab-nav-item:hover,
.lab-nav-item:focus,
.lab-nav-title,
.lab-nav-desc,
.lab-nav-more {
    text-decoration: none !important;
}

a.lab-nav-item:hover .lab-nav-title {
    color: #2563eb;
}


/* ---------- 测试中心：分组与卡片排布 ---------- */
.lab-section {
    margin-bottom: 24px;
}

.lab-section-title {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--c-faint);
}

/* 入口卡：浅底 + 左侧色条，与下面的内容卡区分开 */
.lab-nav-item {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-left: 3px solid #c7d2fe;
}

.lab-nav-item.is-current {
    background: var(--c-bg-soft);
    border-left-color: #cbd5e1;
    border-style: solid;
    border-color: #e2e8f0;
    border-left: 3px solid #cbd5e1;
}

.lab-nav-item.span-all {
    grid-column: 1 / -1;
}

/* 卡片上的 demo 角标 */
.card-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.6875rem;
    font-weight: 600;
    vertical-align: middle;
}

/* 账号卡 */
.card-account-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.card-account .btn-mini,
.card-account .btn-ghost {
    width: auto;
}

/* 添加卡片：虚线卡，点开才展开表单 */
.lab-card.card-new {
    border: 1px dashed #cbd5e1;
    background: #fbfcfe;
    box-shadow: none;
    padding: 16px 18px;
}

.lab-card.card-new summary {
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--c-text-2);
    list-style: none;
}

.lab-card.card-new summary::-webkit-details-marker {
    display: none;
}

.lab-card.card-new[open] summary {
    margin-bottom: 10px;
    color: var(--c-heading);
}

.lab-card.card-new form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lab-card.card-new input {
    padding: 6px 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

.lab-card.card-new input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

@media (max-width: 640px) {
    .lab-section { margin-bottom: 18px; }
    .lab-nav-item.span-all { grid-column: auto; }
}


/* ---------- UI 元素练习场 ---------- */
.uilab-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--c-text-2);
}

.uilab-field input,
.uilab-field select,
.uilab-field textarea {
    padding: 6px 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--c-surface);
}

.uilab-field input:focus,
.uilab-field select:focus,
.uilab-field textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.uilab-field input[type="range"] {
    padding: 0;
    border: 0;
    box-shadow: none;
}

.uilab-field em {
    font-style: normal;
    font-size: 0.75rem;
    color: var(--c-muted);
}

.uilab-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 10px 0;
    font-size: 0.8125rem;
    color: var(--c-text-2);
}

.uilab-row label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.uilab-label {
    font-weight: 600;
    color: #334155;
}

.uilab-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.uilab-output {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #334155;
    white-space: pre-wrap;
    max-height: 220px;
    overflow: auto;
}

.uilab-hint {
    font-size: 0.75rem;
    color: var(--c-faint);
    margin: 6px 0 0;
}

.uilab-msg {
    font-size: 0.875rem;
    color: #047857;
    min-height: 20px;
}

/* 弹层 */
.uilab-tooltip {
    position: relative;
    display: inline-block;
    padding: 4px 8px;
    border-bottom: 1px dashed #94a3b8;
    cursor: help;
}

.uilab-tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    bottom: 130%;
    padding: 5px 9px;
    border-radius: 6px;
    background: #1e293b;
    color: #fff;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 20;
}

.uilab-menu {
    position: relative;
}

.uilab-menu-list {
    position: absolute;
    top: 110%;
    left: 0;
    z-index: 30;
    min-width: 120px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.uilab-menu-list a {
    display: block;
    padding: 6px 12px;
    font-size: 0.8125rem;
    color: #334155;
}

.uilab-menu-list a:hover {
    background: var(--c-bg-soft);
}

/* 加载动画 */
.uilab-spinner {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.uilab-spinner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #93c5fd;
    animation: uilab-bounce 0.9s infinite ease-in-out;
}

.uilab-spinner-dot:nth-child(2) { animation-delay: 0.15s; }
.uilab-spinner-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes uilab-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
}

/* 进度条 */
.uilab-progress {
    height: 8px;
    margin-top: 10px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}

.uilab-progress-bar {
    height: 100%;
    background: #2563eb;
    transition: width 0.12s linear;
}

/* 拖拽排序 */
.uilab-sortable {
    display: flex;
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.uilab-sortable li {
    padding: 8px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: var(--c-surface);
    font-size: 0.8125rem;
    color: #334155;
    cursor: grab;
}

.uilab-sortable li.is-dragging {
    opacity: 0.5;
    border-style: solid;
    border-color: #93c5fd;
}

.uilab-reset {
    margin: 8px 0 32px;
    text-align: center;
}

@media (max-width: 640px) {
    .uilab-sortable { flex-direction: column; }
}


/* ---------- 轻提示 toast ---------- */
.ui-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    z-index: 10000;
    padding: 9px 18px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    font-size: 0.8125rem;
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.ui-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}


/* ---------- 顶部登录状态按钮 ---------- */
.site-header nav a.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-header nav a.nav-user:hover {
    background: #e0e7ff;
    color: #3730a3;
}

@media (max-width: 900px) {
    .site-header nav a.nav-user {
        font-size: 0.75rem;
        padding: 2px 10px;
    }
}


/* ---------- 系列左栏：两级目录树 ---------- */
.nav-tree {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    font-size: 0.8125rem;
}

.nav-tree-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 6px;
    border-radius: 6px;
    color: var(--c-heading);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.nav-tree-title::-webkit-details-marker { display: none; }

.nav-tree-title::before {
    content: "▾";
    margin-right: 2px;
    font-size: 10px;
    color: var(--c-faint);
    transition: transform 0.15s ease;
}

.nav-tree-branch:not([open]) > .nav-tree-title::before {
    transform: rotate(-90deg);
}

.nav-tree-title:hover {
    background: var(--c-bg-soft);
}

.nav-tree-count {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--c-faint);
}

.nav-tree-children {
    list-style: none;
    margin: 2px 0 0;
    padding: 0 0 0 14px;
    border-left: 1px solid #e5e7eb;
}

.nav-tree-children li a {
    display: block;
    padding: 4px 6px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    color: var(--c-text-2);
    line-height: 1.55;
    word-break: break-word;
}

.nav-tree-children li a:hover {
    color: #2563eb;
    background: var(--c-bg);
}

.nav-tree-children li a.is-active {
    color: #2563eb;
    font-weight: 600;
    border-left-color: #2563eb;
    background: #eff6ff;
}


/* ---------- 三级目录树：二级分组 ---------- */
.nav-tree-subtitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--c-text-2);
    cursor: pointer;
    list-style: none;
}

.nav-tree-subtitle::-webkit-details-marker { display: none; }

.nav-tree-subtitle::before {
    content: "▾";
    margin-right: 2px;
    font-size: 9px;
    color: var(--c-faint);
    transition: transform 0.15s ease;
}

.nav-tree-branch-sub:not([open]) > .nav-tree-subtitle::before {
    transform: rotate(-90deg);
}

.nav-tree-subtitle:hover {
    background: var(--c-bg);
}

.nav-tree-leaves {
    list-style: none;
    margin: 1px 0 6px 10px;
    padding: 0 0 0 14px;
    border-left: 1px dashed #e2e8f0;
}

.nav-tree-leaves li a {
    padding-left: 6px;
}

.nav-tree-subgroup {
    margin-bottom: 2px;
    padding-left: 2px;
}


/* ---------- 三级树缩进（最终生效） ---------- */
.nav-tree-leaves {
    margin-left: 14px !important;
    padding-left: 16px !important;
}

.nav-tree-leaves > li > a {
    padding: 4px 6px 4px 8px !important;
    margin-left: 0 !important;
    position: relative;
}

.nav-tree-leaves > li > a::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    width: 6px;
    border-top: 1px dashed #cbd5e1;
}


/* ---------- 全部系列：卡片宽度与系列内文章一致 ---------- */
@media (min-width: 769px) {
    .container-plain .post-list {
        max-width: 790px;
        margin: 0 auto;
    }
}


/* ---------- 文章页左栏与正文顶部对齐 ---------- */
.post-nav {
    padding-top: 32px;
}

.post-nav-head {
    margin-top: 0;
}

@media (max-width: 1200px) {
    .post-nav { padding-top: 0; }
}


@media (max-width: 900px) {
    .site-header nav a.nav-icp {
        font-size: 0.625rem;
        padding: 1px 6px;
    }
}


/* ---------- 页脚固定：ICP 备案不随内容滚动 ---------- */
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin-top: 0;
    padding: 7px 0;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
}

body {
    padding-bottom: 112px;
}

@media (max-width: 640px) {
    .site-footer {
        font-size: 0.6875rem;
        padding: 6px 0;
    }

    body { padding-bottom: 96px; }
}


/* ---------- 分页按钮文字居中 ---------- */
.pager-btn {
    text-align: center;
    line-height: 1.6;
}


/* ---------- 系列上一篇/下一篇：文字居中 ---------- */
.series-nav-item {
    text-align: center;
}

.series-nav-label {
    text-align: center;
}


/* ---------- 正文排版优化：行内代码 / 代码块 / 引用 / 表格 ---------- */
.post-content code:not(pre code) {
    background: #eef2f7;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    color: #0f172a;
    white-space: nowrap;
}

.post-content pre {
    position: relative;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    line-height: 1.7;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.post-content pre::-webkit-scrollbar {
    height: 8px;
}

.post-content pre::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 999px;
}

.post-content pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: 0.8125rem;
    color: inherit;
    white-space: pre;
}

/* 复制按钮 */
.code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.85);
    color: #cbd5e1;
    font-size: 0.6875rem;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.post-content pre:hover .code-copy,
.code-copy:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .code-copy { opacity: 1; }
}

.code-copy:hover {
    background: #1e293b;
    color: #fff;
}

/* 引用 */
.post-content blockquote {
    background: var(--c-bg);
    border-left: 3px solid #93c5fd;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    color: var(--c-text-2);
}

/* 表格 */
.post-content table th {
    background: var(--c-bg);
    color: #334155;
    font-weight: 600;
}

.post-content table tbody tr:nth-child(even) {
    background: #fafbfc;
}


/* ---------- 系列详情：分页贴到内容底部 ---------- */
.container-series .post-list {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 260px);
}

.container-series .post-list > .pager {
    margin-top: auto;
    padding-top: 18px;
}

@media (max-width: 768px) {
    .container-series .post-list {
        min-height: calc(100vh - 220px);
    }
}


/* ---------- 全部系列：分页贴到内容底部 ---------- */
.container-plain .post-list {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 260px);
}

.container-plain .post-list > .pager {
    margin-top: auto;
    padding-top: 18px;
}

@media (max-width: 768px) {
    .container-plain .post-list {
        min-height: calc(100vh - 220px);
    }
}


/* ---------- 首页/搜索结果：分页贴到内容底部 ---------- */
.container-home .post-list {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 260px);
}

.container-home .post-list > .pager {
    margin-top: auto;
    padding-top: 18px;
}

@media (max-width: 768px) {
    .container-home .post-list {
        min-height: calc(100vh - 220px);
    }
}


/* ---------- 首页卡片略微收紧，保证分页在一屏内完整可见 ---------- */
.post-item {
    padding: 15px 20px;
    margin-bottom: 12px;
}

.post-item h2 {
    margin-bottom: 6px;
}

.post-item .post-meta {
    margin-bottom: 8px;
}

.post-item .post-excerpt {
    margin-bottom: 8px;
    line-height: 1.65;
}

.home-hero {
    padding: 18px 22px;
    margin-bottom: 18px;
}

.home-hero p {
    margin-bottom: 8px;
}

.container-home .post-list {
    min-height: calc(100vh - 320px);
}

.container-home .post-list > .pager {
    padding-top: 12px;
}


/* ---------- 首页标签云：查看更多 ---------- */
.tag-cloud-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--c-muted);
}

.tag-cloud-more:hover {
    color: #2563eb;
}


/* ---------- 首页卡片略微加高，吃掉底部留白 ---------- */
.post-item {
    padding: 19px 22px;
    margin-bottom: 14px;
}

.post-item h2 {
    margin-bottom: 8px;
}

.post-item .post-meta {
    margin-bottom: 9px;
}

.post-item .post-excerpt {
    margin-bottom: 10px;
    line-height: 1.7;
}


/* ---------- 系列页：5 篇一页时压缩卡片高度 ---------- */
.container-series .post-item {
    padding: 16px 20px;
    margin-bottom: 12px;
}

.container-series .post-item h2 {
    margin-bottom: 6px;
}

.container-series .post-item .post-meta {
    margin-bottom: 7px;
}

.container-series .post-item .post-excerpt {
    margin-bottom: 7px;
    line-height: 1.6;
}

.container-series .post-list {
    min-height: calc(100vh - 300px);
}

.container-plain .post-list {
    min-height: calc(100vh - 300px);
}


/* ---------- 系列页：进一步压缩，5 条 + 分页一屏显示 ---------- */
.container-series .blog-layout,
.container-plain .blog-layout {
    padding: 20px 0;
}

.container-series .tag-heading,
.container-plain .tag-heading {
    margin-bottom: 12px;
    font-size: 1rem;
}

.container-series .post-item,
.container-plain .post-item {
    padding: 17px 20px;
    margin-bottom: 11px;
}

.container-series .post-item h2,
.container-plain .post-item h2 {
    margin-bottom: 6px;
    font-size: 1.0625rem;
}

.container-series .post-item .post-meta,
.container-plain .post-item .post-meta {
    margin-bottom: 7px;
    font-size: 0.8125rem;
}

.container-series .post-item .post-excerpt,
.container-plain .post-item .post-excerpt {
    margin-bottom: 7px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.container-series .post-item .read-more,
.container-plain .post-item .read-more {
    font-size: 0.8125rem;
}

.container-series .post-list,
.container-plain .post-list {
    min-height: calc(100vh - 250px);
}


/* ---------- 独立页面侧栏目录 ---------- */
.toc ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
    font-size: 0.8125rem;
    line-height: 1.9;
}

.toc ul ul {
    padding-left: 12px;
    font-size: 0.75rem;
}

.toc a {
    color: var(--c-text-2);
}

.toc a:hover {
    color: #2563eb;
}


/* ---------- 正文列表缩进（全局 reset 去掉了默认内边距） ---------- */
.post-content ul,
.post-content ol {
    padding-left: 1.5em;
    margin: 8px 0 12px;
}

.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
    margin: 4px 0;
    padding-left: 1.3em;
}

.post-content li {
    margin-bottom: 4px;
    line-height: 1.75;
}


/* ---------- 导航「更多」下拉 ---------- */
.nav-more {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 20px;   /* 与其它菜单项一致的首行间距 */
}

.nav-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #000;
    cursor: pointer;
}

.nav-more-btn:hover {
    color: #2563eb;
}

.nav-caret {
    font-size: 0.625rem;
    color: var(--c-faint);
    transition: transform 0.15s ease;
}

.nav-more:hover .nav-caret,
.nav-more.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-more-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -4px);
    z-index: 60;
    min-width: 128px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.nav-more-panel a {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.nav-more-panel a:hover {
    background: var(--c-bg-soft);
    color: #2563eb;
}

.nav-more:hover .nav-more-panel,
.nav-more:focus-within .nav-more-panel,
.nav-more.is-open .nav-more-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}




/* ---------- 正文四级小标题：字距放宽 ---------- */
.post-content h4 {
    margin: 20px 0 8px;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.12em;
}


/* ---------- 正文表格铺满并等比拉伸 ---------- */
.post-content table {
    width: 100%;
    table-layout: fixed;
}

.post-content table th:first-child,
.post-content table td:first-child {
    width: 40%;
}

.post-content table th,
.post-content table td {
    white-space: normal;
    overflow-wrap: anywhere;
}


/* ---------- 正文表格：表头与数据统一居中 ---------- */
.post-content table th,
.post-content table td {
    text-align: center;
}


/* ---------- 构建历史 ---------- */
.build-hint {
    color: var(--c-faint);
    font-size: 0.8125rem;
}

.build-badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--c-bg-soft);
    color: var(--c-text-2);
}

.build-badge.is-ok {
    background: #dcfce7;
    color: #15803d;
}

.build-badge.is-fail {
    background: #fee2e2;
    color: #b91c1c;
}

.build-badge.is-skip {
    background: #fef3c7;
    color: #b45309;
}



/* ---------- 手机端：登录状态按钮固定到页头右上角 ---------- */
@media (max-width: 900px) {
    .site-header nav a.nav-user {
        position: fixed;
        top: 6px;
        right: 8px;
        margin: 0;
        padding: 2px 10px;
        font-size: 0.6875rem;
        z-index: 80;
    }
}


/* ---------- 手机端：隐藏侧栏小部件（系列 / 统计 / 标签云） ---------- */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
}


/* ---------- 手机端导航：保证一行放得下 5 个入口 ---------- */
@media (max-width: 900px) {
    .nav-more {
        /* 按钮没有链接的前后内边距，视觉上会贴着「标签云」，补一点左边距 */
        margin-left: 9px;
    }

    .nav-more-btn {
        white-space: nowrap;
        font-size: 0.875rem;
    }

    .nav-more-panel a {
        white-space: nowrap;
    }
}


/* ---------- 手机端：禁止横向溢出，子菜单白底不越界 ---------- */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }
}


/* ---------- 播放器文字按钮（歌单 / 顺序） ---------- */
.music-btn-text {
    width: auto;
    min-width: 56px;
    height: 32px;
    padding: 0 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #b45309;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.music-btn-text:hover {
    color: #92400e;
    background: #ffedd5;
}


/* ---------- 歌单按钮：紫色 ---------- */
.music-btn-list {
    color: #6d28d9;
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.music-btn-list:hover {
    color: #5b21b6;
    background: #ede9fe;
}




/* ---------- 「显示播放器」独占一行，与首行首项左对齐 ---------- */
#nav-show-player {
    flex: 0 0 100%;
    width: 100%;
    text-align: left;
    /* 与其它菜单项的内边距一致，文字左边缘才能对齐 */
    padding-left: 12px;
}


/* ---------- 回到顶部 ---------- */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 92px;
    z-index: 70;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    background: var(--c-surface);
    color: var(--c-text-2);
    font-size: 1.125rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    color: #2563eb;
    border-color: #bfdbfe;
}

/* ---------- 手机端：加大点击区域 ---------- */
@media (max-width: 768px) {
    .tag,
    .post-meta .tag {
        padding: 4px 9px;
        font-size: 0.75rem;
        line-height: 1.6;
    }

    .pager a,
    .pager span,
    .pagination a,
    .pagination span {
        min-height: 36px;
        min-width: 36px;
        padding: 6px 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .site-nav a,
    .nav-more-btn {
        padding: 6px 2px;
    }

    .back-to-top {
        right: 12px;
        bottom: 86px;
        width: 44px;
        height: 44px;
    }
}
