/**
 * 全局命令面板 (Ctrl+K) — 毛玻璃 + 键盘选中态
 * 依赖 admin_standard.css 中的 --primary 等变量；徽章依赖 ui_tables .erp-badge
 */
.erp-command-palette {
    --cp-width: 600px;
    --cp-z-index: 10000;
    --cp-item-height: 64px;
    --primary: var(--primary, #2563eb);
    --erp-semantic-info-soft: var(--erp-semantic-info-soft, #eff6ff);
    position: fixed;
    inset: 0;
    z-index: var(--cp-z-index);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 24px;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.erp-command-palette.is-open {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.erp-command-palette__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.erp-command-palette__panel {
    position: relative;
    width: min(var(--cp-width), calc(100vw - 32px));
    max-height: min(90vh, 640px);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 24px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.erp-command-palette__input-wrap {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.erp-command-palette__input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.05rem;
    line-height: 1.4;
    color: #0f172a;
    padding: 4px 0;
}

.erp-command-palette__input::placeholder {
    color: #94a3b8;
}

.erp-command-palette__hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
    letter-spacing: 0.02em;
}

.erp-command-palette__body {
    min-height: 120px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.erp-command-palette__tips {
    padding: 16px 18px 20px;
    font-size: 13px;
    color: #475569;
    line-height: 1.65;
}

.erp-command-palette__tips kbd {
    display: inline-block;
    padding: 2px 7px;
    margin: 0 2px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #334155;
}

.erp-command-palette__tips-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.erp-command-palette__tips-title--follow {
    margin-top: 14px;
}

/* 最近使用：与「常用搜索」区分，带历史图标 */
.erp-command-palette__tips-title--history {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.erp-command-palette__tips-title--history .fa-history {
    opacity: 0.85;
    font-size: 13px;
}

.erp-command-palette__history-wrap {
    margin-bottom: 4px;
}

.erp-command-palette__history-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.erp-command-palette__list {
    list-style: none;
    margin: 0;
    padding: 4px 0 8px;
}

.erp-cp-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: var(--cp-item-height);
    padding: 10px 16px 10px 12px;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.erp-cp-item:hover {
    background-color: rgba(37, 99, 235, 0.06);
}

/* 键盘选中：语义浅底 + 左侧主色条 */
.erp-cp-item.is-selected {
    background-color: var(--erp-semantic-info-soft);
    border-left: 4px solid var(--primary);
}

.erp-cp-item__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 15px;
}

.erp-cp-item__main {
    flex: 1;
    min-width: 0;
}

.erp-cp-item__title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}

.erp-cp-item__sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.45;
    word-break: break-word;
}

.erp-cp-item__badge {
    flex-shrink: 0;
    align-self: center;
}

.erp-command-palette__empty,
.erp-command-palette__loading {
    padding: 28px 20px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.erp-command-palette__loading {
    color: #94a3b8;
}
