/* ==========================================================================
   神罚 · chat  (整页聊天 · 站点主题背景 · 胶囊气泡)
   ========================================================================== */

.wx-body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font);
  background-color: #eef1f7;
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cg fill='none' stroke='%23152233' stroke-opacity='.07' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='44' cy='52' r='15'/%3E%3Cpath d='M96 34c11 9 11 22 0 31'/%3E%3Cpath d='M176 28l7 15 16 2-12 11 3 16-14-8-14 8 3-16-12-11 16-2z'/%3E%3Cpath d='M246 70c15 0 24 11 24 24'/%3E%3Cpath d='M26 132h38'/%3E%3Ccircle cx='268' cy='140' r='10'/%3E%3Cpath d='M64 186c13-15 33-15 44 0'/%3E%3Cpath d='M132 238c9-9 22-9 28 2'/%3E%3Cpath d='M196 196l18 18M214 196l-18 18'/%3E%3Cpath d='M262 252c7-11 20-11 26 0'/%3E%3Cpath d='M108 104l12-12M108 92l12 12'/%3E%3Cpath d='M34 250c8-12 24-12 32 0'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(120% 80% at 6% 0%, #e9efff 0%, rgba(233, 239, 255, 0) 58%),
    radial-gradient(95% 70% at 100% 10%, #f6e9f3 0%, rgba(246, 233, 243, 0) 56%),
    linear-gradient(175deg, #f4f6fd 0%, #e9edf8 50%, #e5eaf4 100%);
  background-size: 320px 320px, cover, cover, cover;
}

.wx {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 700px;
  margin-inline: auto;
}

/* ---------------------------------------------------------------- 顶部栏 */
.wx-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 6px;
}

.wx-back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px -12px rgba(17, 25, 54, 0.6);
}

.wx-back:active {
  transform: scale(0.95);
}

.wx-title {
  flex: 1;
  min-width: 0;
  padding: 6px 14px;
  border-radius: 999px;
  text-align: center;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px -16px rgba(17, 25, 54, 0.7);
}

.wx-name {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.wx-status {
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--ink-3);
}

.wx-me {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f3f5fb;
  background: linear-gradient(145deg, #1a2135, #3a4568);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ---------------------------------------------------------------- 消息区 */
.wx-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.wx-divider {
  align-self: stretch;
  display: flex;
  justify-content: center;
  margin: 2px 0 4px;
}

.wx-divider span {
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.wx-row {
  display: flex;
  animation: wxIn 0.26s var(--ease) both;
}

.wx-row--out {
  justify-content: flex-end;
}

/* 胶囊气泡：单行就是完整药丸，多行也是大圆角长条 */
.wx-bubble {
  position: relative;
  max-width: 78%;
  padding: 10px 18px 8px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px -16px rgba(17, 25, 54, 0.65);
}

.wx-row--out .wx-bubble {
  background: #98e57f;
  border-color: rgba(255, 255, 255, 0.45);
}

.wx-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #16210f;
  word-break: break-word;
  white-space: pre-wrap;
}

.wx-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.6rem;
  color: rgba(17, 25, 54, 0.38);
  font-variant-numeric: tabular-nums;
}

.wx-row--out .wx-meta {
  color: rgba(28, 66, 14, 0.55);
}

.wx-read {
  font-size: 0.6rem;
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------- 播放条 */
.wx-music {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 4px;
}

.gplayer-slot {
  width: 208px;
}

.gplayer {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 3px 7px 3px 3px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px -12px rgba(17, 25, 54, 0.6);
}

.gplayer__cover {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(17, 25, 54, 0.1);
}

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

.gplayer__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gplayer__title {
  font-size: 0.66rem;
  font-weight: 560;
  line-height: 1.1;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gplayer__line {
  height: 2px;
  border-radius: 99px;
  background: rgba(17, 25, 54, 0.12);
  overflow: hidden;
}

.gplayer__line i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #1a2135, #6d5cff);
  transition: width 0.2s linear;
}

.gplayer__btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.52rem;
  color: #f3f5fb;
  background: linear-gradient(145deg, #1a2135, #3a4568);
}

/* ---------------------------------------------------------------- 输入条 */
.wx-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
}

.wx-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.wx-ico svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wx-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.94rem;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(17, 25, 54, 0.06);
}

.wx-input::placeholder {
  color: var(--ink-4);
}

.wx-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(109, 92, 255, 0.25);
}

.wx-send {
  display: none;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  flex-shrink: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(145deg, #151b2c, #2f3a5c);
}

.wx-bar.has-text .wx-send {
  display: block;
}

.wx-bar.has-text .wx-ico--voice {
  display: none;
}

.wx-send:active {
  transform: scale(0.97);
}

@keyframes wxIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 420px) {
  .wx-head {
    padding: 8px 10px 4px;
  }

  .wx-title {
    padding: 5px 10px;
  }

  .wx-name {
    font-size: 0.94rem;
  }

  .wx-bubble {
    max-width: 82%;
  }

  .wx-log {
    padding-inline: 10px;
  }

  .wx-bar {
    padding-inline: 10px;
    gap: 6px;
  }

  .gplayer-slot {
    width: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wx-row {
    animation: none;
  }
}
