/* ---------- 音乐悬浮球 ---------- */
.music-ball {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    width: 52px;
    height: 52px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--c-surface);
    color: #b45309;
    font-size: 1.875rem;   /* 音符放大 50% */
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.music-ball:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
}

.music-ball.is-playing-area {
    color: #6d28d9;
}

/* 展开时出现在球的上方，右对齐，从右下角放大 */
.global-music-player {
    right: 20px;
    bottom: 84px;
    transform-origin: bottom right;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.global-music-player.is-collapsed {
    display: none;
}

.global-music-player:not(.is-open) {
    opacity: 0;
    transform: scale(0.92);
}

@media (max-width: 768px) {
    .music-ball {
        right: 12px;
        bottom: 35px;      /* 上移半个图标高度（约 21px） */
        width: 42px;
        height: 42px;
        font-size: 1.575rem;   /* 手机上同样放大 50% */
    }

    .global-music-player {
        right: 12px;
        bottom: 78px;
    }
}


/* ---------- 统一各页面容器宽度与左右留白，左边缘与站点标题对齐 ---------- */
.container,
.container-home,
.container-series,
.container-post,
.container-plain {
    max-width: 1080px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}


/* ---------- 系列页：取消正文居中收窄，左边缘与其它页对齐 ---------- */
.container-plain .post-list {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}


/* ---------- 系列页：卡片三列排布 ---------- */
.series-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.series-grid .series-item {
    margin: 0 !important;
    height: 100%;
}

@media (max-width: 900px) {
    .series-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .series-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* ---------- 系列页：卡片紧贴标题下方 ---------- */
.container-plain .tag-heading {
    margin-bottom: 6px !important;
    color: #111 !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;   /* 与「测试中心功能」标题一致 */
}

.container-plain .post-list > .series-item {
    margin-top: 0 !important;
}


/* ---------- 统一各页面正文与页头的间距 ---------- */
.blog-layout {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

/* 各页面容器自身不要再叠加上内边距 */
.container-home,
.container-series,
.container-plain,
.container-post,
.container {
    padding-top: 0 !important;
}

.post-list,
.post-detail {
    padding-top: 0 !important;
}

.post-list > .tag-heading:first-child,
.post-list > h1:first-child,
.post-list > h2:first-child {
    margin-top: 0 !important;
}


/* ---------- 测试中心各页面：与博客页统一顶部间距 ---------- */
.container > .lab-page,
.container > .demo-shell,
.container > .auth-wrap {
    padding-top: 24px;
}


/* ---------- 系列页说明文字 ---------- */
.series-subtitle {
    margin: 0 0 14px;
    color: var(--c-muted);
    font-size: 0.9375rem;
    line-height: 1.8;
}


/* ---------- 系列页卡片：与测试中心卡片一致 ---------- */
.series-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 18px;
}

.series-grid .series-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-left: 3px solid #c7d2fe !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.series-grid .series-item:hover {
    background: #f8fafc !important;
}

.series-grid .series-item h2 {
    margin: 0 !important;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.series-grid .series-item h2 a {
    color: #1e293b;
    text-decoration: none;
}

.series-grid .series-item .post-excerpt {
    margin: 0 !important;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--c-muted);
}

.series-grid .series-item .read-more {
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.7;
    color: #2563eb;
    text-decoration: none;
}

.series-grid .series-item .read-more:hover {
    color: #2563eb;
}

@media (max-width: 900px) {
    .series-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .series-grid .series-item {
        padding: 12px 14px !important;
    }

    .series-grid .series-item h2 {
        font-size: 1.0625rem;
    }

    .series-grid .series-item .post-excerpt {
        font-size: 0.75rem;
    }
}


/* ---------- 系列卡片：整卡可点 + 三列 ---------- */
.series-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 18px;
}

.series-card-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.series-card-link h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    color: #1e293b;
}

.series-card-link:hover h2 {
    color: #2563eb;
}

.series-grid .series-item .post-excerpt {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--c-muted);
}

.series-card-meta {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--c-faint);
}

.series-card-link .read-more {
    margin-top: auto;
    padding-top: 6px;
    font-size: 0.75rem;
    color: #2563eb;
}

@media (max-width: 900px) {
    .series-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    .series-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .series-card-link h2 {
        font-size: 1.0625rem;
    }
}


/* ---------- 系列卡片：任何状态下都不显示下划线 ---------- */
.series-card-link,
.series-card-link:hover,
.series-card-link:focus,
.series-card-link:active,
.series-card-link h2,
.series-card-link h2 a,
.series-card-link .post-excerpt,
.series-card-link .series-card-meta,
.series-card-link .read-more {
    text-decoration: none !important;
}


