/**
 * TG抢车位 - 全局样式表 (v2.0 全新布局)
 * 
 * 深色主题，紫蓝渐变背景 + 玫红强调色
 * 
 * 样式模块索引：
 *   - 全局样式 / CSS Reset
 *   - 全页面背景 (.full-page-bg)
 *   - 顶部菜单栏 (.top-nav)
 *   - 广播条 (.broadcast-bar)
 *   - 用户信息栏 (.user-bar)
 *   - 主内容区 (.main-content)
 *   - 右侧伸缩栏 (.sidebar)
 *   - 页面容器 (.page)
 *   - 登录页面 (.login-page)
 *   - 卡片样式 (.card)
 *   - 停车场 (.parking-lot, .parking-spot)
 *   - 收入面板 (.earnings-panel)
 *   - 车市 (.car-category-tabs, .car-card)
 *   - 我的车库 (.my-car-item)
 *   - 排行榜 (.ranking-item)
 *   - 按钮 (.btn)
 *   - 弹窗 (.modal-overlay, .modal)
 *   - 消息提示 (.toast)
 *   - 返回按钮 (.back-btn)
 *   - 换车选择 (.trade-car-item)
 *   - 停车选择 (.select-car-item)
 *   - 页面标题 (.page-title)
 *   - 滚动条样式
 *   - 响应式适配
 */

/* ============ 全局样式 ============ */
:root {
  --tg-viewport-height: 100vh;
  --tg-bg-color: #1a1a2e;
  --tg-text-color: #e0e0e0;
  --tg-button-color: #e94560;
  --tg-button-text-color: #ffffff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(135deg, var(--tg-bg-color) 0%, #16213e 50%, #0f3460 100%);
  color: var(--tg-text-color);
  height: var(--tg-viewport-height);
  overflow: hidden;
}

/* ============ 全页面背景 ============ */
.full-page-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.full-page-bg.active {
  opacity: 0.5;
}

/* ============ 顶部菜单栏 ============ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(10px);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav-tabs {
  display: flex;
  align-items: center;
}
.nav-tab {
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.3s;
  color: #888;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  background: rgba(60, 60, 75, 0.5);
  border: 1px solid rgba(80, 80, 100, 0.4);
  border-radius: 6px;
  margin: 6px 3px;
}
.nav-tab:hover {
  background: rgba(80, 80, 100, 0.6);
  color: #ccc;
}
.nav-tab.active {
  background: rgba(80, 80, 100, 0.8);
  color: #fff;
  border-color: rgba(120, 120, 140, 0.6);
}
.nav-tab-label { font-size: 13px; }

/* ============ 广播条 ============ */
.broadcast-bar {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  height: 28px;
  display: flex;
  align-items: center;
  margin-left: 8px;
  background: transparent;
  border: none;
  padding: 0;
}
.broadcast-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-right: 4px;
}
.broadcast-scroll-area {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 28px;
}
.broadcast-content {
  white-space: nowrap;
  font-size: 12px;
  color: #ffd700;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  animation: broadcastScroll var(--broadcast-duration, 15s) linear infinite;
}
@keyframes broadcastScroll {
  0% { left: 100%; }
  100% { left: -100%; }
}

/* ============ 主内容区 ============ */
.main-content {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  height: calc(var(--tg-viewport-height) - 50px - env(safe-area-inset-top, 0px));
  overflow: hidden;
}
.main-content-inner {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  min-height: 0;
}

