.mma-app {
  --mma-primary: #2457a6;
  --mma-primary-dark: #183d78;
  --mma-soft: #eef4ff;
  --mma-border: #d9e2ef;
  --mma-text: #1f2937;
  --mma-muted: #64748b;
  max-width: 980px;
  margin: 24px auto;
  color: var(--mma-text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.mma-app * {
  box-sizing: border-box;
}

.mma-hero,
.mma-case,
.mma-chat,
.mma-form,
.mma-notice,
.mma-error {
  border-radius: 16px;
}

.mma-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #153d78, #2f6bc5);
}

.mma-hero h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 28px;
}

.mma-hero p {
  margin: 0;
  line-height: 1.7;
  color: #eaf1ff;
}

.mma-notice,
.mma-error {
  margin-top: 14px;
  padding: 12px 14px;
  line-height: 1.65;
}

.mma-notice {
  border: 1px solid #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}

.mma-error {
  border: 1px solid #fecaca;
  color: #991b1b;
  background: #fef2f2;
}

.mma-case {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--mma-border);
  border-left: 5px solid var(--mma-primary);
  background: #fff;
}

.mma-case h3 {
  margin: 0 0 8px;
}

.mma-case p {
  margin: 0;
  line-height: 1.8;
}

.mma-progress {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.mma-progress span {
  padding: 9px 6px;
  border: 1px solid var(--mma-border);
  border-radius: 999px;
  color: var(--mma-muted);
  background: #fff;
  text-align: center;
  font-weight: 700;
}

.mma-progress span.done {
  border-color: #86b7a0;
  color: #166534;
  background: #ecfdf3;
}

.mma-progress span.active {
  border-color: var(--mma-primary);
  color: #fff;
  background: var(--mma-primary);
}

.mma-chat {
  min-height: 440px;
  max-height: 620px;
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--mma-border);
  background: #f8fafc;
}

.mma-message {
  max-width: 82%;
  margin-bottom: 16px;
}

.mma-message-label {
  margin-bottom: 5px;
  color: var(--mma-muted);
  font-size: 12px;
  font-weight: 700;
}

.mma-bubble {
  padding: 13px 15px;
  border-radius: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mma-bot {
  margin-right: auto;
}

.mma-bot .mma-bubble {
  border: 1px solid var(--mma-border);
  border-top-left-radius: 4px;
  background: #fff;
}

.mma-user {
  margin-left: auto;
}

.mma-user .mma-message-label {
  text-align: right;
}

.mma-user .mma-bubble {
  border-top-right-radius: 4px;
  color: #fff;
  background: var(--mma-primary);
}

.mma-message-meta {
  margin-top: 5px;
  color: var(--mma-muted);
  font-size: 12px;
}

.mma-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0;
}

.mma-form {
  padding: 14px;
  border: 1px solid var(--mma-border);
  background: #fff;
}

.mma-form textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 1px solid #b8c5d6;
  border-radius: 10px;
  resize: vertical;
  line-height: 1.65;
}

.mma-form textarea:focus {
  outline: 3px solid rgba(36, 87, 166, 0.13);
  border-color: var(--mma-primary);
}

.mma-form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.mma-form-bottom span {
  color: var(--mma-muted);
  font-size: 12px;
}

.mma-primary,
.mma-secondary,
.mma-outline {
  border-radius: 10px;
  padding: 9px 15px;
  cursor: pointer;
  font-weight: 700;
}

.mma-primary {
  border: 1px solid var(--mma-primary);
  color: #fff;
  background: var(--mma-primary);
}

.mma-primary:hover {
  background: var(--mma-primary-dark);
}

.mma-secondary {
  border: 1px solid rgba(255,255,255,.62);
  color: #fff;
  background: rgba(255,255,255,.12);
}

.mma-outline {
  border: 1px solid #9db5d8;
  color: var(--mma-primary-dark);
  background: #fff;
}

.mma-outline:hover {
  background: var(--mma-soft);
}

.mma-primary:disabled,
.mma-secondary:disabled,
.mma-outline:disabled,
.mma-form textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.mma-footnote {
  margin: 10px 2px 0;
  color: var(--mma-muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .mma-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .mma-hero h2 {
    font-size: 24px;
  }

  .mma-progress {
    grid-template-columns: repeat(3, 1fr);
  }

  .mma-message {
    max-width: 94%;
  }

  .mma-chat {
    min-height: 400px;
  }
}

.mma-thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 104px;
  color: var(--mma-muted);
}

.mma-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mma-thinking-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b86ad;
  animation: mma-thinking-bounce 1.15s infinite ease-in-out;
}

.mma-thinking-dots i:nth-child(2) {
  animation-delay: .16s;
}

.mma-thinking-dots i:nth-child(3) {
  animation-delay: .32s;
}

@keyframes mma-thinking-bounce {
  0%, 70%, 100% {
    transform: translateY(0);
    opacity: .35;
  }
  35% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