/* ---------- 文章页恢复为今天之前的 1400px ---------- */
.container.container-post {
    max-width: 1400px !important;
}


/* ---------- 文章页左侧系列导航：跟随页面滚动，不再吸附 ---------- */
.container-post .post-nav-inner {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
}


/* ---------- 文章页：左侧系列导航与右侧目录都跟随正文滚动 ---------- */
.container-post .post-nav,
.container-post .post-nav-inner,
.container-post .sidebar {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    align-self: flex-start !important;
}


/* ---------- 文章页两侧栏：跟随页面滚动，内容过长时自己滚动 ---------- */
.container-post .post-nav,
.container-post .sidebar {
    position: static !important;
    top: auto !important;
    align-self: flex-start !important;
}

.container-post .post-nav-inner,
.container-post .sidebar .widget-list {
    position: static !important;
    top: auto !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-right: 4px;
}


/* ---------- 文章页两侧栏：滚动时始终可见（吸附在视口） ---------- */
.container-post .post-nav,
.container-post .sidebar {
    position: sticky !important;
    top: 16px !important;
    align-self: flex-start !important;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.container-post .post-nav-inner {
    position: static !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0;
}


/* ---------- 文章底部「回到顶部」 ---------- */
.post-back-top-wrap {
    display: flex;
    justify-content: center;
    padding: 22px 0 8px;
}

.post-back-top {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--c-muted);
    text-decoration: none;
    background: var(--c-surface);
}

.post-back-top:hover {
    color: #2563eb;
    border-color: #bfdbfe;
    background: #f8fbff;
}


/* ---------- 回到顶部：位置由 JS 贴着音乐球计算 ---------- */
.back-to-top {
    right: 76px;
    bottom: 20px;
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .back-to-top {
        right: 60px;
        bottom: 14px;
        width: 42px;
        height: 42px;
        font-size: 1.05rem;
    }
}


/* ---------- 播放器新外观：封面 + 进度 ---------- */
.mp-head {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.mp-cover {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.25rem;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    user-select: none;
}

.mp-meta {
    flex: 1;
    min-width: 0;
}

.mp-meta .music-info {
    margin: 0 0 6px;
    padding: 0;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
}

.mp-progress-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mp-time {
    font-size: 0.6875rem;
    color: var(--c-faint);
    font-variant-numeric: tabular-nums;
    min-width: 30px;
}

.mp-progress {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 999px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}

.mp-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #b45309;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mp-progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #b45309;
}

.music-controls .mp-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff7ed;
    color: #b45309;
    border: 1px solid #fed7aa;
    font-size: 1.125rem;
}

.music-controls .mp-play:hover {
    background: #ffedd5;
}

/* ---------- 桌面端：右侧抽屉，歌单常驻 ---------- */
@media (min-width: 769px) {
    .global-music-player {
        top: 88px;          /* 与正文起始高度对齐（页头 64px + 24px 间距） */
        /* 固定位置：距右侧 48px，与右侧导航拉开一点 */
        right: 48px;
        bottom: auto;
        left: auto;
        width: 340px;
        height: auto;
        max-height: calc(100vh - 100px);
        border-radius: 14px;
        overflow: hidden;
        box-shadow: -8px 0 28px rgba(15, 23, 42, 0.14);
        transform: translateX(100%);
        transition: transform 0.22s ease;
        z-index: 900;
    }

    .global-music-player.is-open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .global-music-player.is-collapsed {
        display: none;
    }

    .music-player-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding: 18px;
    }

    .mp-cover {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
        font-size: 1.5rem;
    }

    /* 桌面端：歌单常驻显示 */
    .music-playlist {
        display: flex;
        flex-direction: column;
        margin-top: 12px;
        border-top: 1px solid var(--c-border);
        padding-top: 10px;
    }

    #btn-playlist {
        display: none;
    }

    .music-list {
        height: calc(36px * 15);
        max-height: calc(36px * 15);
        overflow-y: auto;
    }

    .music-list li {
        height: 36px;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        padding: 0 10px;
        border-radius: 6px;
    }
}

/* ---------- 手机端：球上方的小卡片 ---------- */
@media (max-width: 768px) {
    .global-music-player {
        /* 手机端水平居中，不再贴右 */
        left: 50%;
        right: auto;
        bottom: 92px;      /* 抬高，避开底部音乐球 */
        top: auto;
        width: 80vw;
        max-width: 340px;
        border-radius: 14px;
        padding: 0;
        transform: translateX(-50%);
    }

    .global-music-player.is-open {
        transform: translateX(-50%);
    }

    .music-player-inner {
        padding: 12px 14px;
    }

    .global-music-player.is-collapsed {
        display: none;
    }
}


/* ---------- 首页文章区：恢复昨天（b8309c6）的位置与间距 ---------- */
.container-home .blog-layout {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
}

