* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #0a57c9 0%, #0847a6 100%);
  color: #ffffff;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
  gap: 24px;
}

.title {
  margin: 0;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}

.chat-card {
  width: min(92vw, 960px);
  padding: 24px;
  border-radius: 20px;
  background: rgba(0, 22, 58, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.chat-card-header h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 32px);
}

.chat-card-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.chat-messages {
  margin-top: 20px;
  height: 320px;
  overflow-y: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(4, 21, 54, 0.78);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: min(100%, 720px);
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.message.user {
  align-self: flex-end;
  background: #ffffff;
  color: #0a2b63;
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.12);
}

.message-role {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.chat-form {
  margin-top: 16px;
}

.chat-input {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  font: inherit;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.52);
}

.chat-input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.chat-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-status {
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
}

.chat-submit {
  border: 0;
  border-radius: 999px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 700;
  color: #0a2b63;
  background: #ffffff;
  cursor: pointer;
}

.chat-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-link {
  display: block;
  width: min(92vw, 960px);
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  background: #ffffff;
}

.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;
}

@media (max-width: 640px) {
  .page {
    justify-content: flex-start;
  }

  .chat-card {
    padding: 18px;
  }

  .chat-messages {
    height: 280px;
    padding: 12px;
  }

  .chat-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-submit {
    width: 100%;
  }
}
