:root {
  /* 主题语义色：换暗色时只改这三组 rgb 就能整体反转 */
  --ink-rgb: 46, 37, 28;
  --surface-rgb: 255, 255, 255;
  --shadow-rgb: 92, 63, 32;
  --surface-1: #fffdf9;
  --surface-2: #fff7ee;
  --surface-3: #fdf5ea;
  --text: #2e251c;
  --dim: rgba(var(--ink-rgb), 0.66);
  --dimmer: rgba(var(--ink-rgb), 0.46);
  --line: rgba(var(--ink-rgb), 0.12);
  --line-strong: rgba(var(--ink-rgb), 0.24);
  --panel: rgba(var(--surface-rgb), 0.86);
  --panel-solid: var(--surface-1);
  --amber: #a9551a;
  --amber-deep: #8d4813;
  --ink: #2a1c08;
  --danger: #c0392b;
  --radius: 6px;
  --shadow: 0 18px 50px rgba(var(--shadow-rgb), 0.16);
  /* 辅助色取自晚霞：暮紫、晚玫、余金 */
  --teal: #6a5f8a;
  --teal-soft: rgba(106, 95, 138, 0.12);
  --rose: #b4596a;
  --rose-soft: rgba(180, 89, 106, 0.12);
  --gold-soft: rgba(201, 150, 52, 0.16);
  --violet: #7a6494;
  --violet-soft: rgba(122, 100, 148, 0.12);
  --peach-soft: rgba(217, 130, 85, 0.13);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
/* 移动端避免双击缩放带来的点击延迟 */
button {
  touch-action: manipulation;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #fbf3e9;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* 晚叙底景：上方晚霞暖光，下方暮色微蓝，保留"黄昏入夜"的感觉 */
.scenery {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #fbf3e9;
  background-image:
    radial-gradient(80% 55% at 10% -8%, rgba(255, 208, 168, 0.72), transparent 68%),
    radial-gradient(66% 46% at 92% -4%, rgba(205, 188, 226, 0.58), transparent 72%),
    radial-gradient(85% 55% at 50% 110%, rgba(166, 176, 214, 0.5), transparent 72%),
    linear-gradient(180deg, #fffaf3 0%, #fdf1e4 44%, #f0e7ef 74%, #e7e7f3 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.scenery::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(36% 28% at 30% 64%, rgba(196, 99, 58, 0.16), transparent 70%),
    radial-gradient(30% 24% at 72% 38%, rgba(217, 130, 85, 0.1), transparent 72%);
  animation: scenery-drift 28s ease-in-out infinite alternate;
}

@keyframes scenery-drift {
  from {
    transform: translate3d(-1.4%, 1%, 0) scale(1.02);
  }
  to {
    transform: translate3d(1.4%, -1%, 0) scale(1.06);
  }
}

.scenery::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.32) 0%, rgba(255, 250, 242, 0) 38%, rgba(212, 212, 232, 0.3) 100%);
}

/* ---------- 底景画面：落日、云带、归鸟、远山、星月 ---------- */

.scenery > * {
  position: absolute;
  pointer-events: none;
}

/* 落日：低悬左侧，暖光晕开 */
.scenery__sun {
  inset: 0;
  background: radial-gradient(circle 220px at 9% calc(100% - 23vh),
    #ffeecd 0 34px,
    rgba(255, 221, 174, 0.96) 35px 42px,
    rgba(255, 198, 142, 0.45) 92px,
    rgba(255, 184, 128, 0.14) 150px,
    rgba(255, 184, 128, 0) 220px);
  filter: blur(0.6px);
}

/* 云带：贴着地平线缓慢漂移 */
.scenery__clouds {
  inset: 0;
  background:
    radial-gradient(38% 10% at 18% 62%, rgba(255, 216, 178, 0.55), transparent 70%),
    radial-gradient(30% 9% at 42% 55%, rgba(255, 206, 182, 0.38), transparent 72%),
    radial-gradient(34% 8% at 78% 50%, rgba(222, 194, 224, 0.4), transparent 74%),
    radial-gradient(46% 6% at 68% 43%, rgba(255, 212, 184, 0.34), transparent 72%),
    radial-gradient(40% 5% at 86% 33%, rgba(202, 186, 222, 0.3), transparent 74%),
    radial-gradient(26% 7% at 92% 58%, rgba(255, 214, 190, 0.28), transparent 75%);
  filter: blur(8px);
  animation: cloud-drift 48s ease-in-out infinite alternate;
}

@keyframes cloud-drift {
  from {
    transform: translate3d(-1.2%, 0, 0);
  }
  to {
    transform: translate3d(1.2%, -0.6%, 0);
  }
}

/* 归鸟：落日上方的一小簇剪影 */
.scenery__birds {
  left: 13%;
  bottom: 31vh;
  width: 122px;
  opacity: 0.5;
}

.scenery__birds svg {
  display: block;
  width: 100%;
  height: auto;
}

/* 星：只铺在右上，淡淡的，不抢正文 */
.scenery__stars {
  top: 0;
  right: 0;
  width: 56%;
  height: 46%;
  animation: star-twinkle 8s ease-in-out infinite;
}

.scenery__stars svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes star-twinkle {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 0.5;
  }
}

/* 月：一弯暖色新月，给右上角一个落点 */
.scenery__moon {
  top: 9%;
  right: 11%;
  width: 32px;
  height: 32px;
}

.scenery__moon::before {
  content: "";
  position: absolute;
  inset: -32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 243, 216, 0.55), rgba(255, 243, 216, 0) 70%);
}

.scenery__moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fdf1d6;
  -webkit-mask: radial-gradient(circle at 72% 30%, transparent 42%, #000 44%);
  mask: radial-gradient(circle at 72% 30%, transparent 42%, #000 44%);
}

/* 远山：三层晚霞→暮紫的山脊，低透明度只做背景层次 */
.scenery__hills {
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(150px, 26vh, 260px);
}

.scenery__hills svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scenery__hills path:nth-child(1) {
  fill: rgba(214, 178, 196, 0.3);
}

.scenery__hills path:nth-child(2) {
  fill: rgba(164, 143, 186, 0.26);
}

.scenery__hills path:nth-child(3) {
  fill: rgba(100, 86, 130, 0.16);
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 22px calc(16px + env(safe-area-inset-bottom));
  overflow: hidden;
}

/* ---------- 通用 ---------- */

.screen {
  display: none;
  flex: 1;
  min-height: 0;
}

.screen--active {
  display: flex;
  flex-direction: column;
  animation: once-show 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes once-show {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hidden {
  display: none !important;
}

.dim {
  color: var(--dimmer);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  vertical-align: middle;
}

.badge--vip {
  background: linear-gradient(135deg, #ffe1ad, #ffb877);
  color: var(--ink);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(var(--ink-rgb), 0.68);
  font-family: inherit;
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--amber-deep);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.62);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.35s ease;
}

.icon-btn:hover {
  color: var(--amber-deep);
  transform: rotate(-90deg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(176, 111, 29, 0.06);
  color: rgba(var(--ink-rgb), 0.68);
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.16s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--outline {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: rgba(var(--ink-rgb), 0.68);
  font-size: 12px;
}

.btn--outline:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

/* ---------- 顶部 ---------- */

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

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(var(--ink-rgb), 0.68);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.brand__name {
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 500;
}

.vip-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--amber);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.vip-link:hover {
  opacity: 1;
}

.vip-link.is-vip {
  padding: 3px 9px;
  border: 1px solid rgba(217, 130, 85, 0.38);
  border-radius: 999px;
  background: rgba(217, 130, 85, 0.1);
}

/* ---------- 大厅 ---------- */

.lobby-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: none;
}

.lobby-body::-webkit-scrollbar {
  display: none;
}

.lobby-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 5px;
  text-indent: 5px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 18%, #ffdcb0 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 18px rgba(196, 99, 58, 0.18);
}

.lobby-sub {
  max-width: 280px;
  margin: 0;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.6px;
  text-align: center;
}

/* 大厅内容轻微上浮入场，切换页面时有呼吸感 */
@keyframes lobby-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#screen-lobby .lobby-body > * {
  animation: lobby-rise 0.5s ease both;
}

#screen-lobby .lobby-body > *:nth-child(2) { animation-delay: 0.03s; }
#screen-lobby .lobby-body > *:nth-child(3) { animation-delay: 0.06s; }
#screen-lobby .lobby-body > *:nth-child(4) { animation-delay: 0.09s; }
#screen-lobby .lobby-body > *:nth-child(5) { animation-delay: 0.12s; }
#screen-lobby .lobby-body > *:nth-child(6) { animation-delay: 0.15s; }
#screen-lobby .lobby-body > *:nth-child(7) { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  #screen-lobby .lobby-body > * {
    animation: none;
  }
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 14px 0 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  border-radius: 50%;
  border: 1px solid rgba(var(--ink-rgb), 0.34);
  font-size: 26px;
  font-weight: 400;
  color: #4a3010;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 240, 210, 0.95), rgba(232, 196, 146, 0.9) 72%),
    #f3e0c4;
  box-shadow: inset 0 0 26px rgba(196, 99, 58, 0.18);
  animation: avatar-glow 7s ease-in-out infinite;
  user-select: none;
}

@keyframes avatar-glow {
  0%,
  100% {
    box-shadow: inset 0 0 26px rgba(196, 99, 58, 0.18), 0 0 0 rgba(196, 99, 58, 0);
  }
  50% {
    box-shadow: inset 0 0 30px rgba(196, 99, 58, 0.3), 0 0 26px rgba(196, 99, 58, 0.1);
  }
}

.avatar--sm {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-size: 15px;
  animation: none;
}

.identity__name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.name-btn {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.name-btn:hover {
  color: var(--amber-deep);
}

.identity__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  color: var(--dim);
  font-size: 12px;
}

.identity__meta svg {
  opacity: 0.6;
}

.location-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid rgba(var(--ink-rgb), 0.18);
  border-radius: 999px;
  background: rgba(176, 111, 29, 0.06);
  color: rgba(var(--ink-rgb), 0.68);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.location-chip:hover {
  border-color: rgba(217, 130, 85, 0.5);
  background: rgba(217, 130, 85, 0.08);
}

.location-chip svg {
  flex: none;
  opacity: 0.8;
}

.location-chip__chevron {
  opacity: 0.45;
}

.location-hint {
  margin: 0;
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 10.5px;
  letter-spacing: 0.3px;
}

.geo-hint {
  margin: 6px 0 0;
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 11px;
  line-height: 1.45;
}

.geo-hint.is-warn {
  color: rgba(255, 178, 122, 0.85);
}

.location-refresh {
  margin-top: 11px;
  color: rgba(217, 130, 85, 0.8);
  text-align: left;
}

.location-refresh:hover {
  color: var(--amber);
}

.location-refresh:disabled {
  opacity: 0.5;
  cursor: default;
}

.location-panel {
  margin: 14px 0 10px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 12px;
  background: rgba(176, 111, 29, 0.06);
}

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

.location-panel__label {
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.location-panel__city {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.location-panel__city .dim {
  font-size: 11px;
  font-weight: 400;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(var(--ink-rgb), 0.12);
  color: rgba(var(--ink-rgb), 0.68);
  font-size: 13px;
  cursor: pointer;
}

.switch-input {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
  cursor: pointer;
}

.city-vip-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 11px 13px;
  border: 1px solid rgba(217, 130, 85, 0.22);
  border-radius: 10px;
  background: rgba(217, 130, 85, 0.06);
  color: rgba(217, 130, 85, 0.9);
  font-size: 12px;
}

.city-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.city-switch__lock {
  width: 10px;
  height: 10px;
  color: var(--amber);
}

.identity__meta .city-switch__lock {
  opacity: 0.9;
}

.link-btn.is-vip-only {
  color: rgba(217, 130, 85, 0.78);
}

.link-btn.is-vip-only:hover {
  color: var(--amber);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border: 1px solid rgba(var(--ink-rgb), 0.23);
  border-radius: 3px;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ---------- 登录：性别与年龄 ---------- */

.onboard {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}

.onboard::-webkit-scrollbar {
  display: none;
}

.onboard__label {
  margin: 18px 0 0;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 4px;
  text-indent: 4px;
}

.gender-row {
  display: flex;
  gap: 36px;
  margin: 6px 0 2px;
}

.gender {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: var(--dim);
  cursor: pointer;
}

.gender__icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(var(--ink-rgb), 0.25);
  color: rgba(var(--ink-rgb), 0.62);
  background: rgba(var(--surface-rgb), 0.74);
  transition: all 0.22s ease;
}

.gender__label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-indent: 1.5px;
}

.gender:hover .gender__icon {
  border-color: rgba(var(--ink-rgb), 0.40);
  color: var(--amber-deep);
}

