:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17191f;
  --muted: #606674;
  --line: #e4e7ed;
  --red: #d7192f;
  --red-dark: #ad1022;
  --red-soft: #fff0f2;
  --ink: #242833;
  --shadow: 0 18px 55px rgba(23, 25, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  gap: 28px;
  align-items: center;
  padding: 36px 0;
}

.intro {
  padding: 8px 0;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(215, 25, 47, 0.24);
}

.mode-badge,
.live-dot {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 9px 12px;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 78px;
  line-height: 1.02;
  font-weight: 900;
}

.subtitle {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.metrics span,
.quick-prompts button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 14px;
  padding: 10px 13px;
}

.module-roadmap {
  margin-top: 36px;
}

.module-heading {
  margin-bottom: 14px;
}

.module-heading h2 {
  font-size: 20px;
}

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

.module-card {
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 15px;
}

.module-card.active {
  border-color: #f0a5ae;
  background: var(--red-soft);
}

.module-status {
  display: inline-flex;
  margin-bottom: 12px;
  border: 1px solid #d8dce4;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
}

.module-card.active .module-status {
  border-color: #f0a5ae;
  color: var(--red-dark);
  background: #fff;
}

.module-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.module-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.chat-panel {
  min-height: 720px;
  max-height: calc(100vh - 72px);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.live-dot {
  color: var(--red-dark);
  background: var(--red-soft);
  border-color: #ffd2d8;
}

.quick-prompts {
  display: flex;
  gap: 10px;
  padding: 16px 24px 6px;
  overflow-x: auto;
}

.quick-prompts button {
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}

.quick-prompts button:hover {
  border-color: #f0a5ae;
  background: var(--red-soft);
  color: var(--red-dark);
}

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

.message {
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 15px;
}

.message.assistant {
  align-self: flex-start;
  background: #fff;
}

.message.user {
  align-self: flex-end;
  border-color: #f3bcc4;
  background: var(--red-soft);
}

.message.loading {
  color: var(--muted);
}

.message strong {
  color: var(--ink);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}

textarea {
  width: 100%;
  min-height: 74px;
  max-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text);
  outline: none;
  line-height: 1.55;
}

textarea:focus {
  border-color: #ee7482;
  box-shadow: 0 0 0 4px rgba(215, 25, 47, 0.1);
}

.composer button {
  align-self: stretch;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 22px;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.composer button:hover {
  background: var(--red-dark);
}

.composer button:active {
  transform: translateY(1px);
}

.composer button:disabled {
  cursor: wait;
  opacity: 0.72;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 24px 0;
  }

  .chat-panel {
    min-height: 680px;
    max-height: none;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  h1 {
    font-size: 46px;
  }

  .subtitle {
    font-size: 16px;
  }

  .chat-header,
  .quick-prompts,
  .messages,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .composer button {
    min-height: 48px;
  }

  .message {
    max-width: 96%;
  }

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