/* ====== CSS 变量 ====== */
:root {
  /* Telegram 安全区域 */
  --tg-safe-top: 0px;
  --tg-safe-bottom: 0px;

  /* 主题色 - 赛博朋克风格 */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111628;
  --bg-card: #161d35;
  --bg-card-hover: #1e2745;
  --bg-input: #0d1225;

  /* 强调色 */
  --accent-gold: #00f0ff;
  --accent-gold-light: #00e0ff;
  --accent-red: #ff2d7b;
  --accent-green: #39ff14;
  --accent-blue: #4d7cff;
  --accent-purple: #b84dff;

  /* 品牌梯度色 */
  --tier-legendary: #00f0ff;   /* 特级 - 霓虹青 */
  --tier-high: #ff2d7b;        /* 高级 - 霓虹粉 */
  --tier-mid: #4d7cff;         /* 中级 - 电蓝 */
  --tier-low: #6c6c8a;         /* 低级 - 暗灰 */

  /* 文字色 */
  --text-primary: #e0e8ff;
  --text-secondary: #7b8ec2;
  --text-muted: #3d4770;
  --text-gold: var(--accent-gold);

  /* 边框 */
  --border-color: #1e2745;
  --border-active: var(--accent-gold);

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 50%;

  /* 间距 */
  --header-height: 56px;
    --jackpot-height: 40px;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* 动画 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

/* ====== 基础重置 ====== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* 粒子背景 canvas */
#particleBg {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  background-image: url("/assets/bg.png");
  background-size: cover;
  background-repeat: no-repeat;
}

body::before {
  content: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 240, 255, 0.015) 0px,
    rgba(0, 240, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* 数据流光条（从上到下扫描） */
#app-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), var(--accent-purple), transparent);
  opacity: 0.5;
  animation: dataFlow 4s linear infinite;
  z-index: 10;
  pointer-events: none;
}

/* 网格脉冲特效（叠加在背景图上方） */
#app-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(184, 77, 255, 0.06) 0%, transparent 50%);
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
  pointer-events: none;
  z-index: 1;
  animation: gridPulse 6s ease-in-out infinite;
}

@keyframes dataFlow {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(100vh); opacity: 0; }
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  outline: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

/* ====== 头部 ====== */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-height) + var(--tg-safe-top));
  padding-top: var(--tg-safe-top);
  background: rgba(17, 22, 40, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 1px 20px rgba(0, 240, 255, 0.08), 0 1px 0 rgba(0, 240, 255, 0.15) inset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 600;
}

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

.user-avatar, .profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
  border: 2px solid rgba(0, 240, 255, 0.4);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-level {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 600;
}

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

.points-display {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-lg);
  padding: 4px 10px;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15), inset 0 0 6px rgba(0, 240, 255, 0.05);
}

.points-icon {
  font-size: 16px;
}

.points-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  font-family: var(--font-mono);
}

.lang-select-header {
  min-width: 100px;
  height: 32px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
}

.lang-select-header:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.lang-select-header option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ====== 主内容 ====== */
#app-main {
  position: fixed;
  top: calc(var(--header-height) + var(--jackpot-height) + var(--tg-safe-top));
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: none;
  z-index: 1;
}

/* ====== 快捷入口按钮栏 ====== */
.quick-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px 14px;
  /* background: rgba(17, 22, 40, 0.85); */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  flex-shrink: 0;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  background: rgba(22, 29, 53, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all 0.25s ease;
  min-width: 64px;
  position: relative;
  overflow: hidden;
}

.quick-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.quick-btn:active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2), inset 0 0 8px rgba(0, 240, 255, 0.05);
  transform: translateY(-1px);
}

.quick-btn:active::after {
  opacity: 1;
}

.quick-btn:active .quick-icon {
  animation: iconBounce 0.3s ease;
}

.quick-icon {
  font-size: 22px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.quick-label {
  font-size: 10px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

@keyframes iconBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25) translateY(-2px); }
  100% { transform: scale(1); }
}

/* ====== 全屏面板弹窗 ====== */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 500;
  display: none;
  backdrop-filter: blur(2px);
}

.panel-overlay.show {
  display: block;
  animation: panelFadeIn 0.2s ease;
}

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

.panel-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 2px solid var(--accent-gold);
  box-shadow: 0 -4px 30px rgba(0, 240, 255, 0.1);
  display: flex;
  flex-direction: column;
  animation: panelSlideUp 0.3s ease;
  overflow: hidden;
}

@keyframes panelSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 16px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.panel-close:active {
  background: var(--accent-red);
  color: #fff;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

/* 面板加载中 */
.panel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 12px;
}

.panel-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: panelSpin 0.8s linear infinite;
}

