:root {
  --tab-bar-height: 0px;
  --mp-tabbar-height: calc(1.333rem + env(safe-area-inset-bottom, 0px));
  --mp-bottom-area-height: 4.2rem;
  --bg: #05070F;
  --card: rgba(28, 32, 48, 0.92);
  --card-line: rgba(255, 255, 255, 0.06);
  --text: #F4F6FF;
  --muted: #8B93A7;
  --accent: #7B7CFF;
  --accent-2: #5B8CFF;
}

* {
  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: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 15% -10%, rgba(120, 150, 255, 0.28) 0%, transparent 55%),
    radial-gradient(90% 60% at 85% 8%, rgba(110, 70, 220, 0.22) 0%, transparent 50%),
    linear-gradient(180deg, #0B1020 0%, #05070F 42%, #05070F 100%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: absolute;
  right: -1.2rem;
  top: -0.4rem;
  width: 7.2rem;
  height: 8.4rem;
  background: url("../assets/bg-hero.png") no-repeat right top;
  background-size: cover;
  opacity: 0.95;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 100%);
}

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

.header-content {
  position: relative;
  padding-top: 0.32rem;
  padding-right: 3.6rem;
  z-index: 2;
}

.hello {
  font-size: 0.88rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
  background: linear-gradient(90deg, #9EC5FF 0%, #7B9CFF 45%, #B089FF 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: #FFFFFF;
  line-height: 1.4;
}

.subtitle {
  margin-top: 0.267rem;
  font-size: 0.347rem;
  color: var(--muted);
  line-height: 1.4;
}

.robot-wrap {
  display: none;
}

.robot {
  display: none;
}

.suggest-card {
  position: relative;
  z-index: 5;
  margin: 0.427rem 0.427rem 0;
  background: var(--card);
  border: 0.013rem solid var(--card-line);
  border-radius: 0.533rem;
  box-shadow: 0 0.213rem 0.8rem rgba(0, 0, 0, 0.35);
  padding: 0.48rem 0.427rem 0.16rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

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

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

.refresh-btn img {
  width: 0.373rem;
  height: 0.373rem;
  opacity: 0.85;
}

.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: #9AA3B8;
}

.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 rgba(255, 255, 255, 0.06);
}

.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: #D7DCEC;
  line-height: 1.4;
}

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

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

html.mp-tabbar-visible,
html.mp-tabbar-visible body {
  height: 100%;
  overflow: hidden;
}

html.mp-tabbar-visible .page {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: calc(var(--mp-bottom-area-height) + var(--mp-tabbar-height));
  box-sizing: border-box;
}

html.mp-tabbar-visible .header {
  min-height: 3.4rem;
  padding-top: 0;
}

html.mp-tabbar-visible .bg-glow {
  width: 6.2rem;
  height: 7.2rem;
  top: -0.8rem;
  right: -1rem;
}

html.mp-tabbar-visible .suggest-card {
  margin-top: 0.27rem;
}

html.mp-tabbar-visible .main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.mp-tabbar-visible .bottom-spacer {
  display: none;
}

html.mp-tabbar-visible .bottom-area {
  position: fixed !important;
  bottom: var(--mp-tabbar-height) !important;
  left: 0 !important;
  right: 0;
  width: 100%;
  flex-shrink: 0;
  z-index: 20;
  padding: 0.16rem 0.427rem 0.16rem;
  background: #05070F;
  border-top: 0.013rem solid rgba(255, 255, 255, 0.05);
}

html.mp-tabbar-visible .model-chips {
  padding: 0.16rem 0 0.24rem;
}

.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.853rem;
  padding: 0 0.32rem 0 0.213rem;
  background: rgba(255, 255, 255, 0.04);
  border: 0.013rem solid rgba(255, 255, 255, 0.08);
  border-radius: 0.427rem;
  cursor: pointer;
}

.chip.active {
  border-color: var(--accent);
  background: rgba(123, 124, 255, 0.14);
  box-shadow: 0 0 0.32rem rgba(123, 124, 255, 0.25);
}

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

.chip span {
  font-size: 0.32rem;
  color: #E6E9F5;
  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: rgba(255, 255, 255, 0.05);
  border: 0.013rem solid rgba(255, 255, 255, 0.08);
  border-radius: 0.587rem;
  padding: 0 0.32rem;
  gap: 0.16rem;
}

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

.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: calc(4.267rem + var(--tab-bar-height));
}

.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,
.page.chatting .bg-glow {
  display: none;
}

.page.chatting .bottom-spacer {
  height: calc(3.733rem + var(--tab-bar-height));
}

.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, #5B8CFF 0%, #7B7CFF 100%);
  color: #fff;
  border-bottom-right-radius: 0.107rem;
}

.msg.ai .msg-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: #E8ECF8;
  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: #9AA3B8;
  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: #F2F4FF;
  min-width: 0;
}

.input-box input::placeholder {
  color: #6F778C;
}

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

.mp-tabbar {
  display: none;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  background: #0B0D16;
  align-items: stretch;
}

html.mp-tabbar-visible .mp-tabbar {
  display: flex !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0;
  z-index: 30;
  min-height: var(--mp-tabbar-height);
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-top: 0.013rem solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -0.08rem 0.4rem rgba(0, 0, 0, 0.35);
}

.mp-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 1.333rem;
  min-width: 0;
  padding: 0;
  cursor: pointer;
}

.mp-tabbar-item.active {
  cursor: default;
}

.mp-tabbar-icon-wrap {
  width: 0.6rem;
  height: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-tabbar-icon {
  display: block;
  width: 0.587rem !important;
  height: 0.587rem !important;
  max-width: 0.587rem !important;
  max-height: 0.587rem !important;
  object-fit: contain;
  flex-shrink: 0;
}

.mp-tabbar-label {
  margin-top: 0.16rem;
  font-size: 0.32rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #A7AFBF;
}
