.balance-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 0;
  font-size: 12px;
  flex-wrap: wrap;
}

.bal-guest {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(157, 23, 77, 0.15);
  transition: transform 0.14s cubic-bezier(0.34, 1.2, 0.64, 1), background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.bal-guest:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.32);
}

.bal-user {
  color: #fff;
  font-weight: 600;
}

.bal-vip {
  margin-left: 4px;
  background: #fbbf24;
  color: #78350f;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
}

.bal-amt {
  color: rgba(255, 255, 255, 0.95);
}

.bal-btn {
  margin-left: auto;
  border: none;
  background: #fff;
  color: #db2777;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255, 255, 255, 0.35);
  transition: transform 0.14s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.bal-btn:active {
  transform: scale(0.94);
  box-shadow: 0 1px 6px rgba(255, 255, 255, 0.25);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(74, 44, 53, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.auth-overlay.open {
  display: flex;
}

.auth-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  animation: auth-up 0.25s ease;
}

@keyframes auth-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.auth-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  font-size: 24px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.auth-close:active {
  transform: scale(0.9);
  background: rgba(236, 72, 153, 0.12);
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.auth-panel h2 {
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-panel label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
}

.auth-panel input {
  display: block;
  width: 100%;
  margin-top: 6px;
  height: 42px;
  border: 1px solid #fbcfe8;
  border-radius: 12px;
  background: #fffbfc;
  padding: 0 12px;
  font-size: 15px;
}

.auth-primary {
  width: 100%;
  border: none;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb7185, #ec4899);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.38);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.18s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.auth-primary:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(236, 72, 153, 0.28);
  filter: brightness(1.05);
}

.auth-primary:disabled {
  opacity: 0.65;
}

.auth-links {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
}

.auth-links a {
  color: #db2777;
}

.auth-hint {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
  text-align: center;
}

.recharge-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.recharge-presets button {
  height: 42px;
  border: 1px solid #fbcfe8;
  border-radius: 14px;
  background: #fff5f7;
  color: #9d174d;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.recharge-presets button:active {
  transform: scale(0.96);
  background: #fce7f3;
  border-color: #f9a8d4;
  box-shadow: inset 0 2px 6px rgba(236, 72, 153, 0.08);
}

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: linear-gradient(90deg, #be185d, #db2777);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 90%;
  text-align: center;
}

.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cs-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.cs-overlay.open {
  display: flex;
}

.cs-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
}

.cs-dialog h2 {
  text-align: center;
  font-size: 18px;
  margin-bottom: 10px;
}

.cs-intro {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.cs-link-btn {
  display: block;
  text-align: center;
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #059669;
  font-weight: 700;
}

.cs-form textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  resize: vertical;
}

.cs-history {
  margin-top: 16px;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.cs-history-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
  padding: 8px 0;
}

.cs-h-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.cs-h-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.cs-h-content {
  color: #334155;
  line-height: 1.45;
  white-space: pre-wrap;
}

.cs-h-reply {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  color: #059669;
  line-height: 1.45;
  white-space: pre-wrap;
}

.cs-h-reply span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cs-h-pending {
  margin-top: 6px;
  font-size: 12px;
  color: #f59e0b;
}

/* 实时聊天对话框 */
.cs-chat-dialog {
  display: flex;
  flex-direction: column;
  height: min(78vh, 560px);
  padding: 0;
  overflow: hidden;
}

.cs-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(90deg, #fb7185, #f472b6);
  color: #fff;
  flex-shrink: 0;
}

.cs-chat-head .auth-close {
  color: rgba(255, 255, 255, 0.9);
  position: static;
}

.cs-chat-sub {
  font-size: 12px;
  opacity: 0.92;
  margin-top: 4px;
  line-height: 1.35;
  max-width: 280px;
}

.cs-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: linear-gradient(180deg, #fff5f7 0%, #ffe4e6 100%);
  -webkit-overflow-scrolling: touch;
}

.cs-chat-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 32px 16px;
}

.cs-msg {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  max-width: 82%;
}

.cs-msg.mine {
  align-self: flex-end;
  margin-left: auto;
  align-items: flex-end;
}

.cs-msg.their {
  align-self: flex-start;
  align-items: flex-start;
}

.cs-msg-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.cs-msg.mine .cs-msg-bubble {
  background: linear-gradient(135deg, #f472b6, #ec4899);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}

.cs-msg.their .cs-msg-bubble {
  background: #fff;
  color: #4a2c35;
  border: 1px solid #fce7f3;
  border-bottom-left-radius: 4px;
}

.cs-msg-time {
  font-size: 10px;
  color: #999;
  margin-top: 4px;
  padding: 0 4px;
}

.cs-chat-gate {
  padding: 12px 16px;
  text-align: center;
  background: #fff1f2;
  border-top: 1px solid #fecdd3;
  font-size: 13px;
  color: #9f1239;
}

.cs-chat-gate .auth-primary {
  margin-top: 10px;
  width: 100%;
}

.cs-chat-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

.cs-chat-bar.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.cs-chat-bar input {
  flex: 1;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 0 14px;
  font-size: 14px;
}

.cs-chat-bar button {
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb7185, #ec4899);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
  transition: transform 0.14s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.cs-chat-bar button:active {
  transform: scale(0.94);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.25);
}

.cs-chat-bar input:focus {
  outline: none;
  border-color: #f9a8d4;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.2);
}