.gender.is-active .gender__icon {
  border-color: rgba(217, 130, 85, 0.85);
  color: var(--amber);
  background: rgba(217, 130, 85, 0.12);
  box-shadow: 0 0 0 3px rgba(217, 130, 85, 0.07), inset 0 0 22px rgba(196, 99, 58, 0.22);
}

.gender.is-active .gender__label {
  color: var(--amber-deep);
}

.age-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(var(--surface-rgb), 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.age-field__label {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 3px;
}

.age-field input {
  width: 88px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  text-align: center;
  outline: none;
}

.age-field input::placeholder {
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 12.5px;
  letter-spacing: 1px;
}

.age-field input::-webkit-outer-spin-button,
.age-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.onboard__tip {
  margin: 2px 0 0;
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10.5px;
  letter-spacing: 0.4px;
}

#btn-enter {
  margin-top: 6px;
}

#onboard-msg {
  margin: 2px 0 0;
}

/* 主操作：细边半透明横条 */
.action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-bottom: 4px;
}

.bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 210px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(var(--surface-rgb), 0.80);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.16s ease;
}

.bar-btn:hover {
  background: rgba(var(--surface-rgb), 0.95);
  border-color: rgba(var(--ink-rgb), 0.40);
}

.bar-btn:active {
  transform: scale(0.98);
}

.bar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bar-btn:disabled:hover {
  background: rgba(var(--surface-rgb), 0.80);
  border-color: var(--line-strong);
}

#btn-match svg {
  animation: bottle-sway 5s ease-in-out infinite;
}

/* 主操作按钮：暖色渐变与柔光，成为首屏视觉焦点 */
#btn-match {
  border-color: rgba(176, 111, 29, 0.35);
  background: linear-gradient(180deg, var(--surface-2), #ffdca8);
  box-shadow: 0 10px 26px rgba(176, 111, 29, 0.18);
}

#btn-match:hover {
  border-color: rgba(176, 111, 29, 0.6);
  background: linear-gradient(180deg, #fffdf7, #ffd193);
  box-shadow: 0 12px 30px rgba(176, 111, 29, 0.26);
}

#btn-match:disabled {
  box-shadow: none;
}

#btn-match:disabled svg {
  animation: none;
}

/* 引导页主按钮与大厅主按钮保持统一的暖色视觉 */
#btn-enter {
  border-color: rgba(176, 111, 29, 0.35);
  background: linear-gradient(180deg, var(--surface-2), #ffdca8);
  box-shadow: 0 10px 26px rgba(176, 111, 29, 0.18);
}

#btn-enter:hover {
  border-color: rgba(176, 111, 29, 0.6);
  background: linear-gradient(180deg, #fffdf7, #ffd193);
  box-shadow: 0 12px 30px rgba(176, 111, 29, 0.26);
}

@keyframes bottle-sway {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.bar-btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: rgba(var(--ink-rgb), 0.68);
  letter-spacing: 1px;
}

.action-hint {
  margin: 0;
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: 0.8px;
}

.searching {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: auto;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px dashed rgba(217, 130, 85, 0.42);
  border-radius: 4px;
  color: rgba(255, 232, 198, 0.92);
  font-size: 12px;
  text-align: left;
  background: rgba(var(--surface-rgb), 0.72);
  animation: searching-breathe 3.8s ease-in-out infinite;
}

.waiting-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  max-width: 340px;
  padding: 12px;
  border: 1px dashed rgba(217, 130, 85, 0.28);
  border-radius: 6px;
  background: rgba(var(--surface-rgb), 0.68);
}

.waiting-panel__lead {
  margin: 0;
  color: rgba(255, 232, 198, 0.9);
  font-size: 12px;
}

.waiting-panel__tip {
  margin: 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.6;
}

.waiting-panel__row {
  display: flex;
  gap: 6px;
}

.waiting-panel__input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  border-radius: 4px;
  outline: none;
  background: rgba(var(--surface-rgb), 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
}

.waiting-panel__input:focus {
  border-color: rgba(217, 130, 85, 0.5);
}

.waiting-panel__btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(217, 130, 85, 0.4);
  border-radius: 4px;
  background: rgba(217, 130, 85, 0.12);
  color: rgba(255, 232, 198, 0.95);
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.waiting-panel__saved {
  margin: 0;
  color: #7fd8a8;
  font-size: 11px;
}

.bot-offer {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  max-width: 340px;
  padding: 12px;
  border: 1px solid rgba(217, 130, 85, 0.35);
  border-radius: 6px;
  background: rgba(217, 130, 85, 0.06);
}

.bot-offer__lead {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

.bot-offer__actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.bot-offer__actions .bar-btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 38px;
  font-size: 13px;
  letter-spacing: 1px;
}

.startup-note {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.3px;
  text-align: center;
}

@keyframes searching-breathe {
  0%,
  100% {
    border-color: rgba(217, 130, 85, 0.3);
    box-shadow: 0 0 0 rgba(196, 99, 58, 0);
  }
  50% {
    border-color: rgba(217, 130, 85, 0.62);
    box-shadow: 0 0 22px rgba(196, 99, 58, 0.12);
  }
}

.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1.6s infinite;
}

.pulse::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(217, 130, 85, 0.4);
  animation: pulse-ring 1.6s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 130, 85, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(217, 130, 85, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 130, 85, 0);
  }
}

/* VIP 同城开关 */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--surface-rgb), 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.switch-row:hover {
  border-color: var(--line-strong);
}

/* 开启同城匹配时给整行一点金色反馈 */
.switch-row:has(input:checked) {
  border-color: rgba(217, 130, 85, 0.42);
  background: rgba(217, 130, 85, 0.06);
}

.switch-row.is-locked {
  opacity: 0.7;
}

.switch-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.switch-row__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  letter-spacing: 0.4px;
}

.switch-row__desc {
  color: var(--dimmer);
  font-size: 10.5px;
  line-height: 1.5;
}

.switch {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 20px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  background: rgba(var(--ink-rgb), 0.08);
  transition: background 0.25s ease, border-color 0.25s ease;
  pointer-events: none;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(var(--surface-rgb), 0.85);
  box-shadow: 0 1px 3px rgba(var(--shadow-rgb), 0.25);
  transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.switch input:checked + i {
  border-color: rgba(217, 130, 85, 0.7);
  background: rgba(217, 130, 85, 0.25);
}

.switch input:checked + i::after {
  background: var(--amber);
  transform: translateX(16px);
}

.switch input:disabled + i {
  opacity: 0.5;
}

/* 数据 */
.stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  margin-top: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(var(--ink-rgb), 0.12);
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.12);
}

.stats__item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border-right: 1px solid rgba(var(--ink-rgb), 0.12);
}

.stats__item:last-child {
  border-right: 0;
}

.stats__item strong {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.stats__item span {
  color: var(--dimmer);
  font-size: 10px;
  letter-spacing: 1px;
}

/* 在线状态：绿点表示已连接，断线时置灰，数字变化轻微淡入 */
.stats__item--online strong::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
  vertical-align: 2px;
}

.stats__item--online.is-offline strong {
  color: var(--dimmer);
}

.stats__item--online.is-offline span {
  color: var(--amber);
}

.stats__item--online.is-offline strong::before {
  background: rgba(var(--surface-rgb), 0.3);
  box-shadow: none;
}

.stats__item strong.is-bump {
  animation: stat-bump 0.32s ease;
}

@keyframes stat-bump {
  0% {
    opacity: 0.35;
    transform: translateY(-1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats__item strong.is-bump {
    animation: none;
  }
}

.lobby-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10px;
  letter-spacing: 0.5px;
}

.lobby-seo {
  flex: 0 0 100%;
  margin: 2px 0 0;
  max-width: 34em;
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0.2px;
  text-align: center;
}

.lobby-cities {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  margin-top: 4px;
}

.lobby-cities a {
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10px;
  text-decoration: none;
}

.lobby-cities a:hover {
  color: rgba(var(--ink-rgb), 0.68);
  text-decoration: underline;
}


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lobby-foot i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(var(--surface-rgb), 0.3);
}

.foot-share {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(var(--ink-rgb), 0.16);
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.55);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.foot-share svg {
  flex: none;
}

.foot-share:hover {
  color: rgba(var(--ink-rgb), 0.68);
  border-color: rgba(var(--ink-rgb), 0.37);
  background: rgba(176, 111, 29, 0.06);
}

.foot-share:active {
  transform: translateY(1px);
}

/* ---------- 聊天 ---------- */

#screen-chat {
  position: relative;
  gap: 10px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 12px;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.18);
}

/* 把「结束 / 举报 / 拉黑」收拢到右侧，窄屏更整齐 */
.chat-head .peer {
  margin-right: auto;
}

.peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.peer__body {
  min-width: 0;
}

.peer__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  letter-spacing: 0.4px;
}

.peer__name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 11px;
}

#peer-mode.is-typing {
  color: var(--amber);
  animation: typing-blink 1.4s ease-in-out infinite;
}

@keyframes typing-blink {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.sep {
  width: 1px;
  height: 9px;
  background: rgba(var(--surface-rgb), 0.22);
}

.messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scroll-padding-bottom: 14px;
  /* 聊天区做成白色卡片，和米色背景拉开层次 */
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(var(--surface-rgb), 0.94), rgba(var(--surface-rgb), 0.78));
  box-shadow: 0 10px 26px rgba(var(--shadow-rgb), 0.08), inset 0 1px 0 rgba(var(--surface-rgb), 0.9);
}

.messages::-webkit-scrollbar {
  width: 3px;
}

.messages::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(var(--surface-rgb), 0.16);
}

.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.68;
  word-break: break-word;
  white-space: pre-wrap;
  animation: bubble-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.msg--peer {
  align-self: flex-start;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(var(--shadow-rgb), 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.msg--me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--surface-2), #ffe1b5);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(var(--shadow-rgb), 0.06);
}

/* 同一人连续消息收紧间距，只保留最后一条的时间 */
.msg--grouped {
  margin-top: -6px;
}

.msg--time-hidden .msg__time {
  display: none;
}

/* 发送失败的气泡，点击可重发 */
.msg--failed {
  border: 1px dashed rgba(255, 159, 174, 0.55);
  background: rgba(255, 159, 174, 0.08);
  color: rgba(var(--ink-rgb), 0.68);
  cursor: pointer;
}

.msg__retry {
  display: block;
  margin-top: 3px;
  color: var(--danger);
  font-size: 10px;
  letter-spacing: 0.3px;
}

/* 对方已读标记 */
.msg__state {
  display: block;
  margin-top: 2px;
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-align: right;
}

.msg__time {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  opacity: 0.75;
  text-align: right;
}

.sys {
  align-self: center;
  max-width: 88%;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 11px;
  letter-spacing: 0.4px;
  text-align: center;
}

/* 上翻历史时的新消息提示 */
.msg-jump {
  position: absolute;
  left: 50%;
  bottom: 152px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 13px;
  border: 1px solid rgba(176, 111, 29, 0.36);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.96);
  color: var(--amber-deep);
  box-shadow: 0 6px 16px rgba(var(--shadow-rgb), 0.14);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.6px;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.msg-jump.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn--img {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--surface-rgb), 0.84);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.btn--img:hover {
  border-color: rgba(217, 130, 85, 0.55);
}

.msg__img {
  display: block;
  max-width: 220px;
  max-height: 260px;
  border-radius: 10px;
  cursor: zoom-in;
}

/* 图片点击后的全屏预览，避免移动端 window.open 被拦截 */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(var(--surface-rgb), 0.95);
  cursor: zoom-out;
  animation: viewer-in 0.16s ease;
}

.img-viewer img {
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 10px;
  object-fit: contain;
}

@keyframes viewer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 大厅功能入口：两列卡片，比整行胶囊更紧凑 */
.lobby-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.72);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  border-color: rgba(217, 130, 85, 0.5);
  background: rgba(217, 130, 85, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(var(--shadow-rgb), 0.10);
}

.tool-card__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(217, 130, 85, 0.12);
  color: var(--amber, #ffcf87);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover .tool-card__icon {
  background: rgba(217, 130, 85, 0.2);
  box-shadow: 0 0 14px rgba(196, 99, 58, 0.25);
}

.tool-card.is-done {
  opacity: 0.62;
}

.tool-card--wide {
  grid-column: 1 / -1;
}

.tool-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tool-card__text strong {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text);
}

