:root {
  color-scheme: light;
  --ink: #102033;
  --muted: #6d7b8c;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(37, 65, 91, 0.14);
  --blue: #2f73ff;
  --cyan: #28d7d2;
  --green: #7ee787;
  --bg-a: #f8fbff;
  --bg-b: #e9f3ff;
  --shadow: 0 30px 80px rgba(18, 52, 87, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(40, 215, 210, 0.18), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(47, 115, 255, 0.16), transparent 30%),
    linear-gradient(135deg, var(--bg-a), var(--bg-b) 48%, #f7fff9);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 18px;
}

.stage,
.chat-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.stage {
  padding: 34px;
}

.brandbar,
.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 54px;
  line-height: 1;
}

.chat-header h2 {
  font-size: 26px;
}

.status-pill,
.ghost-button {
  border: 1px solid rgba(47, 115, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #1c5bd8;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
}

.ghost-button {
  cursor: pointer;
}

.teacher-zone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 330px;
  align-items: center;
  gap: 32px;
  min-height: 570px;
}

.halo {
  position: absolute;
  left: 10%;
  top: 17%;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.15)),
    conic-gradient(from 210deg, rgba(47,115,255,0.16), rgba(40,215,210,0.28), rgba(126,231,135,0.18), rgba(47,115,255,0.16));
  filter: blur(0.2px);
}

.robot {
  position: relative;
  width: 340px;
  height: 420px;
  margin: 80px auto 0;
  transform-origin: center bottom;
  animation: float 4s ease-in-out infinite;
}

.antenna {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 4px;
  height: 58px;
  transform: translateX(-50%);
  background: linear-gradient(#aeb9c7, #ffffff);
  border-radius: 999px;
}

.antenna span {
  position: absolute;
  left: 50%;
  top: -13px;
  width: 25px;
  height: 25px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 26px rgba(40, 215, 210, 0.9);
}

.head {
  position: absolute;
  left: 50%;
  top: 52px;
  width: 248px;
  height: 176px;
  transform: translateX(-50%);
  border-radius: 58px;
  background: linear-gradient(145deg, #ffffff, #dfe8f3);
  border: 1px solid rgba(255,255,255,0.88);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.95),
    inset 0 -20px 45px rgba(93,116,140,0.15),
    0 28px 60px rgba(14, 46, 76, 0.22);
}

.visor {
  position: absolute;
  left: 30px;
  top: 48px;
  width: 188px;
  height: 70px;
  border-radius: 28px;
  background: linear-gradient(180deg, #142439, #071320);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.eye {
  position: absolute;
  top: 27px;
  width: 32px;
  height: 12px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 22px rgba(40, 215, 210, 0.9);
}

.eye-left {
  left: 42px;
}

.eye-right {
  right: 42px;
}

.cheek {
  position: absolute;
  bottom: 30px;
  width: 22px;
  height: 9px;
  border-radius: 999px;
  background: rgba(47, 115, 255, 0.22);
}

.cheek.left {
  left: 54px;
}

.cheek.right {
  right: 54px;
}

.neck {
  position: absolute;
  left: 50%;
  top: 218px;
  width: 72px;
  height: 38px;
  transform: translateX(-50%);
  border-radius: 16px;
  background: linear-gradient(180deg, #cdd8e5, #f8fbff);
}

.body {
  position: absolute;
  left: 50%;
  top: 246px;
  width: 210px;
  height: 150px;
  transform: translateX(-50%);
  border-radius: 46px;
  background: linear-gradient(145deg, #ffffff, #dce7f3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.95),
    0 25px 50px rgba(14, 46, 76, 0.18);
}

.core {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 78px;
  height: 78px;
  transform: translateX(-50%);
  border-radius: 28px;
  background: linear-gradient(180deg, #102033, #1d3654);
  display: grid;
  place-items: center;
}

.core span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 18%, var(--cyan) 20% 55%, transparent 57%);
  box-shadow: 0 0 25px rgba(40, 215, 210, 0.8);
}

.badge {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(47, 115, 255, 0.1);
  color: #1c5bd8;
  font-weight: 900;
  font-size: 13px;
}

.arm {
  position: absolute;
  top: 275px;
  width: 46px;
  height: 108px;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffffff, #dce7f3);
  box-shadow: 0 18px 32px rgba(14, 46, 76, 0.15);
}

.arm-left {
  left: 28px;
  transform: rotate(16deg);
}

.arm-right {
  right: 28px;
  transform: rotate(-16deg);
}

.robot[data-state="listening"] .antenna span,
.robot[data-state="thinking"] .core span,
.robot[data-state="speaking"] .eye {
  animation: pulse 1s ease-in-out infinite;
}

.robot[data-state="thinking"] {
  animation: think 1.4s ease-in-out infinite;
}

.robot[data-state="speaking"] .eye {
  height: 20px;
  top: 23px;
}

.teacher-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.7);
}

.teacher-name {
  margin: 0 0 8px;
  color: #1c5bd8;
  font-weight: 900;
}

.teacher-card h2 {
  margin-bottom: 14px;
  font-size: 28px;
  line-height: 1.12;
}

.teacher-card p {
  color: var(--muted);
  line-height: 1.65;
}

.state-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px rgba(126, 231, 135, 0.9);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
  min-height: 680px;
}

.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0 14px;
}

.suggestions button {
  min-height: 48px;
  border: 1px solid rgba(47, 115, 255, 0.16);
  border-radius: 16px;
  background: #ffffff;
  color: #284561;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
}

.messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 2px 18px;
}

.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
}

.message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.message.user .avatar {
  grid-column: 2;
  background: #102033;
  color: #ffffff;
}

.message.user div {
  grid-column: 1;
  grid-row: 1;
  background: #102033;
  color: #ffffff;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.message div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 12px 14px;
}

.message p {
  margin: 0;
  line-height: 1.62;
  font-size: 14.5px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(47, 115, 255, 0.18);
  border-radius: 18px;
  outline: none;
  padding: 13px 14px;
  color: var(--ink);
  background: #ffffff;
  line-height: 1.45;
}

textarea:focus {
  border-color: rgba(47, 115, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 115, 255, 0.1);
}

.composer button {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.composer button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes think {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1.2deg); }
}

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

  .teacher-zone {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .robot {
    margin-top: 40px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    margin: 10px auto;
  }

  .stage,
  .chat-panel {
    border-radius: 22px;
  }

  .stage {
    padding: 24px;
  }

  h1 {
    font-size: 42px;
  }

  .robot {
    width: 300px;
    transform: scale(0.9);
  }

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