/* ── Slash Command Dropdown ── */
.slash-cmd-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    background: var(--bg-primary, #1a1a2e);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 12px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

.slash-cmd-dropdown.hidden {
    display: none;
}

/* ── 每一項 ── */
.slash-cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.05));
}

.slash-cmd-item:last-child {
    border-bottom: none;
}

.slash-cmd-item:hover,
.slash-cmd-item.active {
    background: var(--bg-hover, rgba(255,255,255,0.08));
}

.slash-cmd-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.slash-cmd-name {
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    white-space: nowrap;
    font-size: 14px;
}

.slash-cmd-desc {
    color: var(--text-secondary, #888);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.slash-cmd-hint {
    color: var(--text-tertiary, #666);
    font-size: 12px;
    white-space: nowrap;
    font-style: italic;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Inline Placeholder Overlay ── */
.slash-cmd-placeholder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    padding: inherit;
    font: inherit;
    line-height: inherit;
    color: var(--text-tertiary, #555);
    white-space: pre;
    overflow: hidden;
    display: none;
}

/* ── 錯誤提示 ── */
.slash-cmd-error {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    padding: 8px 14px;
    background: var(--bg-error, rgba(220,53,69,0.15));
    border: 1px solid var(--border-error, rgba(220,53,69,0.3));
    border-radius: 8px;
    color: var(--text-error, #ff6b6b);
    font-size: 13px;
    z-index: 999;
    animation: slash-error-in 0.2s ease-out;
    display: none;
}

@keyframes slash-error-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Light theme overrides ── */
[data-theme="light"] .slash-cmd-dropdown {
    background: #fff;
    border-color: rgba(0,0,0,0.12);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}

[data-theme="light"] .slash-cmd-item:hover,
[data-theme="light"] .slash-cmd-item.active {
    background: rgba(0,0,0,0.04);
}

[data-theme="light"] .slash-cmd-name {
    color: #1a1a1a;
}

[data-theme="light"] .slash-cmd-desc {
    color: #666;
}

[data-theme="light"] .slash-cmd-hint {
    color: #999;
}

[data-theme="light"] .slash-cmd-error {
    background: rgba(220,53,69,0.08);
}