.tool-card__text small {
  overflow: hidden;
  font-size: 10.5px;
  color: var(--dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lottery-prizes {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.lottery-prize {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.lottery-prize:last-child {
  border-bottom: 0;
}

.lottery-pay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 12px;
  border: 1px dashed rgba(217, 130, 85, 0.35);
  border-radius: 10px;
}

.lottery-pay img {
  width: 168px;
  height: 168px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.lottery-pay__line {
  margin: 0;
  font-size: 12.5px;
  color: var(--dim);
}

.lottery-pay__line strong {
  color: var(--gold, #ffcf87);
}

.lottery-pay__hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--dim);
  text-align: center;
}

.lottery-ticket {
  margin: 10px 0;
  font-size: 13px;
  color: var(--dim);
}

.lottery-ticket strong {
  color: var(--gold, #ffcf87);
  font-size: 16px;
}

.lottery-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 6px;
}

.lottery-actions .btn {
  flex: 1;
}

.lottery-result {
  margin: 10px 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(217, 130, 85, 0.4);
  background: rgba(217, 130, 85, 0.1);
  text-align: center;
}

.lottery-result strong {
  display: block;
  font-size: 16px;
  color: var(--gold, #ffcf87);
  margin-bottom: 4px;
}

.lottery-result span {
  font-size: 12px;
  color: var(--dim);
}

.chat-notice {
  margin: 0 12px 6px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(var(--ink-rgb), 0.55);
  text-align: center;
}

.chat-notice summary {
  display: inline-block;
  color: rgba(var(--ink-rgb), 0.55);
  list-style: none;
  cursor: pointer;
}

.chat-notice summary::-webkit-details-marker { display: none; }

.chat-notice summary::after {
  content: ' · 查看';
  color: rgba(217, 130, 85, 0.6);
}

.chat-notice[open] summary::after {
  content: ' · 收起';
  color: rgba(217, 130, 85, 0.6);
}

.chat-notice p {
  margin: 4px 0 0;
  text-align: left;
}

.composer input {
  flex: 1;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--surface-rgb), 0.84);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.composer input::placeholder {
  color: rgba(var(--ink-rgb), 0.58);
}

.composer input:focus {
  border-color: rgba(217, 130, 85, 0.55);
  background: rgba(var(--surface-rgb), 0.95);
}

.btn--send {
  height: 44px;
  padding: 0 16px;
  background: linear-gradient(135deg, #ffe3b6, #ffc182);
  color: var(--ink);
  letter-spacing: 1px;
}

.chat-note {
  margin: 0;
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-align: center;
}

/* ---------- 弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(var(--ink-rgb), 0.42);
  backdrop-filter: blur(3px);
  animation: fade 0.25s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffaf2;
  box-shadow: var(--shadow);
  animation: sheet-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.modal__panel h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
}

.modal__desc {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.7;
}

.perks {
  margin: 0 0 16px;
  padding: 11px 14px 11px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(176, 111, 29, 0.06);
  color: rgba(var(--ink-rgb), 0.68);
  font-size: 12px;
  line-height: 2;
}

.perks li::marker {
  color: var(--amber);
}

.vip-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(176, 111, 29, 0.06);
}

.vip-tab {
  flex: 1;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.55);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.vip-tab:hover {
  color: var(--amber-deep);
}

.vip-tab.is-active {
  background: rgba(217, 130, 85, 0.14);
  color: var(--amber);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.plan-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(176, 111, 29, 0.06);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.plan-card:hover {
  border-color: rgba(217, 130, 85, 0.55);
  background: rgba(217, 130, 85, 0.08);
}

.plan-card:disabled {
  opacity: 0.45;
  cursor: wait;
}

.plan-card__days {
  color: rgba(var(--ink-rgb), 0.68);
  font-size: 12px;
}

.plan-card__price {
  margin-top: 3px;
  color: var(--amber);
  font-size: 14px;
  font-weight: 500;
}

.plan-card__price small {
  margin-left: 4px;
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10px;
  font-weight: 400;
}

/* 新用户首充「充多少送多少」 */
.first-recharge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(217, 130, 85, 0.4);
  border-radius: 8px;
  background: rgba(217, 130, 85, 0.1);
  color: var(--amber);
  font-size: 12px;
}

.first-recharge strong {
  font-weight: 600;
}

.first-recharge span {
  color: var(--dim);
}

.plan-card__bonus {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-size: 10.5px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.history-empty {
  margin: 6px 0;
  padding: 22px 10px;
  text-align: center;
  color: var(--dimmer);
  font-size: 12px;
}

.history-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(176, 111, 29, 0.06);
}

.history-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.history-item__label {
  color: rgba(var(--ink-rgb), 0.68);
}

.history-item__amount {
  color: var(--amber);
}

.history-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--dimmer);
  font-size: 10.5px;
}

.history-item__status.is-paid {
  color: #8fe0b0;
}

.history-item__code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.history-item__code span {
  color: var(--text);
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.history-item__code .btn {
  margin-left: auto;
}

.pay-result {
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(143, 224, 176, 0.35);
  border-radius: 6px;
  background: rgba(143, 224, 176, 0.07);
}

.pay-result__title {
  color: #8fe0b0;
  font-size: 12px;
}

.pay-result__code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.pay-result__code-text {
  color: var(--text);
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  letter-spacing: 1px;
}

.pay-result__hint {
  margin: 6px 0 0;
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 10.5px;
}

.pay-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 10px auto 4px;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

/* 个人收款码流程 */
.pay-result__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.manual-amount {
  color: var(--amber);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pay-result__plan {
  margin: 2px 0 0;
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 11.5px;
  letter-spacing: 0.3px;
}

.pay-steps {
  margin: 12px 0 0;
  padding-left: 17px;
  color: rgba(var(--ink-rgb), 0.68);
  font-size: 11.5px;
  line-height: 1.95;
}

.pay-steps li::marker {
  color: var(--amber);
}

.manual-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(217, 130, 85, 0.28);
  border-radius: 6px;
  background: rgba(217, 130, 85, 0.06);
  color: rgba(255, 232, 198, 0.92);
  font-size: 11.5px;
}

.manual-status__dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1.8s infinite;
}

.manual-status__time {
  margin-left: auto;
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.manual-status.is-warn {
  border-color: rgba(255, 159, 174, 0.35);
  background: rgba(255, 159, 174, 0.07);
  color: var(--danger);
}

.manual-status.is-warn .manual-status__dot {
  background: var(--danger);
  animation: none;
}

.manual-actions {
  display: flex;
  margin-top: 10px;
}

.manual-actions .btn {
  flex: 1;
  height: 36px;
}

/* 个人收款：付款单号填写 */
.manual-note {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.manual-note input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(176, 111, 29, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.manual-note input:focus {
  border-color: rgba(217, 130, 85, 0.5);
}

.manual-note .btn {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
}

.manual-note.is-done input {
  color: rgba(var(--ink-rgb), 0.62);
  border-color: rgba(143, 224, 176, 0.45);
}

.mono {
  font-family: 'SFMono-Regular', Consolas, monospace;
  letter-spacing: 0.4px;
}

.pay-summary {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(176, 111, 29, 0.06);
}

.pay-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  color: var(--dim);
  font-size: 12px;
}

.pay-summary__row strong {
  color: rgba(var(--ink-rgb), 0.68);
  font-weight: 500;
}

.pay-summary__amount {
  color: var(--amber) !important;
  font-size: 16px;
}

.pay-channel {
  margin-top: 10px;
}

.pay-channel__label {
  display: block;
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 11.5px;
}

.pay-channel__options {
  display: flex;
  gap: 8px;
}

.pay-channel__item {
  flex: 1;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(176, 111, 29, 0.06);
  color: rgba(var(--ink-rgb), 0.68);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.pay-channel__item:hover {
  color: var(--amber-deep);
  border-color: rgba(var(--ink-rgb), 0.37);
}

.pay-channel__item.is-active {
  border-color: rgba(217, 130, 85, 0.55);
  background: rgba(217, 130, 85, 0.1);
  color: var(--amber);
}

.pay-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.pay-actions .btn {
  flex: 1;
  height: 40px;
}

.btn--sm {
  height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.vip-form {
  display: flex;
  gap: 8px;
}

.vip-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(176, 111, 29, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.6px;
  outline: none;
}

#vip-code {
  text-transform: uppercase;
}

.vip-form input:focus {
  border-color: rgba(217, 130, 85, 0.5);
}

.btn--gold {
  height: 42px;
  padding: 0 18px;
  background: linear-gradient(135deg, #ffe3b6, #ffc182);
  color: var(--ink);
  font-weight: 600;
}

.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(192, 57, 43, 0.32);
}

.form-msg {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 11.5px;
}

.name-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10.5px;
  letter-spacing: 0.3px;
}

.name-meta span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.name-meta.is-limit span:last-child {
  color: var(--amber);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vip-status {
  margin: 4px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(217, 130, 85, 0.3);
  border-radius: var(--radius);
  background: rgba(217, 130, 85, 0.08);
  color: var(--amber);
  font-size: 12px;
}

.vip-display {
  margin-top: 10px;
  background: rgba(176, 111, 29, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal__tip {
  margin: 12px 0 0;
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 10.5px;
  line-height: 1.7;
}

.city-custom {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.city-custom input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(176, 111, 29, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.city-custom input:focus {
  border-color: rgba(217, 130, 85, 0.55);
}

.city-custom .btn {
  height: 38px;
  padding: 0 16px;
  flex: 0 0 auto;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
}

.city-chip {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(176, 111, 29, 0.06);
  color: rgba(var(--ink-rgb), 0.68);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.city-chip:hover {
  border-color: var(--line-strong);
  background: rgba(176, 111, 29, 0.08);
}

.city-chip.is-current {
  border-color: rgba(217, 130, 85, 0.7);
  background: rgba(217, 130, 85, 0.12);
  color: var(--amber);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(34px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(86vw, 340px);
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 250, 242, 0.97);
  color: rgba(var(--ink-rgb), 0.72);
  font-size: 12px;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

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

/* ---------- 大屏 ---------- */

@media (min-width: 720px) {
  .app {
    height: 94dvh;
    margin-top: 3dvh;
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* ---------- 移动端 H5 ---------- */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overscroll-behavior: none;
}

/* 兼容不支持 dvh 的旧内核 */
.app {
  height: 100vh;
  height: 100dvh;
}

/* 小屏输入框保持 16px，避免 iOS 聚焦时自动放大 */
@media (max-width: 640px) {
  /* 软键盘弹出时按可视高度收缩，避免输入框被遮挡 */
  .app {
    height: var(--app-height, 100dvh);
  }

  .composer input,
  .vip-form input,
  .pay-form input,
  .pay-form select,
  .login input,
  .toolbar input,
  .toolbar select,
  .notify-row input,
  .field input,
  .field select {
    font-size: 16px;
  }
}

/* 手机端软键盘打开：收起非必要区域，固定页面并收紧底部留白，让输入框贴近键盘 */
@media (max-width: 820px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  html.kb-open #screen-chat {
    gap: 6px;
  }

  html.kb-open #screen-chat .quick-bar,
  html.kb-open #screen-chat .chat-notice,
  html.kb-open #screen-chat .chat-note,
  html.kb-open #screen-chat .emoji-panel {
    display: none !important;
  }

  /* 键盘打开时把页面固定在可视区域，避免浏览器滚动整页导致输入区跑到屏幕上方 */
  html.kb-open .app {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    margin: 0 auto;
    height: var(--app-height, 100dvh);
    padding-bottom: 6px;
  }
}

@media (max-width: 560px) {
  .app {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 弹窗改为底部抽屉，贴合手机操作习惯 */
  .modal {
    padding: 0;
  }

  .modal__panel {
    max-width: 100%;
    /* 软键盘弹出时按可视高度收缩，避免输入框被键盘遮挡 */
    max-height: calc(var(--app-height, 92dvh) - 12px);
    padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }

  /* 软键盘弹出时把弹窗容器收缩到可视区域，面板始终贴在键盘上方 */
  html.kb-open .modal {
    bottom: auto;
    height: var(--app-height, 100dvh);
  }

  html.kb-open .modal__panel {
    max-height: 100%;
    padding-bottom: 12px;
  }

  /* iOS 在字号小于 16px 时聚焦会自动放大页面，统一放大到 16px 避免跳动 */
  .vip-form input,
  .field input {
    font-size: 16px;
  }

  .modal__close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
  }

  .vip-tab {
    height: 40px;
    font-size: 13px;
  }

  .plan-card {
    padding: 12px;
  }

  .btn {
    min-height: 44px;
  }

  .btn--sm {
    min-height: 30px;
    height: 30px;
  }

  .pay-qr {
    width: 200px;
    height: 200px;
  }

  .toast {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* 横屏小高度：弹窗居中，避免抽屉占满 */
@media (max-height: 520px) and (orientation: landscape) {
  .modal {
    align-items: center;
    padding: 10px;
  }

  .modal__panel {
    max-height: 94dvh;
    border-radius: 10px;
  }

  .lobby-body {
    justify-content: flex-start;
  }
}

/* 尊重系统「减弱动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- 广场动态 ---------------- */

.tool-card {
  position: relative;
}

.tool-card__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--amber-deep, #8d4813);
  color: #fff8ea;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.modal__panel--wide {
  max-width: 880px;
  max-height: min(88vh, 820px);
}

.modal__panel--dm {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 640px);
}

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

.plaza-head .modal__desc {
  margin-bottom: 0;
}

.plaza-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  align-items: start;
}

.plaza-main {
  min-width: 0;
}

.plaza-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(176, 111, 29, 0.06);
}

.plaza-form textarea {
  width: 100%;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.70);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.plaza-form textarea:focus {
  outline: none;
  border-color: rgba(217, 130, 85, 0.55);
}

.plaza-form__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.plaza-upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.plaza-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.plaza-previews:empty {
  display: none;
}

.plaza-preview {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.plaza-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plaza-preview button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--surface-rgb), 0.95);
  color: #5a4628;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

.plaza-login-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--dim);
  font-size: 12px;
}

.plaza-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.plaza-post {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.68);
}

.plaza-post.is-highlight {
  border-color: rgba(217, 130, 85, 0.65);
  box-shadow: 0 0 0 1px rgba(217, 130, 85, 0.25);
}

.plaza-post__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.plaza-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(217, 130, 85, 0.16);
  color: var(--amber, #ffcf87);
  font-size: 13px;
  font-weight: 600;
}

.plaza-post__name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
}

.plaza-post__time {
  color: var(--dimmer);
  font-size: 10.5px;
}

.plaza-post__text {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.plaza-post__images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.plaza-post__images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  background: rgba(176, 111, 29, 0.06);
}

.plaza-post__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(var(--ink-rgb), 0.12);
}

.plaza-post__actions .btn {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
}

.plaza-comments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.plaza-comment {
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(176, 111, 29, 0.06);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.plaza-comment strong {
  color: var(--amber, #ffcf87);
  font-weight: 500;
}

.plaza-comment__time {
  margin-left: 6px;
  color: var(--dimmer);
  font-size: 10px;
}

.plaza-comment-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.plaza-comment-form input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(var(--surface-rgb), 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
}

/* 广场分栏：动态与消息分开，消息带未读角标 */
.plaza-tabs {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(var(--surface-rgb), 0.68);
}

.plaza-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.plaza-tab:hover {
  color: var(--text);
  background: rgba(176, 111, 29, 0.06);
}

.plaza-tab.is-active {
  background: rgba(217, 130, 85, 0.28);
  color: var(--amber-deep);
}

.plaza-tab .tag {
  margin-left: 2px;
}

.plaza-pane {
  min-height: 0;
}

.plaza-pane.hidden {
  display: none;
}

.plaza-messages__hint {
  margin: 0 0 8px;
  color: var(--dimmer);
  font-size: 11.5px;
  line-height: 1.6;
}

.plaza-messages .plaza-activity {
  margin-top: 0;
  gap: 6px;
}

.plaza-messages .plaza-activity__item {
  padding: 10px;
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 9px;
  background: rgba(176, 111, 29, 0.06);
}

.plaza-messages .plaza-activity__item.is-unread {
  border-color: rgba(217, 130, 85, 0.4);
}

.plaza-side {
  position: sticky;
  top: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.66);
  padding: 10px;
  max-height: 560px;
  overflow-y: auto;
}

.plaza-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.12);
  font-size: 12.5px;
}

