:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #e3516f;
  --brand-dark: #b83253;
  --blue: #2563eb;
  --green: #079455;
  --card: #ffffff;
  --shadow: 0 18px 48px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  background: #eef2f6;
  color: #344054;
  font-weight: 700;
}

button.primary {
  background: var(--brand);
  color: #fff;
}

button.ghost {
  background: #fff;
  border: 1px solid var(--line);
}

button.mini {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.app-shell {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #f8fafc;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 84px;
}

.top-hero {
  min-height: 300px;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(135deg, #fff1f3, #eff6ff);
}

.top-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.top-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.05), rgba(16, 24, 40, 0.82));
}

.hero-copy {
  position: relative;
  z-index: 1;
  color: #fff;
  padding: 32px 22px 26px;
}

.hero-copy span,
.section-head span,
.chat-head span {
  color: #f9a8bb;
  font-weight: 800;
  font-size: 13px;
}

.hero-copy h1,
.section-head h2,
.chat-head h2 {
  margin: 6px 0 8px;
  line-height: 1.15;
}

.hero-copy h1 {
  font-size: 32px;
}

.hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.screen {
  display: none;
  padding: 18px;
}

.screen.active {
  display: block;
}

.panel,
.date-card,
.conversation-card,
.profile-strip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.06);
}

.module-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.module-card {
  min-height: 82px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 4px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
}

.module-card strong {
  color: #182230;
  font-size: 17px;
}

.module-card span {
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.module-card.ai {
  background: linear-gradient(135deg, #eef4ff, #fff1f3);
}

.module-card.life {
  background: linear-gradient(135deg, #ecfdf3, #ffffff);
}

.module-card.plan {
  background: linear-gradient(135deg, #fff7ed, #eef2ff);
}

.login-panel {
  margin-top: -44px;
  position: relative;
  z-index: 2;
  padding: 22px;
}

.login-panel h2,
.login-panel p {
  margin-top: 0;
}

.login-panel p,
.login-panel small,
.muted {
  color: var(--muted);
  line-height: 1.5;
}

label {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: #344054;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  outline: none;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 12px;
}

.form-grid label {
  margin-top: 0;
}

.login-panel button {
  width: 100%;
  margin-top: 10px;
}

.section-head,
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2,
.chat-head h2 {
  font-size: 24px;
}

.profile-strip {
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.profile-strip strong {
  display: block;
  margin-bottom: 4px;
}

.cards,
.conversation-list {
  display: grid;
  gap: 14px;
}

.date-card {
  overflow: hidden;
}

.date-cover {
  min-height: 220px;
  background: #111827;
  position: relative;
}

.date-cover img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.score-pill {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-dark);
  font-weight: 900;
}

.date-body {
  padding: 16px;
}

.date-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.date-title h3 {
  margin: 0;
  font-size: 22px;
}

.bio {
  margin: 12px 0;
  color: #344054;
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  padding: 6px 10px;
  font-size: 13px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.conversation-card {
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffd6df, #bfdbfe);
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  font-weight: 900;
}

.conversation-main {
  min-width: 0;
  flex: 1;
}

.conversation-main h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.single-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-screen {
  padding-bottom: 146px;
}

.chat-messages {
  display: grid;
  gap: 12px;
  min-height: 360px;
  align-content: end;
}

.message {
  max-width: 82%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.45;
}

.message.mine {
  margin-left: auto;
  background: #fff1f3;
  border-color: #fecdd6;
}

.message small {
  display: block;
  margin-bottom: 4px;
  color: #98a2b3;
}

.quick-replies {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(12px);
}

.quick-replies button {
  white-space: nowrap;
  min-height: 34px;
  font-size: 13px;
}

.chat-form {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.assistant-screen {
  padding-bottom: 116px;
}

.assistant-card {
  border-radius: 8px;
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #eff6ff, #fff1f3);
  padding: 16px;
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.assistant-orb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #635bff;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex-shrink: 0;
}

.assistant-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.assistant-card p {
  margin: 0;
  color: #667085;
  line-height: 1.45;
}

.assistant-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.assistant-suggestions button {
  white-space: nowrap;
  min-height: 36px;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
}

.assistant-messages {
  display: grid;
  gap: 12px;
  min-height: 260px;
}

.assistant-message {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  line-height: 1.5;
}

.assistant-message.mine {
  background: #fff1f3;
  border-color: #fecdd6;
}

.assistant-message small {
  display: block;
  color: #98a2b3;
  margin-bottom: 4px;
}

.assistant-form {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.tabs.hidden {
  display: none;
}

.tabs button.active {
  background: #fff1f3;
  color: var(--brand-dark);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: rgba(16, 24, 40, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: min(420px, calc(100% - 32px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.toast.show {
  opacity: 1;
}
