/* ============================================
   云卡栈 - 高级感UI系统 v16.0
   会员专属+终极优化20项（第261-280项）
   总计280项高级感优化
   ============================================ */

/* ========== 261. 会员专属直播间 ========== */
.vip-live-entry {
  position: relative;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border-radius: 16px;
  padding: 20px;
  color: white;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.vip-live-entry::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  animation: vipLiveGlow 3s ease-in-out infinite;
}

@keyframes vipLiveGlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10%, 10%); }
}

.vip-live-entry:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.3);
}

.vip-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.vip-live-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: livePulse 1s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ========== 262. 会员专属商品 ========== */
.vip-product-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.vip-product-tag::before {
  content: '👑 VIP';
}

.vip-product-lock {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 4;
  border-radius: inherit;
}

.vip-product-lock-icon {
  font-size: 32px;
}

.vip-product-lock-text {
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.vip-product-lock-btn {
  padding: 6px 16px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== 263. 会员折扣日 ========== */
.vip-day-banner {
  background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  background-size: 200% 200%;
  animation: vipDayGradient 5s ease infinite;
  border-radius: 16px;
  padding: 24px;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

@keyframes vipDayGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.vip-day-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.vip-day-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.vip-day-countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.vip-day-countdown-item {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 10px 14px;
  border-radius: 10px;
  min-width: 60px;
}

.vip-day-countdown-number {
  font-size: 24px;
  font-weight: 800;
  font-family: monospace;
}

.vip-day-countdown-label {
  font-size: 11px;
  opacity: 0.8;
}

/* ========== 264. 会员专属客服 ========== */
.vip-service-btn {
  position: fixed;
  right: 20px;
  bottom: 100px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  z-index: 999;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vip-service-btn:hover {
  transform: scale(1.1);
}

.vip-service-btn::after {
  content: 'VIP';
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 8px;
}

.vip-service-window {
  position: fixed;
  right: 20px;
  bottom: 170px;
  width: 340px;
  height: 480px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-2xl);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #fbbf24;
}

.vip-service-window.show {
  display: flex;
  animation: vipServiceIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vipServiceIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.vip-service-header {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vip-service-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.vip-service-info {
  flex: 1;
}

.vip-service-name {
  font-size: 15px;
  font-weight: 600;
}

.vip-service-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vip-service-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

/* ========== 265. 会员提现加速 ========== */
.vip-withdraw-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.vip-withdraw-channel {
  border: 2px solid #fbbf24;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.vip-withdraw-channel::before {
  content: 'VIP极速';
  position: absolute;
  top: -10px;
  left: 16px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

/* ========== 266. 会员订单优先 ========== */
.vip-order-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.vip-order-priority {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8b5cf6;
  font-size: 12px;
  font-weight: 600;
}

/* ========== 267. 会员数据分析 ========== */
.vip-analytics-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: 16px;
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;
}

.vip-analytics-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  border-radius: 50%;
}

.vip-analytics-title {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vip-analytics-value {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.vip-analytics-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vip-analytics-change.up { color: #10b981; }
.vip-analytics-change.down { color: #ef4444; }

/* ========== 268. 会员专属壁纸 ========== */
.vip-wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.vip-wallpaper-item {
  aspect-ratio: 9/16;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.vip-wallpaper-item:hover {
  transform: scale(1.05);
}

.vip-wallpaper-item.active {
  border-color: #fbbf24;
}

.vip-wallpaper-item.active::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: #fbbf24;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.vip-wallpaper-lock {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  backdrop-filter: blur(2px);
}

/* ========== 269. 会员专属表情 ========== */
.vip-emoji-panel {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 12px;
}

.vip-emoji {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.vip-emoji:hover {
  background: var(--bg-secondary);
  transform: scale(1.2);
}

.vip-emoji.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.vip-emoji.locked::after {
  content: '🔒';
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 10px;
}

/* ========== 271. 全局搜索增强 ========== */
.global-search {
  position: relative;
}

.global-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid var(--border-light);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  background: var(--bg-card);
}

.global-search-input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.global-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-2xl);
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.global-search-results.show {
  display: block;
  animation: searchResultsIn 0.2s ease;
}

@keyframes searchResultsIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-result-group {
  padding: 8px 0;
}

.search-result-group-title {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--bg-secondary);
}

.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.search-result-text {
  flex: 1;
}

.search-result-title {
  font-size: 14px;
  font-weight: 500;
}

.search-result-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-highlight {
  background: #fef08a;
  padding: 0 2px;
  border-radius: 2px;
}

/* ========== 272. 智能推荐增强 ========== */
.recommendation-section {
  margin: 24px 0;
}

.recommendation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.recommendation-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recommendation-title::before {
  content: '✨';
}

.recommendation-more {
  font-size: 13px;
  color: var(--primary-500);
  cursor: pointer;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.recommendation-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.recommendation-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.recommendation-card-image {
  aspect-ratio: 1;
  background: var(--bg-secondary);
  position: relative;
}

.recommendation-card-info {
  padding: 10px;
}

.recommendation-card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--danger);
}

.recommendation-card-reason {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ========== 273. 个性化首页 ========== */
.personalize-btn {
  position: fixed;
  right: 20px;
  bottom: 180px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 998;
  transition: all 0.3s ease;
}

.personalize-btn:hover {
  transform: rotate(90deg);
}

.personalize-panel {
  position: fixed;
  right: 20px;
  bottom: 240px;
  width: 300px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-2xl);
  padding: 20px;
  z-index: 999;
  display: none;
}

.personalize-panel.show {
  display: block;
  animation: vipServiceIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.personalize-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.personalize-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.personalize-option:last-child {
  border-bottom: none;
}

.personalize-option-label {
  font-size: 14px;
}

/* ========== 274. 浏览历史 ========== */
.history-section {
  margin: 24px 0;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.history-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-clear {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.history-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.history-list::-webkit-scrollbar {
  display: none;
}

.history-item {
  flex-shrink: 0;
  width: 100px;
  cursor: pointer;
}

.history-item-image {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  background: var(--bg-secondary);
  margin-bottom: 6px;
}

.history-item-title {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

/* ========== 275. 收藏夹 ========== */
.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 5;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.favorite-btn:hover {
  transform: scale(1.15);
}

.favorite-btn.active {
  color: #ef4444;
  animation: favoritePop 0.3s ease;
}

@keyframes favoritePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ========== 276. 商品对比 ========== */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 997;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.compare-bar.show {
  transform: translateY(0);
}

.compare-items {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
}

.compare-item {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: var(--bg-secondary);
  position: relative;
  flex-shrink: 0;
}

.compare-item-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-btn {
  padding: 10px 24px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ========== 277. 降价提醒 ========== */
.price-alert-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.price-alert-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.price-alert-btn.active {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

/* ========== 279. 价格走势 ========== */
.price-chart {
  width: 100%;
  height: 120px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px;
}

.price-chart svg {
  width: 100%;
  height: 100%;
}

.price-chart-line {
  fill: none;
  stroke: var(--primary-500);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-chart-area {
  fill: url(#priceGradient);
}

.price-chart-dot {
  fill: var(--primary-500);
  stroke: white;
  stroke-width: 2;
}

.price-chart-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.price-lowest {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* 响应式 */
@media (max-width: 768px) {
  .vip-wallpaper-grid { grid-template-columns: repeat(2, 1fr); }
  .recommendation-grid { grid-template-columns: repeat(2, 1fr); }
  .vip-service-window { width: calc(100% - 40px); right: 20px; }
}
