:root {
  --text: #ffffff;
  --dim: rgba(255, 255, 255, 0.58);
  --dimmer: rgba(255, 255, 255, 0.38);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.32);
  --panel: rgba(14, 10, 7, 0.42);
  --panel-solid: #0c0906;
  --amber: #ffcf87;
  --amber-deep: #ff9d5c;
  --ink: #2a1c08;
  --danger: #ff9fae;
  --radius: 6px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* 移动端避免双击缩放带来的点击延迟 */
button {
  touch-action: manipulation;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #0a0705;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

/* 黄昏海滩底图 + 黑色蒙层 */
.scenery {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #0a0705;
  background-image: url("https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=cinematic%20dusk%20beach%2C%20warm%20amber%20sunset%20sky%2C%20distant%20mountain%20silhouettes%2C%20calm%20sea%20reflection%2C%20a%20lone%20small%20figure%20sitting%20on%20the%20sand%2C%20dark%20moody%20atmosphere%2C%20vertical%20composition%2C%20photorealistic%2C%20no%20text&image_size=portrait_16_9");
  background-size: cover;
  background-position: center 26%;
  background-repeat: no-repeat;
}

.scenery::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.28) 38%, rgba(0, 0, 0, 0.82) 100%);
}

.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(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: #fff;
}

.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(255, 255, 255, 0.55);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.35s ease;
}

.icon-btn:hover {
  color: #fff;
  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;
  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(255, 255, 255, 0.72);
  font-size: 12px;
}

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

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

.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(255, 255, 255, 0.86);
}

.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(255, 207, 135, 0.38);
  border-radius: 999px;
  background: rgba(255, 207, 135, 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;
}

.lobby-sub {
  max-width: 280px;
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.6px;
  text-align: center;
}

.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(255, 255, 255, 0.3);
  font-size: 26px;
  font-weight: 400;
  color: #fff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 207, 135, 0.4), rgba(0, 0, 0, 0.5) 72%),
    rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 26px rgba(255, 157, 92, 0.18);
  user-select: none;
}

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

.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: #ffe1b3;
}

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

.identity__meta svg {
  opacity: 0.6;
}

.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(255, 207, 135, 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(255, 255, 255, 0.2);
  border-radius: 3px;
  color: rgba(255, 255, 255, 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(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.62);
  background: rgba(0, 0, 0, 0.32);
  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(255, 255, 255, 0.4);
  color: #fff;
}

.gender.is-active .gender__icon {
  border-color: rgba(255, 207, 135, 0.85);
  color: var(--amber);
  background: rgba(255, 207, 135, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 207, 135, 0.07), inset 0 0 22px rgba(255, 157, 92, 0.22);
}

.gender.is-active .gender__label {
  color: #fff;
}

.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(0, 0, 0, 0.32);
  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: #fff;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  text-align: center;
  outline: none;
}

.age-field input::placeholder {
  color: rgba(255, 255, 255, 0.26);
  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(255, 255, 255, 0.3);
  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(0, 0, 0, 0.38);
  color: #fff;
  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(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.5);
}

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

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

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

.searching {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 210px;
  padding: 8px 12px;
  border: 1px dashed rgba(255, 207, 135, 0.42);
  border-radius: 4px;
  color: rgba(255, 232, 198, 0.92);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
}

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

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 207, 135, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 207, 135, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 207, 135, 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(0, 0, 0, 0.3);
  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.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 var(--line);
  background: rgba(255, 255, 255, 0.06);
  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(255, 255, 255, 0.85);
  transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.switch input:checked + i {
  border-color: rgba(255, 207, 135, 0.7);
  background: rgba(255, 207, 135, 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(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.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;
}

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

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

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

#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(255, 255, 255, 0.12);
}

.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: var(--dimmer);
  font-size: 11px;
}

.sep {
  width: 1px;
  height: 9px;
  background: rgba(255, 255, 255, 0.22);
}

.messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 8px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

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

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

.msg {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  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(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.msg--me {
  align-self: flex-end;
  background: linear-gradient(135deg, #ffe3b6, #ffc182);
  color: var(--ink);
}

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

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

/* 上翻历史时的新消息提示 */
.msg-jump {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 13px;
  border: 1px solid rgba(255, 207, 135, 0.42);
  border-radius: 999px;
  background: rgba(12, 9, 6, 0.92);
  color: var(--amber);
  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;
}

.composer input {
  flex: 1;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.42);
  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(255, 255, 255, 0.34);
}

.composer input:focus {
  border-color: rgba(255, 207, 135, 0.55);
  background: rgba(0, 0, 0, 0.55);
}

.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(255, 255, 255, 0.28);
  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(0, 0, 0, 0.7);
  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;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(12, 9, 6, 0.96);
  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(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.82);
  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(255, 255, 255, 0.02);
}

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

.vip-tab:hover {
  color: #fff;
}

.vip-tab.is-active {
  background: rgba(255, 207, 135, 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(255, 255, 255, 0.03);
  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(255, 207, 135, 0.55);
  background: rgba(255, 207, 135, 0.08);
}

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

.plan-card__days {
  color: rgba(255, 255, 255, 0.82);
  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(255, 255, 255, 0.38);
  font-size: 10px;
  font-weight: 400;
}

.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(255, 255, 255, 0.03);
}

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

.history-item__label {
  color: rgba(255, 255, 255, 0.85);
}

.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: #fff;
  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: #fff;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  letter-spacing: 1px;
}

.pay-result__hint {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.4);
  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-summary {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.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(255, 255, 255, 0.88);
  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(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.7);
  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: #fff;
  border-color: rgba(255, 255, 255, 0.32);
}

.pay-channel__item.is-active {
  border-color: rgba(255, 207, 135, 0.55);
  background: rgba(255, 207, 135, 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(255, 255, 255, 0.04);
  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(255, 207, 135, 0.5);
}

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

.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(255, 255, 255, 0.38);
  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(255, 207, 135, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 207, 135, 0.08);
  color: var(--amber);
  font-size: 12px;
}

.vip-display {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal__tip {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10.5px;
  line-height: 1.7;
}

.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(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

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

.city-chip.is-current {
  border-color: rgba(255, 207, 135, 0.7);
  background: rgba(255, 207, 135, 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(10, 7, 5, 0.94);
  color: rgba(255, 255, 255, 0.9);
  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: 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;
  }

  .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;
  }
}
