* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 7.387rem;
  background: linear-gradient(180deg, #fde8ef 0%, #f5f0f2 40%, #f8f8f8 100%);
  pointer-events: none;
  z-index: 0;
}

.bg-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/bg-gradient.png") no-repeat top center;
  background-size: 100% auto;
  opacity: 0.85;
}

.header {
  position: relative;
  z-index: 5;
  padding: 0 0.533rem;
  padding-top: env(safe-area-inset-top, 0);
  min-height: 4rem;
}

.header-content {
  position: relative;
  padding-top: 0.107rem;
  padding-right: 3.2rem;
}

.hello {
  font-size: 0.8rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
  background: linear-gradient(90deg, #3B82F6 0%, #6366F1 40%, #A855F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.16rem;
}

.title {
  font-size: 0.587rem;
  font-weight: 700;
  color: #111;
  line-height: 1.4;
  letter-spacing: 0.005rem;
}

.subtitle {
  margin-top: 0.267rem;
  font-size: 0.347rem;
  color: #aaa;
  line-height: 1.4;
  letter-spacing: 0.013rem;
}

.robot {
  position: absolute;
  right: 0.107rem;
  top: -0.48rem;
  width: 2.88rem;
  height: 4rem;
  object-fit: contain;
  pointer-events: none;
}

.suggest-card {
  position: relative;
  z-index: 5;
  margin: 0.533rem 0.427rem 0;
  background: #fff;
  border-radius: 0.533rem;
  box-shadow: 0 0.053rem 0.533rem rgba(0, 0, 0, 0.05);
  padding: 0.48rem 0.427rem 0.16rem;
}

.suggest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.32rem;
  padding: 0 0.107rem;
}

.suggest-header .label {
  font-size: 0.4rem;
  font-weight: 600;
  color: #1a1a1a;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 0.107rem;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.refresh-btn img {
  width: 0.32rem;
  height: 0.32rem;
}

.refresh-btn img.spin {
  animation: spin 0.6s linear;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.refresh-btn span {
  font-size: 0.347rem;
  color: #999;
}

.suggest-list {
  list-style: none;
}

.suggest-item {
  display: flex;
  align-items: center;
  padding: 0.373rem 0.107rem;
  cursor: pointer;
}

.suggest-item + .suggest-item {
  border-top: 0.013rem solid #f0f0f0;
}

.suggest-item .icon {
  width: 0.533rem;
  height: 0.533rem;
  flex-shrink: 0;
  object-fit: contain;
}

.suggest-item .text {
  flex: 1;
  margin-left: 0.32rem;
  font-size: 0.4rem;
  color: #333;
  line-height: 1.4;
}

.suggest-item .arrow {
  width: 0.373rem;
  height: 0.373rem;
  flex-shrink: 0;
  opacity: 0.4;
}

.bottom-area {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  padding: 0 0.427rem;
  padding-bottom: calc(0.213rem + env(safe-area-inset-bottom, 0));
  background: linear-gradient(to top, #fff 60%, rgba(255, 255, 255, 0));
}

.model-chips {
  display: flex;
  gap: 0.213rem;
  overflow-x: auto;
  padding: 0.213rem 0 0.32rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.model-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: flex;
  align-items: center;
  gap: 0.133rem;
  flex-shrink: 0;
  height: 0.8rem;
  padding: 0 0.267rem 0 0.213rem;
  background: #fff;
  border: 0.013rem solid #e8e8e8;
  border-radius: 0.4rem;
  cursor: pointer;
  box-shadow: 0 0.027rem 0.107rem rgba(0, 0, 0, 0.04);
}

.chip.active {
  border-color: #6366F1;
  background: #f5f3ff;
}

.chip img {
  width: 0.48rem;
  height: 0.48rem;
  object-fit: contain;
  border-radius: 50%;
}

.chip span {
  font-size: 0.32rem;
  color: #333;
  white-space: nowrap;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0.267rem;
}

.input-box {
  flex: 1;
  display: flex;
  align-items: center;
  height: 1.173rem;
  background: #fff;
  border: 0.013rem solid #e8e8e8;
  border-radius: 0.587rem;
  padding: 0 0.32rem;
  gap: 0.16rem;
  box-shadow: 0 0.027rem 0.107rem rgba(0, 0, 0, 0.04);
}

.input-box .privacy-icon {
  width: 0.64rem;
  height: 0.64rem;
  flex-shrink: 0;
  object-fit: contain;
}

.input-box .placeholder {
  flex: 1;
  font-size: 0.347rem;
  color: #bbb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-box .plus-btn {
  width: 0.64rem;
  height: 0.64rem;
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-box .plus-btn img {
  width: 0.64rem;
  height: 0.64rem;
}

.send-btn {
  width: 1.173rem;
  height: 1.173rem;
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.send-btn img {
  width: 1.173rem;
  height: 1.173rem;
}

.bottom-spacer {
  height: 4.267rem;
}

.main-content {
  position: relative;
  z-index: 5;
  flex: 1;
  overflow: hidden;
}

.chat-area {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 0 0.427rem 0.427rem;
  -webkit-overflow-scrolling: touch;
}

.chat-area.visible {
  display: block;
}

.page.chatting .suggest-card,
.page.chatting .header {
  display: none;
}

.page.chatting .bottom-spacer {
  height: 3.733rem;
}

.msg {
  display: flex;
  margin-bottom: 0.427rem;
}

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

.msg.ai {
  justify-content: flex-start;
}

.msg-bubble {
  max-width: 78%;
  padding: 0.32rem 0.373rem;
  border-radius: 0.427rem;
  font-size: 0.4rem;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #fff;
  border-bottom-right-radius: 0.107rem;
}

.msg.ai .msg-bubble {
  background: #f5f5f7;
  color: #333;
  border-bottom-left-radius: 0.107rem;
}

.msg.ai.loading .msg-bubble {
  padding: 0.373rem 0.48rem;
}

.typing-dots {
  display: inline-flex;
  gap: 0.133rem;
  align-items: center;
}

.typing-dots span {
  width: 0.187rem;
  height: 0.187rem;
  border-radius: 50%;
  background: #999;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-0.133rem); opacity: 1; }
}

.input-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.373rem;
  color: #333;
  min-width: 0;
}

.input-box input::placeholder {
  color: #bbb;
}

.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
