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

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
    Arial, sans-serif;
  background: #0a0a0f;
  color: #fff;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

input {
  font-family: inherit;
  outline: none;
}

/* ============ 首页 ============ */
.home-wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(circle at 20% 20%, #1a1a3e 0%, #0a0a0f 60%);
}

.home-logo {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ff4d6d, #ff8a5c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-sub {
  color: #888;
  font-size: 14px;
  margin-bottom: 48px;
}

.home-card {
  width: 100%;
  max-width: 420px;
  background: #16161f;
  border: 1px solid #2a2a3a;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}

.home-card h2 {
  font-size: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-card h2 .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d6d;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #2a2a3a;
  background: #0d0d14;
  color: #fff;
  font-size: 15px;
}

.form-group input:focus {
  border-color: #ff4d6d;
}

/* 上传行 */
.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-preview {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 2px dashed #3a3a4a;
  background: #0d0d14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.upload-preview .upload-placeholder {
  font-size: 24px;
  color: #555;
}

.upload-preview .preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-ghost {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #3a3a4a;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ghost:active {
  background: rgba(255, 255, 255, 0.15);
}

/* 开关 */
.form-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-switch > label {
  margin-bottom: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 14px;
  flex-shrink: 0;
}

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

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #3a3a4a;
  border-radius: 14px;
  transition: 0.3s;
}

.switch .slider:before {
  content: "";
  position: absolute;
  height: 10px;
  width: 10px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: #ff4d6d;
}

.switch input:checked + .slider:before {
  transform: translateX(10px);
}

.btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #ff4d6d, #ff8a5c);
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-secondary {
  background: #2a2a3a;
}

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

.home-tip {
  color: #666;
  font-size: 12px;
  text-align: center;
  margin-top: 24px;
  line-height: 1.6;
}

/* ============ 直播页通用 ============ */
.live-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
}

.video-container {
  position: relative;
  flex: 1;
  width: 100%;
  background: #000;
  overflow: hidden;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 顶部栏 */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
  z-index: 10;
}

.host-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  backdrop-filter: blur(8px);
}

.host-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4d6d, #ff8a5c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.host-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ff4d6d;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.live-tag .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.viewer-count {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.viewer-count .count-icon {
  width: 14px;
  height: 14px;
  display: block;
}

.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.top-right-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.net-status {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.net-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  flex-shrink: 0;
}

.net-status.good .net-dot { background: #34c759; }
.net-status.normal .net-dot { background: #ff9500; }
.net-status.bad .net-dot { background: #ff3b30; }
.net-status.offline .net-dot { background: #999; }

.net-status.good .net-text { color: #34c759; }
.net-status.normal .net-text { color: #ff9500; }
.net-status.bad .net-text { color: #ff3b30; }
.net-status.offline .net-text { color: #999; }

.live-duration {
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.switch-cam-btn {
  position: absolute;
  right: 16px;
  top: 70px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: transform 0.3s;
  z-index: 10;
}

.switch-cam-btn .switch-cam-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.switch-cam-btn:active {
  transform: rotate(180deg);
}

.voice-btn {
  position: absolute;
  right: 16px;
  top: 122px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  z-index: 10;
}

.voice-btn .voice-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.voice-panel {
  position: absolute;
  right: 66px;
  top: 110px;
  background: rgba(30, 30, 46, 0.95);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(12px);
  z-index: 15;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.voice-panel-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
  color: #fff;
}

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

.voice-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
}

.voice-item:active {
  transform: scale(0.95);
}

.voice-item.selected {
  border-color: #ff4d6d;
  background: rgba(255, 77, 109, 0.18);
}

.voice-item .v-emoji {
  font-size: 22px;
}

.voice-item .v-name {
  font-size: 12px;
  color: #ccc;
}

.voice-item.selected .v-name {
  color: #ff8a5c;
}

.screen-btn {
  position: absolute;
  right: 16px;
  top: 174px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  z-index: 10;
}

.screen-btn .screen-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.screen-btn.active {
  background: rgba(255, 77, 109, 0.7);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.5);
}

.source-btn {
  position: absolute;
  right: 16px;
  top: 226px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  z-index: 10;
}

.source-btn .source-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.source-btn:active {
  transform: scale(0.95);
}

.source-btn.active {
  background: rgba(255, 77, 109, 0.7);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.5);
}

.mic-btn {
  position: absolute;
  right: 16px;
  top: 280px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  z-index: 10;
}

.mic-btn .mic-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: brightness(0) invert(1);
}

.mic-btn:active {
  transform: scale(0.95);
}

.mic-btn.muted {
  background: rgba(255, 59, 48, 0.8);
}

.mic-btn.muted .mic-icon {
  opacity: 0.6;
}

.share-float-btn {
  position: absolute;
  right: 16px;
  top: 334px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  z-index: 10;
}

.share-float-btn .share-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: brightness(0) invert(1);
}

.share-float-btn:active {
  transform: scale(0.95);
}

/* 观众端底部分享按钮 */
.share-bottom-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.share-bottom-btn .share-icon {
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) invert(1);
}

.share-bottom-btn:active {
  transform: scale(0.9);
}

/* 观众端礼物按钮 */
.gift-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.gift-btn .gift-icon {
  width: 20px;
  height: 20px;
  display: block;
  filter: brightness(0) invert(1);
}

.gift-btn:active {
  transform: scale(0.9);
}

/* 弹幕开关 */
.chat-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.chat-input-wrap .chat-input {
  padding-right: 40px;
}

.danmaku-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: all 0.3s;
}

.danmaku-toggle .danmaku-icon {
  width: 14px;
  height: 14px;
  display: block;
  filter: brightness(0) invert(1);
}

.danmaku-toggle.active {
  background: rgba(255, 77, 109, 0.4);
  opacity: 1;
}

.danmaku-toggle.active .danmaku-icon {
  filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(255,77,109,0.8));
}

/* 分享弹窗 */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.share-modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  width: 280px;
  text-align: center;
  color: #333;
}