.plaza-activity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.plaza-activity__item {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.plaza-activity__item:hover {
  background: rgba(176, 111, 29, 0.06);
}

.plaza-activity__item .dim {
  display: block;
  color: var(--dimmer);
  font-size: 10px;
  margin-top: 2px;
}

.plaza-activity__item.is-unread {
  background: rgba(217, 130, 85, 0.09);
}

.dm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-right: 26px;
}

.dm-head h3 {
  margin: 0 0 8px;
}

.dm-messages {
  flex: 1;
  min-height: 160px;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 2px;
}

.dm-bubble {
  max-width: 82%;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(176, 111, 29, 0.08);
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-word;
  align-self: flex-start;
}

.dm-bubble.is-mine {
  align-self: flex-end;
  background: rgba(217, 130, 85, 0.34);
  color: var(--ink);
}

.dm-bubble__time {
  display: block;
  margin-top: 3px;
  color: var(--dimmer);
  font-size: 9.5px;
}

.dm-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.dm-upload {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 10px;
  cursor: pointer;
}

.dm-bubble--image {
  padding: 5px;
  background: rgba(176, 111, 29, 0.08);
}

.dm-bubble--image.is-mine {
  background: rgba(217, 130, 85, 0.16);
}

.dm-bubble--image img {
  display: block;
  width: min(180px, 58vw);
  max-width: 100%;
  border-radius: 8px;
  cursor: zoom-in;
}

.dm-bubble--image .dm-bubble__time {
  padding: 2px 4px 0;
}

.dm-form input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

/* 广场独立页面：覆盖在应用之上，带返回按钮 */
#screen-plaza {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* 跟随可视视口收缩，软键盘弹出时输入区始终可见 */
  height: var(--app-height, 100dvh);
  z-index: 6;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  flex: none;
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, #fbf6ec 0%, #f3e9da 100%);
}

#screen-plaza.screen--active {
  display: flex;
  flex-direction: column;
}

/* 我的中心独立页面：与广场一致使用固定定位，避免内容高度塌陷 */
#screen-me {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-height, 100dvh);
  z-index: 6;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  flex: none;
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, #fbf6ec 0%, #f3e9da 100%);
}

#screen-me.screen--active {
  display: flex;
  flex-direction: column;
}

.plaza-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.plaza-page__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-bottom: 10px;
}

.plaza-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.plaza-page__title {
  flex: 1;
  min-width: 0;
}

.plaza-page__title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}

.plaza-page__title p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plaza-page__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.plaza-page__body::-webkit-scrollbar {
  display: none;
}

#screen-plaza .plaza-grid {
  grid-template-columns: 1fr;
}

#screen-plaza .plaza-side {
  position: static;
  order: -1;
  max-height: 180px;
}

@media (max-width: 720px) {
  .plaza-grid {
    grid-template-columns: 1fr;
  }

  /* 手机端：输入区优先，动态消息放在动态列表之后 */
  #screen-plaza {
    padding-left: 14px;
    padding-right: 14px;
  }

  #screen-plaza .plaza-page__head {
    padding-bottom: 8px;
  }

  .plaza-tabs {
    margin-bottom: 8px;
  }

  .plaza-tab {
    min-height: 32px;
    font-size: 12.5px;
  }

  #screen-plaza .plaza-page__title h3 {
    font-size: 16px;
  }

  #screen-plaza .plaza-page__title p {
    display: none;
  }

  #screen-plaza .plaza-form {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px;
    background: #fbf5eb;
  }

  /* 评论时键盘弹出：发布框不再吸顶，避免占满可视区把评论输入框挤到键盘后面 */
  html.kb-open #screen-plaza .plaza-form {
    position: static;
  }

  #screen-plaza .plaza-comment-form input {
    scroll-margin-block: 72px;
  }

  /* iOS 聚焦小于 16px 的输入框会自动放大页面，统一为 16px */
  #screen-plaza .plaza-form textarea,
  #screen-plaza .plaza-comment-form input,
  .dm-form input {
    font-size: 16px;
    line-height: 1.5;
  }

  #screen-plaza .plaza-form textarea {
    min-height: 58px;
    padding: 8px 10px;
  }

  #btn-plaza-post {
    margin-left: auto;
  }

  #screen-plaza .plaza-form {
    border-color: rgba(217, 130, 85, 0.35);
    box-shadow: 0 6px 18px rgba(var(--shadow-rgb), 0.13);
  }

  #screen-plaza .plaza-feed {
    gap: 8px;
  }

  #screen-plaza .plaza-post {
    padding: 10px;
  }

  #screen-plaza .plaza-post__text {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.65;
  }

  #screen-plaza .plaza-post__actions {
    gap: 6px;
  }

  #screen-plaza .plaza-side {
    position: static;
    order: 2;
    max-height: 150px;
  }

  /* 键盘弹出时隐藏动态消息，给输入与动态列表留空间 */
  html.kb-open #screen-plaza .plaza-side {
    display: none;
  }

  html.kb-open #screen-plaza .plaza-page__head {
    padding-bottom: 4px;
  }

  .modal__panel--wide {
    max-width: 100%;
  }

  .plaza-post__images {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ---------- 账号 ---------- */
.account-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 2px 0 10px;
  font-size: 11.5px;
  color: rgba(var(--ink-rgb), 0.55);
}

.account-chip {
  padding: 2px 9px;
  border: 1px solid rgba(217, 130, 85, 0.4);
  border-radius: 999px;
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.3px;
}

.account-id {
  padding: 2px 8px;
  border: 1px dashed rgba(var(--ink-rgb), 0.25);
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.62);
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.account-id:hover {
  color: var(--amber);
  border-color: rgba(217, 130, 85, 0.45);
}

.gender-switch {
  font-size: 10.5px;
  white-space: nowrap;
}

.account-bar__tip {
  color: rgba(var(--ink-rgb), 0.55);
  font-size: 10.5px;
}

/* 未登录时把登录入口做成清晰的小胶囊，避免淹没在辅助文字里 */
#btn-account {
  padding: 3px 10px;
  border: 1px solid rgba(217, 130, 85, 0.35);
  border-radius: 999px;
  color: var(--amber);
  transition: border-color 0.18s ease, background 0.18s ease;
}

#btn-account:hover {
  border-color: rgba(217, 130, 85, 0.65);
  background: rgba(217, 130, 85, 0.1);
}

.auth-form {
  flex-direction: column;
}

.auth-form input {
  flex: 0 0 auto;
  width: 100%;
}

.auth-form .btn {
  flex: 0 0 auto;
  width: 100%;
}
/* ---------- 公告 / 维护 / 邀请 / 举报拉黑 ---------- */
.site-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(217, 130, 85, 0.35);
  border-radius: 8px;
  background: rgba(217, 130, 85, 0.08);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
}

.site-notice span { flex: 1; }

.site-notice button {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.maintenance-mask {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(247, 241, 230, 0.94);
  backdrop-filter: blur(6px);
}

.maintenance-card {
  max-width: 340px;
  padding: 26px 22px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(176, 111, 29, 0.06);
}

.maintenance-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--amber);
}

.maintenance-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--dim);
}

.invite-code {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px dashed rgba(217, 130, 85, 0.4);
  border-radius: 10px;
}

.invite-code span {
  flex: 1;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--amber);
}

.chat-head__actions {
  display: flex;
  gap: 4px;
  margin-left: 0;
}

.btn--sm {
  padding: 5px 9px;
  font-size: 11px;
}

.msg__recall {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 10.5px;
  text-decoration: underline;
  cursor: pointer;
}

/* 桌面端悬停才显示撤回，减少消息气泡干扰；触屏设备保持常显 */
@media (hover: hover) {
  .msg__recall {
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .msg--me:hover .msg__recall,
  .msg__recall:focus-visible {
    opacity: 1;
  }
}

.msg__recalled {
  color: var(--dim);
  font-size: 12px;
  font-style: italic;
}
/* ---------- 签到 / 反馈 / 快捷短语 / 推广链接 ---------- */
.invite-link {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.invite-link input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(176, 111, 29, 0.06);
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

#feedback-form select,
#feedback-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(176, 111, 29, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

#feedback-form select {
  height: 42px;
  padding: 0 12px;
}

#feedback-form textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

#feedback-form select:focus,
#feedback-form textarea:focus {
  border-color: rgba(217, 130, 85, 0.5);
}

#feedback-form select option {
  background: var(--panel-solid);
  color: var(--text);
}

.quick-bar {
  display: flex;
  gap: 6px;
  margin: 0 12px 6px;
  padding: 2px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-bar::-webkit-scrollbar { display: none; }

.quick-chip {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--surface-rgb), 0.74);
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.quick-chip:hover {
  border-color: rgba(217, 130, 85, 0.45);
  color: var(--amber);
}

