:root {
  --p: #5b5bff;
  --p2: #7b63ff;
  --p3: #ecebff;
  --ok: #18c970;
  --green: #24aa7a;
  --orange: #ff8a3d;
  --red: #ff3b6b;
  --bg: #f4f2fb;
  --card: #ffffff;
  --line: #e8e8f5;
  --t1: #15152e;
  --t2: #4b4b70;
  --t3: #9292b3;
  --shadow: 0 8px 28px rgba(91, 76, 220, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--t1);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
}

.view {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.view.no-tab {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  color: var(--p);
  font-size: 13px;
  font-weight: 800;
}

.h1 {
  margin-top: 4px;
  color: var(--t1);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.18;
}

.sub {
  margin-top: 7px;
  color: var(--t3);
  font-size: 14px;
  line-height: 1.5;
}

.card,
.soft,
.warm,
.hero-card {
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card {
  padding: 16px;
}

.soft {
  padding: 16px;
  background: #eeecff;
}

.warm {
  padding: 16px;
  background: #fff4e0;
}

.hero-card {
  overflow: hidden;
  background: linear-gradient(135deg, #615dff 0%, #7a66f2 54%, #33b989 100%);
  color: #fff;
}

.hero-inner {
  display: flex;
  align-items: flex-end;
  min-height: 190px;
  padding: 20px 18px 0;
}

.hero-copy {
  flex: 1;
  padding-bottom: 20px;
}

.hero-title {
  font-size: 27px;
  font-weight: 900;
  line-height: 1.18;
}

.hero-sub {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.hero-robots {
  display: flex;
  align-items: flex-end;
  width: 178px;
  margin-right: -22px;
}

.hero-robots img {
  width: 72px;
  height: 118px;
  object-fit: contain;
  margin-left: -16px;
}

.robot-main {
  width: clamp(96px, 24vw, 124px);
  height: 164px;
  flex: 0 1 124px;
  object-fit: contain;
  margin-bottom: -6px;
}

.top-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #e8fbf2;
  color: #15965a;
  font-size: 13px;
  font-weight: 800;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.section {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 900;
}

.link {
  color: var(--p);
  font-size: 13px;
  font-weight: 800;
}

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

.section.grid-2 {
  grid-template-columns: 1fr;
}

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

.quick-card {
  min-height: 124px;
  padding: 14px 10px;
  border-radius: 16px;
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 26px rgba(30, 28, 92, 0.16);
}

.quick-card.purple {
  background: linear-gradient(160deg, #7766f8, #9b86ff);
}

.quick-card.green {
  background: linear-gradient(160deg, #37c08a, #20a877);
}

.quick-card.orange {
  background: linear-gradient(160deg, #ffa45c, #ff8136);
}

.quick-card img {
  width: 44px;
  height: 44px;
  margin: 0 auto 9px;
}

.quick-name {
  font-size: 16px;
  font-weight: 900;
}

.quick-sub {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.ai-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #ffe0a8;
  border-radius: 12px;
  background: #fff4e0;
}

.ai-tag,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-tag {
  background: #f0930c;
  color: #fff;
}

.ai-text {
  min-width: 0;
  color: #9a6b12;
  font-size: 13px;
  line-height: 1.45;
}

.tag {
  background: var(--p3);
  color: var(--p);
}

.tag.ok {
  background: #e5f9ef;
  color: #18a860;
}

.tag.warn {
  background: #fff0eb;
  color: #e05a20;
}

.tag.gray {
  background: #f0f0f8;
  color: var(--t3);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row > *,
.grid-2 > *,
.grid-3 > *,
.card > *,
.soft > *,
.warm > * {
  min-width: 0;
}

.care-row,
.task-row,
.menu-row,
.risk-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.care-row:last-child,
.task-row:last-child,
.menu-row:last-child,
.risk-row:last-child {
  border-bottom: 0;
}

.check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: #e6faf0;
  color: var(--ok);
  font-size: 12px;
  font-weight: 900;
}

.task-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin-top: 6px;
  border: 2px solid #c8b8ff;
  border-radius: 50%;
}

.task-dot.done {
  border-color: var(--ok);
  background: var(--ok);
}

.muted {
  color: var(--t3);
}

.small {
  font-size: 12px;
}

.strong {
  font-weight: 900;
}

.obj-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.avatar,
.round-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--p3);
  color: var(--p);
  font-weight: 900;
}

.avatar {
  width: 48px;
  height: 48px;
}

.round-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
}

.round-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--t2);
  font-size: 14px;
  font-weight: 700;
}

.chip.on {
  border-color: var(--p);
  background: var(--p3);
  color: var(--p);
  font-weight: 900;
}

.primary,
.secondary,
.outline {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 900;
  text-align: center;
}

.primary {
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(91, 91, 255, 0.28);
}

.secondary {
  background: var(--p3);
  color: var(--p);
}

.outline {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--t2);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--t2);
  font-size: 13px;
  font-weight: 900;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f6ff;
  color: var(--t1);
  font-size: 15px;
  outline: none;
}

