/* 爆枪英雄编辑器 — 侧边栏布局 */

.bq-detail-page .detail-header {
    flex-shrink: 0;
}

.bq-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.bq-detail-stats .top-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 72px;
}

.bq-detail-stats .top-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bq-detail-stats .top-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.bq-detail-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
}

.bq-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-input);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.65rem 0;
    align-self: stretch;
}

.bq-sidebar-group {
    margin-bottom: 0.5rem;
}

.bq-sidebar-group-title {
    padding: 0.35rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bq-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.bq-nav-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.bq-nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.bq-nav-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 99px;
    background: var(--border);
    color: var(--text-dim);
    flex-shrink: 0;
}

.bq-nav-item.active .bq-nav-badge {
    background: var(--primary);
    color: #fff;
}

.bq-nav-badge.missing {
    opacity: 0.45;
}

.bq-content {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.25rem 1.5rem;
    align-self: stretch;
    background: var(--bg-card);
    box-sizing: border-box;
}

.bq-content .panel {
    display: none;
    max-height: none !important;
    overflow: visible;
    min-height: 100%;
    padding: 0 !important;
    box-sizing: border-box;
}

.bq-content .panel.active {
    display: block;
    animation: bqFadeIn 0.2s ease;
    max-height: none !important;
    overflow: visible;
    min-height: 100%;
    padding: 0 !important;
}

@keyframes bqFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.bq-section-hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bq-section-hdr h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.bq-section-hdr p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.bq-section-tag {
    font-size: 0.72rem;
    font-family: var(--font-mono, monospace);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--border);
}

.bq-generic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.65rem;
}

.bq-nested-block {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.bq-nested-block h4 {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.bq-mobile-nav-toggle {
    display: none;
    margin: 0.5rem 1rem;
    width: calc(100% - 2rem);
    flex-shrink: 0;
}

/* 一键操作 & 直观面板 */
.bq-nav-item.bq-nav-quick {
    font-weight: 600;
}

.bq-quick-actions-lg .btn-p {
    min-width: 7rem;
}

.bq-quick-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-bg, rgba(79,70,229,.08)), transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
}

.bq-quick-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.bq-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.bq-quick-group {
    margin-bottom: 1.25rem;
}

.bq-quick-group h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.bq-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.6rem;
}

.bq-quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-card, #fff);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.bq-quick-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow, rgba(79,70,229,.12));
    transform: translateY(-1px);
}

.bq-quick-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

.bq-quick-card-go {
    font-size: 0.72rem;
    color: var(--primary);
}

.bq-form-section {
    margin-bottom: 1.25rem;
}

.bq-form-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.bq-form-hint {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-dim);
}

.bq-add-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
    align-items: center;
}

.bq-add-field-name,
.bq-add-field-val {
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.82rem;
    font-family: inherit;
    min-width: 100px;
}

.bq-inline-input {
    width: 100%;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: inherit;
}

.bq-empty-card {
    text-align: center;
    padding: 2rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm, 8px);
    color: var(--text-muted);
}

/* 快速添加物品条 */
.bq-inline-picker-lg {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--r-lg, 12px);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(124, 58, 237, 0.04));
}

.bq-picker-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bq-picker-controls .bq-inline-search {
    flex: 1;
    min-width: 180px;
}

.bq-qty-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

.bq-qty-input {
    width: 88px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.bq-inline-list-lg {
    max-height: 280px;
}

.bq-inline-picker {
    margin-bottom: 0.85rem;
    padding: 0.75rem;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm, 8px);
    background: var(--primary-bg, rgba(79,70,229,.06));
}

.bq-inline-picker-hdr {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.bq-inline-picker-hdr span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.bq-inline-search {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-family: inherit;
}

.bq-inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: 140px;
    overflow-y: auto;
}

.bq-inline-item {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card, #fff);
    cursor: pointer;
    font-family: inherit;
    max-width: 160px;
    transition: all 0.12s;
}

.bq-inline-item:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.bq-inline-item:hover .bq-inline-item-code {
    color: rgba(255,255,255,.75);
}

.bq-inline-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.bq-inline-item-code {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: monospace;
}

.bq-inline-empty {
    font-size: 0.78rem;
    color: var(--text-dim);
    padding: 0.5rem;
}

.bq-item-toolbar {
    gap: 0.35rem;
    align-items: center;
}

.bq-item-toolbar .btn {
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .save-editor-body .detail-page.bq-detail-page {
        height: auto;
        max-height: none;
        min-height: calc(100vh - 3rem);
    }

    .bq-detail-layout {
        flex-direction: column;
        min-height: calc(100vh - 14rem);
    }

    .bq-content {
        min-height: 50vh;
    }

    .bq-mobile-nav-toggle {
        display: inline-flex;
    }

    .bq-sidebar {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: none;
    }

    .bq-sidebar.open {
        display: block;
        max-height: 50vh;
    }

    .bq-content {
        max-height: none;
    }
}
