* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(52, 211, 153, 0.12), transparent 26%),
        radial-gradient(circle at right, rgba(14, 165, 233, 0.14), transparent 20%),
        #eef3f6;
    color: #17272c;
}

.desktop-shell {
    min-height: 100vh;
    padding: 20px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) 420px;
    gap: 18px;
    max-width: 1480px;
    margin: 0 auto;
}

.chat-pane,
.sidebar-pane {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.chat-pane {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    background: linear-gradient(180deg, #f8fbfc 0%, #ffffff 100%);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px 18px;
    border-bottom: 1px solid rgba(23, 39, 44, 0.08);
    background: rgba(255, 255, 255, 0.86);
}

.app-chip,
.sidebar-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e8f7f1;
    color: #0f766e;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.chat-header h1,
.sidebar-title {
    margin: 10px 0 6px;
    font-size: 26px;
    line-height: 1.2;
}

.chat-header p,
.plain-text,
.muted-text {
    margin: 0;
    color: #60757c;
    line-height: 1.7;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #dff7ec;
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.neutral {
    background: #edf2f5;
    color: #58707a;
}

.status-badge.warn {
    background: #fff1d6;
    color: #9a6700;
}

.status-badge.live {
    background: #dbf6ff;
    color: #0369a1;
}

.chat-stream-shell {
    flex: 1;
    padding: 22px 22px 6px;
    background:
        linear-gradient(180deg, rgba(247, 252, 251, 0.86), rgba(255, 255, 255, 0.96)),
        #fff;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    padding-right: 8px;
}

.message {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 18px;
    line-height: 1.75;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.message.customer {
    align-self: flex-start;
    border-top-left-radius: 6px;
    background: #ffffff;
}

.message.teacher {
    align-self: flex-end;
    border-top-right-radius: 6px;
    background: linear-gradient(135deg, #dffaf0, #edfdf8);
}

.message-role {
    margin-bottom: 4px;
    font-size: 12px;
    color: #6c848b;
}

.composer-shell {
    padding: 18px 22px 22px;
    border-top: 1px solid rgba(23, 39, 44, 0.08);
    background: #fbfdfd;
}

.composer-title,
.section-title {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #17343c;
}

textarea,
input,
select,
button {
    font: inherit;
}

textarea,
input,
select {
    width: 100%;
    border: 1px solid #dbe6ea;
    border-radius: 14px;
    background: #fff;
    outline: none;
}

textarea {
    min-height: 110px;
    padding: 14px 16px;
    resize: vertical;
    line-height: 1.75;
}

input,
select {
    height: 42px;
    padding: 0 14px;
}

.sidebar-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(180deg, #f5fbfd, #f8fcfd);
}

.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px 2px;
}

.badge-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.sidebar-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(23, 39, 44, 0.06);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.integration-card {
    background: linear-gradient(180deg, rgba(239, 249, 249, 0.96), rgba(255, 255, 255, 0.94));
}

.input-stack {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.action-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.action-row.compact button {
    flex: 1;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
}

.secondary-btn {
    background: #e8f2f4;
    color: #1d4f5c;
}

.ghost-btn {
    background: #fff;
    color: #627981;
    border: 1px solid #dbe6ea;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-list {
    display: grid;
    gap: 10px;
}

.info-item {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 10px;
    align-items: start;
}

.info-label,
.field-label,
.mini-title {
    font-size: 13px;
    font-weight: 700;
    color: #4f676f;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag-list li {
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef9f4;
    color: #0f766e;
    font-size: 12px;
}

.memory-card,
.plain-box,
.event-list {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f7fbfc;
    line-height: 1.75;
}

.product-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-desc,
.meta-line {
    margin-bottom: 8px;
    color: #506870;
    line-height: 1.7;
}

.point-list,
.risk-list {
    margin: 8px 0 0;
    padding-left: 18px;
    line-height: 1.7;
}

.event-list {
    margin-top: 8px;
    max-height: 168px;
    overflow-y: auto;
}

.event-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(23, 39, 44, 0.06);
}

.event-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.event-title {
    font-size: 13px;
    font-weight: 700;
    color: #184b59;
}

.event-meta {
    font-size: 12px;
    color: #6d8288;
}

.draft-card textarea {
    min-height: 120px;
}

.status-text {
    margin-top: 12px;
    min-height: 22px;
    font-size: 13px;
    color: #61787f;
}

.empty-state,
.placeholder {
    color: #8aa0a5;
}

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

    .chat-pane {
        min-height: auto;
    }

    .history-list {
        max-height: 420px;
    }
}

@media (max-width: 720px) {
    .desktop-shell {
        padding: 12px;
    }

    .chat-header,
    .sidebar-pane {
        padding-left: 14px;
        padding-right: 14px;
    }

    .message {
        max-width: 92%;
    }
}
