.skills-workspace-active .chat-header {
    border-bottom-color: #e5e7eb;
}

.skills-workspace-view {
    background: #f7f8fa;
    padding: 18px;
}

.skills-workspace-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
}

.skills-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.skills-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.skills-search {
    flex: 1;
    max-width: 520px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    color: #6b7280;
}

.skills-search input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 13px;
    color: #111827;
    background: transparent;
}

.skills-search-btn {
    height: 30px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.skills-search-btn:hover {
    background: #f3f4f6;
}

.skills-primary-btn {
    height: 40px;
    border: 1px solid #dbe2f4;
    border-radius: 12px;
    background: #4f46e5;
    color: #fff;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.14);
}

.skills-primary-btn:hover {
    background: #4338ca;
}

.skills-secondary-btn {
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.skills-secondary-btn:hover {
    background: #f3f4f6;
}

.skills-chat-btn {
    min-width: 122px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eef4ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.skills-chat-btn:hover {
    background: #e0edff;
}

.skills-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skills-chip {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #6b7280;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
}

.skills-chip:hover,
.skills-chip.active {
    color: #3b82f6;
    background: #eef4ff;
    border-color: #dbeafe;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.skills-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 0;
}

.skills-pagination-meta,
.skills-pagination-end {
    font-size: 12px;
    color: #6b7280;
}

.skills-load-more-btn {
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.skills-load-more-btn:hover {
    background: #f3f4f6;
}

.skills-load-more-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.skills-card,
.skills-empty-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    min-height: 138px;
    padding: 16px;
}

.skills-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.skills-card:hover {
    border-color: #d7dbe5;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
    transform: translateY(-1px);
}

.skills-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skills-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}

.skills-card-head {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skills-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.skills-card-time {
    font-size: 12px;
    color: #9ca3af;
}

.skills-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f1f3;
}

.skills-card-author {
    font-size: 12px;
    color: #6b7280;
}

.skills-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.skills-icon-btn,
.skills-ghost-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    border-radius: 10px;
    height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
}

.skills-icon-btn:hover,
.skills-ghost-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.skills-icon-btn.is-primary {
    background: #eef4ff;
    border-color: #dbeafe;
    color: #3b82f6;
}

.skills-icon-btn.is-disabled,
.skills-ghost-btn.is-disabled,
.qb-btn.is-disabled,
.qb-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.skills-ghost-btn.active {
    background: #eef4ff;
    border-color: #dbeafe;
    color: #3b82f6;
}

.skills-danger-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.skills-loading-state,
.skills-empty-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #6b7280;
}

.skills-ai-note {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f6f6f6;
    padding: 14px 16px;
}

.skills-ai-note-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}

.skills-ai-note-text {
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

.skills-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.skills-empty-text {
    font-size: 13px;
    color: #6b7280;
}

.skills-dispatch-modal {
    width: min(760px, 94vw);
    height: min(620px, 84vh);
    border-radius: 20px;
}

.skills-dispatch-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px 18px;
    min-height: 0;
}

.skills-dispatch-subtitle {
    font-size: 12px;
    line-height: 1.6;
    color: #6b7280;
}

.skills-dispatch-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eceff3;
    border-radius: 18px;
    background: #fbfbfc;
}

.skills-dispatch-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skills-dispatch-role {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
}

.skills-dispatch-bubble {
    max-width: min(100%, 640px);
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #eceff3;
    background: #ffffff;
    color: #111827;
}

.skills-dispatch-message.user {
    align-items: flex-end;
}

.skills-dispatch-message.user .skills-dispatch-role {
    color: #4f46e5;
}

.skills-dispatch-message.user .skills-dispatch-bubble {
    background: #eef4ff;
    border-color: #dbeafe;
}

.skills-dispatch-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: #6b7280;
    font-size: 13px;
}

.skills-modal.hidden {
    display: none;
}

.skills-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skills-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.28);
    backdrop-filter: blur(4px);
}

.skills-modal-card {
    position: relative;
    z-index: 1;
    width: min(980px, 92vw);
    max-height: 86vh;
    border-radius: 22px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skills-modal-compact {
    width: min(420px, 92vw);
}

.skills-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eef0f3;
    background: #fff;
}

.skills-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.skills-modal-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.skills-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
}

.skills-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.skills-modal-body {
    padding: 18px 20px;
    overflow: auto;
}

.skills-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eef0f3;
    background: #fafafa;
}

.skills-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.skills-field input,
.skills-field select,
.skills-field textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    font-size: 13px;
    color: #111827;
    outline: none;
}

.skills-field textarea {
    resize: vertical;
    min-height: 160px;
    line-height: 1.65;
}

.skills-detail-card {
    width: min(860px, 88vw);
    height: min(640px, 82vh);
}

.skills-detail-layout {
    min-height: 0;
    flex: 1;
}

.skills-detail-preview {
    min-height: 0;
    height: 100%;
    background: #f7f8fa;
    padding: 20px 20px 0;
}

.skills-rich-content {
    height: 100%;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    padding: 18px;
    font-size: 14px;
    line-height: 1.75;
    color: #111827;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.skills-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 1px solid #eef0f3;
    background: #fff;
}

.skills-reaction-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.skills-rich-content img {
    max-width: 100%;
    border-radius: 12px;
}

.skills-rich-content pre {
    background: #111827;
    color: #f3f4f6;
    padding: 14px;
    border-radius: 12px;
    overflow: auto;
}

.skills-rich-content code {
    font-family: "SFMono-Regular", Consolas, monospace;
}

.skills-editor-card {
    width: min(920px, 90vw);
    height: min(700px, 84vh);
}

.skills-editor-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 0;
    padding: 0;
}

.skills-editor-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid #eef0f3;
    background: #f7f8fa;
}

.skills-editor-toolbar {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid #eef0f3;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.skills-editor {
    flex: 1;
    margin: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.7;
    color: #111827;
    outline: none;
}

.skills-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

.skills-side-form {
    min-height: 0;
    overflow: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skills-tag {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 8px 10px;
    font-size: 12px;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.skills-tag:hover,
.skills-tag.active {
    background: #eef4ff;
    color: #3b82f6;
    border-color: #dbeafe;
}

.skills-inline-empty,
.skills-field-hint {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.6;
}

.skills-markdown-input {
    resize: none;
    white-space: pre;
    font-family: "SFMono-Regular", Consolas, monospace;
    line-height: 1.7;
}

.hidden {
    display: none !important;
}

@media (max-width: 1180px) {
    .skills-editor-body {
        grid-template-columns: 1fr;
    }

    .skills-editor-pane {
        border-right: none;
        border-bottom: 1px solid #eef0f3;
    }
}

@media (max-width: 768px) {
    .skills-workspace-view {
        padding: 14px;
    }

    .skills-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .skills-search {
        max-width: none;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}