.panel-loading-text {
  font-size: 13px;
  color: var(--text-muted);
}

@keyframes panelSpin {
  to { transform: rotate(360deg); }
}

/* ====== 通用页面头部 ====== */
.page-header {
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.page-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ====== 弹窗 ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: rgba(22, 29, 53, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-lg);
  width: 85%;
  max-width: 280px;
  overflow: hidden;
  animation: modalIn 0.25s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.08);
}

@keyframes modalIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 16px 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 8px 16px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.modal-footer {
  padding: 0 16px 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.modal-footer button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition-fast);
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
  color: #000;
}

.modal-footer .btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* 大奖弹窗特殊样式 */
.modal-box.modal-jackpot {
  border-color: var(--accent-gold);
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.5), 0 0 100px rgba(184, 77, 255, 0.2);
  background: linear-gradient(180deg, rgba(20, 20, 40, 0.98), rgba(10, 10, 30, 0.98));
}

.modal-box.modal-jackpot .modal-header {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(184, 77, 255, 0.25));
  font-size: 22px;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
  animation: jackpotTitlePulse 2s ease-in-out infinite;
}

@keyframes jackpotTitlePulse {
  0%, 100% { text-shadow: 0 0 12px rgba(0, 240, 255, 0.5); }
  50%       { text-shadow: 0 0 25px rgba(0, 240, 255, 0.9), 0 0 40px rgba(184, 77, 255, 0.4); }
}

.modal-box.modal-jackpot .modal-body {
  padding: 15px 20px;
}

.modal-box.modal-jackpot .btn-primary {
  background: linear-gradient(135deg, #00f0ff, #b84dff);
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

/* ====== Toast ====== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--jackpot-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: rgba(10, 14, 26, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  animation: toastIn 0.2s ease, toastOut 0.3s ease 2s forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.toast.toast-success { border-color: var(--accent-green); color: var(--accent-green); box-shadow: 0 0 12px rgba(57, 255, 20, 0.15); }
.toast.toast-error   { border-color: var(--accent-red);   color: var(--accent-red);   box-shadow: 0 0 12px rgba(255, 45, 123, 0.15); }
.toast.toast-gold    { border-color: var(--accent-gold);  color: var(--accent-gold);  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15); }

@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ====== 广播条 ====== */
.broadcast-bar {
  position: fixed;
  top: calc(var(--header-height) + var(--tg-safe-top));
  left: 0;
  right: 0;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.15), rgba(184, 77, 255, 0.15));
  border-bottom: 1px solid rgba(0, 240, 255, 0.3);
  padding: 8px 12px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 90;
  font-size: 13px;
  animation: broadcastSlide 0.4s ease;
}

.broadcast-bar.show {
  display: flex;
}

.broadcast-icon { font-size: 16px; }
.broadcast-text { flex: 1; color: var(--accent-gold-light); }
.broadcast-close { font-size: 14px; color: var(--text-muted); padding: 4px; }

@keyframes broadcastSlide {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

/* ====== 通用组件样式 ====== */

/* 品牌徽章 */
.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.brand-logo {
  width: 80%;
  height: 80%;
  object-fit: contain;
  pointer-events: none;
}

.brand-badge.tier-legendary {
  border: 3px solid #00f0ff;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.25), rgba(0, 180, 220, 0.1));
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6), inset 0 0 8px rgba(0, 240, 255, 0.15);
  animation: legendaryGlow 2s ease-in-out infinite;
}

.brand-badge.tier-high {
  border: 3px solid #ff2d7b;
  background: radial-gradient(circle, rgba(255, 45, 123, 0.2), rgba(180, 20, 60, 0.08));
  box-shadow: 0 0 10px rgba(255, 45, 123, 0.45), inset 0 0 6px rgba(255, 45, 123, 0.1);
  animation: highGlow 2.5s ease-in-out infinite;
}

.brand-badge.tier-mid {
  border: 2px solid #4d7cff;
  background: radial-gradient(circle, rgba(77, 124, 255, 0.18), rgba(40, 70, 160, 0.06));
  box-shadow: 0 0 8px rgba(77, 124, 255, 0.35), inset 0 0 5px rgba(77, 124, 255, 0.08);
  animation: midGlow 3s ease-in-out infinite;
}

.brand-badge.tier-low {
  border: 2px solid #6c6c8a;
  background: radial-gradient(circle, rgba(108, 108, 138, 0.15), rgba(60, 60, 80, 0.05));
  box-shadow: 0 0 4px rgba(108, 108, 138, 0.2);
  animation: lowGlow 3.5s ease-in-out infinite;
}

