/* 雾岛工具箱 · 仅限 /toolbox/ 的 3D 动态环绕文章星环与「全部工具」列表 */
.page-toolbox .ag-bg-veil {
    background: transparent !important;
}

/* 与本地原型保持 1:1 舞台宽度（1320px），并将页脚胶囊贴近首屏底部（与右下角按钮同高） */
.page-toolbox .ag-viewport {
    width: min(1320px, calc(100% - 24px));
    min-height: 100svh;
    padding: 84px 0 24px;
    display: flex;
    flex-direction: column;
}

.page-toolbox .ag-main {
    min-height: 0;
    flex: 1 0 auto;
}

.page-toolbox .ag-footer {
    margin: 12px auto 0;
}

.tb-shell {
    width: 100%;
    margin: 0 auto;
    color: #f4f7ff;
}

/* 3D 环绕星环舞台：1:1 复刻原型比例 */
.tb-orbit-stage {
    position: relative;
    width: 100%;
    height: clamp(470px, 68vh, 620px);
    margin: 4px auto 0;
    perspective: 1700px;
    user-select: none;
    touch-action: pan-y;
    cursor: grab;
}
.tb-orbit-stage:active { cursor: grabbing; }
.tb-orbit-stage[hidden] { display: none; }

.tb-orbit-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 0 18px rgba(165, 188, 255, 0.55)) drop-shadow(0 0 8px rgba(255, 178, 165, 0.35));
}

.tb-orbit-ring {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* 80% 紧凑比例斜切星徽玻璃卡：支持「有图」与「无图纯排版」双形态 */
.tb-orbit-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(256px, 27vw, 355px);
    padding: 12px 14px;
    border-radius: 16px 6px 16px 16px;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
    border: 1px solid rgba(220, 232, 255, 0.28);
    background: linear-gradient(142deg, rgba(16, 26, 60, 0.64), rgba(32, 44, 88, 0.34));
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 16px 38px rgba(4, 10, 28, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    color: #f6f9ff;
    text-decoration: none;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    pointer-events: auto;
    will-change: transform, opacity;
    transform: translate3d(calc(-50% + var(--ox, 0px)), calc(-50% + var(--oy, 0px)), var(--oz, 0px)) rotateY(var(--ory, 0deg)) rotateZ(var(--orz, 0deg)) scale(var(--os, 1));
    opacity: var(--oo, 1);
    z-index: var(--oi, 1);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    overflow: hidden;
}

.tb-orbit-card.is-text-only {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 11px;
    padding: 13px 15px;
}

.tb-orbit-spine {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 4px 6px 4px 0;
    border-right: 1px dashed rgba(195, 214, 255, 0.28);
}

.tb-orbit-spine-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9bb4ff, #e4c6ff);
    box-shadow: 0 0 8px rgba(155, 180, 255, 0.85);
}

.tb-orbit-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(118deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 36%, transparent 54%);
}

.tb-orbit-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(168, 198, 255, 0.45), rgba(255, 255, 255, 0.08) 45%, rgba(255, 186, 206, 0.42));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

.tb-orbit-card:hover::before,
.tb-orbit-card.is-front::before { opacity: 1; }