.container-home .post-list {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
}


/* ---------- 播放中的迷你条（音乐球左侧） ---------- */
.mp-mini-bar {
    position: fixed;
    right: 80px;
    bottom: 24px;
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 262px;
    height: 44px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--c-surface);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.mp-mini-bar[hidden] {
    display: none;
}

.mp-mini-title {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-mini-btn {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #fff7ed;
    color: #b45309;
    font-size: 0.8125rem;
    cursor: pointer;
}

.mp-mini-btn:hover {
    background: #ffedd5;
}

.mp-mini-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--c-bg-soft);
}

.mp-mini-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: #f59e0b;
    transition: width 0.25s linear;
}

@media (max-width: 768px) {
    .mp-mini-bar {
        left: auto;
        right: 60px;
        bottom: 13px;
        width: 236px;
        height: 45px;
        padding: 0 11px;
        gap: 7px;
        border-radius: 999px;
    }

    .mp-mini-title {
        font-size: 0.8125rem;
    }

    .mp-mini-btn {
        width: 28px;
        height: 28px;
    }

    .mp-mini-btn svg {
        width: 15px;
        height: 15px;
    }
}


/* ---------- 迷你条停止按钮 ---------- */
.mp-mini-stop {
    background: var(--c-bg-soft);
    color: var(--c-text-2);
}

.mp-mini-stop:hover {
    background: #e2e8f0;
    color: #b91c1c;
}


/* ---------- 全屏播放层 ---------- */
.mp-stage {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 50% 20%, hsl(var(--mp-h1, 30), 70%, 42%), transparent 60%),
        linear-gradient(160deg, hsl(var(--mp-h2, 260), 45%, 18%), #0b1020 70%);
    overflow-y: auto;
    overflow-x: hidden;
}

.mp-stage[hidden] {
    display: none;
}

.mp-stage-back {
    position: absolute;
    top: 18px;
    left: 18px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.8125rem;
    cursor: pointer;
}

.mp-stage-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mp-stage-body {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.mp-stage-disc {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-radial-gradient(circle at 50% 50%,
            rgba(255, 255, 255, 0.06) 0 3px,
            rgba(0, 0, 0, 0.08) 3px 6px),
        linear-gradient(135deg, hsl(var(--mp-h1, 30), 75%, 58%), hsl(var(--mp-h2, 260), 70%, 42%));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45), inset 0 0 0 10px rgba(255, 255, 255, 0.06);
}

.mp-stage-disc::after {
    content: '';
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.18);
}

.mp-stage-disc.is-spinning {
    animation: mp-spin 8s linear infinite;
}

@keyframes mp-spin {
    to { transform: rotate(360deg); }
}

.mp-stage-title {
    margin: 4px 0 0;
    font-size: 1.375rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
}

.mp-stage-artist {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
}

.mp-stage-progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.mp-stage-progress input {
    flex: 1;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
}

.mp-stage-progress input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--c-surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.mp-stage-controls {
    display: flex;
    align-items: center;
    gap: 22px;
}

.mp-stage-btn {
    border: 0;
    background: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.85;
}

.mp-stage-btn:hover {
    opacity: 1;
}

.mp-stage-play {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--c-surface);
    color: #0b1020;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.mp-stage-extra {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.mp-stage-chip {
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
}

.mp-stage-vol {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mp-stage-vol input {
    width: 84px;
}

.mp-stage-playlist {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    padding: 56px 14px 18px;
    background: rgba(10, 14, 30, 0.94);
    backdrop-filter: blur(8px);
    transform: translateX(100%);
    transition: transform 0.2s ease, visibility 0.2s;
    overflow-y: auto;
    visibility: hidden;
}

.mp-stage-playlist.show {
    transform: translateX(0);
    visibility: visible;
}

.mp-stage-playlist ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mp-stage-playlist li {
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
}

.mp-stage-playlist li:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
    .mp-stage-disc {
        width: 168px;
        height: 168px;
    }

    .mp-stage-title {
        font-size: 1.125rem;
    }

    .mp-stage-play {
        width: 60px;
        height: 60px;
    }
}


/* ---------- 播放器按钮：文字不竖排 ---------- */
.music-btn,
.music-btn-text {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .music-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .music-btn-text {
        min-width: 52px;
        padding: 0 10px;
        font-size: 0.75rem;
    }
}


/* ---------- 播放器控制区：统一圆键 + 文字胶囊 ---------- */
.music-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.music-controls .music-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-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: 1rem;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.music-controls .music-btn:hover {
    background: #eef2f7;
    color: #0f172a;
}