.share-modal-content h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: #333;
}

.share-qr {
  width: 180px;
  height: 180px;
  margin: 0 auto 12px;
  background: #f5f5f5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.share-qr canvas,
.share-qr img {
  width: 100%;
  height: 100%;
}

.share-tip {
  font-size: 13px;
  color: #999;
  margin: 0 0 16px;
}

.share-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.share-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: #f5f5f5;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}

.share-action-btn:active {
  background: #ebebeb;
}

.share-action-icon {
  font-size: 24px;
}

.share-close {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 20px;
  background: #f5f5f5;
  color: #666;
  font-size: 15px;
  cursor: pointer;
}

.share-close:active {
  background: #ebebeb;
}

/* 画面源小窗 */
.source-window {
  position: absolute;
  left: 16px;
  top: 70px;
  width: 120px;
  height: 160px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  z-index: 12;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

/* 画面源作为主画面 */
.video-container.source-as-main .host-video {
  position: absolute;
  left: 16px;
  top: 70px;
  width: 120px !important;
  height: 160px !important;
  border-radius: 8px;
  z-index: 12;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.video-container.source-as-main .source-window {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  z-index: 5;
  box-shadow: none;
}

.source-window video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.source-input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #3a3a4a;
  background: #0d0d14;
  color: #fff;
  padding: 0 12px;
  font-size: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.source-input:focus {
  outline: none;
  border-color: #ff4d6d;
}

.voice-btn.active {
  background: rgba(255, 77, 109, 0.7);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.5);
}

.voice-toast {
  position: absolute;
  right: 66px;
  top: 130px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  z-index: 10;
}

/* 弹幕层 */
.danmaku-layer {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 120px;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.danmaku-item {
  position: absolute;
  white-space: nowrap;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  animation: danmakuMove linear forwards;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
}

.danmaku-item .name {
  color: #ffd166;
  margin-right: 6px;
}

@keyframes danmakuMove {
  from {
    transform: translateX(100vw);
  }
  to {
    transform: translateX(-100%);
  }
}

/* 消息区 */
.chat-area {
  position: absolute;
  left: 10px;
  bottom: 90px;
  width: 70%;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 8;
  scrollbar-width: none;
}

.chat-area::-webkit-scrollbar {
  display: none;
}

.chat-msg {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 100%;
  word-break: break-all;
  align-self: flex-start;
  backdrop-filter: blur(4px);
}

.chat-msg .name {
  color: #ffd166;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-msg.host .name {
  color: #ff4d6d;
}

.chat-msg.system {
  color: #8a8a9a;
  background: transparent;
  font-size: 12px;
}

/* 底部操作栏 */
.bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

/* 主播端底部栏：只有分享+点赞，左右分布 */
.host-bottom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.host-bottom-bar .chat-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  outline: none;
  backdrop-filter: blur(8px);
}

.host-bottom-bar .chat-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.host-bottom-bar .send-btn {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff4d6d, #ff8fa3);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.host-bottom-bar .send-btn:active {
  transform: scale(0.96);
}

.chat-input {
  flex: 1;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0 16px;
  font-size: 14px;
  backdrop-filter: blur(8px);
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.like {
  background: linear-gradient(135deg, #ff4d6d, #ff8a5c);
}

.icon-btn.end-btn {
  width: auto;
  padding: 0 18px;
  border-radius: 20px;
  background: #ff4d6d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* 礼物面板 */
.gift-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #1e1e2e 0%, #13131f 100%);
  border-radius: 20px 20px 0 0;
  padding: 18px 14px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
}

.gift-panel.show {
  transform: translateY(0);
}

.gift-panel h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: center;
  position: relative;
}

.gift-panel h3::before,
.gift-panel h3::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ff4d6d);
  vertical-align: middle;
  margin: 0 10px;
}

.gift-panel h3::after {
  background: linear-gradient(90deg, #ff4d6d, transparent);
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.gift-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px 10px;
  border-radius: 14px;
  background: linear-gradient(145deg, #232333, #1a1a26);
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.gift-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
  pointer-events: none;
}

.gift-item:active {
  transform: scale(0.95);
}

.gift-item.selected {
  border-color: #ff4d6d;
  background: linear-gradient(145deg, rgba(255, 77, 109, 0.18), rgba(255, 138, 92, 0.08));
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.4);
}

.gift-item.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff4d6d;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.gift-item .emoji {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s;
}

.gift-item.selected .emoji {
  transform: scale(1.1);
}

.gift-item .gname {
  font-size: 12px;
  color: #bbb;
  font-weight: 500;
}

.gift-item.selected .gname {
  color: #ff8a5c;
}

.gift-close {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a2a3a, #1e1e2e);
  color: #ccc;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid #2a2a3a;
  transition: all 0.2s;
}

.gift-close:active {
  transform: scale(0.98);
  opacity: 0.8;
}

/* 礼物飘屏 */
.gift-float {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  z-index: 15;
  pointer-events: none;
  animation: giftPop 1.5s ease-out forwards;
}

@keyframes giftPop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -80%) scale(0.8);
    opacity: 0;
  }
}

