:root {
  --ink: #17201c;
  --muted: #66736d;
  --line: rgba(23, 32, 28, 0.12);
  --wechat: #1fb76e;
  --paper: #f7f4ed;
  --panel: rgba(255, 255, 255, 0.78);
  --green-soft: #dff4e9;
  --yellow-soft: #fff1bf;
  --blue-soft: #ddecff;
  --rose-soft: #ffe4df;
  --shadow: 0 24px 70px rgba(31, 45, 38, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 16% 12%, rgba(78, 173, 126, 0.22), transparent 28%),
    linear-gradient(135deg, #e8f1ed 0%, #f8f2e6 52%, #e7eef7 100%);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button {
  font: inherit;
}

.tablet-shell {
  width: min(96vw, calc((94vh - 76px) * 3000 / 1876));
  aspect-ratio: 3000 / 1876;
  padding: 16px;
  border: 12px solid #242827;
  border-radius: 34px;
  background: #111514;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.status-bar {
  height: 34px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.status-right {
  text-align: right;
}

.camera-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #060807;
  box-shadow: inset 0 0 0 2px #2a302d;
}

.stage {
  position: relative;
  height: calc(100% - 34px);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(250, 250, 245, 0.98);
}

.step-nav {
  width: min(560px, calc(100% - 48px));
  min-height: 48px;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 34px rgba(31, 45, 38, 0.12);
  backdrop-filter: blur(18px);
}

.step-nav button {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #45514c;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.step-nav button span {
  display: block;
  margin-bottom: 1px;
  color: #7a8580;
  font-size: 11px;
  font-weight: 700;
}

.step-nav button.is-active {
  background: #1c2722;
  color: white;
}

.step-nav button.is-active span {
  color: rgba(255, 255, 255, 0.72);
}

.wechat-panel {
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wechat-titlebar,
.chat-header,
.agent-header,
.side-cards header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wechat-titlebar {
  min-height: 76px;
  padding: 0 150px 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 247, 0.94);
}

.desktop-top {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 26px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
}

.ghost-button,
.desktop-switch,
.desktop-back,
.tool-button,
.primary-button,
.ink-action,
.memory-new {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

.title-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  align-self: flex-start;
}

.wechat-content {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.contact-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--line);
  background: rgba(246, 246, 238, 0.76);
  overflow: auto;
}