/* 金色边框（特定高端品牌） */
.brand-badge.gold-border {
  border: 3px solid #ffd700 !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), inset 0 0 6px rgba(255, 215, 0, 0.15) !important;
  animation: goldGlow 2s ease-in-out infinite !important;
}

@keyframes legendaryGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(0, 240, 255, 0.6), inset 0 0 8px rgba(0, 240, 255, 0.15); }
  50%       { box-shadow: 0 0 30px rgba(0, 240, 255, 0.9), inset 0 0 14px rgba(0, 240, 255, 0.25); }
}

@keyframes highGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 45, 123, 0.45), inset 0 0 6px rgba(255, 45, 123, 0.1); }
  50%       { box-shadow: 0 0 20px rgba(255, 45, 123, 0.7), inset 0 0 10px rgba(255, 45, 123, 0.2); }
}

@keyframes midGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(77, 124, 255, 0.35), inset 0 0 5px rgba(77, 124, 255, 0.08); }
  50%       { box-shadow: 0 0 15px rgba(77, 124, 255, 0.55), inset 0 0 8px rgba(77, 124, 255, 0.15); }
}

@keyframes lowGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(108, 108, 138, 0.2); }
  50%       { box-shadow: 0 0 10px rgba(108, 108, 138, 0.4); }
}

@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), inset 0 0 6px rgba(255, 215, 0, 0.15); }
  50%       { box-shadow: 0 0 24px rgba(255, 215, 0, 0.8), inset 0 0 12px rgba(255, 215, 0, 0.25); }
}

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-purple));
  transition: width 0.4s ease;
}

/* Toggle 开关 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-normal);
  pointer-events: none;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: var(--transition-normal);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* ====== 滚动条 ====== */
.panel-body::-webkit-scrollbar {
  width: 3px;
}
.panel-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

/* ====== 响应式 ====== */

/* 小屏幕宽度适配（≤360px，如 iPhone SE） */
@media (max-width: 360px) {
  #app-header {
    padding: 0 8px;
    height: 48px;
  }

  :root {
    --header-height: 48px;
    --jackpot-height: 34px;
  }

  .user-avatar, .profile-avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .user-name { font-size: 12px; }
  .user-level { font-size: 10px; }

  .points-display {
    padding: 3px 8px;
    gap: 3px;
  }

  .points-icon { font-size: 14px; }
  .points-value { font-size: 12px; }

  .lang-select-header {
    min-width: 80px;
    font-size: 10px;
    height: 28px;
    padding: 2px 6px;
    padding-right: 18px;
  }

  .quick-nav {
    gap: 8px;
    padding: 8px 8px 12px;
  }

  .quick-btn {
    padding: 6px 10px;
    min-width: 52px;
    gap: 1px;
  }

  .quick-icon { font-size: 18px; }
  .quick-label { font-size: 9px; }

  .panel-container {
    max-height: 90vh;
  }

  .panel-header {
    padding: 10px 12px 8px;
  }

  .panel-title { font-size: 15px; }

  .modal-box {
    width: 90%;
    max-width: 300px;
  }

  .toast {
    font-size: 12px;
    padding: 6px 12px;
  }

  .broadcast-bar {
    font-size: 11px;
    padding: 6px 8px;
  }
}

/* 超小屏幕适配（≤320px） */
@media (max-width: 320px) {
  #app-header {
    padding: 0 6px;
    height: 44px;
  }

  :root {
    --header-height: 44px;
    --jackpot-height: 30px;
  }

  .header-left { gap: 4px; }
  .header-right { gap: 4px; }

  .user-avatar, .profile-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .points-display {
    padding: 2px 6px;
  }

  .lang-select-header {
    min-width: 70px;
    font-size: 9px;
  }

  .quick-nav {
    gap: 4px;
    padding: 6px 6px 10px;
  }

  .quick-btn {
    padding: 5px 8px;
    min-width: 44px;
  }

  .modal-box {
    width: 94%;
  }

  .modal-header { font-size: 14px; padding: 12px 12px 6px; }
  .modal-body { padding: 6px 12px 12px; font-size: 13px; }
  .modal-footer { padding: 0 12px 12px; gap: 6px; }
  .modal-footer button { padding: 8px; font-size: 13px; }
}

/* 大屏幕宽度上限 */
@media (min-width: 420px) {
  body {
    max-width: 420px;
    margin: 0 auto;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
  }
}

/* 横屏/超矮屏幕适配 */
@media (max-height: 500px) {
  .quick-nav {
    padding: 4px 8px 6px;
    gap: 6px;
  }

  .quick-btn {
    padding: 4px 8px;
    min-width: 48px;
  }

  .quick-icon { font-size: 16px; }
  .quick-label { font-size: 8px; }

  .panel-container {
    max-height: 92vh;
  }
}