.gift-banner {
  position: absolute;
  top: 70px;
  left: 10px;
  right: 10px;
  background: linear-gradient(90deg, rgba(255, 77, 109, 0.8), rgba(255, 138, 92, 0.8));
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 9;
  animation: bannerShow 3s ease-out forwards;
  backdrop-filter: blur(8px);
}

@keyframes bannerShow {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  15%,
  85% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* 点赞飘心 */
.like-float {
  position: absolute;
  bottom: 90px;
  right: 20px;
  font-size: 28px;
  pointer-events: none;
  z-index: 6;
  animation: likeFloat 2s ease-out forwards;
}

@keyframes likeFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-200px) scale(1.5);
  }
}

/* 主播端控制条 */
.host-controls {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 10;
}

.ctrl-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.ctrl-btn.active {
  background: rgba(255, 77, 109, 0.8);
  border-color: #ff4d6d;
}

.ctrl-btn.end {
  background: #ff4d6d;
  border-color: #ff4d6d;
  width: 56px;
  height: 56px;
  font-size: 12px;
  font-weight: 600;
}

/* 分享弹窗（共享） */
.share-box {
  width: 100%;
  max-width: 360px;
  background: #16161f;
  border-radius: 16px;
  padding: 24px;
}

.share-box h3 {
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
}

.share-link {
  background: #0d0d14;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  color: #aaa;
  word-break: break-all;
  margin-bottom: 16px;
  line-height: 1.5;
}

.share-tip {
  color: #888;
  font-size: 12px;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* 提示 toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  animation: toastShow 2s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
}

@keyframes toastShow {
  0% {
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* 加载 / 等待 */
.waiting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0a0a0f;
  z-index: 7;
}

.waiting-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #2a2a3a;
  border-top-color: #ff4d6d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.waiting-overlay p {
  color: #888;
  font-size: 14px;
}