/* ---------- 表情面板 ---------- */
.emoji-panel {
  margin: 0 12px 8px;
  padding: 8px 8px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(var(--surface-rgb), 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.emoji-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.emoji-tabs::-webkit-scrollbar { display: none; }

.emoji-tab {
  flex: 0 0 auto;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.emoji-tab:hover { color: var(--amber); }

.emoji-tab.is-active {
  border-color: rgba(217, 130, 85, 0.45);
  background: rgba(217, 130, 85, 0.12);
  color: var(--amber);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  max-height: 176px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.emoji-item:hover { background: rgba(217, 130, 85, 0.14); }
.emoji-item:active { transform: scale(0.9); }

@media (max-width: 380px) {
  .btn--img {
    width: 40px;
    height: 40px;
  }

  .btn--send {
    padding: 0 12px;
  }

  .emoji-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #feedback-form select,
  #feedback-form textarea {
    font-size: 16px;
  }
}

/* ---------------- 语音消息 ---------------- */

.msg__voice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 118px;
}

.msg__voice-play {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(176, 111, 29, 0.14);
  color: inherit;
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.msg--peer .msg__voice-play {
  background: rgba(217, 130, 85, 0.18);
  color: var(--amber);
}

.msg__voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 22px;
}

.msg__voice-wave i {
  display: block;
  width: 2.5px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.55;
}

.msg__voice-wave i:nth-child(3n) { height: 15px; }
.msg__voice-wave i:nth-child(2n) { height: 11px; }
.msg__voice-wave i:nth-child(4n) { height: 18px; }

.msg__voice.is-playing .msg__voice-wave i {
  animation: voice-wave 0.9s ease-in-out infinite;
}

.msg__voice-wave i:nth-child(2) { animation-delay: 0.08s; }
.msg__voice-wave i:nth-child(3) { animation-delay: 0.16s; }
.msg__voice-wave i:nth-child(4) { animation-delay: 0.24s; }
.msg__voice-wave i:nth-child(5) { animation-delay: 0.32s; }
.msg__voice-wave i:nth-child(6) { animation-delay: 0.4s; }
.msg__voice-wave i:nth-child(7) { animation-delay: 0.48s; }
.msg__voice-wave i:nth-child(8) { animation-delay: 0.56s; }
.msg__voice-wave i:nth-child(9) { animation-delay: 0.64s; }
.msg__voice-wave i:nth-child(10) { animation-delay: 0.72s; }
.msg__voice-wave i:nth-child(11) { animation-delay: 0.8s; }
.msg__voice-wave i:nth-child(12) { animation-delay: 0.88s; }

@keyframes voice-wave {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1.15); }
}

.msg__voice-dur {
  font-size: 11px;
  opacity: 0.78;
}

.voice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 120, 90, 0.35);
  border-radius: 10px;
  background: rgba(255, 90, 60, 0.08);
  color: var(--text);
  font-size: 12px;
}

.voice-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b52;
  animation: voice-dot 1s ease-in-out infinite;
}

.voice-bar__text {
  font-variant-numeric: tabular-nums;
}

.voice-bar__hint {
  flex: 1;
  color: var(--dim);
  font-size: 10.5px;
}

.voice-bar .btn {
  height: 26px;
}

@keyframes voice-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.btn--img.is-recording {
  border-color: rgba(255, 120, 90, 0.7);
  background: rgba(255, 90, 60, 0.16);
  color: var(--danger);
}

/* ---------------- 每日任务 ---------------- */

.task-boost {
  margin: 8px 0 0;
  padding: 7px 10px;
  border: 1px solid rgba(196, 99, 58, 0.35);
  border-radius: 9px;
  background: rgba(196, 99, 58, 0.1);
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.2px;
}

.task-list {
  margin: 10px 0 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.task-row--weekly .task-row__body strong {
  color: var(--amber-deep);
}

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.task-row:last-child {
  border-bottom: 0;
}

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

.task-row__body strong {
  font-size: 13px;
  font-weight: 500;
}

.task-row__body small {
  font-size: 10.5px;
  color: var(--dim);
}

.task-row__points {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.task-row.is-done .task-row__body strong {
  color: var(--amber);
}

.task-row.is-claimed {
  opacity: 0.55;
}

.task-row .btn {
  flex: 0 0 auto;
}

/* ---------------- 积分商城 ---------------- */

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

.shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.70);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.shop-item:hover {
  border-color: rgba(217, 130, 85, 0.55);
  background: rgba(217, 130, 85, 0.08);
}

.shop-item strong {
  font-size: 13px;
  color: var(--amber);
}

.shop-item span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  color: var(--dim);
}

.shop-item__tag {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(196, 99, 58, 0.16);
  color: var(--amber);
  font-style: normal;
  font-size: 9px;
}

/* ---------------- 邀请海报 ---------------- */

.btn--block {
  width: 100%;
  margin-top: 10px;
}

.modal__panel--poster {
  max-width: 340px;
}

.poster-preview {
  width: 100%;
  max-width: 260px;
  margin: 10px auto 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(var(--shadow-rgb), 0.14);
}

.poster-preview canvas {
  display: block;
  width: 100%;
  height: auto;
}

.poster-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.poster-actions .btn {
  flex: 1;
}


/* ---------------- 我的中心 ---------------- */

.me-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: 8px;
  scrollbar-width: none;
}

/* 子区块按内容高度排列，避免被 flex 压缩后裁切导致整页无法滚动 */
.me-page > * {
  flex: 0 0 auto;
}

.me-page::-webkit-scrollbar { display: none; }

.me-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-bottom: 10px;
}

.me-head h3 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
}

.me-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(217, 130, 85, 0.24);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(217, 130, 85, 0.1), rgba(var(--surface-rgb), 0.02));
}

.me-avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe3b6, #ffc182);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.me-profile__body {
  flex: 1;
  min-width: 0;
}

.me-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}

.me-id {
  margin-top: 3px;
  color: var(--dim);
  font-size: 11px;
}

.me-gold {
  margin-top: 2px;
  color: var(--amber-deep);
  font-size: 10.5px;
  letter-spacing: 0.2px;
}

.me-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.me-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.67);
}

.me-stat strong {
  color: var(--amber);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.me-stat span {
  color: var(--dim);
  font-size: 10.5px;
}

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

.me-action {
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.66);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.me-action:hover {
  border-color: rgba(217, 130, 85, 0.5);
  background: rgba(217, 130, 85, 0.08);
}

.me-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.62);
  overflow: hidden;
}

.me-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.me-history {
  max-height: 300px;
  overflow-y: auto;
}

.me-history__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.12);
  font-size: 12px;
}

.me-history__row:last-child { border-bottom: 0; }

.me-history__reason {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-history__time {
  flex: 0 0 auto;
  color: var(--dimmer);
  font-size: 10px;
}

.me-history__delta {
  flex: 0 0 auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.me-history__delta.is-plus { color: #7ed6a5; }
.me-history__delta.is-minus { color: var(--danger); }

.me-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
}

.tool-card--me {
  border-color: rgba(176, 111, 29, 0.32);
  background: linear-gradient(135deg, rgba(217, 130, 85, 0.28), rgba(var(--surface-rgb), 0.6));
}

/* ---------------- 广场排序 / 点赞 / 消息筛选 ---------------- */

.plaza-sort {
  display: flex;
  gap: 6px;
  margin: 8px 0 10px;
}

.plaza-sort__item {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.plaza-sort__item.is-active {
  border-color: rgba(217, 130, 85, 0.55);
  background: rgba(217, 130, 85, 0.12);
  color: var(--amber);
}

.plaza-like { color: var(--dim); }

.plaza-like.is-liked {
  border-color: rgba(255, 142, 158, 0.45);
  background: rgba(255, 142, 158, 0.1);
  color: var(--danger);
}

.plaza-filters {
  display: flex;
  gap: 6px;
  margin: 8px 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.plaza-filters::-webkit-scrollbar { display: none; }

.plaza-filter {
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.plaza-filter em {
  margin-left: 3px;
  color: var(--amber);
  font-style: normal;
  font-size: 10px;
}

.plaza-filter.is-active {
  border-color: rgba(217, 130, 85, 0.55);
  background: rgba(217, 130, 85, 0.12);
  color: var(--amber);
}

/* 消息栏条目：图标 + 标题 + 摘要 + 时间 */
.plaza-messages .plaza-activity { gap: 8px; }

.plaza-activity__day {
  margin: 6px 2px 0;
  color: var(--dimmer);
  font-size: 10.5px;
  letter-spacing: 0.5px;
}

.plaza-messages .plaza-activity__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
}

.plaza-activity__icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(217, 130, 85, 0.12);
  color: var(--amber);
  font-size: 11px;
}

.plaza-activity__icon--dm {
  background: rgba(126, 179, 214, 0.14);
  color: #9fc8e4;
}

.plaza-activity__icon--like {
  background: rgba(255, 142, 158, 0.14);
  color: var(--danger);
}

.plaza-activity__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plaza-activity__body strong {
  font-size: 12px;
  font-weight: 500;
}

.plaza-activity__snippet {
  overflow: hidden;
  color: var(--dim);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plaza-activity__time {
  flex: 0 0 auto;
  align-self: flex-start;
  color: var(--dimmer);
  font-size: 10px;
}

.plaza-activity__empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
}

.plaza-activity__hint {
  padding: 8px 2px 4px;
  color: var(--dimmer);
  font-size: 10.5px;
}

.plaza-mine-posts {
  margin: 6px 0 4px;
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 12px;
  background: rgba(176, 111, 29, 0.06);
  overflow: hidden;
}

.plaza-mine-posts .me-post:first-child { border-top: 0; }

/* ---------------- 聊天界面细节 ---------------- */

.msg-divider {
  align-self: center;
  margin: 10px 0 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(176, 111, 29, 0.08);
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 10px;
  letter-spacing: 0.4px;
}

.msg__who {
  display: block;
  margin-bottom: 3px;
  color: rgba(var(--ink-rgb), 0.62);
  font-size: 10px;
  letter-spacing: 0.3px;
}

.msg--peer { border-radius: 12px 12px 12px 4px; }
.msg--me { border-radius: 12px 12px 4px 12px; }

/* ---------------- 广场搜索 / 话题 / 置顶 ---------------- */

.plaza-search {
  display: flex;
  gap: 8px;
  margin: 8px 0 0;
}

.plaza-search input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(var(--surface-rgb), 0.77);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  /* 去掉搜索框原生清除按钮，避免输入时宽度与比例跳动 */
  -webkit-appearance: none;
  appearance: none;
}

.plaza-search input::-webkit-search-cancel-button { display: none; }

.plaza-search .btn { flex: 0 0 auto; }

.plaza-search input:focus { border-color: rgba(217, 130, 85, 0.5); }

.plaza-topics {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.plaza-topics::-webkit-scrollbar { display: none; }

.plaza-topic {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.plaza-topic em {
  margin-left: 4px;
  color: var(--amber);
  font-style: normal;
  font-size: 9.5px;
}

.plaza-topic.is-active {
  border-color: rgba(217, 130, 85, 0.55);
  background: rgba(217, 130, 85, 0.12);
  color: var(--amber);
}

.plaza-post__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.plaza-topic-chip {
  padding: 2px 8px;
  border: 1px solid rgba(217, 130, 85, 0.28);
  border-radius: 999px;
  background: rgba(217, 130, 85, 0.08);
  color: var(--amber);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
}

.plaza-post__city {
  color: var(--dimmer);
  font-size: 10.5px;
}

.plaza-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.plaza-tags--filter {
  margin: 6px 0 10px;
}

.plaza-post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.plaza-tag {
  padding: 3px 10px;
  border: 1px solid rgba(var(--ink-rgb), 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.plaza-tag.is-active {
  border-color: rgba(217, 130, 85, 0.5);
  background: rgba(217, 130, 85, 0.14);
  color: var(--amber);
}

.plaza-pin {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(196, 99, 58, 0.18);
  color: var(--amber-deep);
  font-size: 9.5px;
}

.is-gold {
  font-weight: 700;
  /* 兜底色：不支持渐变文字的浏览器仍显示金色 */
  color: var(--amber-deep);
  background-image: linear-gradient(92deg, #fff3c4 0%, #ffd166 22%, #f2a92b 48%, #ffd166 74%, #fff3c4 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 5px rgba(255, 190, 70, 0.6));
  animation: gold-shimmer 5s linear infinite;
}

@keyframes gold-shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

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

/* ---------------- 我的中心：互动与我的动态 ---------------- */

.me-interaction-stats {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}

.me-interaction-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(176, 111, 29, 0.06);
}

.me-interaction-chip strong {
  color: var(--amber);
  font-size: 16px;
  font-weight: 600;
}

.me-interaction-chip span {
  color: var(--dim);
  font-size: 10px;
}

.me-posts {
  display: flex;
  flex-direction: column;
}

.me-post {
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(var(--ink-rgb), 0.12);
}

.me-post__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 4px 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.me-post__main:hover { background: rgba(var(--surface-rgb), 0.04); }

.me-post__delete {
  flex: none;
  margin-right: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 159, 174, 0.35);
  border-radius: 999px;
  background: rgba(255, 159, 174, 0.08);
  color: var(--danger);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.me-post__delete:disabled { opacity: 0.5; cursor: default; }

.me-hint {
  margin: 8px 2px 0;
  color: var(--dimmer);
  font-size: 10.5px;
}

.plaza-note {
  margin: 6px 2px 0;
  color: var(--dimmer);
  font-size: 10.5px;
}

.me-post__text {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-post__meta {
  color: var(--dimmer);
  font-size: 10px;
}

/* ---------------- 引用回复 / 表情回应 ---------------- */

.reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  background: rgba(176, 111, 29, 0.06);
  color: var(--dim);
  font-size: 11px;
}

.reply-bar__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-bar button {
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 16px;
  cursor: pointer;
}

.msg__quote {
  display: block;
  margin-bottom: 4px;
  padding: 4px 8px;
  border-left: 2px solid rgba(217, 130, 85, 0.5);
  border-radius: 4px;
  background: rgba(var(--surface-rgb), 0.60);
  color: var(--dim);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg__tools {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  opacity: 0.6;
}

.msg__tool {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dimmer);
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
}

.msg__tool:hover { color: var(--amber); }

.msg__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.msg__reaction {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(176, 111, 29, 0.08);
  font-size: 10px;
}

.msg__react-panel {
  display: flex;
  gap: 4px;
  width: max-content;
  margin-top: 5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf2;
  box-shadow: 0 6px 16px rgba(var(--shadow-rgb), 0.12);
}

.msg__react-option {
  padding: 0 2px;
  border: 0;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

/* ---------------- 评论点赞 / 回复 ---------------- */

.plaza-comment__actions {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
}

.plaza-comment__like,
.plaza-comment__reply {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dimmer);
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
}

.plaza-comment__like.is-liked { color: var(--danger); }

/* ---------------- 账号安全 ---------------- */

.me-security {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
}

.me-security .btn { flex: 1 1 auto; min-width: 0; }

.password-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.password-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--dim);
  font-size: 12px;
}

.password-form input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(var(--surface-rgb), 0.77);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

@media (max-width: 420px) {
  .plaza-search input { font-size: 13px; }
  .msg__tools { opacity: 0.75; }
  .me-security { flex-direction: column; }
  .me-security .btn { flex: 0 0 auto; width: 100%; }
  .password-form input { height: 42px; }
}

/* ---------------- 大厅功能入口：紧凑三列布局 ---------------- */

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

.lobby-tools .tool-card,
.lobby-tools .tool-card--wide {
  grid-column: auto;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  text-align: left;
}

.lobby-tools .tool-card__icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}

.lobby-tools .tool-card__icon svg {
  width: 14px;
  height: 14px;
}

.lobby-tools .tool-card__text {
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}

.lobby-tools .tool-card__text strong {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.lobby-tools .tool-card__text small {
  display: none;
}

.lobby-tools .tool-card__badge {
  top: 4px;
  right: 6px;
}

.foot-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 360px) {
  .lobby-tools .tool-card { gap: 6px; padding: 8px; }
  .lobby-tools .tool-card__text strong { font-size: 11px; }
}

/* ---------------- 首页垂直节奏收紧 ---------------- */

.lobby-title {
  margin: 6px 0 4px;
  font-size: 26px;
}

.lobby-sub {
  margin: 0 0 14px;
  font-size: 12px;
}

/* 视口较矮时，居中溢出会把标题顶出可视区；用自动外边距在空间足够时保持居中 */
.lobby-body { justify-content: flex-start; }
.lobby-body > :first-child { margin-top: auto; }
.lobby-body > :last-child { margin-bottom: auto; }

.identity {
  padding: 12px;
}

.action-area {
  margin-top: 14px;
}

.switch-row {
  margin-top: 10px;
  padding: 10px 12px;
}

.stats {
  margin-top: 10px;
}

@media (max-width: 420px) {
  .lobby-title { font-size: 24px; }
  .lobby-sub { margin-bottom: 10px; }
  .account-bar__tip { display: none; }
  .switch-row__desc { display: none; }
}

/* iOS 在输入框字号小于 16px 时聚焦会自动放大页面，导致输入时比例与布局跳动 */
@media (max-width: 820px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* 与按钮并排的输入框固定比例，避免输入内容变长时挤压按钮、整体比例跳动 */
.composer input,
.plaza-comment-form input,
.dm-form input,
.manual-note input,
.invite-link input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

/* 危险操作按钮（注销账号等） */
.btn--danger {
  border-color: rgba(255, 120, 130, 0.55);
  color: var(--danger);
}
.btn--danger:hover {
  background: rgba(255, 120, 130, 0.12);
  border-color: rgba(255, 120, 130, 0.8);
}

/* 我的中心底部协议入口 */
.me-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 18px 0 8px;
  font-size: 12px;
}
.me-links a {
  color: rgba(var(--ink-rgb), 0.55);
  text-decoration: none;
}
.me-links a:hover {
  color: var(--gold, #e6c471);
}

/* 注册时的协议勾选与老用户协议确认 */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(var(--ink-rgb), 0.62);
}
.auth-consent input {
  margin-top: 2px;
  flex: 0 0 auto;
}
.auth-consent a {
  color: var(--gold, #e6c471);
  text-decoration: none;
}
.consent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* ---------- 浅色聊天预览：地址后加 ?chatTheme=light 生效，默认不影响线上 ---------- */
html.chat-theme-light #screen-chat {
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-1), #f7f0e5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  color: #2e251c;
}

html.chat-theme-light #screen-chat .chat-head {
  border-bottom-color: rgba(var(--ink-rgb), 0.12);
}

html.chat-theme-light #screen-chat .peer__name {
  color: #2e251c;
}

