.chat-container.channel-workspace-active .chat-messages {
    padding: 18px 20px;
}

.chat-messages.channel-workspace-view {
    overflow-y: auto;
}

.chat-input.channel-config-mode {
    padding-top: 10px;
}

.chat-input.channel-config-mode .input-wrapper {
    border-radius: 24px;
}

.channel-workspace-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.channel-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.channel-card {
    border: 1px solid #eceff3;
    border-radius: 18px;
    background: #ffffff;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.channel-card:hover {
    background: #fbfcff;
    border-color: #dbe4ff;
    transform: translateY(-1px);
}

.channel-card.active {
    background: #f7faff;
    border-color: rgba(79, 70, 229, 0.18);
}

.channel-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.channel-card-badge,
.channel-config-badge {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--qb-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.channel-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-card-title-row h3 {
    margin: 0;
    font-size: 15px;
    color: var(--qb-text);
}

.channel-card-meta p {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.65;
    color: var(--qb-text-soft);
}

.channel-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--qb-text-soft);
    font-size: 11px;
    font-weight: 600;
}

.channel-chip.enabled {
    background: #eefbf3;
    color: #15803d;
}

.channel-card-bottom {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.channel-card-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-card-stat {
    color: var(--qb-text-faint);
}

.channel-card-binding {
    color: var(--qb-text-soft);
    font-size: 11px;
}

.channel-card-link {
    color: var(--qb-accent);
    font-weight: 600;
    white-space: nowrap;
}

.channel-ai-note {
    border: 1px solid #eceff3;
    border-radius: 16px;
    background: #ffffff;
    padding: 14px 16px;
}

.channel-ai-note-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--qb-text-soft);
}

.channel-ai-note-text {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--qb-text);
    white-space: pre-wrap;
}

.channel-config-modal {
    width: min(760px, 92vw);
}

.channel-config-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.channel-config-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #eceff3;
    border-radius: 16px;
    background: #fafbfc;
}

.channel-config-platform {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-config-platform strong {
    display: block;
    font-size: 15px;
    color: var(--qb-text);
}

.channel-config-platform p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--qb-text-soft);
}

.channel-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--qb-text);
    white-space: nowrap;
}

.channel-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.channel-config-grid-single {
    grid-template-columns: 1fr;
}

.channel-config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-config-field span {
    font-size: 12px;
    font-weight: 600;
    color: var(--qb-text-soft);
}

.channel-config-field input,
.channel-config-field select {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: var(--qb-text);
    outline: none;
}

.channel-config-field input:focus,
.channel-config-field select:focus {
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.06);
}

.channel-kf-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid #eceff3;
    border-radius: 16px;
    background: #fafcff;
}

.channel-kf-note {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-kf-note-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--qb-text);
}

.channel-kf-note-text {
    font-size: 12px;
    line-height: 1.65;
    color: var(--qb-text-soft);
}

.channel-kf-url-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-kf-url-row input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: var(--qb-text);
}

.channel-kf-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.channel-kf-qr-card {
    border: 1px solid #e8edf5;
    border-radius: 16px;
    background: #ffffff;
    padding: 16px;
}

.channel-kf-qr-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.channel-kf-qr-header strong {
    font-size: 14px;
    color: var(--qb-text);
}

.channel-kf-qr-meta {
    font-size: 12px;
    line-height: 1.6;
    color: var(--qb-text-soft);
}

.channel-kf-qr-body {
    display: flex;
    align-items: center;
    gap: 18px;
}

.channel-kf-qr-box {
    width: 196px;
    min-width: 196px;
    height: 196px;
    border: 1px dashed #d7deea;
    border-radius: 16px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.channel-kf-qr-box.is-empty {
    padding: 18px;
}

.channel-kf-qr-box span {
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    color: var(--qb-text-faint);
}

.channel-kf-qr-side {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-kf-qr-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-kf-qr-line span {
    font-size: 11px;
    color: var(--qb-text-faint);
}

.channel-kf-qr-line strong,
.channel-kf-qr-line a {
    font-size: 13px;
    line-height: 1.5;
    color: var(--qb-text);
    word-break: break-all;
}

.channel-kf-qr-line a {
    color: var(--qb-accent);
    text-decoration: none;
 }

@media (max-width: 768px) {
    .channel-card-grid,
    .channel-config-grid {
        grid-template-columns: 1fr;
    }

    .channel-config-intro {
        flex-direction: column;
        align-items: flex-start;
    }

    .channel-kf-url-row,
    .channel-kf-qr-body {
        flex-direction: column;
        align-items: stretch;
    }

    .channel-kf-qr-box {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 196px;
    }
}
