/* ===== 工具箱面板（与个人信息面板同款布局机制） ===== */
.toolbox-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: calc(var(--new-top)) 0 24px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    visibility: hidden;
}

@media (max-width: 767.98px) {
    .toolbox-panel {
        max-width: 100vw;
        margin: 0;
        padding: calc(var(--new-top)) 12px 24px;
        background: rgba(255, 255, 255, 0.9);
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
        pointer-events: none;
        visibility: hidden;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
    }
}

/* 显示/隐藏切换 */
body.show-toolbox-panel #chat-wrapper,
body.show-toolbox-panel #chat-form,
body.show-toolbox-panel #hero-logo,
body.show-toolbox-panel #ai-warning,
body.show-toolbox-panel .reset-btn,
body.show-toolbox-panel #top-mask,
body.show-toolbox-panel #bottom-mask,
body.show-toolbox-panel #loading,
body.show-toolbox-panel #specialization-page {
    display: none;
}

/* 专业模式页面的显示由 JS inline style 控制，需 !important 确保工具箱打开时隐藏（关闭面板后自动恢复） */
body.show-toolbox-panel #specialization-page {
    display: none !important;
}

body.show-toolbox-panel .toolbox-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
}

/* ===== 面板内部布局 ===== */
#toolbox-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 4px 12px;
}

.toolbox-header-wrapper {
    max-width: 960px;
    margin: 40px auto 12px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbox-title-lg {
    font-weight: 700;
    font-size: 20px;
    color: #0f172a;
    line-height: 1.2;
}

.toolbox-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-top: 4px;
}

/* ===== 工具网格 ===== */
.tb-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 12px 18px 0;
}

.tb-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tb-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.tb-card:active {
    transform: translateY(0);
}

.tb-card-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-card-icon svg {
    width: 22px;
    height: 22px;
}

.tb-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.tb-card-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

@media (max-width: 960px) {
    .tb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 680px) {
    .tb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 420px) {
    .tb-grid { grid-template-columns: 1fr; gap: 10px; }
}

/* ===== 功能视图 ===== */
#toolbox-view .tb-view-card {
    background: #ffffff;
    padding: 22px 22px 24px;
    margin: 0 auto 16px;
}