html.chat-theme-light #screen-chat .peer__meta {
  color: rgba(var(--ink-rgb), 0.62);
}

html.chat-theme-light #screen-chat .btn--outline,
html.chat-theme-light #screen-chat .btn--ghost {
  border-color: rgba(var(--ink-rgb), 0.18);
  color: #5a4628;
  background: rgba(var(--surface-rgb), 0.7);
}

html.chat-theme-light #screen-chat .messages {
  padding: 8px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html.chat-theme-light #screen-chat .msg--peer {
  border-color: rgba(var(--ink-rgb), 0.1);
  background: #ffffff;
  color: #2e251c;
  box-shadow: 0 1px 4px rgba(var(--ink-rgb), 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.chat-theme-light #screen-chat .msg--me {
  background: linear-gradient(135deg, #ffdc9f, #ffc06a);
  color: #2a1c08;
  box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.12);
}

html.chat-theme-light #screen-chat .msg__time {
  color: rgba(var(--ink-rgb), 0.45);
  opacity: 1;
}

html.chat-theme-light #screen-chat .msg__who {
  color: rgba(var(--ink-rgb), 0.55);
}

html.chat-theme-light #screen-chat .sys {
  color: rgba(var(--ink-rgb), 0.55);
}

html.chat-theme-light #screen-chat .msg-divider {
  background: rgba(var(--ink-rgb), 0.06);
  color: rgba(var(--ink-rgb), 0.55);
}

html.chat-theme-light #screen-chat .chat-notice,
html.chat-theme-light #screen-chat .chat-notice summary {
  color: rgba(var(--ink-rgb), 0.58);
}

html.chat-theme-light #screen-chat .chat-note {
  color: rgba(var(--ink-rgb), 0.42);
}

html.chat-theme-light #screen-chat .composer input {
  border-color: rgba(var(--ink-rgb), 0.14);
  background: #ffffff;
  color: #2e251c;
}

html.chat-theme-light #screen-chat .composer input::placeholder {
  color: rgba(var(--ink-rgb), 0.46);
}

html.chat-theme-light #screen-chat .composer input:focus {
  border-color: rgba(196, 132, 32, 0.6);
  background: var(--surface-1);
}

html.chat-theme-light #screen-chat .quick-chip {
  border-color: rgba(var(--ink-rgb), 0.14);
  background: #ffffff;
  color: #6b5636;
}

html.chat-theme-light #screen-chat .msg-jump {
  border-color: rgba(var(--ink-rgb), 0.14);
  background: #ffffff;
  color: #8a5a12;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* ---------- 配色分层：陶土主色 + 青绿 / 玫瑰点缀 ---------- */

/* 顶部：品牌徽标用主色渐变，和下方内容分层 */
.topbar {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.07);
}

.brand__mark {
  color: #fff;
  border-color: rgba(151, 64, 31, 0.28);
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  box-shadow: 0 4px 12px rgba(181, 82, 43, 0.26);
}

.brand__name {
  color: var(--text);
}

.vip-link {
  border-color: rgba(192, 95, 52, 0.3);
  background: linear-gradient(135deg, rgba(217, 130, 85, 0.18), rgba(180, 89, 106, 0.12));
  color: var(--amber-deep);
}

/* 标题做暖色渐变文字，给首屏一个视觉重心 */
.lobby-title {
  background: linear-gradient(115deg, #a8481f 0%, #b4601f 46%, #b4596a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 主操作按钮：陶土渐变 + 白字 */
#btn-match,
#btn-enter {
  border-color: rgba(151, 64, 31, 0.35);
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  color: #fff;
  box-shadow: 0 10px 24px rgba(181, 82, 43, 0.26);
}

#btn-match:hover,
#btn-enter:hover {
  border-color: rgba(151, 64, 31, 0.5);
  background: linear-gradient(135deg, #d8793a, #ac5316);
  box-shadow: 0 12px 28px rgba(181, 82, 43, 0.32);
}

#btn-match:disabled,
#btn-enter:disabled {
  opacity: 0.55;
}

.bar-btn {
  border-color: rgba(var(--ink-rgb), 0.14);
  background: var(--surface-1);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(var(--shadow-rgb), 0.05);
}

/* 功能入口：每张卡片一个色系，避免整屏一片白 */
.tool-card {
  border: 1px solid rgba(var(--ink-rgb), 0.08);
  background: var(--surface-1);
  box-shadow: 0 3px 12px rgba(var(--shadow-rgb), 0.05);
}

#btn-plaza .tool-card__icon { background: var(--teal-soft); color: var(--teal); }
#btn-checkin .tool-card__icon { background: var(--peach-soft); color: #b25a2c; }
#btn-tasks .tool-card__icon { background: var(--rose-soft); color: var(--rose); }
#btn-points .tool-card__icon { background: var(--gold-soft); color: #9a6a12; }
#btn-invite .tool-card__icon { background: rgba(122, 139, 176, 0.14); color: #5f739c; }
#btn-me .tool-card__icon { background: rgba(192, 95, 52, 0.16); color: var(--amber-deep); }

.tool-card--me {
  border-color: rgba(192, 95, 52, 0.2);
  background: linear-gradient(135deg, rgba(217, 130, 85, 0.16), rgba(180, 89, 106, 0.08) 58%, var(--surface-1));
}