/* 主播放键：更大的实心圆 */
.music-controls .mp-play {
    width: 46px;
    height: 46px;
    border: 0;
    background: #f59e0b;
    color: #fff;
    font-size: 1.0625rem;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.music-controls .mp-play:hover {
    background: #ea8a06;
    color: #fff;
}

/* 文字按钮：圆角胶囊，弱化存在感 */
.music-controls .music-btn-text {
    width: auto;
    min-width: 0;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
}

.music-controls .music-btn-text:hover {
    background: var(--c-bg);
    border-color: #fed7aa;
    color: #b45309;
}

.music-controls .music-btn-list {
    border-color: #ddd6fe;
    background: #faf5ff;
    color: #6d28d9;
}

.music-controls .music-btn-list:hover {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #5b21b6;
}

/* 歌名一行更清爽 */
.mp-meta .music-info {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
}

@media (max-width: 768px) {
    .music-controls {
        flex-wrap: wrap;
        gap: 8px 8px;
    }

    .music-controls .music-btn {
        width: 34px;
        height: 34px;
    }

    .music-controls .mp-play {
        width: 44px;
        height: 44px;
    }

    .music-controls .music-btn-text {
        height: 28px;
        padding: 0 12px;
        font-size: 0.6875rem;
    }
}


/* ---------- 声明页面为浅色，避免华为等浏览器的「强制深色」把背景染灰 ---------- */
html {
    color-scheme: light;
}


/* ---------- 播放器 SVG 图标 ---------- */
.music-btn svg,
.mp-mini-btn svg,
.mp-stage-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.music-controls .mp-play svg,
.mp-stage-play svg {
    width: 20px;
    height: 20px;
}

.music-btn .ico-pause,
.mp-mini-btn .ico-pause,
.mp-stage-btn .ico-pause {
    display: none;
}

.is-playing .ico-play {
    display: none !important;
}

.is-playing .ico-pause {
    display: block !important;
}


/* ---------- 桌面端：音乐球放在右下角靠内一点，迷你条在它左侧 ---------- */
@media (min-width: 769px) {
    .music-ball {
        left: auto;
        right: 48px;
        bottom: 124px;      /* 抬高到页脚上方，与内容卡片底部平齐 */
    }

    .mp-mini-bar {
        left: auto;
        right: 108px;
        bottom: 96px;
    }
}


/* ---------- 手机端首页：压缩卡片，保证一屏放下文章 + 分页 ---------- */
@media (max-width: 768px) {
    .container-home .home-hero {
        padding: 14px 16px;
        margin-bottom: 10px;
    }

    .container-home .home-hero h1 {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }

    .container-home .home-hero p {
        font-size: 0.8125rem;
        line-height: 1.6;
    }

    .container-home .home-stats {
        margin-top: 6px;
        gap: 6px;
    }

    .container-home .post-item {
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    .container-home .post-item h2 {
        font-size: 1rem;
        line-height: 1.45;
        margin-bottom: 6px;
    }

    .container-home .post-meta {
        gap: 4px 8px;
        margin-bottom: 6px;
        font-size: 0.75rem;
    }

    /* 手机端首页摘要只显示一行 */
    .container-home .post-item .post-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.8125rem;
        line-height: 1.5;
        margin-bottom: 6px;
    }

    .container-home .read-more {
        font-size: 0.8125rem;
    }

    .container-home .pager {
        padding-top: 8px;
        gap: 8px;
    }
}


/* ---------- 手机端首页：缩小首个卡片与顶部的距离 ---------- */
@media (max-width: 768px) {
    .container-home .blog-layout {
        padding-top: 20px !important;
    }

    .container-home .post-list {
        padding-top: 0 !important;
    }

    .container-home .home-hero {
        margin-top: 0;
    }
}


/* ---------- 手机端分页：条数与按钮同一行 ---------- */
@media (max-width: 768px) {
    .pager {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .pager .pager-info {
        font-size: 0.75rem;
        white-space: nowrap;
        order: 0;
        flex: 0 0 auto !important;   /* 之前是 flex: 1 1 100%，会独占整行 */
    }

    .pager .pager-btn {
        font-size: 0.75rem;
        padding: 4px 10px;
        white-space: nowrap;
        flex: 0 0 auto;
        min-width: 0 !important;
    }
}


/* ---------- 手机端首页：分页紧跟卡片，不再被推到屏幕底部 ---------- */
@media (max-width: 768px) {
    .container-home .post-list > .pager {
        margin-top: 12px !important;
        padding-top: 0 !important;
    }
}


/* ---------- 手机端不显示迷你播放条 ---------- */
@media (max-width: 768px) {
    .mp-mini-bar {
        display: none !important;
    }
}


/* ---------- 页脚：贴底，上方两角圆角 ---------- */
.site-footer {
    margin: 0;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    .site-footer {
        margin: 0;
        border-radius: 12px 12px 0 0;
    }
}




/* ---------- 桌面端歌单常驻，隐藏无意义的关闭按钮 ---------- */
@media (min-width: 769px) {
    #btn-close-playlist {
        display: none;
    }
}


/* ---------- 测试设计等宽页面：恢复宽版布局 ---------- */
.container.container-wide {
    max-width: 1760px !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
}

.container.container-wide > .lab-page {
    padding-top: 24px;
}


/* ---------- 播放器歌名滚动（超出时来回滚动） ---------- */
.music-info,
.mp-mini-title {
    overflow: hidden;
    position: relative;
}

.music-info > span,
.mp-mini-title {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

.music-info > span.is-scrolling,
.mp-mini-title.is-scrolling {
    animation: mp-marquee 9s linear infinite alternate;
}

@keyframes mp-marquee {
    0%, 15% { transform: translateX(0); }
    85%, 100% { transform: translateX(var(--mp-shift, 0)); }
}


/* ---------- 全屏播放页歌词 ---------- */
.mp-stage-lyrics {
    width: 100%;
    height: 132px;
    overflow: hidden;
    position: relative;
    margin: 6px 0 2px;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.mp-stage-lyrics-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.25s ease;
    will-change: transform;
}

.mp-lyric-line {
    margin: 0;
    padding: 2px 8px;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.mp-lyric-line:hover {
    color: rgba(255, 255, 255, 0.75);
}

.mp-lyric-line.is-active {
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    transform: scale(1.02);
}

.mp-lyric-empty {
    margin: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
}

@media (max-width: 768px) {
    .mp-stage-lyrics {
        height: 96px;
    }

    .mp-lyric-line {
        font-size: 0.8125rem;
    }

    .mp-lyric-line.is-active {
        font-size: 0.875rem;
    }
}


/* ---------- 系列页容器宽度与文章详情页一致 ---------- */
.container.container-series {
    max-width: 1400px !important;
}


/* ---------- 书签页 ---------- */
.bm-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

.bm-head {
    margin-bottom: 16px;
}

.bm-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.bm-add input {
    flex: 1 1 180px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
}

.bm-add input:focus {
    outline: none;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.bm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.bm-toolbar input {
    flex: 1;
    max-width: 280px;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8125rem;
}

.bm-count {
    margin-left: 10px;
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
    vertical-align: middle;
}

.bm-group {
    margin-bottom: 22px;
}

.bm-group-title {
    margin: 0 0 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.02em;
}

.bm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.bm-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.bm-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.bm-open {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
    text-decoration: none;
}

.bm-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    color: #4f46e5;
    font-size: 0.875rem;
    font-weight: 700;
    overflow: hidden;
}

.bm-favicon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.bm-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bm-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-host {
    font-size: 0.6875rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-note {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.bm-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.bm-card:hover .bm-actions {
    opacity: 1;
}

.bm-btn {
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.6875rem;
    color: #94a3b8;
    cursor: pointer;
    font-family: inherit;
}

.bm-btn:hover {
    color: #4338ca;
}

.bm-del:hover {
    color: #dc2626;
}

@media (max-width: 768px) {
    .bm-add input {
        flex: 1 1 100%;
    }

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

    .bm-actions {
        opacity: 1;
    }
}


/* ---------- 书签：行内编辑表单 ---------- */
.bm-edit-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.bm-edit-form input {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: inherit;
}

.bm-edit-form input:focus {
    outline: none;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.bm-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.bm-edit-actions .btn-primary,
.bm-edit-actions .btn-ghost {
    flex: 0 0 auto;
    width: auto;
    padding: 6px 16px;
    white-space: nowrap;
    line-height: 1.4;
}


/* 编辑态：隐藏原内容与操作按钮，表单占满整张卡片 */
.bm-open[hidden],
.bm-actions[hidden] {
    display: none !important;
}

.bm-card:has(.bm-edit-form) {
    display: block;
}

.bm-edit-form {
    width: 100%;
}



/* ---------- 手机端看板下拉：统一字号（pages.css 最后加载，能覆盖 layout.css） ---------- */
@media (max-width: 768px) {
    .design-head-row .board-picker {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    .design-head-row .board-picker label {
        flex: 0 0 auto;
        font-size: 0.8125rem;
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
    }

    .design-head-row .board-picker select {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: 168px;
        height: 28px;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 0.8125rem;
        font-weight: 700;
        color: #0f172a;
        line-height: 1.2;
    }

    .design-head-row .board-picker select option {
        font-size: 0.8125rem;
    }
}


/* ---------- 手机端：测试设计标题与系列页对齐 ---------- */
@media (max-width: 768px) {
    .container.container-wide {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .container-wide > .lab-page {
        padding-top: 12px;
    }

    .design-title {
        text-align: left;
        margin: 0 0 8px;
        /* 字号交给 .lab-title 的响应式规则，和系列页完全一致 */
    }
}


/* ---------- 手机端：搜索按钮固定到页头右上角 ---------- */
@media (max-width: 768px) {
    .site-header .container {
        position: relative;
    }

    .nav-search-toggle {
        position: absolute;
        top: 12px;
        right: 16px;
        margin: 0;
        z-index: 5;
    }

    /* 展开的搜索框铺在标题下面一行 */
    .site-nav.search-open .nav-search {
        order: 9;
        width: 100%;
        margin: 8px 0 0;
    }
}


/* ---------- 手机端：不显示搜索入口 ---------- */
@media (max-width: 768px) {
    .nav-search-toggle {
        display: none !important;
    }

    .site-nav.search-open .nav-search {
        display: none !important;
    }
}


/* ---------- 书签：导出链接 ---------- */
.bm-export {
    display: flex;
    gap: 12px;
    margin: 0 0 12px;
}

.bm-btn-link {
    font-size: 0.75rem;
    color: #4f46e5;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #e0e7ff;
    border-radius: 999px;
    background: #f5f7ff;
}

.bm-btn-link:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}


/* ---------- 书签：导入 / 导出工具行 ---------- */
.bm-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 12px;
}

.bm-import,
.bm-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.bm-import input[type="file"] {
    max-width: 200px;
    padding: 5px 8px;
    font-size: 0.75rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
}

.bm-import input[type="file"]:hover {
    border-color: #a5b4fc;
    color: #4338ca;
}

/* 添加按钮回到自适应宽度 */
.bm-add .btn-primary {
    flex: 0 0 auto;
    padding: 8px 26px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .bm-add .btn-primary {
        width: 100%;
    }
}

.bm-import-result {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.8125rem;
}


/* ---------- 书签页：视觉整理 ---------- */
.bm-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 0 48px;
}

/* 页头 */
.bm-page .bm-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 18px;
}

.bm-page .bm-head .lab-title {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 0.01em;
}

.bm-page .bm-count {
    margin: 0;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.6875rem;
    font-weight: 600;
}

.bm-page .bm-head .lab-subtitle {
    margin: 6px 0 0;
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* 添加区 */
.bm-page .bm-add {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #edf0f6;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -18px rgba(15, 23, 42, 0.25);
}

.bm-page .bm-add input {
    flex: 1 1 160px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f7f9fc;
    font-size: 0.875rem;
    color: #1f2937;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.bm-page .bm-add input::placeholder {
    color: #a3adbd;
}

.bm-page .bm-add input:focus {
    outline: none;
    background: #fff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.bm-page .bm-add .btn-primary {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 26px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.5);
}

/* 导入 / 导出 */
.bm-page .bm-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-left: 2px;
}

/* 导入按钮：把文件选择藏在按钮里 */
.bm-page .bm-import-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.bm-page .bm-import-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.bm-page .bm-btn-link {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5b6472;
    background: #fff;
    border: 1px solid #e8ebf2;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bm-page .bm-btn-link:hover {
    background: #f5f7ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

/* 搜索行 */
.bm-page .bm-toolbar {
    margin-bottom: 20px;
}

.bm-page .bm-toolbar input {
    width: 100%;
    max-width: 320px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #edf0f6;
    border-radius: 999px;
    background: #fff;
    font-size: 0.8125rem;
}

.bm-page .bm-toolbar input:focus {
    outline: none;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 分组标题 */
.bm-page .bm-group {
    margin-bottom: 26px;
}

.bm-page .bm-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.02em;
}

.bm-page .bm-group-title::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 3px;
    background: linear-gradient(180deg, #6366f1, #a855f7);
}

/* 卡片 */
.bm-page .bm-grid {
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 12px;
}

.bm-page .bm-card {
    padding: 12px 14px;
    border: 1px solid #eef1f6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.bm-page .bm-card:hover {
    transform: translateY(-2px);
    border-color: #dfe4f2;
    box-shadow: 0 10px 24px -14px rgba(15, 23, 42, 0.35);
}

.bm-page .bm-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #f7f3ff);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.bm-page .bm-favicon {
    width: 20px;
    height: 20px;
}

.bm-page .bm-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
}

.bm-page .bm-host {
    font-size: 0.6875rem;
    color: #9aa4b2;
}

@media (max-width: 768px) {
    .bm-page .bm-head {
        flex-wrap: wrap;
        gap: 6px;
    }

    .bm-page .bm-head .lab-title {
        font-size: 1.25rem;
    }

    .bm-page .bm-add .btn-primary {
        width: 100%;
    }

    .bm-page .bm-toolbar input {
        max-width: none;
    }
}


/* ---------- 构建历史表格：列宽固定，时间不换行 ---------- */
.build-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.build-table th,
.build-table td {
    padding: 14px 18px;
    font-size: 0.8125rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.build-table thead th {
    font-weight: 700;
    color: #1f2937;
    background: #fafbfe;
    border-bottom: 1px solid #eef2f7;
}

.build-table th:nth-child(1),
.build-table td:nth-child(1) {
    width: 56px;
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}

.build-table th:nth-child(2),
.build-table td:nth-child(2) {
    width: 156px;
    padding-left: 10px;
    text-align: left;
    font-variant-numeric: tabular-nums;
    color: #475569;
}

.build-table th:nth-child(2),
.build-table td:nth-child(2) {
    width: 170px;
}

.build-table th:nth-child(3),
.build-table td:nth-child(3) {
    width: 96px;
    text-align: center;
}

.build-table th:nth-child(4),
.build-table td:nth-child(4) {
    width: 88px;
    text-align: center;
    color: #64748b;
}

.build-table th:nth-child(5),
.build-table td:nth-child(5) {
    white-space: nowrap;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: #1f2937;
    font-weight: 500;
}

/* 斑马纹，行更好区分 */
.build-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

@media (max-width: 768px) {
    .build-table th,
    .build-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    .build-table th:nth-child(1),
    .build-table td:nth-child(1) {
        width: 70px;
    }

    .build-table th:nth-child(2),
    .build-table td:nth-child(2) {
        width: 130px;
    }
}


/* ---------- 构建历史：手机端横向滚动，不挤压列 ---------- */
.build-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.build-table td.build-version,
.build-table td:nth-child(3),
.build-table td:nth-child(4) {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .build-table {
        min-width: 640px;
    }

    .build-table th,
    .build-table td {
        padding: 10px 12px;
    }
}


/* ---------- 构建历史：手机端一屏放下（覆盖上面的最小宽度） ---------- */
@media (max-width: 768px) {
    .build-table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    .build-table th,
    .build-table td {
        padding: 8px 4px;
        font-size: 0.6875rem;
        line-height: 1.3;
    }

    .build-table th:nth-child(1),
    .build-table td:nth-child(1) {
        width: 46px;
        padding-left: 2px;
        padding-right: 2px;
    }

    .build-table th:nth-child(2),
    .build-table td:nth-child(2) {
        width: 100px;
        padding-left: 4px;
    }

    .build-table th:nth-child(3),
    .build-table td:nth-child(3) {
        width: 56px;
    }

    .build-table th:nth-child(4),
    .build-table td:nth-child(4) {
        width: 44px;
    }

    .build-table th:nth-child(5),
    .build-table td:nth-child(5) {
        width: auto;
        font-size: 0.625rem;
    }

    /* 徽标缩小，避免撑高行 */
    .build-table .build-badge {
        padding: 1px 5px;
        font-size: 0.625rem;
    }
}


/* ---------- 构建历史：手机端不滑动，隐藏次要列 ---------- */
.build-time-short {
    display: none;
}

@media (max-width: 768px) {
    .build-table-wrap {
        overflow-x: hidden;
    }

    /* 手机端不显示「耗时」列 */
    .build-table th:nth-child(4),
    .build-table td:nth-child(4) {
        display: none;
    }

    .build-time-full {
        display: none;
    }

    .build-time-short {
        display: inline;
    }

    /* 用百分比分配，避免固定宽度被浏览器均摊放大 */
    .build-table th:nth-child(1),
    .build-table td:nth-child(1) {
        width: 15%;
    }

    .build-table th:nth-child(2),
    .build-table td:nth-child(2) {
        width: 31%;
    }

    .build-table th:nth-child(3),
    .build-table td:nth-child(3) {
        width: 18%;
    }

    .build-table th:nth-child(5),
    .build-table td:nth-child(5) {
        width: 36%;
        text-align: center;
    }
}


/* ---------- 构建历史：表头与完成时间统一深色（全局，覆盖媒体查询） ---------- */
.build-table thead th,
.build-table th:nth-child(5),
.build-table td:nth-child(5) {
    color: #1f2937;
}

.build-table thead th {
    font-weight: 700;
}

.build-table td:nth-child(5) {
    font-weight: 500;
}


/* ---------- 构建历史表头：统一加粗近黑（特异性高于列规则） ---------- */
.build-table thead th:nth-child(n),
.build-table thead th {
    color: #1f2937;
    font-weight: 700;
}


/* ---------- 侧栏标签云 ---------- */
.tag-cloud-side {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag-cloud-side .tag-cloud-item {
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 999px;
    text-decoration: none;
}

html[data-theme="dark"] .tag-cloud-side .tag-cloud-item:nth-child(n) {
    border: 1px solid rgba(148, 163, 184, 0.2);
}


/* ---------- 关于页头像 ---------- */
.about-body .about-avatar {
    float: right;
    width: 148px;
    height: 148px;
    margin: 4px 0 14px 22px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 10px 26px -12px rgba(15, 23, 42, 0.45);
    background: #f1f5f9;
}

.about-body .about-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 640px) {
    .about-body .about-avatar {
        float: none;
        width: 112px;
        height: 112px;
        margin: 6px auto 16px;
    }
}

html[data-theme="dark"] .about-body .about-avatar {
    border-color: #1e293b;
    box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.8);
}


/* ---------- 书签：拖拽导入遮罩 ---------- */
.bm-drop-mask {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.bm-drop-tip {
    padding: 26px 40px;
    border: 2px dashed #a5b4fc;
    border-radius: 18px;
    background: #fff;
    color: #4338ca;
    font-size: 1rem;
    font-weight: 600;
}

html[data-theme="dark"] .bm-drop-tip {
    background: #1e293b;
    border-color: #6366f1;
    color: #c7d2fe;
}


/* ---------- 文章表格里的行内代码：去掉灰色底 ---------- */
.post-body table code,
.post-content table code,
.post-body table td code,
.post-body table th code {
    background: transparent;
    border: 0;
    padding: 0;
    color: #0f172a;
    font-weight: 600;
}

html[data-theme="dark"] .post-body table code,
html[data-theme="dark"] .post-content table code {
    background: transparent;
    color: #e2e8f0;
}


/* ---------- 文章正文：行内代码不再用灰底 ---------- */
.post-content code:not(pre code),
.post-body code:not(pre code),
.post-body code,
.post-content code {
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
    color: #1f2937;
    font-weight: 600;
}

/* 代码块保持深色底，内部不再叠灰 */
.post-body pre,
.post-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 12px;
    overflow-x: auto;
    line-height: 1.6;
}

.post-body pre code,
.post-content pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
    font-weight: 400;
    font-size: 0.8125rem;
}

html[data-theme="dark"] .post-body code,
html[data-theme="dark"] .post-content code {
    background: transparent;
    color: #e2e8f0;
}


/* ---------- 404 页面 ---------- */
.error-page {
    max-width: 620px;
    margin: 64px auto 80px;
    padding: 44px 36px;
    text-align: center;
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 20px;
    box-shadow: 0 18px 50px -30px rgba(15, 23, 42, 0.45);
}

.error-code {
    font-size: 5.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #6366f1, #a855f7 60%, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-title {
    margin: 14px 0 8px;
    font-size: 1.375rem;
    color: #111827;
}

.error-desc {
    margin: 0 auto 24px;
    max-width: 420px;
    font-size: 0.875rem;
    line-height: 1.8;
    color: #64748b;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid #e5e9f2;
    background: #fff;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.error-btn:hover {
    background: #f5f7ff;
    border-color: #c7d2fe;
    color: #4338ca;
    text-decoration: none;
}

.error-btn.is-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(79, 70, 229, 0.9);
}

.error-btn.is-primary:hover {
    color: #fff;
    filter: brightness(1.06);
}

.error-hint {
    margin: 26px 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.error-hint a {
    color: #6366f1;
    text-decoration: none;
}

@media (max-width: 640px) {
    .error-page {
        margin: 28px 0 48px;
        padding: 32px 20px;
        border-radius: 16px;
    }

    .error-code {
        font-size: 4rem;
    }

    .error-title {
        font-size: 1.1875rem;
    }
}

html[data-theme="dark"] .error-page {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 18px 50px -30px rgba(0, 0, 0, 0.9);
}

html[data-theme="dark"] .error-title {
    color: #f1f5f9;
}

html[data-theme="dark"] .error-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .error-btn:hover {
    background: #253449;
    border-color: #4f46e5;
    color: #c7d2fe;
}

html[data-theme="dark"] .error-btn.is-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}


/* ---------- 文章目录：二级标题缩进 ---------- */
#article-toc ul {
    margin: 0;
    padding-left: 0;
}

#article-toc li {
    margin: 0 0 6px;
    list-style: none;
    line-height: 1.5;
}

/* 二级及以下缩进，并用竖线提示层级 */
#article-toc ul ul {
    margin: 4px 0 2px;
    padding-left: 14px;
    border-left: 1px solid #eef1f6;
}

#article-toc ul ul a {
    font-size: 0.8125rem;
    color: #64748b;
}

#article-toc ul ul ul {
    padding-left: 12px;
}

html[data-theme="dark"] #article-toc ul ul {
    border-left-color: #334155;
}

html[data-theme="dark"] #article-toc ul ul a {
    color: #94a3b8;
}
