:root {
  color-scheme: light;
  --wechat-bg: #ededed;
  --wechat-panel: #f7f7f7;
  --wechat-green: #95ec69;
  --wechat-green-dark: #07c160;
  --ink: #111111;
  --muted: #7a7a7a;
  --line: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--wechat-bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.intro-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 26px 16px;
  background:
    radial-gradient(circle at 50% 8%, rgba(149, 236, 105, 0.32), transparent 34%),
    linear-gradient(180deg, #f7f7f7 0%, #ededed 100%);
}

.intro-card {
  width: min(760px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.08);
}

.intro-hero {
  display: grid;
  justify-items: center;
  text-align: center;
}

.intro-avatar {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 18px 36px rgba(0, 102, 255, 0.2);
}

.intro-kicker {
  margin-top: 18px;
  color: #178b43;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.intro-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.intro-subtitle {
  max-width: 560px;
  margin: 14px auto 0;
  color: #333333;
  font-size: 18px;
  line-height: 1.6;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.intro-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfb;
}

.intro-grid h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.intro-grid p,
.intro-disclaimer {
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.65;
}

.intro-owner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 22px;
  color: #222222;
  font-size: 15px;
}

.intro-owner a {
  color: #178b43;
  text-decoration: none;
}

.intro-open-source {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(7, 193, 96, 0.16);
  border-radius: 12px;
  background: #f7fff4;
  color: #333333;
  font-size: 14px;
  line-height: 1.65;
}

.intro-open-source span {
  display: block;
  margin-bottom: 4px;
  color: #178b43;
  font-weight: 700;
}

.intro-open-source p {
  margin: 0;
}

.intro-open-source a {
  color: #0b7f3a;
  font-weight: 700;
  text-decoration: none;
}

.intro-open-source a:hover {
  text-decoration: underline;
}

.intro-disclaimer {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f4f4f4;
}

.intro-button {
  display: block;
  width: min(320px, 100%);
  height: 50px;
  margin: 22px auto 0;
  border-radius: 999px;
  background: var(--wechat-green-dark);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(7, 193, 96, 0.24);
}

.intro-button:hover {
  background: #06ad56;
}

.wechat-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(860px, 100%);
  height: 100vh;
  margin: 0 auto;
  background: var(--wechat-bg);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--wechat-panel);
  text-align: center;
}

.avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.avatar-img,
.bubble-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
}

.avatar-img {
  box-shadow: 0 8px 18px rgba(0, 102, 255, 0.18);
}

.avatar-wrap h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.avatar-wrap p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.avatar-wrap p.busy {
  color: #1f8f42;
}

.chat-list {
  overflow-y: auto;
  padding: 18px 14px 22px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 16px;
}

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

.bubble {
  position: relative;
  max-width: min(72%, 560px);
  padding: 10px 12px;
  border-radius: 6px;
  background: #ffffff;
  color: #111;
  font-size: 16px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.bubble p {
  margin: 0 0 10px;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: #777;
  vertical-align: -2px;
  animation: blink 0.9s steps(2, start) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.followup-bubble {
  max-width: min(82%, 620px);
}

.followup-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.followup-grid button {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(7, 193, 96, 0.24);
  border-radius: 8px;
  background: #f6fff2;
  color: #16803b;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
}

.followup-grid button:hover {
  background: #ebffe2;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #eeeeee;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7f7f7;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.message.assistant .bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 13px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #ffffff;
}

.message.user .bubble {
  background: var(--wechat-green);
}

.message.user .bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 13px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid var(--wechat-green);
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--wechat-panel);
}

textarea {
  width: 100%;
  min-height: 42px;
  max-height: 130px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

textarea:focus {
  border-color: rgba(7, 193, 96, 0.42);
}

#send {
  min-width: 68px;
  height: 42px;
  padding: 0 15px;
  border-radius: 6px;
  background: var(--wechat-green-dark);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
}

#send:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .intro-shell {
    align-items: start;
    padding: 14px;
  }

  .intro-card {
    padding: 24px 18px;
    border-radius: 14px;
  }

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

  .intro-subtitle {
    font-size: 16px;
  }

  .wechat-shell {
    width: 100%;
  }

  .bubble {
    max-width: 78%;
    font-size: 15px;
  }
}