.contact {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.contact.is-active {
  border-color: rgba(31, 183, 110, 0.35);
  background: rgba(31, 183, 110, 0.13);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: #203c62;
  font-weight: 700;
}

.contact:nth-child(2) .avatar {
  background: var(--yellow-soft);
  color: #72560a;
}

.contact:nth-child(3) .avatar {
  background: var(--rose-soft);
  color: #7a3028;
}

.contact strong,
.contact small {
  display: block;
}

.contact strong {
  font-size: 14px;
}

.contact small {
  margin-top: 3px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-window {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(250, 250, 245, 0.92);
}

.chat-header {
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.desktop-switch {
  background: #1c2722;
  color: white;
}

.chat-feed {
  position: relative;
  padding: 18px;
  overflow: auto;
}

.message-row {
  display: flex;
  margin-bottom: 14px;
}

.message-row.me {
  justify-content: flex-end;
}

.bubble {
  position: relative;
  max-width: min(560px, 86%);
  padding: 12px 14px;
  border-radius: 16px;
  background: white;
  border: 1px solid rgba(23, 32, 28, 0.08);
  box-shadow: 0 8px 20px rgba(31, 45, 38, 0.06);
  line-height: 1.55;
  font-size: 15px;
}

.bubble.is-draggable {
  cursor: grab;
  user-select: none;
}

.bubble.is-dragging {
  opacity: 0.48;
  cursor: grabbing;
}

.me .bubble {
  background: var(--green-soft);
}

.bubble.is-target {
  outline: 3px solid rgba(31, 183, 110, 0.25);
}

.bubble .pen-note {
  position: absolute;
  right: -38px;
  bottom: -22px;
  color: #233ed6;
  font-family: "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 18px;
  transform: rotate(-7deg);
}

.drag-toolbar {
  min-height: 66px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.drag-tip {
  width: 100%;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(31, 183, 110, 0.45);
  border-radius: 999px;
  background: rgba(31, 183, 110, 0.1);
  color: #177a4d;
  font-weight: 800;
}

.memory-orb-panel {
  position: absolute;
  top: 16px;
  right: 24px;
  z-index: 28;
  width: 118px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.memory-orb-panel.is-hidden {
  display: none;
}

.memory-orb-panel.is-awaiting {
  filter: drop-shadow(0 14px 28px rgba(31, 183, 110, 0.18));
}

.memory-orb-panel.is-over {
  filter: drop-shadow(0 18px 34px rgba(31, 183, 110, 0.28));
}

.memory-drop-orb {
  width: 86px;
  height: 106px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: transparent;
  filter: drop-shadow(0 12px 22px rgba(82, 85, 138, 0.22));
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.memory-drop-orb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.memory-orb-panel.is-over .memory-drop-orb,
.memory-drop-orb.has-collected {
  transform: scale(1.08);
  box-shadow: 0 20px 54px rgba(31, 183, 110, 0.42);
}

.drop-result {
  width: 190px;
  min-height: 28px;
  display: grid;
  place-items: center;
}

.drop-toast {
  width: 100%;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(31, 45, 38, 0.14);
  color: #33423d;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 1.45;
  backdrop-filter: blur(14px);
}

.drop-toast p {
  margin: 0;
}

.drop-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.drop-actions button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #33423d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.drop-actions button:first-child {
  background: #233ed6;
  border-color: #233ed6;
  color: white;
}

.drop-toast.is-muted {
  color: var(--muted);
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.agent-card,
.question-card,
.context-card,
.life-card {
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 16px;
  padding: 15px;
  background: white;
  box-shadow: 0 10px 24px rgba(31, 45, 38, 0.08);
}

.agent-card h3,
.question-card h3,
.context-card h3,
.life-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.agent-card p,
.question-card p,
.context-card p,
.life-card p {
  margin-bottom: 10px;
  color: #42504a;
  line-height: 1.55;
  font-size: 14px;
}

.card-mark {
  display: inline-flex;
  margin-bottom: 10px;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #16744a;
  font-size: 12px;
  font-weight: 700;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(23, 32, 28, 0.08);
  font-size: 13px;
}

.detail-item span:first-child {
  color: var(--muted);
}

.ink-area {
  min-height: 92px;
  margin: 12px 0;
  padding: 12px;
  border: 2px dashed rgba(35, 62, 214, 0.32);
  border-radius: 14px;
  background: rgba(245, 247, 255, 0.82);
  color: #233ed6;
  font-family: "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 18px;
}

.ink-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ink-action {
  min-height: 34px;
  font-size: 13px;
}

.ink-action.primary {
  background: #233ed6;
  border-color: #233ed6;
  color: white;
}

.desktop-view {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
  transition: transform 420ms ease;
  z-index: 5;
}

.desktop-view.is-visible {
  transform: translateY(0);
}

.desktop-wallpaper {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 44px 54px;
  overflow: hidden;
  background:
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.24) 0 54px, rgba(255, 214, 235, 0.18) 54px 108px),
    radial-gradient(circle at 62% 54%, rgba(180, 198, 255, 0.26), transparent 30%),
    linear-gradient(120deg, #fff8f5 0%, #ffeef7 50%, #fff7fc 100%);
}

.desktop-clock {
  position: absolute;
  top: 42px;
  left: 58px;
  display: grid;
  gap: 4px;
  z-index: 2;
}

.desktop-clock span {
  font-size: 56px;
  font-weight: 800;
}

.desktop-clock small {
  color: var(--muted);
}

.reminder-avatar {
  position: absolute;
  right: 404px;
  top: 242px;
  width: 205px;
  height: 305px;
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 20px 34px rgba(94, 82, 156, 0.22));
}

.proactive-card {
  position: absolute;
  top: 118px;
  right: 52px;
  width: 420px;
  min-height: 548px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  z-index: 2;
}

.proactive-card h2 {
  margin: 0 0 10px;
  color: #303936;
  font-size: 32px;
  line-height: 1.14;
}

.card-subtitle {
  margin-bottom: 20px;
  color: #7a8580;
  line-height: 1.6;
}

.form-preview {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 26px rgba(31, 45, 38, 0.07);
}

.form-preview div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(23, 32, 28, 0.08);
}

.form-preview div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.form-preview span {
  color: var(--muted);
  font-size: 13px;
}

.form-preview strong {
  max-width: 230px;
  text-align: right;
  font-size: 13px;
}

.agent-note {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid #7b61ff;
  border-radius: 14px;
  background: rgba(245, 247, 255, 0.88);
}

.agent-note strong {
  display: block;
  margin-bottom: 6px;
}

.agent-note p {
  margin: 0;
  color: #5d6965;
  line-height: 1.55;
  font-size: 14px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions button {
  min-height: 42px;
  flex: 1;
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #33423d;
  font-weight: 800;
  cursor: pointer;
}

.confirm-actions button:last-child {
  background: #233ed6;
  border-color: #233ed6;
  color: white;
}

.memory-view {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: block;
  background:
    radial-gradient(circle at 28% 14%, rgba(98, 180, 214, 0.2), transparent 28%),
    linear-gradient(135deg, #e9f5f7 0%, #f5f1eb 42%, #dfeef4 100%);
  transform: translateX(100%);
  transition: transform 420ms ease;
}

.memory-view.is-visible {
  transform: translateX(0);
}

.memory-new {
  min-width: 96px;
  background: #3694f5;
  border-color: #3694f5;
  color: white;
  font-weight: 700;
}

.memory-main {
  padding: 48px 24px 24px 30px;
  min-width: 0;
  overflow: auto;
}

.task-board {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 16px 38px rgba(31, 45, 38, 0.08);
  backdrop-filter: blur(16px);
}

.board-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.board-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
}

.board-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.task-card {
  min-height: 132px;
  padding: 15px;
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: 16px;
  background: #f6fbff;
  box-shadow: 0 10px 24px rgba(31, 45, 38, 0.06);
}

.task-card.urgent {
  background: #fff8df;
}

.task-card.soft {
  background: #f1fff8;
}

.task-card small {
  display: block;
  margin-bottom: 10px;
  color: #268af2;
  font-weight: 800;
}

.task-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.task-card p {
  margin: 0;
  color: #5d6965;
  line-height: 1.5;
  font-size: 13px;
}

.memory-topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segment-control {
  min-width: 560px;
  min-height: 42px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.segment-control button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #303936;
  font-weight: 700;
  cursor: pointer;
}

.segment-control button.is-active {
  background: rgba(226, 239, 255, 0.98);
  color: #268af2;
}

.memory-heading {
  margin: 14px 0 16px;
}

.memory-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

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

.memory-card {
  min-height: 154px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  gap: 8px;
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 26px rgba(31, 45, 38, 0.07);
  cursor: pointer;
}

.memory-card.is-selected {
  border-color: rgba(54, 148, 245, 0.55);
  box-shadow: 0 0 0 3px rgba(54, 148, 245, 0.12), 0 12px 26px rgba(31, 45, 38, 0.07);
}

.memory-card header {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.memory-badge {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(54, 148, 245, 0.12);
  color: #268af2;
}

.memory-card h3 {
  margin: 0 0 3px;
  font-size: 16px;
}

.memory-card small,
.memory-card p {
  color: #7b8584;
}

.memory-card p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.5;
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memory-reason {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(31, 183, 110, 0.08);
  color: #33614c;
  line-height: 1.45;
  font-size: 12px;
}

.memory-meta {
  color: #2691ff;
  font-size: 13px;
  font-weight: 700;
}

.memory-card footer {
  display: flex;
  gap: 7px;
}

.memory-card footer button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #42504a;
  cursor: pointer;
}

.memory-card footer button:last-child {
  color: #b64a3a;
}

.memory-inline-panel {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(23, 32, 28, 0.08);
}

.memory-empty {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(23, 32, 28, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  text-align: center;
  color: var(--muted);
}

.memory-empty h3 {
  margin-bottom: 8px;
  color: var(--ink);
}

.memory-inspector {
  display: none;
}

.memory-detail,
.memory-editor {
  display: grid;
  gap: 12px;
}

.memory-detail h3 {
  margin-bottom: 0;
  font-size: 20px;
}

.memory-detail p {
  margin: 0;
  color: #42504a;
  line-height: 1.6;
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.value-strip span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(31, 183, 110, 0.1);
  color: #16744a;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.memory-editor label {
  display: grid;
  gap: 6px;
  color: #5c6965;
  font-size: 13px;
}

.memory-editor input,
.memory-editor textarea {
  width: 100%;
  border: 1px solid rgba(23, 32, 28, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  padding: 10px 11px;
  outline: 0;
}

.memory-editor textarea {
  min-height: 112px;
  resize: vertical;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 920px) {
  .tablet-shell {
    width: 100vw;
    height: auto;
    min-height: 100vh;
    border-radius: 0;
    border-width: 0;
  }

  .wechat-content {
    grid-template-columns: 86px 1fr;
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .contact small {
    display: none;
  }

  .agent-panel {
    width: 300px;
  }

  .memory-view {
    grid-template-columns: 1fr;
  }

  .memory-inspector {
    display: none;
  }

  .memory-grid {
    grid-template-columns: 1fr;
  }
}
