:root {
  color-scheme: light;
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: #f5f7fa;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(224, 242, 254, 0.65), transparent 28%),
    #f5f7fa;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  max-width: 1120px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 20px;
}

.chat-panel,
.learning-panel {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100vh - 64px);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #e5edf7;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 750;
}

.chat-header p {
  margin-top: 4px;
  color: #64748b;
  font-size: 14px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
  flex: 0 0 auto;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  overflow-y: auto;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: min(680px, 86%);
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent .bubble {
  background: #eef6ff;
  border: 1px solid #cfe4ff;
}

.user .bubble {
  background: #1f6feb;
  color: #ffffff;
}

.meta {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #475569;
  font-size: 13px;
}

.tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d7e3f2;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid #e5edf7;
  background: #fbfdff;
}

input,
button {
  min-height: 44px;
  border-radius: 8px;
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid #cbd5e1;
  padding: 0 13px;
  outline: none;
}

input:focus {
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.14);
}

button {
  border: 0;
  background: #1f6feb;
  color: #ffffff;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 650;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.learning-panel {
  align-self: start;
  padding: 20px;
}

.learning-panel h2 {
  font-size: 18px;
}

.learning-panel ol {
  margin: 14px 0 0;
  padding-left: 22px;
  line-height: 1.75;
  color: #475569;
}

code {
  background: #eef2f7;
  padding: 2px 5px;
  border-radius: 4px;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .chat-panel {
    min-height: 72vh;
  }
}