/* 我的：三张数字卡用晚霞橙、暮紫、晚玫，形成色彩节奏 */
.me-stat:nth-child(1) {
  border-color: rgba(192, 95, 52, 0.2);
  background: linear-gradient(160deg, #fff7ef, #ffe7d6);
}

.me-stat:nth-child(2) {
  border-color: rgba(106, 95, 138, 0.2);
  background: linear-gradient(160deg, #f5f3fa, #e9e4f3);
}

.me-stat:nth-child(3) {
  border-color: rgba(180, 89, 106, 0.2);
  background: linear-gradient(160deg, #fdf4f6, #f8e3e8);
}

/* 分区标题前加一根主色小竖条 */
.me-section__head strong {
  position: relative;
  padding-left: 9px;
}

.me-section__head strong::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, #b4601f, #8d4813);
  transform: translateY(-50%);
}

/* 聊天：自己的气泡用陶土渐变白字，对方保持白底深字 */
.messages {
  border-color: rgba(var(--ink-rgb), 0.08);
  background: linear-gradient(180deg, var(--surface-1), var(--surface-3));
  box-shadow: 0 10px 26px rgba(var(--shadow-rgb), 0.07);
}

.msg--me {
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  color: #fff;
  box-shadow: 0 6px 16px rgba(181, 82, 43, 0.22);
}

.msg--me .msg__time,
.msg--me .msg__state {
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
}

.btn--send {
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  color: #fff;
  box-shadow: 0 6px 16px rgba(181, 82, 43, 0.22);
}

/* 私信里自己的气泡与聊天保持一致 */
.dm-bubble.is-mine {
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  color: #fff;
}

.dm-bubble.is-mine .dm-bubble__time {
  color: rgba(255, 255, 255, 0.75);
}

/* 发送失败的气泡要盖回红色，不能沿用正常的陶土渐变 */
.msg--failed {
  border: 1px dashed rgba(192, 57, 43, 0.55);
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
  box-shadow: none;
}

.msg--failed .msg__state {
  color: var(--danger);
}

/* VIP 徽章用贵金属金，和主色区分开 */
.badge--vip {
  border-color: rgba(160, 116, 30, 0.35);
  background: linear-gradient(135deg, #e3b45d, #bd8626);
  color: #fff;
}

/* ---------- 细节打磨：对比度、层次与一致性 ---------- */

/* 辅助文字略微加深，浅底上不再发虚 */
:root {
  --dim: rgba(var(--ink-rgb), 0.68);
  --dimmer: rgba(var(--ink-rgb), 0.54);
}

/* 小号按钮统一为"白底细描边"，不再像禁用态 */
.btn--sm {
  height: 27px;
  padding: 0 11px;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(var(--ink-rgb), 0.05);
}

.btn--sm:hover {
  border-color: rgba(141, 72, 19, 0.32);
  background: var(--surface-2);
  color: var(--amber-deep);
}

/* 大厅：昵称回到深色，VIP 改成金色描边 */
.name-btn {
  color: var(--text);
}

.name-btn:hover {
  color: var(--amber-deep);
}

.link-btn {
  color: var(--amber-deep);
}

/* 右上角开通 VIP：去掉描边，做成与主题圆钮同高的柔和胶囊 */
.vip-link,
.vip-link.is-vip {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(217, 130, 85, 0.14);
  color: var(--amber-deep);
  font-size: 12px;
  letter-spacing: 0.3px;
  opacity: 1;
  white-space: nowrap;
}

.vip-link:hover,
.vip-link.is-vip:hover {
  background: rgba(217, 130, 85, 0.24);
}

.vip-link.is-vip {
  background: rgba(217, 130, 85, 0.2);
  color: var(--amber-deep);
}

.avatar {
  box-shadow: 0 0 0 1px rgba(var(--ink-rgb), 0.05), 0 8px 20px rgba(141, 72, 19, 0.13);
}

.topbar {
  border-bottom-color: rgba(var(--ink-rgb), 0.06);
}

.hint {
  color: rgba(var(--ink-rgb), 0.52);
}

/* 聊天头部：昵称、状态、按钮三层分明 */
.chat-head {
  gap: 8px;
}

.chat-head .peer__name {
  color: var(--text);
}

.chat-head .peer__meta {
  flex-wrap: nowrap;
  overflow: hidden;
  color: var(--dim);
  white-space: nowrap;
}

.chat-head .btn {
  white-space: nowrap;
}

.chat-head .btn--outline {
  height: 28px;
  padding: 0 9px;
  border-color: rgba(var(--ink-rgb), 0.14);
  background: rgba(var(--surface-rgb), 0.72);
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0;
}

.chat-head .btn--outline:hover {
  border-color: rgba(141, 72, 19, 0.34);
  color: var(--amber-deep);
}

/* 窄屏优先保证昵称与城市完整，匹配方式属于次要信息 */
@media (max-width: 400px) {
  .chat-head #peer-mode,
  .chat-head .peer__meta .sep {
    display: none;
  }
}

/* 气泡：连续消息收紧、名字不重复、操作按钮看得见 */
.msg__who {
  color: rgba(var(--ink-rgb), 0.52);
  font-weight: 500;
}

.msg__tool,
.msg__recall {
  color: rgba(var(--ink-rgb), 0.46);
}

.msg__tool:hover,
.msg__recall:hover {
  color: var(--amber-deep);
}

.msg--peer + .msg--peer,
.msg--me + .msg--me {
  margin-top: 4px;
}

.msg--peer + .msg--peer .msg__who {
  display: none;
}

.msg--me .msg__who,
.msg--me .msg__tool,
.msg--me .msg__recall {
  color: rgba(255, 255, 255, 0.82);
}

.msg--me .msg__tool:hover,
.msg--me .msg__recall:hover {
  color: #fff;
}

/* 自己的气泡：晚霞橙更通透，白字更清楚 */
.msg--me {
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  color: #fff;
  box-shadow: 0 6px 16px rgba(141, 72, 19, 0.22);
}

/* 输入区：描边柔化，不再一圈黑边 */
.quick-chip {
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  background: var(--surface-1);
  color: var(--dim);
}

.quick-chip:hover {
  border-color: rgba(141, 72, 19, 0.32);
  color: var(--amber-deep);
}

.btn--img {
  border-color: rgba(var(--ink-rgb), 0.12);
  background: var(--surface-1);
  color: var(--dim);
}

.btn--img:hover {
  border-color: rgba(141, 72, 19, 0.32);
  color: var(--amber-deep);
}

.btn--send {
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  color: #fff;
  box-shadow: 0 6px 16px rgba(141, 72, 19, 0.2);
}

.btn--send:hover {
  background: linear-gradient(135deg, #d8793a, #b2581c);
}

/* 聊天提示与底部说明 */
.chat-notice,
.chat-notice summary {
  color: rgba(var(--ink-rgb), 0.62);
}

.chat-notice a,
.chat-notice button {
  color: var(--amber-deep);
}

.chat-note {
  color: rgba(var(--ink-rgb), 0.5);
}

/* 我的：功能按钮与卡片层次 */
.me-action {
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  background: var(--surface-1);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(var(--ink-rgb), 0.04);
}

.me-action:hover {
  border-color: rgba(141, 72, 19, 0.28);
  background: var(--surface-2);
}

.me-section {
  box-shadow: 0 1px 2px rgba(var(--ink-rgb), 0.04), 0 10px 26px rgba(var(--ink-rgb), 0.05);
}

/* 登录/注册：清晰的琥珀胶囊，不再是浅色幽灵按钮 */
.link-btn {
  padding: 5px 12px;
  border: 1px solid rgba(141, 72, 19, 0.38);
  border-radius: 999px;
  background: rgba(var(--surface-rgb), 0.9);
  color: var(--amber-deep);
  font-weight: 500;
}

.link-btn:hover {
  border-color: rgba(141, 72, 19, 0.6);
  background: #fff;
}

/* 页脚与提示文字：看得清但不过分抢眼 */
.foot-link,
.foot-share,
.foot-note {
  color: rgba(var(--ink-rgb), 0.52);
}

.foot-link:hover,
.foot-share:hover {
  color: var(--amber-deep);
}

.chat-notice button,
.chat-notice a {
  font-weight: 600;
  border-bottom: 1px solid rgba(141, 72, 19, 0.28);
}

.msg--peer {
  border-color: rgba(var(--ink-rgb), 0.12);
}

/* 发送失败的红色状态要盖过上面的正常气泡样式 */
.msg--failed {
  border: 1px dashed rgba(192, 57, 43, 0.55);
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
  box-shadow: none;
}

.msg--failed .msg__state {
  color: var(--danger);
}

/* 空输入时的发送键：中性暖灰，不再褪成一片粉色 */
.btn.btn--send:disabled {
  background: rgba(var(--ink-rgb), 0.09);
  color: rgba(var(--ink-rgb), 0.44);
  box-shadow: none;
  opacity: 1;
}

/* 气泡底部操作行：略提亮，撤回与回复 / 表情同排 */
.msg__tools {
  opacity: 0.86;
}

.msg__tools .msg__recall {
  margin-left: 0;
  font-size: 10px;
}

/* 修复：小号按钮统一白底后，金色主操作被一起冲淡 */
.btn.btn--gold.btn--sm {
  border-color: rgba(154, 106, 18, 0.36);
  background: linear-gradient(135deg, #ffe3b6, #ffc182);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(154, 106, 18, 0.16);
}

.btn.btn--gold.btn--sm:hover {
  border-color: rgba(154, 106, 18, 0.5);
  background: linear-gradient(135deg, #ffeccb, #ffcf9a);
  color: var(--ink);
}

/* 注销等危险操作保留红色语义，不被白底小按钮覆盖 */
.btn.btn--danger.btn--sm {
  border-color: rgba(192, 57, 43, 0.32);
  color: var(--danger);
}

.btn.btn--danger.btn--sm:hover {
  border-color: rgba(192, 57, 43, 0.5);
  background: rgba(192, 57, 43, 0.06);
  color: var(--danger);
}

/* 数字卡与互动小卡：数字跟随各自辅色，避免橙字压在紫 / 粉底上 */
.me-stat:nth-child(1) strong {
  color: var(--amber-deep);
}

.me-stat:nth-child(2) strong {
  color: #5f5480;
}

.me-stat:nth-child(3) strong {
  color: #a4495e;
}

.me-interaction-chip:nth-child(1) {
  border-color: rgba(192, 95, 52, 0.16);
  background: rgba(217, 130, 85, 0.1);
}

.me-interaction-chip:nth-child(2) {
  border-color: rgba(106, 95, 138, 0.16);
  background: rgba(122, 100, 148, 0.09);
}

.me-interaction-chip:nth-child(3) {
  border-color: rgba(180, 89, 106, 0.16);
  background: rgba(180, 89, 106, 0.08);
}

.me-interaction-chip:nth-child(1) strong {
  color: var(--amber-deep);
}

.me-interaction-chip:nth-child(2) strong {
  color: #5f5480;
}

.me-interaction-chip:nth-child(3) strong {
  color: #a4495e;
}

/* 广场：选中态文字加深，避免橙字压在浅橙底上发虚 */
.plaza-sort__item.is-active,
.plaza-filter.is-active,
.plaza-tag.is-active {
  border-color: rgba(164, 96, 31, 0.46);
  background: rgba(217, 130, 85, 0.16);
  color: var(--amber-deep);
}

/* 位置、城市与提示类文字：统一回深琥珀，避免浅橙压在米色底上看不清 */
.location-refresh,
.geo-hint.is-warn,
.city-vip-gate,
.link-btn.is-vip-only {
  color: var(--amber-deep);
}

.chat-notice summary::after {
  color: rgba(141, 72, 19, 0.72);
}

/* 位置提示字号偏小，压深一点才看得清 */
.location-hint {
  color: rgba(var(--ink-rgb), 0.64);
  font-size: 11px;
}

/* 首充福利条：窄弹窗里标题被挤成两行，改成上下排 */
.first-recharge {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
}

.first-recharge strong {
  white-space: nowrap;
}

/* 远山铺到页脚时，底部说明文字提一点亮度，保证可读 */
.chat-note {
  color: rgba(var(--ink-rgb), 0.6);
}

.foot-link,
.foot-share,
.foot-note {
  color: rgba(var(--ink-rgb), 0.56);
}

/* ---------------- 主题切换按钮 ---------------- */

.topbar__actions,
.me-head__actions,
.plaza-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(var(--surface-rgb), 0.72);
  color: rgba(var(--ink-rgb), 0.62);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-toggle:hover {
  border-color: rgba(169, 85, 26, 0.42);
  background: rgba(var(--surface-rgb), 0.92);
  color: var(--amber-deep);
}

.theme-toggle__sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle__sun {
  display: block;
}

html[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

/* ---------------- 修复：匹配等待文案看不清 ---------------- */

.searching {
  border-color: rgba(169, 85, 26, 0.42);
  background: rgba(var(--surface-rgb), 0.78);
  color: var(--text);
  font-size: 12.5px;
}

.waiting-panel {
  border-color: rgba(169, 85, 26, 0.34);
  background: rgba(var(--surface-rgb), 0.8);
}

.waiting-panel__lead {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
}

.waiting-panel__tip {
  color: var(--dim);
}

.waiting-panel__btn {
  border-color: transparent;
  background: linear-gradient(135deg, #c96b2e, #a34a12);
  color: #fff;
  font-weight: 500;
}

.waiting-panel__btn:hover {
  background: linear-gradient(135deg, #d8793a, #b2581c);
}

/* 等待时“取消匹配”原本铺满整行，收成一个小按钮 */
#btn-cancel.bar-btn--ghost {
  align-self: center;
  width: auto;
  min-width: 128px;
  height: 36px;
  padding: 0 22px;
  border: 1px solid rgba(var(--ink-rgb), 0.24);
  background: rgba(var(--surface-rgb), 0.66);
  color: rgba(var(--ink-rgb), 0.82);
  font-size: 12.5px;
  font-weight: 400;
  box-shadow: none;
}

#btn-cancel.bar-btn--ghost:hover {
  border-color: rgba(var(--ink-rgb), 0.36);
  background: rgba(var(--surface-rgb), 0.9);
  color: var(--text);
}

.waiting-panel__input::placeholder {
  color: rgba(var(--ink-rgb), 0.55);
}

.waiting-panel__saved {
  color: #2f7a55;
}

/* 等待中搜索条已说明在线人数，隐藏重复的两行提示，减少视觉噪音 */
.action-area.is-searching .action-hint,
.action-area.is-searching .startup-note {
  display: none;
}

.startup-note {
  color: var(--dim);
}

/* ---------------- 聊天界面：收紧留白与控件尺寸 ---------------- */

#screen-chat {
  gap: 8px;
}

.chat-head {
  padding: 6px 2px 10px;
  border-bottom-color: rgba(var(--ink-rgb), 0.12);
}

.messages {
  gap: 10px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.42);
  scroll-padding-bottom: 12px;
  box-shadow: none;
}

.msg {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14.5px;
  line-height: 1.6;
}

/* 一对一聊天里对方昵称已在顶部显示，气泡内不再重复，气泡更轻 */
#screen-chat .msg__who {
  display: none;
}

#screen-chat .msg__time {
  margin-top: 1px;
  font-size: 9.5px;
}

#screen-chat .msg__tools {
  margin-top: 2px;
  font-size: 9.5px;
}

#screen-chat .msg__reactions {
  margin-top: 2px;
}

.composer input,
.btn--img,
.btn--send {
  height: 40px;
}

.btn--img {
  width: 40px;
  border-radius: 10px;
}

.btn--send {
  padding: 0 15px;
}

.quick-bar {
  margin: 0 10px 4px;
  gap: 5px;
}

.quick-chip {
  padding: 3px 9px;
  font-size: 11.5px;
}

.chat-notice {
  font-size: 10.5px;
}

.chat-note {
  font-size: 10px;
  color: rgba(var(--ink-rgb), 0.62);
}

/* ---------------- 修复：VIP 套餐卡边框与等高 ---------------- */

.plan-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 86px;
  border: 1px solid rgba(141, 72, 19, 0.2);
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.72);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.04);
}