/* ============ 用户信息栏 ============ */
.user-bar {
  position: relative;
  z-index: 60;
  background: rgba(20, 20, 30, 0.92);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(80, 80, 100, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.user-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-bar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #555, #333);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  border: 1px solid rgba(120, 120, 140, 0.5);
  flex-shrink: 0;
}
.user-bar-name {
  font-size: 14px;
  font-weight: bold;
  color: #eee;
}
.user-bar-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-bar-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: #bbb;
  white-space: nowrap;
}
.user-bar-stat .stat-label {
  font-size: 11px;
  color: #888;
}
.user-bar-stat.clickable {
  cursor: pointer;
  transition: color 0.2s;
}
.user-bar-stat.clickable:hover { color: #ffd700; }

/* ============ 右侧伸缩栏 ============ */
.sidebar {
  position: relative;
  display: flex;
  flex-shrink: 0;
  z-index: 50;
  overflow: hidden;
}
.sidebar-toggle {
  width: 36px;
  background: linear-gradient(180deg, #e94560, #533483);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 8px 0 0 8px;
  flex-shrink: 0;
  padding: 10px 0;
}
.sidebar-toggle:hover {
  background: linear-gradient(180deg, #ff5a7a, #6b44a3);
  width: 40px;
}
.toggle-text {
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 6px;
  writing-mode: vertical-rl;
}
.toggle-arrow {
  font-size: 12px;
  color: #fff;
  margin-top: 8px;
  transition: transform 0.3s;
}
.sidebar.collapsed .toggle-arrow {
  transform: rotate(180deg);
}
.sidebar-content {
  width: 220px;
  background: linear-gradient(180deg, rgba(26, 10, 46, 0.95), rgba(15, 52, 96, 0.95));
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(233, 69, 96, 0.3);
  transition: width 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sidebar.collapsed .sidebar-content {
  width: 0;
  opacity: 0;
  pointer-events: none;
}
.sidebar-title {
  font-size: 14px;
  font-weight: bold;
  color: #ffd700;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  white-space: nowrap;
}
.sidebar-player-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}
.sidebar-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.sidebar-player:hover {
  background: rgba(233, 69, 96, 0.15);
  border-color: rgba(233, 69, 96, 0.3);
}
.sidebar-player-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-player-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.sidebar-player-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sidebar-player-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.sidebar-player-name {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}
.sidebar-player-meta {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}
.sidebar-player-spots {
  font-size: 11px;
  color: #0f0;
  margin-top: 2px;
}

.player-list-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
}
.player-list-tab {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #aaa;
  cursor: pointer;
  font-size: 11px;
}
.friend-request-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #17222b;
  border-radius: 999px;
  background: #ff334f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 2px 7px rgba(255, 51, 79, 0.45);
  pointer-events: none;
}
.friend-request-badge[hidden] { display: none; }
.player-list-tab.active {
  color: #fff;
  border-color: var(--tg-button-color);
  background: rgba(233,69,96,0.22);
}
.invite-friend-btn {
  min-height: 38px;
  margin: 0 8px 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--tg-button-text-color);
  background: var(--tg-button-color);
  font-weight: 700;
  cursor: pointer;
}
.sidebar-player-title,
.friend-status {
  color: #ffd700;
  font-size: 10px;
}
.friend-status.accepted { color: #5ee88c; }
.sidebar-player-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.sidebar-player-actions button,
.sidebar-add-friend,
.player-list-pagination button {
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: 7px;
  background: var(--tg-button-color);
  color: var(--tg-button-text-color);
  cursor: pointer;
}
.sidebar-player-actions button.secondary { background: #555; }
.player-list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 4px;
  font-size: 11px;
}
.player-list-pagination button:disabled { opacity: 0.4; }
.player-list-empty {
  padding: 24px 10px;
  text-align: center;
  color: #888;
  font-size: 12px;
}
.player-list-empty.error { color: #ff6b7d; }

/* ============ 左侧聊天大厅伸缩栏 ============ */
.chat-sidebar {
  position: relative;
  display: flex;
  flex-shrink: 0;
  z-index: 50;
  overflow: hidden;
}
.chat-sidebar-toggle {
  width: 36px;
  background: linear-gradient(180deg, #00bcd4, #3a7bd5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 0 8px 8px 0;
  flex-shrink: 0;
  padding: 10px 0;
}
.chat-sidebar-toggle:hover {
  background: linear-gradient(180deg, #26c6da, #4a8be5);
  width: 40px;
}
.chat-toggle-text {
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 5px;
  writing-mode: vertical-rl;
}
.chat-toggle-arrow {
  font-size: 12px;
  color: #fff;
  margin-top: 8px;
  transition: transform 0.3s;
}
.chat-sidebar.collapsed .chat-toggle-arrow {
  transform: rotate(180deg);
}
.chat-sidebar-content {
  width: 260px;
  background: linear-gradient(180deg, rgba(10, 30, 60, 0.96), rgba(15, 20, 46, 0.96));
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0, 188, 212, 0.3);
  transition: width 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-sidebar.collapsed .chat-sidebar-content {
  width: 0;
  opacity: 0;
  pointer-events: none;
}
.chat-sidebar-title {
  font-size: 14px;
  font-weight: bold;
  color: #00e5ff;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.chat-msg {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}
.chat-msg-self {
  background: rgba(0, 188, 212, 0.12);
  border: 1px solid rgba(0, 188, 212, 0.2);
}
.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.chat-msg-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
  color: #fff;
}
.chat-msg-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.chat-msg-avatar-image,
.chat-msg-avatar-fallback {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-msg-avatar-fallback {
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}
.chat-msg-name {
  font-weight: bold;
  color: #00e5ff;
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-msg-time {
  font-size: 10px;
  color: #555;
  margin-left: auto;
  flex-shrink: 0;
}
.chat-msg-text {
  color: #ddd;
  padding-left: 26px;
}
.chat-input-bar {
  display: flex;
  padding: 8px 8px 8px 10px;
  gap: 4px;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
  flex-shrink: 0;
  align-items: center;
}
.chat-input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(0, 188, 212, 0.3);
  border-radius: 6px;
  padding: 6px 8px;
  color: #fff;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus {
  border-color: #00e5ff;
}
.chat-input::placeholder {
  color: #666;
}
.chat-send-btn {
  background: linear-gradient(135deg, #00bcd4, #3a7bd5);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.chat-send-btn:hover {
  opacity: 0.85;
}

/* ============ 聊天表情按钮 ============ */
.chat-emo-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.chat-emo-btn:hover {
  background: rgba(255,255,255,0.18);
}

/* ============ 表情面板 ============ */
.emoticon-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: none;
  flex-shrink: 0;
}
.emoticon-panel.show {
  max-height: 180px;
  overflow-y: auto;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
}
.emoticon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 6px 8px;
}
.emoticon-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  user-select: none;
}
.emoticon-item:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.2);
}

/* ============ 聊天内联表情 ============ */
.emo-inline {
  font-size: 16px;
  vertical-align: middle;
  line-height: 1;
}

/* ============ 聊天消息称号标签 ============ */
.chat-msg-title {
  font-size: 9px;
  color: #ffd700;
  background: rgba(255,215,0,0.12);
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============ 聊天用户名可点击 ============ */
.chat-msg-name[style*="cursor"] {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-msg-name[style*="cursor"]:hover {
  color: #fff;
}
.chat-loading {
  text-align: center;
  color: #555;
  font-size: 12px;
  padding: 20px;
}

/* ============ 页面容器 ============ */
.page { display: none; padding: 15px; padding-bottom: 20px; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ SVG 图标系统 ============ */
svg.ico { width: 1em; height: 1em; vertical-align: -0.15em; fill: currentColor; overflow: hidden; display: inline-block; }
svg.ico use { width: 100%; height: 100%; }
.nav-ico { width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; }
.stat-ico { width: 14px; height: 14px; vertical-align: middle; }
.title-ico { width: 20px; height: 20px; vertical-align: middle; }
.page-placeholder-ico { width: 48px; height: 48px; display: block; margin: 0 auto 12px; }

/* ============ Telegram 身份页 ============ */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--tg-viewport-height);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.login-box {
  width: 360px;
  max-width: 95%;
  background: rgba(20, 20, 40, 0.85);
  border: 1px solid rgba(80, 80, 120, 0.4);
  border-radius: 24px;
  padding: 40px 32px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.login-logo-wrap { text-align: center; margin-bottom: 16px; }
.login-logo-svg { width: 64px; height: 64px; animation: bounce 2s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.login-title {
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  background: linear-gradient(135deg, #ffd700, #e94560);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.login-subtitle { color: #888; text-align: center; margin-bottom: 20px; font-size: 13px; }
.login-tabs {
  display: flex;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(80, 80, 120, 0.4);
}
.login-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: #888;
  background: rgba(255,255,255,0.03);
  transition: all 0.3s;
}
.login-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #e94560, #533483);
}
.login-tab:hover:not(.active) { color: #ccc; background: rgba(255,255,255,0.08); }
.login-input {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1.5px solid rgba(80, 80, 120, 0.4);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.3s;
  box-sizing: border-box;
}
.login-input:focus { border-color: #e94560; background: rgba(233,69,96,0.05); }
/* 昵称行 + 随机按钮 */
.nickname-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
}
.nickname-row .login-input {
  flex: 1;
  margin-bottom: 0;
}
.btn-random-name {
  flex-shrink: 0;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(233, 69, 96, 0.5);
  background: rgba(233, 69, 96, 0.12);
  color: #e94560;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: bold;
}
.btn-random-name:hover {
  background: rgba(233, 69, 96, 0.25);
  border-color: #e94560;
  transform: scale(1.05);
}
.btn-random-name:active {
  transform: scale(0.95);
}
@keyframes nameSlot {
  0% { transform: translateY(-8px); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}
.login-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #e94560, #533483);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 4px;
}
.login-btn:hover { transform: scale(1.03); box-shadow: 0 0 20px rgba(233,69,96,0.5); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.tg-auth-status,
.tg-only-desc {
  color: #aab0c2;
  text-align: center;
  line-height: 1.6;
}
.tg-auth-status.error { color: #ff6b7d; }
.tg-only-icon { text-align: center; font-size: 44px; margin-bottom: 12px; }
.tg-only-title { text-align: center; color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.character-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.character-choice {
  min-height: 132px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.character-choice img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.character-choice:disabled { opacity: 0.55; }

.profile-identity { display: grid; gap: 8px; margin-bottom: 12px; }
.profile-identity > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; background: rgba(255,255,255,0.05); border-radius: 8px; }
.profile-identity span { color: #999; font-size: 12px; }
.profile-identity strong { color: #fff; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.profile-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.profile-actions .invite-friend-btn { margin: 0; flex: 1; }
.bot-notify-toggle { display: flex; align-items: center; gap: 6px; min-height: 38px; color: #ccc; font-size: 12px; cursor: pointer; }
.bot-notify-toggle input { width: 18px; height: 18px; accent-color: var(--tg-button-color); }

/* 性别选择 */
.gender-radio { cursor: pointer; flex: 1; }
.gender-radio input[type="radio"] { display: none; }
.gender-btn {
  display: block; text-align: center; padding: 10px; border-radius: 10px;
  border: 1.5px solid rgba(80, 80, 120, 0.4); background: rgba(255,255,255,0.05);
  color: #888; font-size: 14px; font-weight: bold; transition: all 0.3s;
}
.gender-radio input:checked + .gender-btn.male {
  background: linear-gradient(135deg, #3a7bd5, #00d2ff); color: #fff; border-color: #3a7bd5;
}
.gender-radio input:checked + .gender-btn.female {
  background: linear-gradient(135deg, #e94560, #ff6b8a); color: #fff; border-color: #e94560;
}
.gender-btn:hover { border-color: #aaa; }

/* ============ 卡片样式 ============ */
.card {
  background: linear-gradient(135deg, rgba(45,27,105,0.6), rgba(26,26,46,0.8));
  border: 1px solid rgba(233,69,96,0.2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}
.card-title {
  font-size: 16px;
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ 停车场 ============ */
.parking-lot {
  position: relative;
  min-height: 300px;
  margin-bottom: 12px;
  margin-top: 150px;
}
.spot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}
.parking-spot {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 14px;
  padding-top: 24px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
  position: relative;
  overflow: visible;
}

/* 停车位标线：斜虚线 + P 字 */
.parking-spot::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: none;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.12) 8px,
      rgba(255, 255, 255, 0.12) 10px
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.08) 8px,
      rgba(255, 255, 255, 0.08) 10px
    );
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
}
.parking-spot.occupied::before {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(255, 215, 0, 0.06) 8px,
      rgba(255, 215, 0, 0.06) 10px
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 8px,
      rgba(255, 215, 0, 0.04) 8px,
      rgba(255, 215, 0, 0.04) 10px
    );
}
.parking-spot::after {
  content: 'P';
  position: absolute;
  top: 4px;
  right: 10px;
  font-size: 28px;
  font-weight: 900;
  font-style: italic;
  color: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 0;
  line-height: 1;
}
.parking-spot.occupied::after {
  color: rgba(255, 215, 0, 0.08);
}
.parking-spot > * {
  position: relative;
  z-index: 1;
}
.parking-spot.charity-spot::after {
  content: '';
}
/* 爱心车位边框/背景 */
.parking-spot.charity-spot {
  background: linear-gradient(135deg, rgba(233,69,96,0.12) 0%, rgba(180,50,120,0.08) 100%);
  border: 1px dashed rgba(233,69,96,0.35);
}
.parking-spot.charity-spot .spot-label {
  color: rgba(255,100,130,0.75);
}
.parking-spot .spot-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  position: absolute;
  top: 6px;
  left: 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.parking-spot .car-emoji { font-size: 32px; margin-bottom: 4px; }
.parking-spot .car-image {
  width: 240px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.7));
}
.parking-spot .car-name {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 12px rgba(0,0,0,0.6);
}
.parking-spot .car-owner {
  font-size: 11px;
  color: #ddd;
  margin-top: 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}
.parking-spot .car-earning {
  font-size: 12px;
  color: #ffd700;
  margin-top: 4px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

/* 停车位内皮皮秀图片 */
.parking-spot .spot-qqshow {
  width: 240px;
  height: 250px;
  object-fit: contain;
  position: absolute;
  right: -10px;
  bottom: 10px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.9));
  pointer-events: none;
  z-index: 2;
}

/* 车辆下方信息栏：头像 + 昵称 + 金币 + 操作按钮 横向排列 */
.spot-bottom-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 20px;
  padding: 6px 14px 6px 6px;
  margin-top: 8px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 100%;
}
.spot-bottom-bar .spot-player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.spot-bottom-bar .spot-player-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.spot-bottom-bar .spot-player-name {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spot-bottom-bar .spot-player-title {
  font-size: 9px;
  color: #ffd700;
  background: rgba(255,215,0,0.12);
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 3px;
  font-weight: normal;
  vertical-align: middle;
}
.spot-bottom-bar .spot-player-earning {
  font-size: 11px;
  color: #ffd700;
  white-space: nowrap;
}
.spot-bottom-bar .spot-bottom-actions {
  margin-left: auto;
  flex-shrink: 0;
}
.spot-bottom-bar .spot-action-btn {
  margin-top: 0;
}
.spot-bottom-bar .spot-wait-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* 空闲车位提示 */
.spot-empty-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-top: 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* 白色停车按钮 - 浮在背景上 */
.park-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  font-size: 13px;
  font-weight: bold;
  border: none;
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.park-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

/* 车位上的操作按钮 - 半透明浮层 */
.spot-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: bold;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
}
.spot-action-btn.btn-ticket {
  background: rgba(233, 69, 96, 0.85);
  color: #fff;
  box-shadow: 0 2px 8px rgba(233, 69, 96, 0.4);
}
.spot-action-btn.btn-ticket:hover {
  background: rgba(233, 69, 96, 1);
  transform: scale(1.05);
}
.spot-action-btn.btn-evict {
  background: rgba(124, 92, 252, 0.85);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 92, 252, 0.4);
}
.spot-action-btn.btn-evict:hover {
  background: rgba(124, 92, 252, 1);
  transform: scale(1.05);
}
.spot-action-btn.btn-unpark {
  background: rgba(255, 215, 0, 0.85);
  color: #000;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}
.spot-action-btn.btn-unpark:hover {
  background: rgba(255, 215, 0, 1);
  transform: scale(1.05);
}
.spot-action-btn.btn-report {
  background: rgba(233, 69, 96, 0.85);
  color: #fff;
  box-shadow: 0 2px 8px rgba(233, 69, 96, 0.4);
}
.spot-action-btn.btn-report:hover {
  background: rgba(233, 69, 96, 1);
  transform: scale(1.05);
}

/* 爱心车位切换按钮 */
.spot-charity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: bold;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
}
.spot-charity-btn.btn-set-charity {
  background: rgba(233, 69, 96, 0.7);
  color: #fff;
  box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}
.spot-charity-btn.btn-set-charity:hover {
  background: rgba(233, 69, 96, 0.9);
  transform: scale(1.05);
}
.spot-charity-btn.btn-unset-charity {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255,255,255,0.7);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.spot-charity-btn.btn-unset-charity:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
  transform: scale(1.05);
}

/* 爱心停车中提示 */
.spot-charity-hint {
  font-size: 11px;
  color: rgba(233, 69, 96, 0.85);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* 爱心停车按钮样式 */
.parking-spot.charity-spot .park-btn {
  background: rgba(233, 69, 96, 0.85);
  color: #fff;
  box-shadow: 0 2px 12px rgba(233, 69, 96, 0.4);
}
.parking-spot.charity-spot .park-btn:hover {
  background: rgba(233, 69, 96, 1);
  box-shadow: 0 4px 18px rgba(233, 69, 96, 0.6);
}

/* ============ 停车动画 ============ */

/* 停车入场：车从右侧滑入 */
@keyframes carParkIn {
  0%   { opacity: 0; transform: translateX(120%) scale(0.7); }
  50%  { opacity: 1; transform: translateX(-8%) scale(1.05); }
  70%  { transform: translateX(4%) scale(0.98); }
  85%  { transform: translateX(-2%) scale(1.01); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.parking-spot.anim-park-in > * {
  animation: carParkIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* 挪车出场：车向左驶离 + 金币飞出 */
@keyframes carDriveOut {
  0%   { opacity: 1; transform: translateX(0) scale(1); }
  30%  { transform: translateX(-5%) scale(1.02); }
  100% { opacity: 0; transform: translateX(-120%) scale(0.6); }
}
.parking-spot.anim-drive-out > * {
  animation: carDriveOut 0.5s ease-in both;
}

/* 金币飞出动画 */
@keyframes coinFlyUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-40px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-70px) scale(0.5); }
}
.coin-fly {
  position: absolute;
  z-index: 100;
  font-size: 20px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.8), 0 0 4px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: coinFlyUp 0.9s ease-out forwards;
  white-space: nowrap;
}

/* 贴条动画：章从上方拍下 */
@keyframes ticketSlam {
  0%   { opacity: 0; transform: translateY(-80px) rotate(-15deg) scale(2); }
  50%  { opacity: 1; transform: translateY(5px) rotate(3deg) scale(1.1); }
  70%  { transform: translateY(-3px) rotate(-1deg) scale(1); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}
.ticket-slam {
  position: absolute;
  z-index: 100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 56px;
  font-weight: 900;
  color: #ff4444;
  text-shadow: 0 4px 16px rgba(255, 0, 0, 0.6), 0 0 4px rgba(0,0,0,0.8);
  pointer-events: none;
  animation: ticketSlam 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 举报动画：警灯闪烁 */
@keyframes policeFlash {
  0%, 100% { opacity: 1; box-shadow: 0 0 20px rgba(255, 0, 0, 0.8), inset 0 0 20px rgba(255, 0, 0, 0.3); }
  25%  { opacity: 0.8; box-shadow: 0 0 30px rgba(0, 100, 255, 0.8), inset 0 0 20px rgba(0, 100, 255, 0.3); }
  50%  { opacity: 1; box-shadow: 0 0 20px rgba(255, 0, 0, 0.8), inset 0 0 20px rgba(255, 0, 0, 0.3); }
  75%  { opacity: 0.8; box-shadow: 0 0 30px rgba(0, 100, 255, 0.8), inset 0 0 20px rgba(0, 100, 255, 0.3); }
}
.parking-spot.anim-police {
  animation: policeFlash 0.3s ease 3;
  border-radius: 8px;
}

/* 爱心停车动画：爱心飘出 */
@keyframes heartFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  50%  { opacity: 0.8; transform: translateY(-30px) scale(1.3); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}
.heart-float {
  position: absolute;
  z-index: 100;
  font-size: 24px;
  pointer-events: none;
  animation: heartFloat 1s ease-out forwards;
}

/* 收益数字弹出 */
@keyframes earnPop {
  0%   { opacity: 0; transform: translateY(10px) scale(0.5); }
  50%  { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-30px) scale(0.8); }
}
.earn-pop {
  position: absolute;
  z-index: 100;
  font-size: 18px;
  font-weight: 900;
  pointer-events: none;
  animation: earnPop 1.2s ease-out forwards;
  white-space: nowrap;
}

/* ============ 背景选择器 ============ */
.bg-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  flex-wrap: wrap;
}
.bg-selector::-webkit-scrollbar { display: none; }
.bg-option {
  flex-shrink: 0;
  width: 300px;
  height: 170px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
  position: relative;
  background: rgba(255,255,255,0.04);
}
.bg-option:hover { border-color: #ffd700; transform: scale(1.05); }
.bg-option.active { border-color: #ffd700; box-shadow: 0 0 12px rgba(255,215,0,0.4); }
.bg-option.locked { opacity: 0.7; }
.bg-option.locked img { filter: brightness(0.5); }
.bg-option .bg-lock {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  color: #ffd700;
  font-size: 11px;
  font-weight: bold;
  gap: 3px;
}
.bg-option .bg-lock svg { width: 14px; height: 14px; }
.bg-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}
.bg-option .bg-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bg-option-default {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2a3a, #0d1b2a);
  color: #888;
  font-size: 12px;
}

/* 车市、车库中的车辆图片 */
.car-image-sm {
  width: 80px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.car-image-md {
  width: 110px;
  height: 55px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.car-image-lg {
  width: 160px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ============ 收入面板 ============ */
.earnings-panel {
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(233,69,96,0.08));
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(6px);
}
.earnings-total { text-align: center; font-size: 28px; font-weight: bold; color: #ffd700; margin: 8px 0; }
.earnings-total .unit { font-size: 14px; color: #aaa; }
.earnings-list .earning-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.earning-item .car-info { display: flex; align-items: center; gap: 8px; }
.earning-item .car-image-sm { width: 70px; height: 35px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.earning-item .car-name-sm { font-size: 13px; }
.earning-item .earning-amount { color: #ffd700; font-weight: bold; font-size: 14px; }
.earning-item .parked-at { font-size: 11px; color: #888; }

/* ============ 车市 ============ */
.car-category-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 4px;
}
.car-category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}
.category-tab:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.category-tab.active {
  background: linear-gradient(135deg, rgba(233,69,96,0.85), rgba(83,52,131,0.85));
  backdrop-filter: blur(10px);
  border-color: #e94560;
  color: #fff;
}
.car-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.car-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pag-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pag-btn:hover:not(:disabled) { background: rgba(255,255,255,0.18); color: #fff; }
.pag-btn.active { background: linear-gradient(135deg, #e94560, #533483); border-color: #e94560; color: #fff; }
.pag-btn:disabled { opacity: 0.3; cursor: not-allowed; }
/* ============ Show场 ============ */
.show-stage-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.show-stage-left {
  flex-shrink: 0;
  width: 480px;
}
.show-current-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 80px;
}
.show-current-img {
  width: 440px;
  height: 470px;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}
.show-current-name {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  margin-top: 10px;
}
.show-current-hint {
  font-size: 11px;
  color: #ffd700;
  margin-top: 4px;
}
.show-stage-right {
  flex: 1;
  min-width: 0;
}
.show-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.show-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: bold;
  color: #aaa;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(6px);
}
.show-tab:hover { color: #fff; background: rgba(255,255,255,0.08); }
.show-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(233,69,96,0.8), rgba(83,52,131,0.8));
}
.show-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.show-item {
  cursor: pointer;
  text-align: center;
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
  min-width: 80px;
  transition: all 0.2s;
}
.show-item:hover { background: rgba(255,255,255,0.08); }
.show-item.active { background: rgba(255,215,0,0.06); }
.show-item-img {
  width: 150px;
  height: 220px;
  object-fit: contain;
}
.show-item-name {
  font-size: 12px;
  color: #ccc;
  margin-top: 4px;
}
.show-item-price {
  font-size: 10px;
  margin-top: 2px;
}
.show-item-tag {
  font-size: 10px;
  color: #ffd700;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .show-stage-layout { flex-direction: column; }
  .show-stage-left { width: 100%; }
  .show-current-card { position: static; display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
  .show-current-img { width: 120px; height: 140px; }
  .show-current-hint { margin-top: 0; }
}

.car-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
  backdrop-filter: blur(4px);
}
.car-card:hover { border-color: #e94560; transform: translateY(-2px); }
.car-card.locked { opacity: 0.5; cursor: not-allowed; }
.car-card .car-name { font-size: 13px; font-weight: bold; margin-bottom: 4px; }
.car-card .car-price { font-size: 12px; color: #ffd700; }
.car-card .car-earn { font-size: 11px; color: #0f0; margin-top: 2px; }
.car-card .car-level-req { font-size: 11px; color: #e94560; margin-top: 2px; }
.car-card .owned-tag { font-size: 11px; color: #0df; margin-top: 2px; }
.car-card-btns { display: flex; gap: 8px; margin-top: 10px; justify-content: center; }
.car-btn {
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}
.car-btn-buy {
  background: #fff;
  color: #1a1a2e;
}
.car-btn-buy:hover { background: #e94560; color: #fff; }
.car-btn-trade {
  background: transparent;
  color: #0df;
  border: 1px solid rgba(0,210,255,0.4);
}
.car-btn-trade:hover { background: rgba(0,210,255,0.15); }

/* ============ 我的车库 ============ */
/* ============ 我的车库 ============ */
.garage-car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.garage-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
  transition: all 0.2s;
  overflow: hidden;
}
.garage-card:hover { border-color: rgba(255,255,255,0.2); }
.garage-card-img { flex-shrink: 0; }
.garage-card-img .car-image-md { width: 100px; height: 50px; object-fit: contain; }
.garage-card-info { flex: 1; min-width: 0; }
.garage-card-name { font-weight: bold; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.garage-card-label { font-size: 11px; color: #888; }
.garage-card-value { font-size: 13px; margin-top: 1px; }
.garage-card-value.earn { color: #0f0; }
.garage-card-value.revenue { color: #ffd700; }
.garage-card .car-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 3px;
  display: inline-block;
}
.garage-card .car-status.idle { background: rgba(0,210,0,0.15); color: #0f0; }
.garage-card .car-status.parked { background: rgba(255,215,0,0.15); color: #ffd700; }
.garage-card .car-status.charity { background: rgba(233,69,96,0.15); color: #e94560; }

@media (max-width: 480px) {
  .garage-car-grid { grid-template-columns: 1fr; }
  .garage-card-img .car-image-md { width: 80px; height: 40px; }
}

/* ============ 排行榜 ============ */
.ranking-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 4px;
}
.ranking-tabs::-webkit-scrollbar { display: none; }
.ranking-tab {
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  color: #aaa;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
}
.ranking-tab:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
.ranking-tab.active {
  background: linear-gradient(135deg, rgba(233,69,96,0.8), rgba(83,52,131,0.8));
  backdrop-filter: blur(10px);
  border-color: #e94560;
  color: #fff;
  box-shadow: 0 2px 12px rgba(233,69,96,0.3);
}
.ranking-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.ranking-item:hover { background: rgba(233,69,96,0.08); }
.ranking-item.my-rank { border-color: #ffd700; background: rgba(255,215,0,0.08); }
.ranking-pos {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  font-size: 14px;
  margin-right: 12px;
  flex-shrink: 0;
}
.ranking-pos.gold { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; }
.ranking-pos.silver { background: linear-gradient(135deg, #c0c0c0, #888); color: #000; }
.ranking-pos.bronze { background: linear-gradient(135deg, #cd7f32, #8b4513); color: #fff; }
.ranking-pos.normal { background: rgba(255,255,255,0.1); color: #aaa; }
.ranking-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-right: 10px;
  flex-shrink: 0;
  overflow: hidden;
}
.ranking-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.ranking-info { flex: 1; }
.ranking-name { font-weight: bold; font-size: 14px; }
.ranking-meta { font-size: 11px; color: #888; margin-top: 2px; }
.ranking-value { font-weight: bold; color: #ffd700; font-size: 14px; }

/* ============ 排行榜领奖台 ============ */
.ranking-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 20px 10px 16px;
  background: linear-gradient(180deg, rgba(255,215,0,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border-radius: 16px;
  border: 1px solid rgba(255,215,0,0.15);
}
.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 14px;
  padding: 14px 12px 12px;
  transition: all 0.3s;
  cursor: default;
  min-width: 80px;
}
.podium-item:hover { transform: translateY(-2px); }
.podium-first {
  background: linear-gradient(180deg, rgba(255,215,0,0.18) 0%, rgba(255,140,0,0.08) 100%);
  border: 2px solid rgba(255,215,0,0.5);
  box-shadow: 0 4px 20px rgba(255,215,0,0.2);
  padding: 18px 16px 14px;
}
.podium-second {
  background: linear-gradient(180deg, rgba(192,192,192,0.14) 0%, rgba(136,136,136,0.06) 100%);
  border: 1.5px solid rgba(192,192,192,0.35);
  box-shadow: 0 2px 12px rgba(192,192,192,0.1);
}
.podium-third {
  background: linear-gradient(180deg, rgba(205,127,50,0.14) 0%, rgba(139,69,19,0.06) 100%);
  border: 1.5px solid rgba(205,127,50,0.35);
  box-shadow: 0 2px 12px rgba(205,127,50,0.1);
}
.podium-medal {
  font-size: 22px;
  margin-bottom: 6px;
  line-height: 1;
}
.podium-first .podium-medal { font-size: 28px; }
.podium-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
  overflow: hidden;
}
.podium-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.podium-avatar-first {
  width: 56px; height: 56px;
  border: 3px solid #ffd700;
  box-shadow: 0 0 16px rgba(255,215,0,0.4);
}
.podium-name {
  font-weight: bold;
  font-size: 12px;
  color: #fff;
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.podium-first .podium-name { font-size: 14px; color: #ffd700; }
.podium-value {
  font-weight: bold;
  font-size: 11px;
  color: #ffd700;
  text-align: center;
}
.podium-first .podium-value { font-size: 13px; }
.podium-second .podium-value { color: #c0c0c0; }
.podium-third .podium-value { color: #cd7f32; }

/* ============ 排行榜分页 ============ */
.ranking-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.ranking-pagination .pag-ellipsis {
  color: #888;
  font-size: 13px;
  padding: 0 4px;
  user-select: none;
}

@media (max-width: 380px) {
  .podium-item { min-width: 64px; padding: 10px 8px 8px; }
  .podium-first { padding: 14px 10px 10px; }
  .podium-avatar-first { width: 46px; height: 46px; }
  .podium-avatar { width: 38px; height: 38px; }
  .podium-medal { font-size: 18px; }
  .podium-first .podium-medal { font-size: 22px; }
}

/* ============ 公告Tab ============ */
.announce-tabs {
  display: flex;
  gap: 6px;
  padding: 0 10px 8px;
  flex-wrap: wrap;
}
.announce-tab {
  padding: 4px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #aaa;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.announce-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.announce-tab.active {
  border-color: transparent;
  font-weight: 600;
}
.announce-item {
  transition: background 0.15s;
}
.announce-item:hover {
  background: rgba(255,255,255,0.06) !important;
}
.announce-view-btn:hover {
  opacity: 0.8;
}

/* ============ 反馈Tab ============ */
.fb-tab {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.fb-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.fb-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============ 按钮 ============ */
.btn {
  padding: 8px 16px;
  border-radius: 15px;
  border: none;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
}
.btn:hover { transform: scale(1.05); }
.btn-primary { background: linear-gradient(135deg, #e94560, #533483); color: #fff; }
.btn-success { background: linear-gradient(135deg, #0f0, #00a000); color: #000; }
.btn-warning { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; }
.btn-danger { background: linear-gradient(135deg, #e94560, #ff0000); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============ 弹窗 ============ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
.modal-overlay.show { display: flex; }
.modal {
  background: linear-gradient(135deg, #2d1b69, #1a1a2e);
  border: 1px solid #e94560;
  border-radius: 20px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  max-height: calc(var(--tg-viewport-height) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: bold; color: #ffd700; margin-bottom: 16px; text-align: center; }

/* ============ 玩家留言板 ============ */
.guestbook-modal {
  width: min(92vw, 560px);
  max-width: 560px;
  overflow: hidden;
}
.guestbook-list {
  max-height: min(48vh, 420px);
  min-height: 150px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}
.guestbook-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  color: #85859a;
  font-size: 13px;
  text-align: center;
}
.guestbook-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  margin-bottom: 9px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
}
.guestbook-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.guestbook-meta {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: baseline;
}
.guestbook-name {
  overflow: hidden;
  color: #ffd700;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guestbook-time {
  flex-shrink: 0;
  color: #77778a;
  font-size: 10px;
}
.guestbook-ai-tag {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(79,195,247,0.12);
  color: #4fc3f7;
  font-size: 9px;
}
.guestbook-text {
  margin-top: 5px;
  color: #e7e7ef;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.guestbook-delete {
  min-width: 42px;
  padding: 5px 7px;
  border: 0;
  border-radius: 8px;
  background: rgba(233,69,96,0.12);
  color: #ff8da0;
  cursor: pointer;
  font-size: 11px;
}
.guestbook-delete:hover { background: rgba(233,69,96,0.22); }
.guestbook-composer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.guestbook-composer textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 11px;
  outline: none;
  background: rgba(4,7,20,0.38);
  color: #fff;
  font: inherit;
  line-height: 1.5;
}
.guestbook-composer textarea:focus { border-color: rgba(79,195,247,0.7); }
.guestbook-compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: #77778a;
  font-size: 11px;
}
.guestbook-modal-actions { margin-top: 14px; text-align: center; }

/* ============ 消息提示 ============ */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  white-space: nowrap;
}
.toast.success { background: rgba(0,200,0,0.9); color: #fff; }
.toast.error { background: rgba(233,69,96,0.9); color: #fff; }
.toast.info { background: rgba(0,150,255,0.9); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ============ 返回按钮 ============ */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
  padding: 4px 0;
}
.back-btn:hover { color: #e94560; }

/* ============ 消息通知列表 ============ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.notif-unread { background: rgba(124,92,252,0.08); }
.notif-item.notif-unread:hover { background: rgba(124,92,252,0.14); }
.notif-item.notif-read { opacity: 0.65; }
.notif-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.notif-body { flex: 1; min-width: 0; }
.notif-msg { font-size: 13px; line-height: 1.5; color: #e0e0f0; word-break: break-all; }
.notif-time { font-size: 11px; color: #666; margin-top: 4px; }
.notif-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: #e94560;
  border-radius: 50%;
}

/* ============ 换车选择 ============ */
.trade-car-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.trade-car-item:hover { background: rgba(233,69,96,0.1); }
.trade-car-item .left { display: flex; align-items: center; gap: 10px; }
.trade-car-item .trade-price { color: #ffd700; font-size: 13px; }

/* ============ 停车选择 ============ */
.select-car-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.select-car-item:hover { background: rgba(233,69,96,0.1); }

/* ============ 页面标题 ============ */
.page-title {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e94560; border-radius: 2px; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .sidebar-content { width: 180px; }
  .chat-sidebar-content { width: 220px; }
  .car-grid { grid-template-columns: 1fr; }
  .nav-tab { padding: 8px 10px; }
  .nav-tab-label { font-size: 11px; }
  .user-bar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .user-bar-stats { gap: 6px; flex-wrap: wrap; }
  .spot-grid { max-width: 100%; }
  .parking-spot .car-image { width: 180px; height: 90px; }
  .parking-spot .spot-qqshow { width: 100px; height: 110px; }
}
@media (max-width: 480px) {
  .nav-tab-label { font-size: 10px; }
  .user-bar-stat { font-size: 11px; }
  .sidebar-content { width: 160px; }
  .chat-sidebar-content { width: 200px; }
  .spot-grid { grid-template-columns: 1fr; max-width: 100%; }
  .parking-spot .car-image { width: 140px; height: 70px; }
  .parking-spot .spot-qqshow { width: 70px; height: 80px; }
  .spot-bottom-bar { gap: 6px; padding: 4px 10px 4px 4px; }
}

/* Telegram Mini App 手机布局 */
@media (max-width: 768px) {
  .top-nav { overflow: hidden; }
  .nav-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
  }
  .broadcast-bar { flex: 0 0 190px; min-width: 190px; margin-right: 8px; }
  .main-content { height: calc(var(--tg-viewport-height) - 56px - env(safe-area-inset-top, 0px)); }
  .main-content-inner { position: relative; }
  .page-area { width: 100%; padding-bottom: env(safe-area-inset-bottom, 0px); }

  .chat-sidebar,
  .sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 120;
  }
  .chat-sidebar { left: 0; }
  .sidebar { right: 0; }
  .chat-sidebar-content,
  .sidebar-content {
    width: min(82vw, 320px);
    box-shadow: 0 0 28px rgba(0,0,0,0.55);
  }
  .chat-sidebar.collapsed .chat-sidebar-content,
  .sidebar.collapsed .sidebar-content { width: 0; }
  .chat-sidebar-toggle,
  .sidebar-toggle { width: 38px; min-height: 100%; }

  .user-bar { display: block; padding: 8px 10px; }
  .user-bar-left { min-width: 0; }
  .user-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-bar-stats {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    padding-top: 7px;
    scrollbar-width: none;
  }
  .user-bar-stats::-webkit-scrollbar { display: none; }
  .user-bar-stat { min-height: 34px; flex: 0 0 auto; }
  .page { padding: 10px 44px; }
  .parking-lot { margin-top: 70px; }
  .modal { width: 100%; padding: 18px; border-radius: 16px; }
  .toast-container { top: calc(62px + env(safe-area-inset-top, 0px)); width: calc(100% - 24px); }
  .toast { max-width: 100%; white-space: normal; text-align: center; }

  .btn,
  .car-btn,
  .park-btn,
  .spot-action-btn,
  .spot-charity-btn,
  .select-car-item,
  .trade-car-item,
  .fb-tab,
  .announce-tab,
  .chat-send-btn,
  .chat-emo-btn { min-height: 44px; }
  input,
  select,
  textarea { font-size: 16px !important; }
}

@media (max-width: 480px) {
  .page { padding: 8px 42px; }
  .spot-grid { grid-template-columns: 1fr; gap: 12px; }
  .parking-spot { min-height: 210px; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .bot-notify-toggle { justify-content: center; }
  .login-box { width: 100%; padding: 28px 20px; }
  .login-title { font-size: 28px; }
  .character-choice { min-height: 120px; }
  .player-list-tab { min-height: 44px; }
  .sidebar-player-actions button,
  .sidebar-add-friend,
  .player-list-pagination button,
  .invite-friend-btn { min-height: 44px; }
}

/* ============ TG抢车位全屏启动体验 ============ */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overscroll-behavior: none;
}

#gameContainer {
  position: relative;
  width: 100vw;
  height: var(--tg-viewport-height);
  min-height: 100dvh;
  overflow: hidden;
}

.login-page {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: var(--tg-viewport-height);
  min-height: 100dvh;
  overflow: hidden;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(32px, 6vw, 112px);
  padding:
    max(34px, env(safe-area-inset-top, 0px))
    max(6vw, env(safe-area-inset-right, 0px))
    max(34px, env(safe-area-inset-bottom, 0px))
    max(7vw, env(safe-area-inset-left, 0px));
  background:
    #102c32 url('assets/parking-bg/tg-launch-v1.png') center center / cover no-repeat;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 22, 29, 0.1) 0%, rgba(5, 22, 29, 0.06) 42%, rgba(4, 18, 25, 0.68) 72%, rgba(4, 16, 23, 0.91) 100%),
    linear-gradient(0deg, rgba(5, 17, 22, 0.58) 0%, transparent 46%);
}

.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 45%, rgba(255, 191, 96, 0.12), transparent 34%),
    radial-gradient(circle at 28% 76%, rgba(255, 110, 62, 0.13), transparent 38%);
}

.login-brand {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  max-width: 650px;
  margin-bottom: clamp(18px, 6vh, 72px);
  color: #fff8e9;
  text-shadow: 0 3px 24px rgba(2, 12, 16, 0.72);
}

.login-edition {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: #ffe0a3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.login-edition span {
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffb64d, #ff6c3c);
  box-shadow: 0 0 14px rgba(255, 139, 63, 0.7);
}

.login-title {
  margin: 0 0 12px;
  color: #fff8e9;
  background: none;
  -webkit-text-fill-color: initial;
  font-size: clamp(42px, 5.4vw, 78px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.05em;
  text-align: left;
}

.login-title em {
  padding-right: 0.1em;
  color: #ffbb52;
  font-style: normal;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(180deg, #fff0a5 0%, #ffae3d 52%, #ff6737 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 5px 12px rgba(255, 92, 34, 0.25));
}

.login-subtitle {
  max-width: 540px;
  margin: 0 0 20px;
  color: rgba(255, 248, 233, 0.86);
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.7;
  text-align: left;
}

.login-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-feature-list span {
  padding: 7px 12px;
  border: 1px solid rgba(255, 229, 177, 0.3);
  border-radius: 999px;
  background: rgba(10, 37, 40, 0.45);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  color: #ffe7bc;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.login-box {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: min(410px, 38vw);
  max-width: 100%;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(255, 236, 194, 0.22);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(17, 48, 51, 0.9), rgba(6, 25, 32, 0.95));
  box-shadow:
    0 30px 80px rgba(0, 9, 15, 0.48),
    inset 0 1px rgba(255, 255, 255, 0.13),
    inset 0 -1px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px) saturate(1.2);
}

.login-box-glow {
  position: absolute;
  top: -110px;
  right: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 168, 65, 0.13);
  filter: blur(36px);
  pointer-events: none;
}

.login-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  text-align: left;
}

.login-logo-badge {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 211, 132, 0.5);
  border-radius: 19px;
  background: linear-gradient(145deg, #ffca65, #f06a35);
  box-shadow: 0 10px 28px rgba(226, 91, 37, 0.34), inset 0 1px rgba(255,255,255,0.45);
}

.login-logo-svg {
  width: 38px;
  height: 38px;
  animation: none;
  filter: brightness(0) saturate(100%) invert(12%) sepia(17%) saturate(1546%) hue-rotate(144deg) brightness(91%);
}

.login-card-heading {
  display: grid;
  gap: 4px;
}

.login-card-heading small,
.auth-status-panel small {
  color: #91aeb1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.login-card-heading strong {
  color: #fff8e9;
  font-size: 21px;
  letter-spacing: 0.02em;
}

.auth-status-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 15px 17px;
  border: 1px solid rgba(117, 216, 181, 0.2);
  border-radius: 18px;
  background: rgba(6, 24, 29, 0.54);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.auth-status-light {
  position: relative;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #66e2a2;
  box-shadow: 0 0 0 0 rgba(102, 226, 162, 0.45), 0 0 18px rgba(102, 226, 162, 0.55);
  animation: authPulse 1.5s ease-out infinite;
}

@keyframes authPulse {
  0% { box-shadow: 0 0 0 0 rgba(102, 226, 162, 0.45), 0 0 18px rgba(102, 226, 162, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(102, 226, 162, 0), 0 0 18px rgba(102, 226, 162, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(102, 226, 162, 0), 0 0 18px rgba(102, 226, 162, 0.45); }
}

.tg-auth-status {
  margin-top: 5px;
  color: #eef8f5;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
}

.auth-status-panel.error {
  border-color: rgba(255, 109, 95, 0.34);
  background: rgba(68, 25, 27, 0.42);
}

.auth-status-panel.error .auth-status-light {
  background: #ff796c;
  box-shadow: 0 0 18px rgba(255, 103, 91, 0.55);
  animation: none;
}

.tg-auth-status.error { color: #ffd3cb; }

.tg-only-icon {
  margin: 4px 0 10px;
  font-size: 38px;
  text-align: center;
}

.tg-only-title {
  margin-bottom: 7px;
  color: #fff7e8;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.tg-only-desc {
  color: #9fb5b6;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.tg-open-button {
  display: block;
  min-height: 44px;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffc45b, #f06a35);
  box-shadow: 0 10px 24px rgba(226, 91, 37, 0.28), inset 0 1px rgba(255,255,255,0.4);
  color: #173238;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.login-security-note {
  margin-top: 20px;
  color: #718e91;
  font-size: 11px;
  text-align: center;
}

.login-security-note span { color: #efaa4b; }

.character-choice-grid { margin-top: 14px; }
.character-choice {
  min-height: 120px;
  border-color: rgba(255, 220, 157, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #fff3dc;
  font-weight: 700;
}
.character-choice:hover {
  border-color: rgba(255, 184, 77, 0.72);
  background: rgba(255, 174, 61, 0.11);
  transform: translateY(-2px);
}

.orientation-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    linear-gradient(rgba(7, 28, 33, 0.82), rgba(4, 18, 24, 0.96)),
    url('assets/parking-bg/tg-launch-v1.png') 37% center / cover no-repeat;
  color: #fff5df;
  text-align: center;
}

.orientation-phone {
  position: relative;
  width: 54px;
  height: 88px;
  margin-bottom: 26px;
  border: 3px solid #ffd06f;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(255, 164, 67, 0.24);
  animation: rotatePhone 2.1s ease-in-out infinite;
}

.orientation-phone::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 15px;
  height: 2px;
  border-radius: 4px;
  background: #ffd06f;
  transform: translateX(-50%);
}

.orientation-phone span {
  position: absolute;
  right: -23px;
  bottom: -15px;
  width: 34px;
  height: 34px;
  border-right: 3px solid #ff8547;
  border-bottom: 3px solid #ff8547;
  border-radius: 0 0 23px;
}

.orientation-title { margin-bottom: 8px; font-size: 25px; font-weight: 900; }
.orientation-desc { color: #bdd0ce; font-size: 14px; }

@keyframes rotatePhone {
  0%, 18% { transform: rotate(0deg); }
  55%, 82% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

@media (orientation: landscape) and (max-height: 600px) {
  #messageModal .guestbook-modal {
    width: min(82vw, 620px);
    padding: 14px 18px;
  }
  #messageModal .modal-title { margin-bottom: 9px; font-size: 15px; }
  #messageModal .guestbook-list { min-height: 92px; max-height: 38vh; }
  #messageModal .guestbook-item { padding: 8px 10px; margin-bottom: 6px; }
  #messageModal .guestbook-composer { margin-top: 7px; padding-top: 7px; }
  #messageModal .guestbook-composer textarea { min-height: 52px; max-height: 72px; }
  #messageModal .guestbook-modal-actions { margin-top: 7px; }

  .login-page {
    gap: clamp(20px, 4vw, 48px);
    padding:
      max(12px, env(safe-area-inset-top, 0px))
      max(22px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px))
      max(28px, env(safe-area-inset-left, 0px));
    background-position: 44% center;
  }
  .login-brand { align-self: center; max-width: 46vw; margin: 0; }
  .login-edition { margin-bottom: 8px; font-size: 9px; }
  .login-title { margin-bottom: 8px; font-size: clamp(34px, 6vw, 48px); }
  .login-subtitle { margin-bottom: 12px; font-size: 11px; line-height: 1.45; }
  .login-feature-list span { padding: 5px 9px; font-size: 9px; }
  .login-box { width: min(370px, 46vw); padding: 16px 18px; border-radius: 22px; }
  .login-logo-wrap { gap: 11px; margin-bottom: 13px; }
  .login-logo-badge { width: 46px; height: 46px; border-radius: 14px; }
  .login-logo-svg { width: 29px; height: 29px; }
  .login-card-heading strong { font-size: 16px; }
  .auth-status-panel { min-height: 58px; padding: 10px 12px; border-radius: 14px; }
  .tg-auth-status { font-size: 12px; }
  .login-security-note { margin-top: 10px; font-size: 9px; }
  .tg-only-icon { display: none; }
  .tg-open-button { min-height: 38px; margin-top: 10px; padding: 9px 14px; }
  .character-choice-grid { gap: 8px; margin-top: 8px; }
  .character-choice { min-height: 82px; gap: 4px; font-size: 11px; }
  .character-choice img { width: 50px; height: 50px; }
}

@media (orientation: portrait) and (max-width: 900px) {
  .tg-mobile-platform .orientation-gate { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-status-light,
  .orientation-phone { animation: none; }
}

/* 手机横屏：缩小游戏 HUD、聊天与车位内容，保留更多可玩区域 */
@media (orientation: landscape) and (max-height: 600px) {
  #gameContainer .nav-tab {
    min-height: 34px;
    margin: 3px 2px;
    padding: 6px 8px;
    font-size: 10px;
  }
  #gameContainer .nav-tab-label { font-size: 10px; }
  #gameContainer .nav-ico { width: 13px; height: 13px; margin-right: 2px; }
  #gameContainer .broadcast-bar { flex-basis: 150px; min-width: 150px; height: 24px; }
  #gameContainer .broadcast-scroll-area { height: 24px; }
  #gameContainer .broadcast-content { font-size: 10px; }
  #gameContainer .main-content {
    height: calc(var(--tg-viewport-height) - 42px - env(safe-area-inset-top, 0px));
  }
  #gameContainer .nav-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  #gameContainer .nav-tabs::-webkit-scrollbar { display: none; }
  #gameContainer .main-content-inner { position: relative; }
  #gameContainer .user-bar {
    display: flex;
    gap: 8px;
    padding: 4px 8px;
  }
  #gameContainer .user-bar-avatar { width: 26px; height: 26px; font-size: 12px; }
  #gameContainer .user-bar-name { max-width: 150px; font-size: 11px; }
  #gameContainer .user-bar-stats {
    gap: 8px;
    padding-top: 0;
    overflow-x: auto;
  }
  #gameContainer .user-bar-stat { min-height: 28px; font-size: 10px; }
  #gameContainer .user-bar-stat .stat-label { font-size: 9px; }
  #gameContainer .stat-ico { width: 12px; height: 12px; }

  #gameContainer .chat-sidebar,
  #gameContainer .sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 120;
  }
  #gameContainer .chat-sidebar { left: 0; }
  #gameContainer .sidebar { right: 0; }
  #gameContainer .chat-sidebar-content { width: min(44vw, 280px); }
  #gameContainer .sidebar-content { width: min(42vw, 270px); }
  #gameContainer .chat-sidebar.collapsed .chat-sidebar-content,
  #gameContainer .sidebar.collapsed .sidebar-content { width: 0; }
  #gameContainer .chat-sidebar-toggle,
  #gameContainer .sidebar-toggle { width: 28px; }
  #gameContainer .chat-toggle-text,
  #gameContainer .toggle-text { font-size: 10px; letter-spacing: 3px; }
  #gameContainer .chat-toggle-arrow,
  #gameContainer .toggle-arrow { margin-top: 5px; font-size: 9px; }
  #gameContainer .chat-sidebar-title { padding: 7px 9px 6px; font-size: 12px; }
  #gameContainer .chat-messages { gap: 4px; padding: 5px 6px; }
  #gameContainer .chat-msg {
    padding: 5px 7px;
    border-radius: 7px;
    font-size: 10px;
    line-height: 1.35;
  }
  #gameContainer .chat-msg-header { gap: 4px; margin-bottom: 2px; }
  #gameContainer .chat-msg-avatar-image,
  #gameContainer .chat-msg-avatar-fallback {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
  #gameContainer .chat-msg-avatar-fallback { font-size: 9px; line-height: 16px; }
  #gameContainer .chat-msg-name { font-size: 9px; }
  #gameContainer .chat-msg-title { padding: 1px 3px; font-size: 7px; }
  #gameContainer .chat-msg-time { font-size: 8px; }
  #gameContainer .chat-msg-text { padding-left: 20px; }
  #gameContainer .emo-inline { font-size: 13px; }
  #gameContainer .chat-input-bar { gap: 3px; padding: 5px 6px; }
  #gameContainer .chat-input {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 12px !important;
  }
  #gameContainer .chat-emo-btn,
  #gameContainer .chat-send-btn {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 11px;
  }
  #gameContainer .chat-emo-btn { font-size: 14px; }

  #gameContainer .page { padding: 5px 32px; }
  #gameContainer .parking-lot { min-height: 0; margin-top: 36px; }
  #gameContainer .spot-grid { gap: 8px; }
  #gameContainer .parking-spot { min-height: 160px; padding: 18px 8px 8px; }
  #gameContainer .parking-spot .car-image { width: 150px; height: 75px; }
  #gameContainer .parking-spot .spot-qqshow { width: 90px; height: 100px; }
  #gameContainer .parking-spot .car-name,
  #gameContainer .parking-spot .car-earning { font-size: 10px; }
  #gameContainer .parking-spot .car-owner,
  #gameContainer .parking-spot .spot-label { font-size: 9px; }
  #gameContainer .spot-bottom-bar { gap: 5px; margin-top: 4px; padding: 3px 8px 3px 3px; }
  #gameContainer .spot-bottom-bar .spot-player-avatar { width: 22px; height: 22px; }
  #gameContainer .spot-bottom-bar .spot-player-name { font-size: 9px; }
  #gameContainer .spot-action-btn,
  #gameContainer .spot-charity-btn,
  #gameContainer .park-btn,
  #gameContainer .car-btn,
  #gameContainer .btn { min-height: 32px; }
  #gameContainer .modal { max-height: calc(var(--tg-viewport-height) - 20px); padding: 13px; }
}
