/* workbench.css - 页面专属样式 */
:root {
    --sidebar-w: 270px;
}

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    display: flex;
    background: #f4f5fb;
    overflow: hidden;
}

/* ════════ 侧边栏 ════════ */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    height: 100vh;
    background: linear-gradient(165deg, #5b6ee0 0%, #7c4fd0 55%, #8d44c4 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(80, 60, 160, 0.18);
}

/* 侧栏背景光晕 */
.sidebar::before,
.sidebar::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}
.sidebar::before { width: 260px; height: 260px; background: rgba(160, 190, 255, 0.35); top: -60px; left: -80px; }
.sidebar::after  { width: 240px; height: 240px; background: rgba(220, 140, 255, 0.3); bottom: -50px; right: -70px; }

/* 品牌 */
.brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 26px 24px 24px;
}
.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.16);
}
.brand-name { color: #fff; font-size: 18px; font-weight: 600; letter-spacing: 1px; line-height: 1.2; }
.brand-sub  { color: rgba(255, 255, 255, 0.6); font-size: 11px; margin-top: 2px; letter-spacing: 0.5px; }

/* 分组标题 */
.nav-group-title {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 18px 26px 10px;
}

/* 导航 */
.nav {
    position: relative;
    z-index: 1;
    padding: 6px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.82);
    border: 1px solid transparent;
    transition: all 0.25s ease;
    position: relative;
    user-select: none;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}
.nav-item.active {
    background: rgba(255, 255, 255, 0.96);
    color: #6a4fd0;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}
.nav-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 26px;
    text-align: center;
    line-height: 1;
}
.nav-text { flex: 1; min-width: 0; }
.nav-label {
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}
.nav-desc {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 标签 */
.tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 6px;
    color: #fff;
    flex-shrink: 0;
}
.tag.new    { background: linear-gradient(135deg, #2dd4a7, #14b88a); }
.tag.update { background: linear-gradient(135deg, #ffa64d, #ff7a1a); }
.nav-item.active .tag { box-shadow: 0 2px 6px rgba(0,0,0,0.15); }

/* 步骤连接提示 */
.nav-step-line {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 30px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    letter-spacing: 1px;
}
.nav-step-line::before,
.nav-step-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
}

/* 侧栏页脚 */
.sidebar-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding: 18px 26px 22px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    letter-spacing: 0.3px;
    line-height: 1.6;
}

/* ════════ 右侧内容区 ════════ */
.workbench-content {
    flex: 1;
    height: 100vh;
    position: relative;
    background: #f4f5fb;
}
.tool-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 加载遮罩 */
.frame-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f5fb;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.frame-loader.hide { opacity: 0; pointer-events: none; }
.frame-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0e0ee;
    border-top-color: #7c4fd0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════ 移动端：顶部抽屉 ════════ */
.mobile-bar { display: none; }

@media (max-width: 860px) {
    body { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: column;
        box-shadow: 0 4px 18px rgba(80, 60, 160, 0.2);
    }
    .brand { padding: 18px 20px; }
    .nav-group-title, .nav-step-line, .sidebar-footer { display: none; }
    .nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 14px 14px;
        gap: 10px;
    }
    .nav-item {
        flex-direction: column;
        gap: 6px;
        min-width: 120px;
        padding: 12px 12px;
        text-align: center;
    }
    .nav-text { text-align: center; }
    .nav-label { font-size: 12.5px; justify-content: center; }
    .nav-desc { display: none; }
    .workbench-content { height: auto; flex: 1; }
    .workbench-content, .tool-frame { min-height: calc(100vh - 150px); }
}