.tb-orbit-card.is-front {
    background: linear-gradient(142deg, rgba(20, 32, 74, 0.86), rgba(50, 58, 114, 0.7));
    border-color: rgba(255, 218, 230, 0.74);
    box-shadow:
        0 24px 60px rgba(4, 10, 28, 0.65),
        0 0 26px rgba(175, 195, 255, 0.45),
        0 0 12px rgba(255, 178, 178, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.tb-orbit-cover {
    width: 76px;
    height: 86px;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(145deg, #21376d, #6e5ea8 58%, #d49088);
    box-shadow: 0 8px 20px rgba(4, 10, 28, 0.38);
}
.tb-orbit-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tb-orbit-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }

.tb-orbit-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-family: var(--pearl-mono);
    font-size: 1rem;
    color: #b9ccff;
}

.tb-orbit-tag {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(124, 152, 255, 0.24);
    border: 1px solid rgba(195, 214, 255, 0.3);
    color: #e4ecff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-orbit-spark { opacity: 0.7; font-size: 1rem; flex-shrink: 0; }

.tb-orbit-title {
    margin: 1px 0 0;
    font-family: var(--pearl-serif);
    font-size: clamp(1.35rem, 1.15vw, 1.55rem);
    font-weight: 700;
    line-height: 1.32;
    color: #fff;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.tb-orbit-excerpt {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.5;
    color: rgba(226, 236, 255, 0.8);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.tb-orbit-cta {
    margin-top: 2px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffd4df;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.22s ease;
}
.tb-orbit-card.is-front .tb-orbit-cta { opacity: 1; transform: translateX(0); }

.tb-ctrl-btn {
    border: 1px solid rgba(195, 214, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.tb-ctrl-btn:hover { background: rgba(124, 152, 255, 0.34); }

/* 右下角「全部工具」入口胶囊：与页脚胶囊同高（60px）同质感，固定同高 */
.tb-all-btn {
    position: fixed;
    right: 26px;
    bottom: 24px;
    z-index: 35;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 60px;
    padding: 0 24px;
    border-radius: 999px;
    border: 1px solid var(--pearl-header-edge);
    background: var(--pearl-header-surface);
    -webkit-backdrop-filter: var(--pearl-header-blur);
    backdrop-filter: var(--pearl-header-blur);
    color: var(--pearl-nav-ink);
    text-shadow: var(--pearl-header-text-shadow);
    font: 600 1.4rem/1 var(--ag-font);
    cursor: pointer;
    box-shadow: var(--pearl-header-shadow);
    transition: background-color 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tb-all-btn:hover {
    background: var(--pearl-hero-nav-hover);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: var(--pearl-header-shadow), var(--pearl-progress-glow);
    transform: translateY(-2px);
}
.tb-all-btn[hidden] { display: none; }

/* 「全部工具」文章目录树视图 */
.tb-list-view {
    position: relative;
    z-index: 20;
    width: min(900px, 100%);
    margin: 22px auto 64px;
    padding: 24px 28px;
    border-radius: 24px;
    background: radial-gradient(ellipse at 50% 35%, rgba(10, 18, 44, 0.72) 0%, rgba(10, 18, 44, 0.5) 80%, transparent 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(195, 214, 255, 0.24);
}
.tb-list-view[hidden] { display: none; }

.tb-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(195, 214, 255, 0.22);
}
.tb-list-head-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tb-list-head h2 { margin: 0; font: 700 2.2rem/1.3 var(--pearl-serif); color: #fff; }
.tb-list-total { font: 500 1.2rem/1 var(--pearl-mono); color: rgba(215, 228, 255, 0.8); }
.tb-list-fold { display: flex; gap: 6px; }

.tb-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(124, 152, 255, 0.16);
    border: 1px solid rgba(195, 214, 255, 0.28);
    color: #eef3ff;
    font-size: 1.3rem;
}
.tb-filter-bar[hidden] { display: none; }

.tb-group { margin-bottom: 14px; }
.tb-group > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.tb-group > summary::-webkit-details-marker { display: none; }
.tb-group > summary:hover { background: rgba(124, 152, 255, 0.16); }

.tb-caret {
    width: 7px;
    height: 7px;
    border-right: 1.8px solid #a8c0ff;
    border-bottom: 1.8px solid #a8c0ff;
    transform: rotate(-45deg);
    transition: transform 0.2s;
}
details[open] > summary .tb-caret { transform: rotate(45deg); }
.tb-group-name { font: 700 1.6rem/1.4 var(--pearl-serif); color: #fff; }
.tb-group-count { margin-left: auto; font: 500 1.15rem/1 var(--pearl-mono); color: rgba(205, 220, 255, 0.72); }

.tb-group-list {
    list-style: none;
    margin: 4px 0 8px 13px;
    padding: 0 0 0 16px;
    border-left: 1px dashed rgba(185, 205, 255, 0.28);
}

.tb-post-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
    padding: 8px 10px;
    border-radius: 9px;
    text-decoration: none;
    color: rgba(240, 245, 255, 0.92);
    transition: background-color 0.18s, transform 0.18s;
}
.tb-post-row:hover { background: rgba(124, 152, 255, 0.2); color: #fff; transform: translateX(3px); }
.tb-post-date { font: 500 1.2rem/1 var(--pearl-mono); color: rgba(195, 214, 255, 0.78); }
.tb-post-title { font-size: 1.45rem; font-weight: 600; }
.tb-post-tag {
    margin-left: auto;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 1.1rem;
    background: rgba(124, 152, 255, 0.2);
    border: 1px solid rgba(195, 214, 255, 0.24);
    color: #dce8ff;
}

.tb-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.5rem;
    color: rgba(230, 238, 255, 0.85);
}

@media (max-width: 760px) {
    .page-toolbox .ag-viewport { padding-bottom: 76px; }
    .tb-orbit-card { width: min(275px, 76vw); }
    .tb-all-btn { right: 16px; bottom: 16px; height: 48px; padding: 0 18px; font-size: 1.3rem; }
}