.plan-card:hover {
  border-color: rgba(169, 85, 26, 0.55);
  background: rgba(217, 130, 85, 0.1);
}

.plan-card:focus-visible {
  outline: 2px solid rgba(169, 85, 26, 0.45);
  outline-offset: 1px;
}

.plan-card__days {
  color: var(--dim);
}

.plan-card__price {
  color: var(--amber-deep);
}

.plan-card__price small {
  color: var(--dimmer);
}

.plan-card__bonus {
  color: var(--amber-deep);
}

/* ---------------- 暗色主题 ---------------- */

html[data-theme="dark"] {
  color-scheme: dark;
  --ink-rgb: 244, 233, 220;
  --surface-rgb: 40, 33, 38;
  --shadow-rgb: 6, 5, 10;
  --surface-1: #251f25;
  --surface-2: #2d262c;
  --surface-3: #221d22;
  --text: #f4e9dc;
  --dim: rgba(244, 233, 220, 0.7);
  --dimmer: rgba(244, 233, 220, 0.48);
  --line: rgba(244, 233, 220, 0.12);
  --line-strong: rgba(244, 233, 220, 0.24);
  --panel: rgba(37, 31, 37, 0.86);
  --panel-solid: #251f25;
  --amber: #e8a066;
  --amber-deep: #f0b47c;
  --danger: #f08c7c;
  --teal: #b9a9dc;
  --violet: #b4a1d6;
  --rose: #e3a0b2;
}

html[data-theme="dark"] body {
  background: #15121b;
}

/* 夜晚底景：上方深靛，地平线留一点余温 */
html[data-theme="dark"] .scenery {
  background-color: #15121b;
  background-image:
    radial-gradient(80% 55% at 10% -8%, rgba(255, 146, 86, 0.22), transparent 68%),
    radial-gradient(66% 46% at 92% -4%, rgba(104, 84, 168, 0.5), transparent 72%),
    radial-gradient(85% 55% at 50% 112%, rgba(66, 62, 130, 0.48), transparent 72%),
    linear-gradient(180deg, #171320 0%, #241a24 44%, #2b2030 74%, #1d1a2c 100%);
}

html[data-theme="dark"] .scenery::before {
  background:
    radial-gradient(36% 28% at 30% 64%, rgba(255, 138, 82, 0.16), transparent 70%),
    radial-gradient(30% 24% at 72% 38%, rgba(140, 105, 180, 0.16), transparent 72%);
}

html[data-theme="dark"] .scenery::after {
  background:
    linear-gradient(180deg, rgba(23, 19, 32, 0.4) 0%, rgba(23, 19, 32, 0) 38%, rgba(76, 68, 120, 0.2) 100%);
}

/* 落日变成地平线上的余烬，不抢月亮的形 */
html[data-theme="dark"] .scenery__sun {
  background:
    radial-gradient(58% 20% at 10% 80%, rgba(255, 138, 84, 0.4), transparent 74%),
    radial-gradient(circle 180px at 8% calc(100% - 21vh),
      rgba(255, 196, 140, 0.7) 0 18px,
      rgba(255, 150, 90, 0.45) 19px 34px,
      rgba(255, 122, 72, 0.2) 84px,
      rgba(255, 110, 66, 0) 180px);
  filter: blur(1.5px);
}

html[data-theme="dark"] .scenery__clouds {
  background:
    radial-gradient(38% 10% at 18% 62%, rgba(255, 160, 110, 0.22), transparent 70%),
    radial-gradient(30% 9% at 42% 55%, rgba(255, 150, 120, 0.16), transparent 72%),
    radial-gradient(34% 8% at 78% 50%, rgba(158, 130, 200, 0.22), transparent 74%),
    radial-gradient(46% 6% at 68% 43%, rgba(255, 168, 130, 0.16), transparent 72%),
    radial-gradient(40% 5% at 86% 33%, rgba(136, 116, 186, 0.2), transparent 74%),
    radial-gradient(26% 7% at 92% 58%, rgba(255, 172, 140, 0.14), transparent 75%);
}

html[data-theme="dark"] .scenery__birds svg {
  stroke: rgba(255, 214, 186, 0.42);
}

html[data-theme="dark"] .scenery__stars g {
  fill: #ffeeca;
}

html[data-theme="dark"] .scenery__moon::before {
  background: radial-gradient(circle, rgba(255, 236, 196, 0.6), rgba(255, 236, 196, 0) 70%);
}

html[data-theme="dark"] .scenery__moon::after {
  background: #fff3d8;
}

html[data-theme="dark"] .scenery__hills path:nth-child(1) {
  fill: rgba(120, 100, 154, 0.42);
}

html[data-theme="dark"] .scenery__hills path:nth-child(2) {
  fill: rgba(74, 60, 102, 0.58);
}

html[data-theme="dark"] .scenery__hills path:nth-child(3) {
  fill: rgba(34, 27, 48, 0.72);
}

/* 大厅 / 通用 */
html[data-theme="dark"] .lobby-title {
  background: linear-gradient(115deg, #ffd2a6 0%, #ffb27c 46%, #e4a3c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="dark"] .vip-link {
  border: 0;
  background: rgba(232, 160, 102, 0.16);
  color: var(--amber-deep);
}

html[data-theme="dark"] .vip-link:hover {
  background: rgba(232, 160, 102, 0.26);
}

html[data-theme="dark"] .link-btn {
  border-color: rgba(240, 180, 124, 0.36);
  background: rgba(var(--surface-rgb), 0.6);
  color: var(--amber-deep);
}

html[data-theme="dark"] .link-btn:hover {
  background: rgba(var(--surface-rgb), 0.9);
}

html[data-theme="dark"] .avatar {
  background: radial-gradient(circle at 32% 24%, #4b3a33, #2a2129 72%);
  color: #f3d9b0;
  box-shadow: 0 0 0 1px rgba(255, 225, 190, 0.08), 0 8px 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .identity {
  background: transparent;
}

html[data-theme="dark"] .bot-offer {
  border-color: rgba(232, 160, 102, 0.3);
  background: rgba(232, 160, 102, 0.1);
}

html[data-theme="dark"] .waiting-panel__saved {
  color: #7fd8a8;
}

html[data-theme="dark"] #btn-cancel.bar-btn--ghost {
  border-color: rgba(244, 233, 220, 0.3);
  background: rgba(var(--surface-rgb), 0.6);
  color: rgba(244, 233, 220, 0.82);
}

html[data-theme="dark"] #btn-cancel.bar-btn--ghost:hover {
  border-color: rgba(244, 233, 220, 0.44);
  background: rgba(var(--surface-rgb), 0.85);
  color: var(--text);
}

html[data-theme="dark"] .waiting-panel__input::placeholder {
  color: rgba(244, 233, 220, 0.5);
}

/* 聊天 */
html[data-theme="dark"] .messages {
  border: 0;
  background: rgba(40, 33, 38, 0.5);
  box-shadow: none;
}

html[data-theme="dark"] .msg--peer {
  border-color: rgba(244, 233, 220, 0.14);
  background: linear-gradient(180deg, #302830, #2a232a);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .messages::-webkit-scrollbar-thumb {
  background: rgba(244, 233, 220, 0.2);
}

html[data-theme="dark"] .composer input {
  border-color: rgba(244, 233, 220, 0.16);
  background: rgba(var(--surface-rgb), 0.85);
  color: var(--text);
}

html[data-theme="dark"] .composer input::placeholder {
  color: rgba(244, 233, 220, 0.55);
}

html[data-theme="dark"] .composer input:focus {
  background: rgba(var(--surface-rgb), 0.96);
}

html[data-theme="dark"] .btn--img {
  border-color: rgba(244, 233, 220, 0.14);
  background: rgba(var(--surface-rgb), 0.8);
  color: var(--text);
}

html[data-theme="dark"] .quick-chip {
  border-color: rgba(244, 233, 220, 0.14);
  background: rgba(var(--surface-rgb), 0.8);
  color: var(--dim);
}

html[data-theme="dark"] .btn.btn--send:disabled {
  background: rgba(244, 233, 220, 0.1);
  color: rgba(244, 233, 220, 0.4);
}

/* 我的 */
html[data-theme="dark"] .me-profile {
  border-color: rgba(232, 160, 102, 0.22);
  background: linear-gradient(150deg, rgba(232, 160, 102, 0.14), rgba(var(--surface-rgb), 0.35));
}

html[data-theme="dark"] .me-action {
  border-color: rgba(244, 233, 220, 0.12);
  background: rgba(var(--surface-rgb), 0.7);
  color: var(--text);
}

html[data-theme="dark"] .me-action:hover {
  border-color: rgba(240, 180, 124, 0.3);
  background: rgba(var(--surface-rgb), 0.9);
}

html[data-theme="dark"] .me-stat:nth-child(1) {
  border-color: rgba(232, 160, 102, 0.22);
  background: linear-gradient(160deg, #33241f, #3a2721);
}

html[data-theme="dark"] .me-stat:nth-child(2) {
  border-color: rgba(160, 140, 210, 0.22);
  background: linear-gradient(160deg, #2a2536, #332b42);
}

html[data-theme="dark"] .me-stat:nth-child(3) {
  border-color: rgba(210, 140, 160, 0.22);
  background: linear-gradient(160deg, #332329, #3d2830);
}

html[data-theme="dark"] .me-stat:nth-child(1) strong,
html[data-theme="dark"] .me-interaction-chip:nth-child(1) strong {
  color: #f0b47c;
}

html[data-theme="dark"] .me-stat:nth-child(2) strong,
html[data-theme="dark"] .me-interaction-chip:nth-child(2) strong {
  color: #c9b8ea;
}

html[data-theme="dark"] .me-stat:nth-child(3) strong,
html[data-theme="dark"] .me-interaction-chip:nth-child(3) strong {
  color: #e8a6b8;
}

html[data-theme="dark"] .me-interaction-chip:nth-child(1) {
  border-color: rgba(232, 160, 102, 0.18);
  background: rgba(232, 160, 102, 0.1);
}

html[data-theme="dark"] .me-interaction-chip:nth-child(2) {
  border-color: rgba(160, 140, 210, 0.18);
  background: rgba(160, 140, 210, 0.1);
}

html[data-theme="dark"] .me-interaction-chip:nth-child(3) {
  border-color: rgba(210, 140, 160, 0.18);
  background: rgba(210, 140, 160, 0.1);
}

/* 广场 */
html[data-theme="dark"] #screen-plaza .plaza-form,
html[data-theme="dark"] .plaza-form {
  background: transparent;
}

html[data-theme="dark"] .plaza-tag.is-active,
html[data-theme="dark"] .plaza-filter.is-active,
html[data-theme="dark"] .plaza-sort__item.is-active {
  border-color: rgba(240, 180, 124, 0.4);
  background: rgba(232, 160, 102, 0.14);
  color: var(--amber-deep);
}

/* 弹窗与浮层 */
html[data-theme="dark"] .modal__mask {
  background: rgba(6, 5, 10, 0.62);
}

html[data-theme="dark"] .modal__panel {
  border-color: rgba(244, 233, 220, 0.16);
  background: var(--surface-1);
}

html[data-theme="dark"] .first-recharge {
  border-color: rgba(232, 160, 102, 0.32);
  background: rgba(232, 160, 102, 0.12);
}

html[data-theme="dark"] .vip-tabs {
  background: rgba(244, 233, 220, 0.05);
}

html[data-theme="dark"] .vip-tab.is-active {
  background: rgba(232, 160, 102, 0.16);
  color: var(--amber-deep);
}

html[data-theme="dark"] .shop-item,
html[data-theme="dark"] .plan-card {
  background: rgba(var(--surface-rgb), 0.72);
}

html[data-theme="dark"] .image-viewer,
html[data-theme="dark"] .viewer {
  background: rgba(8, 6, 12, 0.94);
}

html[data-theme="dark"] .toast {
  background: rgba(244, 233, 220, 0.94);
  color: #211c1f;
}