.input {
  height: 46px;
  padding: 0 13px;
}

.textarea {
  min-height: 96px;
  padding: 12px 13px;
  resize: none;
  line-height: 1.55;
}

.chat-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 110px);
}

.reply-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--p3);
}

.seg button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--p);
  font-size: 13px;
  font-weight: 900;
}

.seg button.on {
  background: var(--p);
  color: #fff;
}

.chat-list {
  flex: 1;
  padding: 16px 0 132px;
}

.bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  margin-bottom: 14px;
}

.bubble-wrap.me {
  flex-direction: row-reverse;
}

.bubble-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: var(--p3);
  color: var(--p);
  font-size: 13px;
  font-weight: 900;
}

.bubble-avatar.me {
  background: var(--p);
  color: #fff;
}

.bubble {
  min-width: 0;
  max-width: 72%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.58;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble.ai {
  border-bottom-left-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow);
}

.bubble.me {
  border-bottom-right-radius: 4px;
  background: var(--p);
  color: #fff;
}

.chat-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: min(520px, 100vw);
  transform: translateX(-50%);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.quick-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 9px;
}

.quick-chips::-webkit-scrollbar,
.tabs::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--p3);
  color: var(--p);
  font-size: 13px;
  font-weight: 800;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.mic-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: var(--p3);
}

.mic-btn.recording {
  background: #ffe8ef;
  box-shadow: 0 0 0 6px rgba(255, 59, 107, 0.08);
}

.mic-btn img {
  width: 22px;
  height: 22px;
}

.chat-voice-status {
  display: none;
  margin-bottom: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f7f6ff;
  color: var(--t2);
  font-size: 13px;
  line-height: 1.45;
}

.chat-voice-status.show {
  display: block;
}

.voice-message audio {
  width: 220px;
  max-width: 100%;
  margin-top: 8px;
}

.chat-input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  outline: none;
}

.send-btn {
  flex: 0 0 auto;
  min-width: 56px;
  height: 42px;
  border-radius: 999px;
  background: var(--p);
  color: #fff;
  font-weight: 900;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px 14px;
  padding: 0 16px;
}

.tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--t2);
  font-size: 14px;
  font-weight: 800;
}

.tab.on {
  border-color: var(--p);
  background: var(--p);
  color: #fff;
}

.pkg {
  border: 2px solid transparent;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow);
}

.pkg.on {
  border-color: var(--p);
}

.price {
  color: var(--orange);
  font-size: 24px;
  font-weight: 900;
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.pay-row.on {
  border-color: var(--p);
  background: #f3f1ff;
}

.pay-row img {
  width: 32px;
  height: 32px;
}

.voice-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f6ff;
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--t2);
  font-size: 14px;
  line-height: 1.45;
}

.record-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--t3);
}

.record-dot.on {
  background: var(--red);
  box-shadow: 0 0 0 8px rgba(255, 59, 107, 0.1);
  animation: pulse 1s infinite;
}

.voice-duration {
  flex: 0 0 auto;
  color: var(--t1);
  font-size: 18px;
  font-weight: 900;
}

.voice-env {
  margin-top: -4px;
  color: var(--t3);
  font-size: 12px;
  line-height: 1.45;
}

.voice-audio {
  width: 100%;
}

.primary.recording {
  background: linear-gradient(135deg, var(--red), #ff7a59);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

.step-bars {
  display: flex;
  gap: 7px;
  margin-bottom: 24px;
}

.step-bars span {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: #e0dcf8;
}

.step-bars span.on {
  background: var(--p);
}

.menu-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  background: var(--p3);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(520px, 100vw);
  transform: translateX(-50%);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.tabbar.hidden {
  display: none;
}

.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 14px;
  color: var(--t3);
  font-size: 12px;
  font-weight: 900;
}

.tabbar button.on {
  background: var(--p3);
  color: var(--p);
}

.tabbar .tab-ico {
  font-size: 20px;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: min(420px, calc(100vw - 48px));
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(21, 21, 46, 0.92);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 780px) {
  body {
    background: #e4e2f2;
  }

  .app-shell {
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    box-shadow: 0 22px 70px rgba(30, 28, 92, 0.12);
  }
}

@media (max-width: 430px) {
  .view {
    padding-right: 14px;
    padding-left: 14px;
  }

  .row > .robot-main {
    width: clamp(86px, 26vw, 118px);
    height: auto;
    flex: 0 1 118px;
  }

  .grid-3 {
    gap: 8px;
  }

  .quick-card {
    min-height: 112px;
    padding: 12px 6px;
  }

  .quick-card img {
    width: 38px;
    height: 38px;
  }

  .quick-name {
    font-size: 14px;
  }

  .quick-sub {
    font-size: 10px;
  }

  .section.grid-2 {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 76%;
  }
}
